Bug 1117235 - Handle asm.js warnings + off-main-thread parsing + warnings-as-errors (r=bhackett)
authorLuke Wagner <luke@mozilla.com>
Mon, 05 Jan 2015 18:02:48 -0600
changeset 235219 9d2bba85e8063e645639ed401228f8e8f9083c68
parent 235218 6d50e5de8a2bfd7c1f864bc3fdb1a72e7d056b67
child 235220 6a3870adc1deeaf1d6960eca551e6d629524e1bb
push id355
push usermleibovic@mozilla.com
push dateWed, 07 Jan 2015 02:29:19 +0000
reviewersbhackett
bugs1117235
milestone37.0a1
Bug 1117235 - Handle asm.js warnings + off-main-thread parsing + warnings-as-errors (r=bhackett)
js/src/jit-test/tests/asm.js/testBug1117235.js
js/src/vm/HelperThreads.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/asm.js/testBug1117235.js
@@ -0,0 +1,8 @@
+load(libdir + "asserts.js");
+
+if (helperThreadCount() === 0)
+  quit(0);
+
+options('werror');
+offThreadCompileScript("function f() {'use asm'}");
+assertThrowsInstanceOf(()=>runOffThreadScript(), TypeError);
--- a/js/src/vm/HelperThreads.cpp
+++ b/js/src/vm/HelperThreads.cpp
@@ -921,16 +921,18 @@ GlobalHelperThreadState::finishParseTask
     assertSameCompartment(cx, script);
 
     // Report any error or warnings generated during the parse, and inform the
     // debugger about the compiled scripts.
     for (size_t i = 0; i < parseTask->errors.length(); i++)
         parseTask->errors[i]->throwError(cx);
     if (parseTask->overRecursed)
         js_ReportOverRecursed(cx);
+    if (cx->isExceptionPending())
+        return nullptr;
 
     if (script) {
         // The Debugger only needs to be told about the topmost script that was compiled.
         GlobalObject *compileAndGoGlobal = nullptr;
         if (script->compileAndGo())
             compileAndGoGlobal = &script->global();
         Debugger::onNewScript(cx, script, compileAndGoGlobal);