Mozilla.com

Table of contents
  1. 1. Syntax
  2. 2. Description
Table of contents
  1. 1. Syntax
  2. 2. Description

Retrieves an object's prototype.

Syntax

JSObject * JS_GetPrototype(JSContext *cx, JSObject *obj);
Name Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information. Requires request. (In a JS_THREADSAFE build, the caller must be in a request on this JSContext.)
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.

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.

LXR ID Search for JS_GetPrototype

Page last modified 20:01, 5 Sep 2008 by Jorend

Files (0)