- All Implemented Interfaces:
Serializable,ConstProperties<VarScope>,PropHolder<VarScope>,VarScope
- Direct Known Subclasses:
DeclarationScope,TopLevel
- See Also:
-
Field Summary
Fields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
isSealed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddefineConst(Context cx, String name, VarScope start) Reserves a definition spot for a const.voiddefineProperty(String propertyName, Object value, int attributes) Define a JavaScript property.voiddefineProperty(Symbol key, Object value, int attributes) A version of defineProperty that uses a Symbol key.voiddelete(int index) voidvoidReturns the value of the indexed property or NOT_FOUND.Returns the value of the named property or NOT_FOUND.Another version of Get that supports Symbol keyed properties.Get the parent scope of this scope.getThis()booleanReturns true if the property index is defined.booleanReturns true if the named property is defined.booleanA version of "has" that supports symbols.booleanReturns true if the named property is defined as a const on this object.voidSets the value of the indexed property, creating it if need be.voidSets the value of the named property, creating it if need be.voidImplementation of put required by SymbolScriptable objects.voidSets the value of the named const property, creating it if need be.protected booleanputOwnProperty(int index, VarScope start, Object value, boolean isThrow) Set the value of the named property, and return true if the property is actually defined and can be set.protected booleanputOwnProperty(String name, VarScope start, Object value, boolean isThrow) Set the value of the named property, and return true if the property is actually defined and can be set.protected booleanputOwnProperty(Symbol key, VarScope start, Object value, boolean isThrow) Set the value of the named property, and return true if the property is actually defined and can be set.voidsetAttributes(String name, int attributes) Set the attributes of a named property.voidsetAttributes(Symbol key, int attributes) Set attributes of a Symbol-keyed property.Methods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, createSlotMap, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, isSealed, readMaps, sealObject, setAttributes, setAttributes, setAttributes, writeMapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.htmlunit.corejs.javascript.PropHolder
getIdsMethods inherited from interface org.htmlunit.corejs.javascript.VarScope
copyScope, getAncestor, isNestedScope
-
Constructor Details
-
ScopeObject
-
-
Method Details
-
getParentScope
Description copied from interface:VarScopeGet the parent scope of this scope.- Specified by:
getParentScopein interfaceVarScope- Returns:
- the parent scope
-
getThis
- Specified by:
getThisin classSlotMapOwner<VarScope>
-
put
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:
putin interfacePropHolder<VarScope>- Overrides:
putin classSlotMapOwner<VarScope>- Parameters:
name- the name of the propertystart- the object whose property is being setvalue- value to set the property to
-
putOwnProperty
Set the value of the named property, and return true if the property is actually defined and can be set. Subclasses of ScriptableObject should override this method, and not "put," for proper strict mode operation in the future.- Parameters:
isThrow- if true, throw an exception as if in strict mode
-
put
Sets the value of the indexed property, creating it if need be.- Specified by:
putin interfacePropHolder<VarScope>- Overrides:
putin classSlotMapOwner<VarScope>- Parameters:
index- the numeric index for the propertystart- the object whose property is being setvalue- value to set the property to
-
putOwnProperty
Set the value of the named property, and return true if the property is actually defined and can be set. Subclasses of ScriptableObject should override this method, and not "put," for proper strict mode operation in the future- Parameters:
isThrow- if true, throw an exception as if in strict mode
-
put
Implementation of put required by SymbolScriptable objects.- Specified by:
putin interfacePropHolder<VarScope>- Overrides:
putin classSlotMapOwner<VarScope>
-
putOwnProperty
Set the value of the named property, and return true if the property is actually defined and can be set. Subclasses of ScriptableObject should override this method, and not "put," for proper strict mode operation in the future- Parameters:
isThrow- if true, throw an exception as if in strict mode
-
has
Returns true if the named property is defined.- Specified by:
hasin interfacePropHolder<VarScope>- Overrides:
hasin classSlotMapOwner<VarScope>- Parameters:
name- the name of the propertystart- the object in which the lookup began- Returns:
- true if and only if the property was found in the object
-
has
Returns true if the property index is defined.- Specified by:
hasin interfacePropHolder<VarScope>- Overrides:
hasin classSlotMapOwner<VarScope>- 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
-
has
A version of "has" that supports symbols.- Specified by:
hasin interfacePropHolder<VarScope>- Overrides:
hasin classSlotMapOwner<VarScope>
-
get
Returns the value of the named property or NOT_FOUND.If the property was created using defineProperty, the appropriate getter method is called.
- Specified by:
getin interfacePropHolder<VarScope>- Overrides:
getin classSlotMapOwner<VarScope>- Parameters:
name- the name of the propertystart- the object in which the lookup began- Returns:
- the value of the property (may be null), or NOT_FOUND
-
get
Returns the value of the indexed property or NOT_FOUND.- Specified by:
getin interfacePropHolder<VarScope>- Overrides:
getin classSlotMapOwner<VarScope>- 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
-
get
Another version of Get that supports Symbol keyed properties.- Specified by:
getin interfacePropHolder<VarScope>- Overrides:
getin classSlotMapOwner<VarScope>
-
delete
- Specified by:
deletein interfacePropHolder<VarScope>- Overrides:
deletein classSlotMapOwner<VarScope>
-
delete
public void delete(int index) - Specified by:
deletein interfacePropHolder<VarScope>- Overrides:
deletein classSlotMapOwner<VarScope>
-
delete
- Specified by:
deletein interfacePropHolder<VarScope>- Overrides:
deletein classSlotMapOwner<VarScope>
-
defineProperty
Define a JavaScript property.Creates the property with an initial value and sets its attributes.
- Overrides:
definePropertyin classSlotMapOwner<VarScope>- Parameters:
propertyName- the name of the property to define.value- the initial value of the propertyattributes- the attributes of the JavaScript property- See Also:
-
defineProperty
A version of defineProperty that uses a Symbol key.- Overrides:
definePropertyin classSlotMapOwner<VarScope>- Parameters:
key- symbol of the property to define.value- the initial value of the propertyattributes- the attributes of the JavaScript property
-
setAttributes
Set the attributes of a named property.The property is specified by
nameas defined forhas.The possible attributes are READONLY, DONTENUM, and PERMANENT. Combinations of attributes are expressed by the bitwise OR of attributes. EMPTY is the state of no attributes set. Any unused bits are reserved for future use.
- Overrides:
setAttributesin classSlotMapOwner<VarScope>- Parameters:
name- the name of the propertyattributes- the bitset of attributes- Throws:
EvaluatorException- if the named property is not found- See Also:
-
setAttributes
Set attributes of a Symbol-keyed property.- Overrides:
setAttributesin classSlotMapOwner<VarScope>
-
putConst
Sets the value of the named const 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:
putConstin interfaceConstProperties<VarScope>- Parameters:
name- the name of the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
-
defineConst
Description copied from interface:ConstPropertiesReserves a definition spot for a const. This will set up a definition of the const property, but set its value to undefined. The semantics of the start parameter is the same as for putConst.- Specified by:
defineConstin interfaceConstProperties<VarScope>name- The name of the property.start- The object whose property is being reserved.
-
isConst
Returns true if the named property is defined as a const on this object.- Specified by:
isConstin interfaceConstProperties<VarScope>- Parameters:
name- the name of the property- Returns:
- true if the named property is defined as a const, false otherwise.
-