Package org.mozilla.javascript
Class NativeSymbol
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.NativeSymbol
- All Implemented Interfaces:
Serializable,ConstProperties,DebuggableObject,Scriptable,Symbol,SymbolScriptable
This is an implementation of the standard "Symbol" type that implements all of its weird
properties. One of them is that some objects can have an "internal data slot" that makes them a
Symbol and others cannot.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator -
Field Summary
FieldsFields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the name of the class.Gets the value that will be returned by calling the typeof operator on this object.inthashCode()static voidinit(Context cx, Scriptable scope, boolean sealed) booleanisSymbol()Object() on a Symbol constructs an object which is NOT a symbol, but which has an "internal data slot" that is.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.voidput(Symbol key, Scriptable start, Object value) Implementation of put required by SymbolScriptable objects.toString()Methods inherited from class org.mozilla.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, has, has, 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, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
Field Details
-
CLASS_NAME
- See Also:
-
TYPE_NAME
- See Also:
-
-
Constructor Details
-
NativeSymbol
-
-
Method Details
-
init
-
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
-
toString
-
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 classScriptableObject- Parameters:
name- the name of 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 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:ScriptableObjectImplementation of put required by SymbolScriptable objects.- Specified by:
putin interfaceSymbolScriptable- Overrides:
putin classScriptableObject
-
isSymbol
public boolean isSymbol()Object() on a Symbol constructs an object which is NOT a symbol, but which has an "internal data slot" that is. Furthermore, such an object has the Symbol prototype so this particular object is still used. Account for that here: an "Object" that was created from a Symbol has a different value of the slot. -
getTypeOf
Description copied from class:ScriptableObjectGets the value that will be returned by calling the typeof operator on this object.- Overrides:
getTypeOfin classScriptableObject- Returns:
- default is "object" unless
ScriptableObject.avoidObjectDetection()istruein which case it returns "undefined"
-
hashCode
public int hashCode() -
equals
-