Package org.mozilla.javascript
Class Arguments
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.javascript.IdScriptableObject
-
- org.mozilla.javascript.Arguments
-
- All Implemented Interfaces:
java.io.Serializable
,ConstProperties
,DebuggableObject
,IdFunctionCall
,Scriptable
,SymbolScriptable
final class Arguments extends IdScriptableObject
This class implements the "arguments" object. See ECMA 10.1.8- See Also:
NativeCall
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Arguments.ThrowTypeError
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.GetterSlot, ScriptableObject.KeyComparator, ScriptableObject.Slot, ScriptableObject.SlotAccess
-
-
Field Summary
Fields Modifier and Type Field Description private NativeCall
activation
private java.lang.Object[]
args
private int
calleeAttr
private java.lang.Object
calleeObj
private int
callerAttr
private java.lang.Object
callerObj
private static java.lang.String
FTAG
private static int
Id_callee
private static int
Id_caller
private static int
Id_length
private static BaseFunction
iteratorMethod
private int
lengthAttr
private java.lang.Object
lengthObj
private static int
MAX_INSTANCE_ID
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 Arguments(NativeCall activation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Object
arg(int index)
(package private) void
defineAttributesForStrictMode()
protected void
defineOwnProperty(Context cx, java.lang.Object id, ScriptableObject desc, boolean checkValid)
Defines a property on an object.void
delete(int index)
Removes the indexed property from the object.protected int
findInstanceIdInfo(java.lang.String s)
Map name to id of instance property.java.lang.Object
get(int index, Scriptable start)
Returns the value of the indexed property or NOT_FOUND.java.lang.String
getClassName()
Return the name of the class.private java.lang.Object
getFromActivation(int index)
(package private) java.lang.Object[]
getIds(boolean getNonEnumerable, boolean getSymbols)
protected java.lang.String
getInstanceIdName(int id)
Map id back to property name it defines.protected java.lang.Object
getInstanceIdValue(int id)
Get id value.protected int
getMaxInstanceId()
Get maximum id findInstanceIdInfo can generate.protected ScriptableObject
getOwnPropertyDescriptor(Context cx, java.lang.Object id)
boolean
has(int index, Scriptable start)
Returns true if the property index is defined.void
put(int index, Scriptable start, java.lang.Object value)
Sets the value of the indexed property, creating it if need be.void
put(java.lang.String name, Scriptable start, java.lang.Object value)
Sets the value of the named property, creating it if need be.private void
putIntoActivation(int index, java.lang.Object value)
private void
removeArg(int index)
private void
replaceArg(int index, java.lang.Object value)
protected void
setInstanceIdAttributes(int id, int attr)
Update the attributes of the given instance property.protected void
setInstanceIdValue(int id, java.lang.Object value)
Set or delete id value.private boolean
sharedWithActivation(int index)
-
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, execIdCall, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, findPrototypeId, get, get, getAttributes, getAttributes, has, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeId, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, setAttributes
-
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, 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, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, 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, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
FTAG
private static final java.lang.String FTAG
- See Also:
- Constant Field Values
-
Id_callee
private static final int Id_callee
- See Also:
- Constant Field Values
-
Id_length
private static final int Id_length
- See Also:
- Constant Field Values
-
Id_caller
private static final int Id_caller
- See Also:
- Constant Field Values
-
MAX_INSTANCE_ID
private static final int MAX_INSTANCE_ID
- See Also:
- Constant Field Values
-
iteratorMethod
private static BaseFunction iteratorMethod
-
callerObj
private java.lang.Object callerObj
-
calleeObj
private java.lang.Object calleeObj
-
lengthObj
private java.lang.Object lengthObj
-
callerAttr
private int callerAttr
-
calleeAttr
private int calleeAttr
-
lengthAttr
private int lengthAttr
-
activation
private NativeCall activation
-
args
private java.lang.Object[] args
-
-
Constructor Detail
-
Arguments
public Arguments(NativeCall activation)
-
-
Method Detail
-
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
-
arg
private java.lang.Object arg(int index)
-
putIntoActivation
private void putIntoActivation(int index, java.lang.Object value)
-
getFromActivation
private java.lang.Object getFromActivation(int index)
-
replaceArg
private void replaceArg(int index, java.lang.Object value)
-
removeArg
private void removeArg(int index)
-
has
public boolean has(int index, Scriptable start)
Description copied from class:ScriptableObject
Returns true if the property index is defined.- Specified by:
has
in interfaceScriptable
- Overrides:
has
in 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:
Scriptable.get(int, Scriptable)
,ScriptableObject.getProperty(Scriptable, int)
-
get
public java.lang.Object get(int index, Scriptable start)
Description copied from class:ScriptableObject
Returns the value of the indexed property or NOT_FOUND.- Specified by:
get
in interfaceScriptable
- Overrides:
get
in 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:
Scriptable.get(String,Scriptable)
-
sharedWithActivation
private boolean sharedWithActivation(int index)
-
put
public void put(int index, Scriptable start, java.lang.Object value)
Description copied from class:ScriptableObject
Sets the value of the indexed property, creating it if need be.- Specified by:
put
in interfaceScriptable
- Overrides:
put
in classScriptableObject
- Parameters:
index
- the numeric index for the propertystart
- the object whose property is being setvalue
- value to set the property to- See Also:
Scriptable.has(int, Scriptable)
,Scriptable.get(int, Scriptable)
,ScriptableObject.putProperty(Scriptable, int, Object)
,Context.toObject(Object, Scriptable)
-
put
public void put(java.lang.String name, Scriptable start, java.lang.Object value)
Description copied from class:ScriptableObject
Sets 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:
put
in interfaceScriptable
- Overrides:
put
in classIdScriptableObject
- Parameters:
name
- the name of the propertystart
- the object whose property is being setvalue
- value to set the property to- See Also:
Scriptable.has(String, Scriptable)
,Scriptable.get(String, Scriptable)
,ScriptableObject.putProperty(Scriptable, String, Object)
,Context.toObject(Object, Scriptable)
-
delete
public void delete(int index)
Description copied from class:ScriptableObject
Removes the indexed property from the object. If the property is not found, or it has the PERMANENT attribute, no action is taken.- Specified by:
delete
in interfaceScriptable
- Overrides:
delete
in classScriptableObject
- Parameters:
index
- the numeric index for the property- See Also:
Scriptable.get(int, Scriptable)
,ScriptableObject.deleteProperty(Scriptable, int)
-
getMaxInstanceId
protected int getMaxInstanceId()
Description copied from class:IdScriptableObject
Get maximum id findInstanceIdInfo can generate.- Overrides:
getMaxInstanceId
in classIdScriptableObject
-
findInstanceIdInfo
protected int findInstanceIdInfo(java.lang.String s)
Description copied from class:IdScriptableObject
Map name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int)
.- Overrides:
findInstanceIdInfo
in classIdScriptableObject
-
getInstanceIdName
protected java.lang.String getInstanceIdName(int id)
Description copied from class:IdScriptableObject
Map id back to property name it defines.- Overrides:
getInstanceIdName
in classIdScriptableObject
-
getInstanceIdValue
protected java.lang.Object getInstanceIdValue(int id)
Description copied from class:IdScriptableObject
Get 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:
getInstanceIdValue
in classIdScriptableObject
-
setInstanceIdValue
protected void setInstanceIdValue(int id, java.lang.Object value)
Description copied from class:IdScriptableObject
Set or delete id value. If value == NOT_FOUND , the implementation should make sure that the following getInstanceIdValue return NOT_FOUND.- Overrides:
setInstanceIdValue
in classIdScriptableObject
-
setInstanceIdAttributes
protected void setInstanceIdAttributes(int id, int attr)
Description copied from class:IdScriptableObject
Update 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:
setInstanceIdAttributes
in classIdScriptableObject
- Parameters:
id
- the instance property idattr
- the new attribute bitset
-
getIds
java.lang.Object[] getIds(boolean getNonEnumerable, boolean getSymbols)
- Overrides:
getIds
in classIdScriptableObject
-
getOwnPropertyDescriptor
protected ScriptableObject getOwnPropertyDescriptor(Context cx, java.lang.Object id)
- Overrides:
getOwnPropertyDescriptor
in classIdScriptableObject
-
defineOwnProperty
protected void defineOwnProperty(Context cx, java.lang.Object id, ScriptableObject desc, boolean checkValid)
Description copied from class:ScriptableObject
Defines a property on an object. Based on [[DefineOwnProperty]] from 8.12.10 of the spec.- Overrides:
defineOwnProperty
in classScriptableObject
- 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()
-
-