| |||||||||||||||||||||||||||||||||
SummaryInitializes a class structure, its prototype, properties, and functions. | |||||||||||||||||||||||||||||||||
SyntaxJSObject * JS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto, JSClass *clasp, JSNative constructor, uintN nargs, JSPropertySpec *ps, JSFunctionSpec *fs, JSPropertySpec *static_ps, JSFunctionSpec *static_fs);
| |||||||||||||||||||||||||||||||||
DescriptionJS_InitClass builds a class structure, its object constructor, its prototype, its properties, and its methods. A class is an internal JS structure that is not exposed outside the JS engine. You can use a class, its properties, methods, and prototypes to build other objects that are exposed outside the engine.
A class is comprised of a class structure, a constructor, a prototype object, and properties and functions. The class structure specifies the name of the class, its flags, and its property functions. These include functions for adding and deleting properties, getting and setting property values, and enumerating converting, resolving, and finalizing its properties.
The constructor for the class is built in the same context as
If you provide a constructor for the class, then you should also pass an object to
After building the constructor and prototype,
| |||||||||||||||||||||||||||||||||
See Also
|