Initializer

init()

Initializes a new JavaScript context.

Declaration

init!()

Return Value

A new JavaScript context.

Discussion

This initializer creates a context along with a new, independent virtual machine (a JSVirtualMachine object). You cannot pass JavaScript values (JSValue objects) between contexts in different virtual machines. To create contexts that share a virtual machine, use the init(virtualMachine:) initializer.

See Also

Creating JavaScript Contexts

init!(virtualMachine: JSVirtualMachine!)

Creates a new JavaScript context associated with a specific virtual machine.