Back out 94e52cdc2157
authorGregor Wagner <anygregor@gmail.com>
Wed, 29 Sep 2010 13:39:22 -0700
changeset 54839 ec9e11a37b6d95e4795f03134c7228e89cebc277
parent 54838 94e52cdc2157d5dddbe5bd7f0c999b967248648a
child 54840 fb50e5ff2dab72e676a19a3e9c263c4ac2ce6eaa
push idunknown
push userunknown
push dateunknown
milestone2.0b7pre
backs out94e52cdc2157d5dddbe5bd7f0c999b967248648a
Back out 94e52cdc2157
js/jsd/jsd_high.c
--- a/js/jsd/jsd_high.c
+++ b/js/jsd/jsd_high.c
@@ -134,30 +134,28 @@ static JSDContext*
         goto label_newJSDContext_failure;
 
     jsdc->dumbContext = JS_NewContext(jsdc->jsrt, 256);
     if( ! jsdc->dumbContext )
         goto label_newJSDContext_failure;
 
     JS_BeginRequest(jsdc->dumbContext);
 
-    jsdc->glob = JS_NewCompartmentAndGlobalObject(jsdc->dumbContext, &global_class, NULL);
+    if( scopeobj )
+        call = JS_EnterCrossCompartmentCall(jsdc->dumbContext, scopeobj);
+    jsdc->glob = JS_NewGlobalObject(jsdc->dumbContext, &global_class);
+    if( call )
+        JS_LeaveCrossCompartmentCall(call);
+
     if( ! jsdc->glob )
         goto label_newJSDContext_failure;
 
-    call = JS_EnterCrossCompartmentCall(jsdc->dumbContext, scopeobj);
-    if( ! call )
-        goto label_newJSDContext_failure;
-
     if( ! JS_InitStandardClasses(jsdc->dumbContext, jsdc->glob) )
         goto label_newJSDContext_failure;
 
-    if( call )
-        JS_LeaveCrossCompartmentCall(call);
-
     JS_EndRequest(jsdc->dumbContext);
 
     jsdc->data = NULL;
     jsdc->inited = JS_TRUE;
 
     JSD_LOCK();
     JS_INSERT_LINK(&jsdc->links, &_jsd_context_list);
     JSD_UNLOCK();