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 248020 9d2bba85e8063e645639ed401228f8e8f9083c68
parent 248019 6d50e5de8a2bfd7c1f864bc3fdb1a72e7d056b67
child 248021 6a3870adc1deeaf1d6960eca551e6d629524e1bb
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1117235
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);