Package org.htmlunit.corejs.javascript
Class NativeMap
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.corejs.javascript.IdScriptableObject
-
- org.htmlunit.corejs.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.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private Hashtableentriesprivate static intId_clearprivate static intId_constructorprivate static intId_deleteprivate static intId_entriesprivate static intId_forEachprivate static intId_getprivate static intId_hasprivate static intId_keysprivate static intId_setprivate static intId_valuesprivate booleaninstanceOfMap(package private) static java.lang.StringITERATOR_TAGprivate static java.lang.ObjectMAP_TAGprivate static intMAX_PROTOTYPE_IDprivate static longserialVersionUIDprivate static intSymbolId_getSizeprivate static intSymbolId_toStringTag-
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 NativeMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 intfindPrototypeId(java.lang.String s)protected intfindPrototypeId(Symbol k)java.lang.StringgetClassName()Return the name of the class.(package private) static voidinit(Context cx, Scriptable scope, boolean sealed)protected voidinitPrototypeId(int id)private java.lang.Objectjs_clear()private java.lang.Objectjs_delete(java.lang.Object arg)private java.lang.Objectjs_forEach(Context cx, Scriptable scope, java.lang.Object arg1, java.lang.Object arg2)private java.lang.Objectjs_get(java.lang.Object arg)private java.lang.Objectjs_getSize()private java.lang.Objectjs_has(java.lang.Object arg)private java.lang.Objectjs_iterator(Scriptable scope, NativeCollectionIterator.Type type)private java.lang.Objectjs_set(java.lang.Object k, java.lang.Object v)(package private) static java.lang.Objectkey(java.lang.Object[] args)Extracts the key from the first args entry if any and takes care of the Delegator.(package private) static voidloadFromIterable(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 NativeMaprealThis(Scriptable thisObj, IdFunctionObject f)-
Methods inherited from class org.htmlunit.corejs.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.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
-
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: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
-
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
-
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:
initPrototypeIdin classIdScriptableObject
-
findPrototypeId
protected int findPrototypeId(Symbol k)
- Overrides:
findPrototypeIdin classIdScriptableObject
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeIdin 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, andNativeWekSetalso.- Parameters:
args- the args- Returns:
- the first argument (de-delegated) or undefined if there is no element in args
-
-