JavaScript-1.5 Reference

JS_ExecuteScript Function

Summary

Executes a compiled script.

Syntax

JSBool JS_ExecuteScript(JSContext *cx, JSObject *obj,
    JSScript *script, jsval *rval);
NameTypeDescription
cxJSContext *JS context in which the script executes.
objJSObject *Object with which the script is associated.
scriptJSScript *Previously compiled script to execute.
rvaljsval *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

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_CompileFile | JS_CompileScript | JS_DecompileScript | JS_DestroyScript | JS_EvaluateScript ]

This page was generated by APIDOC