Retry only for https protocol
[elinks.git] / src / scripting / smjs / global_object.c
blob0976f8ae63e8eb1d79acafb4c8677540b52337d4
1 /* The global object. */
3 #ifdef HAVE_CONFIG_H
4 #include "config.h"
5 #endif
7 #include "elinks.h"
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
25 static JSObject *
26 smjs_get_global_object(void)
28 JSObject *jsobj;
30 assert(smjs_ctx);
32 jsobj = JS_NewCompartmentAndGlobalObject(smjs_ctx, (JSClass *) &global_class, NULL);
34 if (!jsobj) return NULL;
36 JS_InitStandardClasses(smjs_ctx, jsobj);
38 return jsobj;
41 void
42 smjs_init_global_object(void)
44 smjs_global_object = smjs_get_global_object();