Contents

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 this or NULL to use the global object as this.

  • sourceURL:

    A Jsstringref that contains a URL for the script’s source file. The system only uses this when reporting exceptions. Pass NULL to 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 NULL to discard any exception.

Return Value

The value that results from evaluating script, or NULL if the system throws an exception.

See Also

Script Evaluation