Bug 1117235 - Handle asm.js warnings + off-main-thread parsing + warnings-as-errors (r=bhackett)
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);