Obsolete since JSAPI 16
This feature is obsolete. Although it is still supported by browsers, its usage is discouraged in new projects. Try to avoid using it.
Create a new global object in a new compartment.
JSObject *JS_NewCompartmentAndGlobalObject(JSContext *cx, JSClass *clasp, JSPrincipals *principals);
||The context in which to create the new global object. Requires request. In a
The class to use for the new global object.
The caller must ensure that the
||The security information to associate with this compartment.|
JS_NewCompartmentAndGlobalObjectcreates a new compartment, and then creates a new global object as the first object in that compartment.
NewCompartmentAndGlobalObjectreturns a pointer to the new global object. Otherwise it returns