Package org.mozilla.javascript
Class NativeMap
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.javascript.IdScriptableObject
-
- org.mozilla.javascript.NativeMap
-
- All Implemented Interfaces:
java.io.Serializable
,ConstProperties
,DebuggableObject
,IdFunctionCall
,Scriptable
,SymbolScriptable
public class NativeMap extends IdScriptableObject
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private Hashtable
entries
private static int
Id_clear
private static int
Id_constructor
private static int
Id_delete
private static int
Id_entries
private static int
Id_forEach
private static int
Id_get
private static int
Id_has
private static int
Id_keys
private static int
Id_set
private static int
Id_values
private boolean
instanceOfMap
(package private) static java.lang.String
ITERATOR_TAG
private static java.lang.Object
MAP_TAG
private static int
MAX_PROTOTYPE_ID
private static long
serialVersionUID
private static int
SymbolId_getSize
private static int
SymbolId_toStringTag
-
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 NativeMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 int
findPrototypeId(java.lang.String s)
protected int
findPrototypeId(Symbol k)
java.lang.String
getClassName()
Return the name of the class.(package private) static void
init(Context cx, Scriptable scope, boolean sealed)
protected void
initPrototypeId(int id)
private java.lang.Object
js_clear()
private java.lang.Object
js_delete(java.lang.Object arg)
private java.lang.Object
js_forEach(Context cx, Scriptable scope, java.lang.Object arg1, java.lang.Object arg2)
private java.lang.Object
js_get(java.lang.Object arg)
private java.lang.Object
js_getSize()
private java.lang.Object
js_has(java.lang.Object arg)
private java.lang.Object
js_iterator(Scriptable scope, NativeCollectionIterator.Type type)
private java.lang.Object
js_set(java.lang.Object k, java.lang.Object v)
(package private) static java.lang.Object
key(java.lang.Object[] args)
Extracts the key from the first args entry if any and takes care of the Delegator.(package private) static void
loadFromIterable(Context cx, Scriptable scope, ScriptableObject map, java.lang.Object arg1)
If an "iterable" object was passed to the constructor, there are many many things to do...private static NativeMap
realThis(Scriptable thisObj, IdFunctionObject f)
-
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findInstanceIdInfo, 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
-
MAP_TAG
private static final java.lang.Object MAP_TAG
-
ITERATOR_TAG
static final java.lang.String ITERATOR_TAG
- See Also:
- Constant Field Values
-
entries
private final Hashtable entries
-
instanceOfMap
private boolean instanceOfMap
-
Id_constructor
private static final int Id_constructor
- See Also:
- Constant Field Values
-
Id_set
private static final int Id_set
- See Also:
- Constant Field Values
-
Id_get
private static final int Id_get
- See Also:
- Constant Field Values
-
Id_delete
private static final int Id_delete
- See Also:
- Constant Field Values
-
Id_has
private static final int Id_has
- See Also:
- Constant Field Values
-
Id_clear
private static final int Id_clear
- See Also:
- Constant Field Values
-
Id_keys
private static final int Id_keys
- See Also:
- Constant Field Values
-
Id_values
private static final int Id_values
- See Also:
- Constant Field Values
-
Id_entries
private static final int Id_entries
- See Also:
- Constant Field Values
-
Id_forEach
private static final int Id_forEach
- See Also:
- Constant Field Values
-
SymbolId_getSize
private static final int SymbolId_getSize
- See Also:
- Constant Field Values
-
SymbolId_toStringTag
private static final int SymbolId_toStringTag
- 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(Context cx, 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
-
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
-
js_set
private java.lang.Object js_set(java.lang.Object k, java.lang.Object v)
-
js_delete
private java.lang.Object js_delete(java.lang.Object arg)
-
js_get
private java.lang.Object js_get(java.lang.Object arg)
-
js_has
private java.lang.Object js_has(java.lang.Object arg)
-
js_getSize
private java.lang.Object js_getSize()
-
js_iterator
private java.lang.Object js_iterator(Scriptable scope, NativeCollectionIterator.Type type)
-
js_clear
private java.lang.Object js_clear()
-
js_forEach
private java.lang.Object js_forEach(Context cx, Scriptable scope, java.lang.Object arg1, java.lang.Object arg2)
-
loadFromIterable
static void loadFromIterable(Context cx, Scriptable scope, ScriptableObject map, java.lang.Object arg1)
If an "iterable" object was passed to the constructor, there are many many things to do... Make this static because NativeWeakMap has the exact same requirement.
-
realThis
private static NativeMap realThis(Scriptable thisObj, IdFunctionObject f)
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeId
in classIdScriptableObject
-
findPrototypeId
protected int findPrototypeId(Symbol k)
- Overrides:
findPrototypeId
in classIdScriptableObject
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeId
in classIdScriptableObject
-
key
static java.lang.Object key(java.lang.Object[] args)
Extracts the key from the first args entry if any and takes care of the Delegator. This is used byNativeSet
,NativeWeakMap
, andNativeWekSet
also.- Parameters:
args
- the args- Returns:
- the first argument (de-delegated) or undefined if there is no element in args
-
-