Package org.mozilla.javascript
Class NativeObject
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.javascript.IdScriptableObject
-
- org.mozilla.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) class
NativeObject.EntrySet
(package private) class
NativeObject.KeySet
(package private) class
NativeObject.ValueCollection
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static int
ConstructorId_assign
private static int
ConstructorId_create
private static int
ConstructorId_defineProperties
private static int
ConstructorId_defineProperty
private static int
ConstructorId_entries
private static int
ConstructorId_freeze
private static int
ConstructorId_fromEntries
private static int
ConstructorId_getOwnPropertyDescriptor
private static int
ConstructorId_getOwnPropertyNames
private static int
ConstructorId_getOwnPropertySymbols
private static int
ConstructorId_getPrototypeOf
private static int
ConstructorId_is
private static int
ConstructorId_isExtensible
private static int
ConstructorId_isFrozen
private static int
ConstructorId_isSealed
private static int
ConstructorId_keys
private static int
ConstructorId_preventExtensions
private static int
ConstructorId_seal
private static int
ConstructorId_setPrototypeOf
private static int
ConstructorId_values
private static int
Id___defineGetter__
private static int
Id___defineSetter__
private static int
Id___lookupGetter__
private static int
Id___lookupSetter__
private static int
Id_constructor
private static int
Id_hasOwnProperty
private static int
Id_isPrototypeOf
private static int
Id_propertyIsEnumerable
private static int
Id_toLocaleString
private static int
Id_toSource
private static int
Id_toString
private static int
Id_valueOf
private static int
MAX_PROTOTYPE_ID
private static java.lang.Object
OBJECT_TAG
private static long
serialVersionUID
-
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.mozilla.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 void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>>
entrySet()
java.lang.Object
execIdCall(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 void
fillConstructorProperties(IdFunctionObject ctor)
protected int
findPrototypeId(java.lang.String s)
java.lang.String
getClassName()
Return the name of the class.private static Scriptable
getCompatibleObject(Context cx, Scriptable scope, java.lang.Object arg)
(package private) static void
init(Scriptable scope, boolean sealed)
protected void
initPrototypeId(int id)
private boolean
isEnumerable(int index, java.lang.Object obj)
private boolean
isEnumerable(java.lang.String key, java.lang.Object obj)
private boolean
isEnumerable(Symbol sym, java.lang.Object obj)
java.util.Set<java.lang.Object>
keySet()
java.lang.Object
put(java.lang.Object key, java.lang.Object value)
void
putAll(java.util.Map m)
java.lang.Object
remove(java.lang.Object key)
java.lang.String
toString()
java.util.Collection<java.lang.Object>
values()
-
Methods inherited from class org.mozilla.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.mozilla.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, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, 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, 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_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
-
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:ScriptableObject
Return the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassName
in interfaceScriptable
- Specified by:
getClassName
in classScriptableObject
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
fillConstructorProperties
protected void fillConstructorProperties(IdFunctionObject ctor)
- Overrides:
fillConstructorProperties
in classIdScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeId
in 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:
execIdCall
in interfaceIdFunctionCall
- Overrides:
execIdCall
in 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:
containsKey
in interfacejava.util.Map
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfacejava.util.Map
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map
-
keySet
public java.util.Set<java.lang.Object> keySet()
- Specified by:
keySet
in interfacejava.util.Map
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
values
in interfacejava.util.Map
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
- Specified by:
put
in interfacejava.util.Map
-
putAll
public void putAll(java.util.Map m)
- Specified by:
putAll
in interfacejava.util.Map
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeId
in classIdScriptableObject
-
-