Oolite
Loading...
Searching...
No Matches
OOJSGlobal.h File Reference
import <Foundation/Foundation.h>
#include <jsapi.h>
Include dependency graph for OOJSGlobal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void CreateOOJSGlobal (JSContext *context, JSObject **outGlobal)
void SetUpOOJSGlobal (JSContext *context, JSObject *global)

Function Documentation

◆ CreateOOJSGlobal()

void CreateOOJSGlobal ( JSContext * context,
JSObject ** outGlobal )

Definition at line 151 of file OOJSGlobal.m.

152{
153 assert(outGlobal != NULL);
154
155 *outGlobal = JS_NewCompartmentAndGlobalObject(context, &sGlobalClass, NULL);
156
157 JS_SetGlobalObject(context, *outGlobal);
158 JS_DefineProperty(context, *outGlobal, "global", OBJECT_TO_JSVAL(*outGlobal), NULL, NULL, OOJS_PROP_READONLY);
159}
static JSClass sGlobalClass
Definition OOJSGlobal.m:85
#define OOJS_PROP_READONLY

References OOJS_PROP_READONLY, and sGlobalClass.

Referenced by OOJavaScriptEngine(Private)::createMainThreadContext.

Here is the caller graph for this function:

◆ SetUpOOJSGlobal()

void SetUpOOJSGlobal ( JSContext * context,
JSObject * global )

Definition at line 161 of file OOJSGlobal.m.

162{
163 JS_DefineProperties(context, global, sGlobalProperties);
164 JS_DefineFunctions(context, global, sGlobalMethods);
165}
static JSFunctionSpec sGlobalMethods[]
Definition OOJSGlobal.m:124
static JSPropertySpec sGlobalProperties[]
Definition OOJSGlobal.m:114

References sGlobalMethods, and sGlobalProperties.

Referenced by OOJavaScriptEngine(Private)::createMainThreadContext.

Here is the caller graph for this function: