Package org.htmlunit.corejs.javascript
Class NativeObject
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.corejs.javascript.IdScriptableObject
-
- org.htmlunit.corejs.javascript.NativeObject
-
- All Implemented Interfaces:
java.io.Serializable,java.util.Map,ConstProperties,DebuggableObject,IdFunctionCall,Scriptable,SymbolScriptable
- Direct Known Subclasses:
NativeIterator.StopIteration
public class NativeObject extends IdScriptableObject implements java.util.Map
This class implements the Object native object. See ECMA 15.2.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classNativeObject.EntrySet(package private) classNativeObject.KeySet(package private) classNativeObject.ValueCollection-
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static intConstructorId_assignprivate static intConstructorId_createprivate static intConstructorId_definePropertiesprivate static intConstructorId_definePropertyprivate static intConstructorId_entriesprivate static intConstructorId_freezeprivate static intConstructorId_fromEntriesprivate static intConstructorId_getOwnPropertyDescriptorprivate static intConstructorId_getOwnPropertyDescriptorsprivate static intConstructorId_getOwnPropertyNamesprivate static intConstructorId_getOwnPropertySymbolsprivate static intConstructorId_getPrototypeOfprivate static intConstructorId_hasOwnprivate static intConstructorId_isprivate static intConstructorId_isExtensibleprivate static intConstructorId_isFrozenprivate static intConstructorId_isSealedprivate static intConstructorId_keysprivate static intConstructorId_preventExtensionsprivate static intConstructorId_sealprivate static intConstructorId_setPrototypeOfprivate static intConstructorId_valuesprivate static intId___defineGetter__private static intId___defineSetter__private static intId___lookupGetter__private static intId___lookupSetter__private static intId_constructorprivate static intId_hasOwnPropertyprivate static intId_isPrototypeOfprivate static intId_propertyIsEnumerableprivate static intId_toLocaleStringprivate static intId_toSourceprivate static intId_toStringprivate static intId_valueOfprivate static intMAX_PROTOTYPE_IDprivate static java.lang.ObjectOBJECT_TAGprivate static longserialVersionUID-
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
-
Constructor Summary
Constructors Constructor Description NativeObject()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>>entrySet()java.lang.ObjectexecIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.protected voidfillConstructorProperties(IdFunctionObject ctor)protected intfindPrototypeId(java.lang.String s)java.lang.StringgetClassName()Return the name of the class.private static ScriptablegetCompatibleObject(Context cx, Scriptable scope, java.lang.Object arg)(package private) static voidinit(Scriptable scope, boolean sealed)protected voidinitPrototypeId(int id)private booleanisEnumerable(int index, java.lang.Object obj)private booleanisEnumerable(java.lang.String key, java.lang.Object obj)private booleanisEnumerable(Symbol sym, java.lang.Object obj)java.util.Set<java.lang.Object>keySet()java.lang.Objectput(java.lang.Object key, java.lang.Object value)voidputAll(java.util.Map m)java.lang.Objectremove(java.lang.Object key)java.lang.StringtoString()java.util.Collection<java.lang.Object>values()-
Methods inherited from class org.htmlunit.corejs.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, findInstanceIdInfo, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getIds, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, getOwnPropertyDescriptor, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
addLazilyInitializedValue, applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildClassCtor, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, checkValidAttributes, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getBase, getBase, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putImpl, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
OBJECT_TAG
private static final java.lang.Object OBJECT_TAG
-
ConstructorId_getPrototypeOf
private static final int ConstructorId_getPrototypeOf
- See Also:
- Constant Field Values
-
ConstructorId_keys
private static final int ConstructorId_keys
- See Also:
- Constant Field Values
-
ConstructorId_getOwnPropertyNames
private static final int ConstructorId_getOwnPropertyNames
- See Also:
- Constant Field Values
-
ConstructorId_getOwnPropertyDescriptor
private static final int ConstructorId_getOwnPropertyDescriptor
- See Also:
- Constant Field Values
-
ConstructorId_getOwnPropertyDescriptors
private static final int ConstructorId_getOwnPropertyDescriptors
- See Also:
- Constant Field Values
-
ConstructorId_defineProperty
private static final int ConstructorId_defineProperty
- See Also:
- Constant Field Values
-
ConstructorId_isExtensible
private static final int ConstructorId_isExtensible
- See Also:
- Constant Field Values
-
ConstructorId_preventExtensions
private static final int ConstructorId_preventExtensions
- See Also:
- Constant Field Values
-
ConstructorId_defineProperties
private static final int ConstructorId_defineProperties
- See Also:
- Constant Field Values
-
ConstructorId_create
private static final int ConstructorId_create
- See Also:
- Constant Field Values
-
ConstructorId_isSealed
private static final int ConstructorId_isSealed
- See Also:
- Constant Field Values
-
ConstructorId_isFrozen
private static final int ConstructorId_isFrozen
- See Also:
- Constant Field Values
-
ConstructorId_seal
private static final int ConstructorId_seal
- See Also:
- Constant Field Values
-
ConstructorId_freeze
private static final int ConstructorId_freeze
- See Also:
- Constant Field Values
-
ConstructorId_getOwnPropertySymbols
private static final int ConstructorId_getOwnPropertySymbols
- See Also:
- Constant Field Values
-
ConstructorId_assign
private static final int ConstructorId_assign
- See Also:
- Constant Field Values
-
ConstructorId_is
private static final int ConstructorId_is
- See Also:
- Constant Field Values
-
ConstructorId_setPrototypeOf
private static final int ConstructorId_setPrototypeOf
- See Also:
- Constant Field Values
-
ConstructorId_entries
private static final int ConstructorId_entries
- See Also:
- Constant Field Values
-
ConstructorId_fromEntries
private static final int ConstructorId_fromEntries
- See Also:
- Constant Field Values
-
ConstructorId_values
private static final int ConstructorId_values
- See Also:
- Constant Field Values
-
ConstructorId_hasOwn
private static final int ConstructorId_hasOwn
- See Also:
- Constant Field Values
-
Id_constructor
private static final int Id_constructor
- See Also:
- Constant Field Values
-
Id_toString
private static final int Id_toString
- See Also:
- Constant Field Values
-
Id_toLocaleString
private static final int Id_toLocaleString
- See Also:
- Constant Field Values
-
Id_valueOf
private static final int Id_valueOf
- See Also:
- Constant Field Values
-
Id_hasOwnProperty
private static final int Id_hasOwnProperty
- See Also:
- Constant Field Values
-
Id_propertyIsEnumerable
private static final int Id_propertyIsEnumerable
- See Also:
- Constant Field Values
-
Id_isPrototypeOf
private static final int Id_isPrototypeOf
- See Also:
- Constant Field Values
-
Id_toSource
private static final int Id_toSource
- See Also:
- Constant Field Values
-
Id___defineGetter__
private static final int Id___defineGetter__
- See Also:
- Constant Field Values
-
Id___defineSetter__
private static final int Id___defineSetter__
- See Also:
- Constant Field Values
-
Id___lookupGetter__
private static final int Id___lookupGetter__
- See Also:
- Constant Field Values
-
Id___lookupSetter__
private static final int Id___lookupSetter__
- See Also:
- Constant Field Values
-
MAX_PROTOTYPE_ID
private static final int MAX_PROTOTYPE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
static void init(Scriptable scope, boolean sealed)
-
getClassName
public java.lang.String getClassName()
Description copied from class:ScriptableObjectReturn the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassNamein interfaceScriptable- Specified by:
getClassNamein classScriptableObject
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fillConstructorProperties
protected void fillConstructorProperties(IdFunctionObject ctor)
- Overrides:
fillConstructorPropertiesin classIdScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeIdin classIdScriptableObject
-
execIdCall
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
Description copied from class:IdScriptableObject'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.- Specified by:
execIdCallin interfaceIdFunctionCall- Overrides:
execIdCallin classIdScriptableObject
-
isEnumerable
private boolean isEnumerable(int index, java.lang.Object obj)
-
isEnumerable
private boolean isEnumerable(java.lang.String key, java.lang.Object obj)
-
isEnumerable
private boolean isEnumerable(Symbol sym, java.lang.Object obj)
-
getCompatibleObject
private static Scriptable getCompatibleObject(Context cx, Scriptable scope, java.lang.Object arg)
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKeyin interfacejava.util.Map
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValuein interfacejava.util.Map
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Map
-
keySet
public java.util.Set<java.lang.Object> keySet()
- Specified by:
keySetin interfacejava.util.Map
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
valuesin interfacejava.util.Map
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet()
- Specified by:
entrySetin interfacejava.util.Map
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)- Specified by:
putin interfacejava.util.Map
-
putAll
public void putAll(java.util.Map m)
- Specified by:
putAllin interfacejava.util.Map
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeIdin classIdScriptableObject
-
-