JavaScript-1.5 Reference

JS_InitStandardClasses Function

Summary

Initializes general JS function and object classes, and the built-in object classes used in most scripts.

Syntax

JSBool JS_InitStandardClasses(JSContext *cx, JSObject *obj);
NameTypeDescription
cxJSContext *Pointer to the executable script context for which to initialize JS function and object classes.
objJSObject *Pointer to a JS object to set as the global object.

Description

JS_InitStandardClasses initializes general JS function and object classes, and the built-in object classes used in most scripts. The appropriate constructors for these objects are created in the scope defined for obj. Always call JS_InitStandardClasses before executing scripts that make use of JS objects, functions, and built-in objects.

As a side effect, JS_InitStandardClasses uses obj to establish a global object for the specified executable context, cx, if one is not already established.

JS_InitStandardClasses also initializes the general JS function and object classes. Initializing the function class enables building of constructors. Initializing the object classes enables the . syntax to work in JavaScript.

Finally, JS_InitStandardClasses initializes the built-in JS objects (Array, Boolean, Date, Math, Number, and String) used by most scripts.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_GetClass | JS_InitClass ]

This page was generated by APIDOC