ADC Home > Reference Library > Reference > Carbon > Internet & Web > JavaScriptCore Framework Reference

 


JSContextRef.h

Includes:

Overview



Functions

JSContextGetGlobalObject
Gets the global object of a JavaScript execution context.
JSGlobalContextCreate
Creates a global JavaScript execution context.
JSGlobalContextRelease
Releases a global JavaScript execution context.
JSGlobalContextRetain
Retains a global JavaScript execution context.

JSContextGetGlobalObject


Gets the global object of a JavaScript execution context.

JSObjectRef JSContextGetGlobalObject(
    JSContextRef ctx);  
Parameters
ctx
The JSContext whose global object you want to get.
Return Value

ctx's global object.


JSGlobalContextCreate


Creates a global JavaScript execution context.

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.


JSGlobalContextRelease


Releases a global JavaScript execution context.

void JSGlobalContextRelease(
    JSGlobalContextRef ctx);  
Parameters
ctx
The JSGlobalContext to release.


JSGlobalContextRetain


Retains a global JavaScript execution context.

JSGlobalContextRef JSGlobalContextRetain(
    JSGlobalContextRef ctx);  
Parameters
ctx
The JSGlobalContext to retain.
Return Value

A JSGlobalContext that is the same as ctx.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.
Last Updated: 2008-03-11