JS SetOptions
From MDC
Enables and disables options on a JSContext, replacing all previously set options.
[edit] Syntax
uint32 JS_SetOptions(JSContext *cx, uint32 options);
| Name | Type | Description |
|---|---|---|
cx |
JSContext * |
A context on which to set options. |
options |
uint32 |
The new set of options. This is the logical OR of zero or more flags described below. |
[edit] Description
JS_SetOptions sets the option flags of a given JS context cx.
This function returns a uint32 value containing the previous values of the flags.
To turn individual options on or off, use JS_SetOptions with JS_GetOptions:
// turn on strict mode JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_STRICT); // turn off strict mode JS_SetOptions(cx, JS_GetOptions(cx) & ~JSOPTION_STRICT);
The options parameter and the return value are the logical OR of zero or more constants from the following table:
| Option | Description |
|---|---|
|
|
Warn on dubious practice. |
|
|
Convert warnings to errors. |
|
|
Make |
|
|
Mozilla extension. The context's private data points to an XPCOM object (see |
|
|
Caller of |
|
|
|
|
|
ECMAScript for XML (E4X) support: parse |
|
|
The branch callback set by |
|
|
When returning from the outermost API call, prevent uncaught exceptions from being converted to error reports. |