JavaScript-1.5 Reference

JS_EvaluateUCScript Function

Summary

Compiles and executes a Unicode-encoded script.

Syntax

JSBool JS_EvaluateUCScript(JSContext *cx, JSObject *obj,
    const jschar *chars, uintN length, const char *filename,
    uintN lineno, jsval *rval);
NameTypeDescription
cxJSContext *JS context in which the script compiles and executes.
objJSObject *Object with which the script is associated.
charsconst jschar *Unicode character array ontaining the script to compile and execute.
lengthuintNSize, in Unicode characters, of the script to compile and execute.
filenameconst char *Name of file or URL containing the script. Used to report filename or URL in error messages.
linenouintNLine number. Used to report the offending line in the file or URL if an error occurs.
rvaljsval *Pointer to the value from the last executed expression statement processed in the script.

Description

JS_EvaluateUCScript compiles and executes a script associated with a JS object, obj. On successful completion, rval is a pointer to a variable that holds the value from the last executed expression statement processed in the script.

chars is the Unicode character array containing the text of the script. length indicates the size of the text version of the script in Unicode characters.

filename is the name of the file (or URL) containing the script. This information is included in messages if an error occurs during compilation. Similarly, lineno is used to report the line number of the script or file where an error occurred during compilation.

If a script compiles and executes successfully, JS_EvaluateUCScript returns JS_TRUE. Otherwise it returns JS_FALSE. On failure, your application should assume that rval is undefined.

See Also

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

This page was generated by APIDOC