JavaScript-1.5 Reference

JS_GetConstructor Function

Summary

Retrieves the constructor for an object.

Syntax

JSObject * JS_GetConstructor(JSContext *cx, JSObject *proto);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
protoJSObject *Pointer to the object for which to retrieve a constructor.

Description

JS_GetConstructor retrieves the constructor for a specified object, proto. The constructor is a function that builds the object. If successful, JS_GetConstructor returns a pointer to the constructor object.

If proto does not have any properties, JS_GetConstructor returns NULL. If proto has properties, but it does not have an associated constructor function, JS_GetConstructor reports the lack of a constructor function and then returns NULL.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_GetParent | JS_GetPrototype ]

This page was generated by APIDOC