JavaScript-1.5 Reference

JS_CompileFile Function

Summary

Compiles a script stored in an external file.

Syntax

JSScript * JS_CompileFile(JSContext *cx, JSObject *obj,
    const char *filename);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
objJSObject *Object with which the script is associated.
filenameconst char *Name of file or URL containing the script to compile.

Description

JS_CompileFile compiles the text of script in an external file location for execution by the JS engine.

Notes

JS_CompileFile is available only if you compile the JS engine with the JSFILE macro defined.

filename is the name of the file (or URL) containing the script to compile.

If a script compiles successfully, JS_CompileFile returns a pointer to the compiled script. Otherwise JS_CompileFile returns NULL.

To pass a script as an argument to a function rather than having to specify a file location, use JS_CompileScript instead of JS_CompileFile.

See Also

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

This page was generated by APIDOC