JS_GetPrototype

Retrieves an object's prototype.

Syntax

JSObject * JS_GetPrototype(JSObject *obj);
Name Type Description
obj JSObject * Object for which to retrieve the prototype.

Description

JS_GetPrototype retrieves the prototype of a specified object, obj. A prototype object provides properties inherited by similar JS objects. This is the equivalent of obj.__proto__ from javascript.

If obj has a prototype, JS_GetPrototype returns a pointer to the prototype. Otherwise, it returns NULL.

To set an object's prototype, use JS_SetPrototype.

MXR ID Search for JS_GetPrototype

Document Tags and Contributors

Contributors to this page: Sheppy, Dmandelin, ashb, Nickolay, Jimb, Tservo, Dria, Jorend
Last updated by: Sheppy,