From c0aaf31f5a9a65808d8b7af92434608135ccc752 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 31 Jul 2012 14:48:53 +0100 Subject: fix global handling --- javascript/jsapi/window.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'javascript/jsapi/window.c') diff --git a/javascript/jsapi/window.c b/javascript/jsapi/window.c index 06e6cdfe8..0b7673be3 100644 --- a/javascript/jsapi/window.c +++ b/javascript/jsapi/window.c @@ -299,8 +299,18 @@ JSObject * jsapi_new_window(JSContext *cx, JSObject *parent, void *win_priv) return NULL; } + /** @todo reconsider global object handling. future + * editions of spidermonkey appear to be removing the + * idea of a global so we probably need to handle + * global object references internally + */ + + /* set the contexts global */ + JS_SetGlobalObject(cx, window); + /* Populate the global object with the standard globals, like - Object and Array. */ + * Object and Array. + */ if (!JS_InitStandardClasses(cx, window)) { return NULL; } -- cgit v1.2.3