docs
Loading...
Searching...
No Matches
JSContextRef.h

Functions

JSContextGroupRef JSContextGroupCreate (void) JSC_API_AVAILABLE(macos(10.6)
 Creates a JavaScript context group.
JSContextGroupRef ios (7.0))
JSContextGroupRef JSContextGroupRetain (JSContextGroupRef group) JSC_API_AVAILABLE(macos(10.6)
 Retains a JavaScript context group.
void JSContextGroupRelease (JSContextGroupRef group) JSC_API_AVAILABLE(macos(10.6)
 Releases a JavaScript context group.
JSGlobalContextRef JSGlobalContextCreate (JSClassRef globalObjectClass) JSC_API_AVAILABLE(macos(10.5)
 Creates a global JavaScript execution context.
JSGlobalContextRef JSGlobalContextCreateInGroup (JSContextGroupRef group, JSClassRef globalObjectClass) JSC_API_AVAILABLE(macos(10.6)
 Creates a global JavaScript execution context in the context group provided.
JSGlobalContextRef JSGlobalContextRetain (JSGlobalContextRef ctx)
 Retains a global JavaScript execution context.
void JSGlobalContextRelease (JSGlobalContextRef ctx)
 Releases a global JavaScript execution context.
JSObjectRef JSContextGetGlobalObject (JSContextRef ctx)
 Gets the global object of a JavaScript execution context.
JSContextGroupRef JSContextGetGroup (JSContextRef ctx) JSC_API_AVAILABLE(macos(10.6)
 Gets the context group to which a JavaScript execution context belongs.
JSGlobalContextRef JSContextGetGlobalContext (JSContextRef ctx) JSC_API_AVAILABLE(macos(10.7)
 Gets the global context of a JavaScript execution context.
JSStringRef JSGlobalContextCopyName (JSGlobalContextRef ctx) JSC_API_AVAILABLE(macos(10.10)
 Gets a copy of the name of a context.
JSStringRef ios (8.0))
void JSGlobalContextSetName (JSGlobalContextRef ctx, JSStringRef name) JSC_API_AVAILABLE(macos(10.10)
 Sets the name exposed when inspecting a context.
bool JSGlobalContextIsInspectable (JSGlobalContextRef ctx) JSC_API_AVAILABLE(macos(JSC_MAC_TBA)
 Gets whether the context is inspectable in Web Inspector.
bool ios (JSC_IOS_TBA))
void JSGlobalContextSetInspectable (JSGlobalContextRef ctx, bool inspectable) JSC_API_AVAILABLE(macos(JSC_MAC_TBA)
 Sets whether the context is inspectable in Web Inspector. Default value is NO.

Function Documentation

◆ ios() [1/3]

JSStringRef ios ( 7. 0)

◆ ios() [2/3]

void ios ( 8. 0)

◆ ios() [3/3]

void ios ( JSC_IOS_TBA )

◆ JSContextGetGlobalContext()

JSGlobalContextRef JSContextGetGlobalContext ( JSContextRef ctx)

Gets the global context of a JavaScript execution context.

Parameters
ctxThe JSContext whose global context you want to get.
Returns
ctx's global context.

◆ JSContextGetGlobalObject()

JSObjectRef JSContextGetGlobalObject ( JSContextRef ctx)

Gets the global object of a JavaScript execution context.

Parameters
ctxThe JSContext whose global object you want to get.
Returns
ctx's global object.

◆ JSContextGetGroup()

JSContextGroupRef JSContextGetGroup ( JSContextRef ctx)

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

Parameters
ctxThe JSContext whose group you want to get.
Returns
ctx's group.

◆ JSContextGroupCreate()

JSContextGroupRef JSContextGroupCreate ( void )

Creates a JavaScript context group.

Note

A JSContextGroup associates JavaScript contexts with one another. Contexts in the same group may share and exchange JavaScript objects. Sharing and/or exchanging JavaScript objects between contexts in different groups will produce undefined behavior. When objects from the same context group are used in multiple threads, explicit synchronization is required.

A JSContextGroup may need to run deferred tasks on a run loop, such as garbage collection or resolving WebAssembly compilations. By default, calling JSContextGroupCreate will use the run loop of the thread it was called on. Currently, there is no API to change a JSContextGroup's run loop once it has been created.

Returns
The created JSContextGroup.

◆ JSContextGroupRelease()

void JSContextGroupRelease ( JSContextGroupRef group)

Releases a JavaScript context group.

Parameters
groupThe JSContextGroup to release.

◆ JSContextGroupRetain()

JSContextGroupRef JSContextGroupRetain ( JSContextGroupRef group)

Retains a JavaScript context group.

Parameters
groupThe JSContextGroup to retain.
Returns
A JSContextGroup that is the same as group.

◆ JSGlobalContextCopyName()

JSStringRef JSGlobalContextCopyName ( JSGlobalContextRef ctx)

Gets a copy of the name of a context.

Parameters
ctxThe JSGlobalContext whose name you want to get.
Returns
The name for ctx.
Note
A JSGlobalContext's name is exposed when inspecting the context to make it easier to identify the context you would like to inspect.

◆ JSGlobalContextCreate()

JSGlobalContextRef JSGlobalContextCreate ( JSClassRef globalObjectClass)

Creates a global JavaScript execution context.

Note

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.

Parameters
globalObjectClassThe class to use when creating the global object. Pass NULL to use the default object class.
Returns
A JSGlobalContext with a global object of class globalObjectClass.

◆ JSGlobalContextCreateInGroup()

JSGlobalContextRef JSGlobalContextCreateInGroup ( JSContextGroupRef group,
JSClassRef globalObjectClass )

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

Note
JSGlobalContextCreateInGroup allocates a global object and populates it with all the built-in JavaScript objects, such as Object, Function, String, and Array.
Parameters
globalObjectClassThe class to use when creating the global object. Pass NULL to use the default object class.
groupThe context group to use. The created global context retains the group. Pass NULL to create a unique group for the context.
Returns
A JSGlobalContext with a global object of class globalObjectClass and a context group equal to group.

◆ JSGlobalContextIsInspectable()

bool JSGlobalContextIsInspectable ( JSGlobalContextRef ctx)

Gets whether the context is inspectable in Web Inspector.

Parameters
ctxThe JSGlobalContext that you want to change the inspectability of.
Returns
Whether the context is inspectable in Web Inspector.

◆ JSGlobalContextRelease()

void JSGlobalContextRelease ( JSGlobalContextRef ctx)

Releases a global JavaScript execution context.

Parameters
ctxThe JSGlobalContext to release.

◆ JSGlobalContextRetain()

JSGlobalContextRef JSGlobalContextRetain ( JSGlobalContextRef ctx)

Retains a global JavaScript execution context.

Parameters
ctxThe JSGlobalContext to retain.
Returns
A JSGlobalContext that is the same as ctx.

◆ JSGlobalContextSetInspectable()

void JSGlobalContextSetInspectable ( JSGlobalContextRef ctx,
bool inspectable )

Sets whether the context is inspectable in Web Inspector. Default value is NO.

Parameters
ctxThe JSGlobalContext that you want to change the inspectability of.
inspectableYES to allow Web Inspector to connect to the context, otherwise NO.

◆ JSGlobalContextSetName()

void JSGlobalContextSetName ( JSGlobalContextRef ctx,
JSStringRef name )

Sets the name exposed when inspecting a context.

Parameters
ctxThe JSGlobalContext that you want to name.
nameThe name to set on the context.

Go to the source code of this file.