Function

JSGlobalContextCreate

Creates a global JavaScript execution context.

Declaration

JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass);

Parameters

globalObjectClass

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

Return Value

A JSGlobalContext with a global object of class globalObjectClass.

Discussion

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

In WebKit version 4.0 and later, the context is created in a unique context group. Therefore, scripts may execute in it concurrently with scripts executing in other contexts. However, you may not use values created in the context in other contexts.

See Also

Miscellaneous

JSContextGetGlobalObject

Gets the global object of a JavaScript execution context.

JSContextGetGroup

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

JSContextGroupCreate

Creates a JavaScript context group.

JSContextGroupRelease

Releases a JavaScript context group.

JSContextGroupRetain

Retains a JavaScript context group.

JSGlobalContextCreateInGroup

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

JSGlobalContextRelease

Releases a global JavaScript execution context.

JSGlobalContextRetain

Retains a global JavaScript execution context.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software