Pointer to a JSContext which the callback may use to call into JSAPI functions. This is the context which was just created, or is about to be destroyed. For example, the callback my call JS_GetContextPrivate(cx) in order to free up resources previously allocated by JS_SetContextPrivate.
See JSContextOp. For future compatibility the callback must do nothing and return true if any other value is passed.
JS_NewContext successfully created a new JSContext instance. The callback can initialize the instance as required. If the callback returns JS_FALSE, the instance will be destroyed and JS_NewContext returns NULL. In this case the callback is not called again.
JS_SetContextCallback specifies a callback function that is automatically called when JSContexts are created or destroyed. Only one callback function may be specified per JS runtime. This function returns the previous context callback, if any, else NULL.