pub unsafe extern "C" fn JSEvaluateScript(
ctx: JSContextRef,
script: JSStringRef,
thisObject: JSObjectRef,
sourceURL: JSStringRef,
startingLineNumber: c_int,
exception: *mut JSValueRef,
) -> JSValueRef
Expand description
Evaluates a string of JavaScript.
ctx
: The execution context to use.script
: AJSStringRef
containing the script to evaluate.thisObject
: The object to use asthis
, orNULL
to use the global object asthis
.sourceURL
: AJSStringRef
containing a URL for the script’s source file. This is used by debuggers and when reporting exceptions. PassNULL
if you do not care to include source file information.startingLineNumber
: An integer value specifying the script’s starting line number in the file located atsourceURL
. This is only used when reporting exceptions. The value is one-based, so the first line is line1
and invalid values are clamped to1
.exception
: A pointer to aJSValueRef
in which to store an exception, if any. PassNULL
if you do not care to store an exception.
The JSValueRef
that results from evaluating script, or NULL
if an exception is thrown.