Creates a global JavaScript execution context in the context group provided.


func JSGlobalContextCreateInGroup(_ group: JSContextGroupRef!, _ globalObjectClass: JSClassRef!) -> JSGlobalContextRef!



The class to use when creating the global object. Pass NULL to use the default object class.


The context group to use. The created global context retains the group. Pass NULL to create a unique group for the context.

Return Value

A JSGlobalContext with a global object of class globalObjectClass and a context group equal to group.


JSGlobalContextCreateInGroup allocates a global object and populates it with all the built-in JavaScript objects, such as Object, Function, String, and Array.

See Also


func JSContextGetGlobalObject(JSContextRef!) -> JSObjectRef!

Gets the global object of a JavaScript execution context.

func JSContextGetGroup(JSContextRef!) -> JSContextGroupRef!

Gets the context group to which a JavaScript execution context belongs.

func JSContextGroupCreate() -> JSContextGroupRef!

Creates a JavaScript context group.

func JSContextGroupRelease(JSContextGroupRef!)

Releases a JavaScript context group.

func JSGlobalContextCreate(JSClassRef!) -> JSGlobalContextRef!

Creates a global JavaScript execution context.

func JSGlobalContextRelease(JSGlobalContextRef!)

Releases a global JavaScript execution context.