1 /* The global object. */
9 #include "ecmascript/spidermonkey-shared.h"
10 #include "scripting/scripting.h"
11 #include "scripting/smjs/core.h"
12 #include "scripting/smjs/global_object.h"
15 JSObject
*smjs_global_object
;
18 static const JSClass global_class
= {
19 "global", JSCLASS_GLOBAL_FLAGS
,
20 JS_PropertyStub
, JS_PropertyStub
,
21 JS_PropertyStub
, JS_StrictPropertyStub
,
22 JS_EnumerateStub
, JS_ResolveStub
, JS_ConvertStub
, JS_FinalizeStub
26 smjs_get_global_object(void)
32 jsobj
= JS_NewCompartmentAndGlobalObject(smjs_ctx
, (JSClass
*) &global_class
, NULL
);
34 if (!jsobj
) return NULL
;
36 JS_InitStandardClasses(smjs_ctx
, jsobj
);
42 smjs_init_global_object(void)
44 smjs_global_object
= smjs_get_global_object();