Instance Methodjavascriptkit 0.24.0JavaScriptKit
new(_:)
A variadic arguments version of new
.
func new(_ arguments: ConvertibleToJSValue...) throws -> JSObject
A variadic arguments version of new
.
func new(_ arguments: ConvertibleToJSValue...) throws -> JSObject
s13JavaScriptKit18JSThrowingFunctionC3newyAA8JSObjectCAA20ConvertibleToJSValue_pd_tKF
What are these?39PYX
import JavaScriptKit
Swift framework to interact with JavaScript through WebAssembly.
class JSThrowingFunction
A JSFunction
wrapper that enables throwing function calls. Exceptions produced by JavaScript functions will be thrown as JSValue
.
protocol ConvertibleToJSValue
Objects that can be converted to a JavaScript value, preferably in a lossless manner.
@dynamicMemberLookup class JSObject
JSObject
represents an object in JavaScript and supports dynamic member lookup. Any member access like object.foo
will dynamically request the JavaScript and Swift runtime bridge library for a member with the specified name in this object.
init(_ base: JSFunction)
@discardableResult func callAsFunction(this: JSObject? = nil, _ arguments: ConvertibleToJSValue...) throws -> JSValue
A variadic arguments version of callAsFunction
.
@discardableResult func callAsFunction(this: JSObject? = nil, arguments: [ConvertibleToJSValue]) throws -> JSValue
Call this function with given arguments
and binding given this
as context.
func new(arguments: [ConvertibleToJSValue]) throws -> JSObject
Instantiate an object from this function as a throwing constructor.