Class Arguments
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.Arguments
- All Implemented Interfaces:
Serializable, ConstProperties, DebuggableObject, IdFunctionCall, Scriptable, SymbolScriptable
This class implements the "arguments" object.
See ECMA 10.1.8
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class ScriptableObject
ScriptableObject.KeyComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate NativeCallprivate Object[]private intprivate Objectprivate intprivate Objectprivate static final Stringprivate static final intprivate static final intprivate static final intprivate static BaseFunctionprivate intprivate Objectprivate static final intprivate static final longFields inherited from class ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Objectarg(int index) (package private) voidprotected voiddefineOwnProperty(Context cx, Object id, ScriptableObject desc, boolean checkValid) Defines a property on an object.voiddelete(int index) Removes the indexed property from the object.protected intMap name to id of instance property.get(int index, Scriptable start) Returns the value of the indexed property or NOT_FOUND.Return the name of the class.private ObjectgetFromActivation(int index) (package private) Object[]getIds(boolean getNonEnumerable, boolean getSymbols) protected StringgetInstanceIdName(int id) Map id back to property name it defines.protected ObjectgetInstanceIdValue(int id) Get id value.protected intGet maximum id findInstanceIdInfo can generate.protected ScriptableObjectgetOwnPropertyDescriptor(Context cx, Object id) booleanhas(int index, Scriptable start) Returns true if the property index is defined.voidput(int index, Scriptable start, Object value) Sets the value of the indexed property, creating it if need be.voidput(String name, Scriptable start, Object value) Sets the value of the named property, creating it if need be.private voidputIntoActivation(int index, Object value) private voidremoveArg(int index) private voidreplaceArg(int index, Object value) protected voidsetInstanceIdAttributes(int id, int attr) Update the attributes of the given instance property.protected voidsetInstanceIdValue(int id, Object value) Set or delete id value.private booleansharedWithActivation(int index) Methods inherited from class IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, delete, delete, ensureType, execIdCall, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, findPrototypeId, get, get, getAttributes, getAttributes, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeId, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, setAttributesMethods inherited from class 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, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, 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, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
FTAG
- See Also:
-
Id_callee
private static final int Id_callee- See Also:
-
Id_length
private static final int Id_length- See Also:
-
Id_caller
private static final int Id_caller- See Also:
-
MAX_INSTANCE_ID
private static final int MAX_INSTANCE_ID- See Also:
-
iteratorMethod
-
callerObj
-
calleeObj
-
lengthObj
-
callerAttr
private int callerAttr -
calleeAttr
private int calleeAttr -
lengthAttr
private int lengthAttr -
activation
-
args
-
-
Constructor Details
-
Arguments
-
-
Method Details
-
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
-
arg
-
putIntoActivation
-
getFromActivation
-
replaceArg
-
removeArg
private void removeArg(int index) -
has
Description copied from class:ScriptableObjectReturns true if the property index is defined.- Specified by:
hasin interfaceScriptable- Overrides:
hasin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- true if and only if the property was found in the object
- See Also:
-
get
Description copied from class:ScriptableObjectReturns the value of the indexed property or NOT_FOUND.- Specified by:
getin interfaceScriptable- Overrides:
getin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
-
put
Description copied from class:ScriptableObjectSets the value of the indexed property, creating it if need be.- Specified by:
putin interfaceScriptable- Overrides:
putin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
-
put
Description copied from class:ScriptableObjectSets the value of the named property, creating it if need be.If the property was created using defineProperty, the appropriate setter method is called.
If the property's attributes include READONLY, no action is taken. This method will actually set the property in the start object.
- Specified by:
putin interfaceScriptable- Overrides:
putin classIdScriptableObject- Parameters:
name- the name of the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
-
delete
public void delete(int index) Description copied from class:ScriptableObjectRemoves the indexed property from the object.If the property is not found, or it has the PERMANENT attribute, no action is taken.
- Specified by:
deletein interfaceScriptable- Overrides:
deletein classScriptableObject- Parameters:
index- the numeric index for the property- See Also:
-
getMaxInstanceId
protected int getMaxInstanceId()Description copied from class:IdScriptableObjectGet maximum id findInstanceIdInfo can generate.- Overrides:
getMaxInstanceIdin classIdScriptableObject
-
findInstanceIdInfo
Description copied from class:IdScriptableObjectMap name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int).- Overrides:
findInstanceIdInfoin classIdScriptableObject
-
getInstanceIdName
Description copied from class:IdScriptableObjectMap id back to property name it defines.- Overrides:
getInstanceIdNamein classIdScriptableObject
-
getInstanceIdValue
Description copied from class:IdScriptableObjectGet id value. * If id value is constant, descendant can call cacheIdValue to store * value in the permanent cache. * Default implementation creates IdFunctionObject instance for given id * and cache its value- Overrides:
getInstanceIdValuein classIdScriptableObject
-
setInstanceIdValue
Description copied from class:IdScriptableObjectSet or delete id value. If value == NOT_FOUND , the implementation should make sure that the following getInstanceIdValue return NOT_FOUND.- Overrides:
setInstanceIdValuein classIdScriptableObject
-
setInstanceIdAttributes
protected void setInstanceIdAttributes(int id, int attr) Description copied from class:IdScriptableObjectUpdate the attributes of the given instance property. Classes which want to support changing property attributes via Object.defineProperty must override this method. The default implementation throws InternalError.- Overrides:
setInstanceIdAttributesin classIdScriptableObject- Parameters:
id- the instance property idattr- the new attribute bitset
-
getIds
- Overrides:
getIdsin classIdScriptableObject
-
getOwnPropertyDescriptor
- Overrides:
getOwnPropertyDescriptorin classIdScriptableObject
-
defineOwnProperty
Description copied from class:ScriptableObjectDefines a property on an object.Based on [[DefineOwnProperty]] from 8.12.10 of the spec.
- Overrides:
defineOwnPropertyin classIdScriptableObject- Parameters:
cx- the current Contextid- the name/index of the propertydesc- the new property descriptor, as described in 8.6.1checkValid- whether to perform validity checks
-
defineAttributesForStrictMode
void defineAttributesForStrictMode()
-