Bug 899447 - Don't set compileAndGo for scripts evaluated against a non-global object. r=luke, a=akeybl
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 02 Aug 2013 07:43:46 -0600
changeset 148250 9191dd96f6b08eb6eaa2e8599c32ef8e397cdb37
parent 148249 fc00207923382e9f99688141093d0f0145a572da
child 148251 db88cdb5dfb5b48b23f6d0e2b4cf7a3dd0d5f147
push id2713
push userryanvm@gmail.com
push dateWed, 07 Aug 2013 22:23:56 +0000
treeherdermozilla-beta@cbd0536ac30e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, akeybl
bugs899447
milestone24.0
Bug 899447 - Don't set compileAndGo for scripts evaluated against a non-global object. r=luke, a=akeybl
js/src/jsapi.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -5484,17 +5484,17 @@ JS::Evaluate(JSContext *cx, HandleObject
     JS_THREADSAFE_ASSERT(cx->compartment() != cx->runtime()->atomsCompartment);
     AssertHeapIsIdle(cx);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     JS_ASSERT_IF(options.principals, cx->compartment()->principals == options.principals);
 
     AutoLastFrameCheck lfc(cx);
 
-    options.setCompileAndGo(true);
+    options.setCompileAndGo(obj->is<GlobalObject>());
     options.setNoScriptRval(!rval);
     SourceCompressionToken sct(cx);
     RootedScript script(cx, frontend::CompileScript(cx, obj, NullPtr(), options,
                                                     chars, length, NULL, 0, &sct));
     if (!script)
         return false;
 
     JS_ASSERT(script->getVersion() == options.version);