JSEvaluateScript(_:_:_:_:_:_:)
Evaluates a string of JavaScript.
Declaration
func JSEvaluateScript(_ ctx: JSContextRef!, _ script: JSStringRef!, _ thisObject: JSObjectRef!, _ sourceURL: JSStringRef!, _ startingLineNumber: Int32, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> JSValueRef!Parameters
- ctx:
The execution context to use.
- script:
A Jsstringref that contains the script to evaluate.
- thisObject:
The object to use as
thisorNULLto use the global object asthis. - 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 an exception in, if any. Pass
NULLto discard any exception.
Return Value
The value that results from evaluating script, or NULL if the system throws an exception.