JS_ExecuteScript |
Function |
|
Summary
Executes a compiled script.
|
Syntax
JSBool JS_ExecuteScript(JSContext *cx, JSObject *obj,
JSScript *script, jsval *rval);
Name | Type | Description |
cx | JSContext * | JS context in which the script executes.
|
obj | JSObject * | Object with which the script is associated.
|
script | JSScript * | Previously compiled script to execute.
|
rval | jsval * | Pointer to the value from the last executed expression statement processed in the script.
|
|
Description
JS_ExecuteScript executes a previously compiled script, script . On successful completion, rval is a pointer to a variable that holds the value from the last executed expression statement processed in the script.
If a script executes successfully, JS_ExecuteScript returns JS_TRUE . Otherwise it returns JS_FALSE . On failure, your application should assume that rval is undefined.
|
Notes
To execute an uncompiled script, compile it with JS_CompileScript , and
then call JS_ExecuteScript , or call JS_EvaluateScript to both compile and
execute the script.
|
See Also
|