JSCheckScriptSyntax(_:_:_:_:_:)
Checks for syntax errors in a string of JavaScript.
Declaration
func JSCheckScriptSyntax(_ ctx: JSContextRef!, _ script: JSStringRef!, _ sourceURL: JSStringRef!, _ startingLineNumber: Int32, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> BoolParameters
- ctx:
The execution context to use.
- script:
A Jsstringref that contains the script to check for syntax errors.
- sourceURL:
A Jsstringref that contains a URL for the script’s source file. The system only uses this when reporting exceptions. Pass
NULLto omit source file information in exceptions. - startingLineNumber:
An integer value that specifies the script’s starting line number in the file at
sourceURL. The system only uses this when reporting exceptions. - exception:
A pointer to a Jsvalueref to store a syntax error exception in, if any. Pass
NULLto ignore any syntax error exception.
Return Value
true if the script is syntactically correct; otherwise, false.