| ||||||||||||
SummarySets the prototype for an object. | ||||||||||||
SyntaxJSBool JS_SetPrototype(JSContext *cx, JSObject *obj, JSObject *proto);
| ||||||||||||
DescriptionJS_SetPrototype enables you to set the prototype object for a specified object. A prototype object provides properties that are shared by similar JS object instances. Ordinarily you set a prototype for an object when you create the object with JS_NewObject , but if you do not set a prototype at that time, you can later call JS_SetPrototype to do so.
If
| ||||||||||||
NotesTake care not to create a circularly-linked list of prototypes using this function, because such a set of prototypes cannot be resolved by the JS engine.
| ||||||||||||
See Also
|