Oolite 1.91.0.7645-241119-222d325
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 166 of file OOJSGlobal.m.

167{
168 assert(outGlobal != NULL);
169
170 *outGlobal = JS_NewCompartmentAndGlobalObject(context, &sGlobalClass, NULL);
171
172 JS_SetGlobalObject(context, *outGlobal);
173 JS_DefineProperty(context, *outGlobal, "global", OBJECT_TO_JSVAL(*outGlobal), NULL, NULL, OOJS_PROP_READONLY);
174}
static JSClass sGlobalClass
Definition OOJSGlobal.m:89
#define OOJS_PROP_READONLY

References OOJS_PROP_READONLY, and sGlobalClass.

◆ SetUpOOJSGlobal()

void SetUpOOJSGlobal ( JSContext * context,
JSObject * global )

Definition at line 177 of file OOJSGlobal.m.

178{
179 JS_DefineProperties(context, global, sGlobalProperties);
180 JS_DefineFunctions(context, global, sGlobalMethods);
181}
static JSFunctionSpec sGlobalMethods[]
Definition OOJSGlobal.m:136
static JSPropertySpec sGlobalProperties[]
Definition OOJSGlobal.m:123

References sGlobalMethods, and sGlobalProperties.