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 162 of file OOJSGlobal.m.

163{
164 assert(outGlobal != NULL);
165
166 *outGlobal = JS_NewCompartmentAndGlobalObject(context, &sGlobalClass, NULL);
167
168 JS_SetGlobalObject(context, *outGlobal);
169 JS_DefineProperty(context, *outGlobal, "global", OBJECT_TO_JSVAL(*outGlobal), NULL, NULL, OOJS_PROP_READONLY);
170}
static JSClass sGlobalClass
Definition OOJSGlobal.m:88
#define OOJS_PROP_READONLY

References OOJS_PROP_READONLY, and sGlobalClass.

◆ SetUpOOJSGlobal()

void SetUpOOJSGlobal ( JSContext *  context,
JSObject *  global 
)

Definition at line 173 of file OOJSGlobal.m.

174{
175 JS_DefineProperties(context, global, sGlobalProperties);
176 JS_DefineFunctions(context, global, sGlobalMethods);
177}
static JSFunctionSpec sGlobalMethods[]
Definition OOJSGlobal.m:133
static JSPropertySpec sGlobalProperties[]
Definition OOJSGlobal.m:121

References sGlobalMethods, and sGlobalProperties.