Execute a compiled script.
| || ||The context in which to execute the script. Requires request. In a |
| || || |
The scope in which to execute the script. In the simplest cases, this should just be the embedding's global object.
In ECMAScript terms, the script is executed in a new execution context, but that context is not initialized quite as described in any of the three cases in ECMA 262-3 §10.2. Instead:
| || ||The compiled script to execute.|
| || ||Out parameter. On success, |
JS_ExecuteScript executes a previously-compiled script,
If the script executes successfully,
*rval receives the value from the last executed expression statement processed in the script, and
JS_TRUE. Otherwise it returns
JS_FALSE, and the value left in
*rval is unspecified.
The JSAPI User Guide contains example code using compiled scripts.
To execute a script that has not been compiled, use