JS::IdentifyStandardInstance

This article covers features introduced in SpiderMonkey 31

Determine if the given object is an instance/prototype/constructor for a standard class.

Syntax

JSProtoKey
JS::IdentifyStandardInstance(JSObject *obj);

JSProtoKey
JS::IdentifyStandardPrototype(JSObject *obj);

JSProtoKey
JS::IdentifyStandardInstanceOrPrototype(JSObject *obj);

JSProtoKey
JS::IdentifyStandardConstructor(JSObject *obj); // Added in SpiderMonkey 38
Name Type Description
obj JSObject * Pointer to the instance/prototype/constructor object to determine.

Description

JS::IdentifyStandardInstance determines if the given object is an instance for a standard class. If so, return the associated JSProtoKey. If not, return JSProto_Null.

JS::IdentifyStandardPrototype determines if the given object is a prototype for a standard class. If so, return the associated JSProtoKey. If not, return JSProto_Null.

JS::IdentifyStandardInstanceOrPrototype determines if the given object is an instance or prototype for a standard class. If so, return the associated JSProtoKey. If not, return JSProto_Null.

JS::IdentifyStandardConstructor determines if the given object is a constructor for a standard class. If so, return the associated JSProtoKey. If not, return JSProto_Null.

See Also