This article needs a technical review. How you can help.
This article covers features introduced in SpiderMonkey 31
Return the global object for the active function on the context.
JSObject * JS::CurrentGlobalOrNull(JSContext *cx);
||The context for which to return the global object. Requires request. In a
JS::CurrentGlobalOrNull() returns the global object for whatever function is currently running on the context. In other words, it returns the global object on the current scope chain.
. Note that
JS_GetGlobalObject() and context globals are becoming obsolete.