Class JSClass
java.lang.Object
com.oracle.truffle.js.runtime.builtins.JSClass
- Direct Known Subclasses:
AbstractJSClass, JSNonProxy
Basic interface for all JavaScript (ordinary and exotic) object types. A JSClass defines the
internal and access methods of a JSObject and allows for overriding their behavior for different
types of objects. It can be obtained from an object via
Shape.getDynamicType().
The interface is inspired by ECMAScript internal methods.
Parameter order: JSDynamicObject receiver[, the rest...].-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleandefineOwnProperty(JSDynamicObject thisObj, Object key, PropertyDescriptor value, boolean doThrow) 9.1.6 [[DefineOwnProperty]] (P, Desc).abstract booleandelete(JSDynamicObject thisObj, long index, boolean isStrict) abstract booleandelete(JSDynamicObject thisObj, Object key, boolean isStrict) 9.1.10 [[Delete]] (P).filterOwnPropertyKeys(List<Object> ownPropertyKeys, boolean strings, boolean symbols) get(JSDynamicObject thisObj, long index) final Objectget(JSDynamicObject thisObj, Object key) 9.1.8 [[Get]] (P, Receiver).abstract ObjectgetHelper(JSDynamicObject store, Object thisObj, long index, com.oracle.truffle.api.nodes.Node encapsulatingNode) abstract ObjectgetHelper(JSDynamicObject store, Object thisObj, Object key, com.oracle.truffle.api.nodes.Node encapsulatingNode) getIntrinsicDefaultProto(JSRealm realm) Allows invokevirtual of this method instead of invokeinterface.abstract ObjectgetMethodHelper(JSDynamicObject store, Object thisObj, Object key, com.oracle.truffle.api.nodes.Node encapsulatingNode) abstract ObjectgetOwnHelper(JSDynamicObject store, Object thisObj, long index, com.oracle.truffle.api.nodes.Node encapsulatingNode) abstract ObjectgetOwnHelper(JSDynamicObject store, Object thisObj, Object key, com.oracle.truffle.api.nodes.Node encapsulatingNode) abstract PropertyDescriptorgetOwnProperty(JSDynamicObject thisObj, Object key) 9.1.5 [[GetOwnProperty]] (P).getOwnPropertyKeys(JSDynamicObject obj, boolean strings, boolean symbols) GetOwnPropertyKeys (O, type).abstract JSDynamicObjectgetPrototypeOf(JSDynamicObject thisObj) 9.1.1 [[GetPrototypeOf]] ().abstract booleanIf true,ownPropertyKeys(JSDynamicObject)andJSShape.getPropertyKeyList(Shape, boolean, boolean)enumerate the same keys.abstract booleanhasOwnProperty(JSDynamicObject thisObj, long index) abstract booleanhasOwnProperty(JSDynamicObject thisObj, Object key) abstract booleanhasProperty(JSDynamicObject thisObj, long index) abstract booleanhasProperty(JSDynamicObject thisObj, Object key) 9.1.7 [[HasProperty]] (P).abstract booleanisExtensible(JSDynamicObject thisObj) 9.1.3 [[IsExtensible]] ().final booleanisInstance(JSDynamicObject object) static booleanisInstance(JSDynamicObject object, JSClass jsclass) final booleanisInstance(Object object) static booleanisInstance(Object object, JSClass jsclass) com.oracle.truffle.api.object.ShapemakeInitialShape(JSContext context, JSDynamicObject prototype) 9.1.12 [[OwnPropertyKeys]]().abstract booleanpreventExtensions(JSDynamicObject thisObj, boolean doThrow) 9.1.4 [[PreventExtensions]] ().abstract booleanset(JSDynamicObject thisObj, long index, Object value, Object receiver, boolean isStrict, com.oracle.truffle.api.nodes.Node encapsulatingNode) abstract booleanset(JSDynamicObject thisObj, Object key, Object value, Object receiver, boolean isStrict, com.oracle.truffle.api.nodes.Node encapsulatingNode) 9.1.9 [[Set]] (P, V, Receiver).abstract booleansetPrototypeOf(JSDynamicObject thisObj, JSDynamicObject newPrototype) 9.1.2 [[SetPrototypeOf]] (V).toString()abstract booleanabstract boolean
-
Constructor Details
-
JSClass
protected JSClass()
-
-
Method Details
-
getPrototypeOf
9.1.1 [[GetPrototypeOf]] (). -
setPrototypeOf
9.1.2 [[SetPrototypeOf]] (V). -
isExtensible
9.1.3 [[IsExtensible]] (). -
preventExtensions
9.1.4 [[PreventExtensions]] (). -
getOwnProperty
9.1.5 [[GetOwnProperty]] (P). -
defineOwnProperty
public abstract boolean defineOwnProperty(JSDynamicObject thisObj, Object key, PropertyDescriptor value, boolean doThrow) 9.1.6 [[DefineOwnProperty]] (P, Desc). -
hasProperty
9.1.7 [[HasProperty]] (P). -
hasProperty
-
hasOwnProperty
-
hasOwnProperty
-
get
9.1.8 [[Get]] (P, Receiver). -
get
-
getHelper
public abstract Object getHelper(JSDynamicObject store, Object thisObj, Object key, com.oracle.truffle.api.nodes.Node encapsulatingNode) -
getHelper
public abstract Object getHelper(JSDynamicObject store, Object thisObj, long index, com.oracle.truffle.api.nodes.Node encapsulatingNode) -
getOwnHelper
public abstract Object getOwnHelper(JSDynamicObject store, Object thisObj, Object key, com.oracle.truffle.api.nodes.Node encapsulatingNode) -
getOwnHelper
public abstract Object getOwnHelper(JSDynamicObject store, Object thisObj, long index, com.oracle.truffle.api.nodes.Node encapsulatingNode) -
getMethodHelper
public abstract Object getMethodHelper(JSDynamicObject store, Object thisObj, Object key, com.oracle.truffle.api.nodes.Node encapsulatingNode) -
set
public abstract boolean set(JSDynamicObject thisObj, Object key, Object value, Object receiver, boolean isStrict, com.oracle.truffle.api.nodes.Node encapsulatingNode) 9.1.9 [[Set]] (P, V, Receiver). -
set
public abstract boolean set(JSDynamicObject thisObj, long index, Object value, Object receiver, boolean isStrict, com.oracle.truffle.api.nodes.Node encapsulatingNode) -
delete
9.1.10 [[Delete]] (P). -
delete
-
ownPropertyKeys
9.1.12 [[OwnPropertyKeys]](). Provides all own properties of this object with a String or Symbol key. Represents the [[OwnPropertyKeys]] internal method.- Returns:
- a List of the keys of all own properties of that object
-
getOwnPropertyKeys
public abstract List<Object> getOwnPropertyKeys(JSDynamicObject obj, boolean strings, boolean symbols) GetOwnPropertyKeys (O, type).- Returns:
- a List of the keys of all own properties of that object with the specified types
-
filterOwnPropertyKeys
-
hasOnlyShapeProperties
If true,ownPropertyKeys(JSDynamicObject)andJSShape.getPropertyKeyList(Shape, boolean, boolean)enumerate the same keys. -
toString
-
isInstance
-
isInstance
-
isInstance
-
isInstance
-
makeInitialShape
public com.oracle.truffle.api.object.Shape makeInitialShape(JSContext context, JSDynamicObject prototype) -
getIntrinsicDefaultProto
Allows invokevirtual of this method instead of invokeinterface. Classes overriding this method should implementPrototypeSupplier.- See Also:
-
usesOrdinaryGetOwnProperty
public abstract boolean usesOrdinaryGetOwnProperty() -
usesOrdinaryIsExtensible
public abstract boolean usesOrdinaryIsExtensible()
-