JavaScript-1.5 Reference

JS_CompileUCScriptForPrincipals Function

Summary

Compiles a security-enabled, Unicode-encoded script for execution.

Syntax

JSScript * JS_CompileUCScriptForPrincipals(JSContext *cx,
    JSObject *obj,JSPrincipals *principals, const jschar *chars,
    size_t length, const char *filename, uintN lineno);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
objJSObject *Object with which the script is associated.
principalsJSPrincipals *Pointer to the structure holding the security information for this script.
charsconst jschar *String containing the script to compile.
lengthsize_tNumber of Unicode characters in the script to compile.
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.

Description

JS_CompileUCScriptForPrincipals compiles a security-enabled script using a Unicode character set, chars, for execution. The script is associated with a JS object.

principals is a pointer to the JSPrincipals structure that contains the security information to associate with this script.

chars is the Unicode string containing the text of the script. length indicates the size of the script in characters.

filename is the name of the file (or URL) containing the script. This information 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 successfully, JS_CompileUCScriptForPrincipals returns a pointer to the compiled script. Otherwise JS_CompileUCScriptForPrincipals returns NULL, and reports an error.

See Also

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

This page was generated by APIDOC