Function JSCheckScriptSyntax

Source
pub unsafe extern "C-unwind" fn JSCheckScriptSyntax(
    ctx: JSContextRef,
    script: JSStringRef,
    source_url: JSStringRef,
    starting_line_number: c_int,
    exception: *mut JSValueRef,
) -> bool
Available on crate feature JSBase only.
Expand description

Checks for syntax errors in a string of JavaScript.

Parameter ctx: The execution context to use.

Parameter script: A JSString containing the script to check for syntax errors.

Parameter sourceURL: A JSString containing a URL for the script’s source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions.

Parameter startingLineNumber: An integer value specifying the script’s starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1.

Parameter exception: A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception.

Returns: true if the script is syntactically correct, otherwise false.