Bug 1508672 - Dynamically imported modules can throw any value as an exception r=jorendorff
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 26 Nov 2018 16:11:45 +0000
changeset 504452 9363b52649ac9b814d4b0b9105cca8416c436223
parent 504451 46ce47bd336841a2d71eb53e3bf76f360784e040
child 504453 b9f771437a1212f4de43cc8419803390358b0ca3
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1508672
milestone65.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 1508672 - Dynamically imported modules can throw any value as an exception r=jorendorff
js/src/shell/js.cpp
js/src/tests/jstests.list
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -5007,26 +5007,20 @@ AbortDynamicModuleImport(JSContext* cx, 
     if (!args[1].isString()) {
         return ReportArgumentTypeError(cx, args[1], "String");
     }
 
     if (!args[2].isObject() || !args[2].toObject().is<PromiseObject>()) {
         return ReportArgumentTypeError(cx, args[2], "PromiseObject");
     }
 
-    if (!args[3].isObject() || !args[3].toObject().is<ErrorObject>()) {
-        return ReportArgumentTypeError(cx, args[3], "ErrorObject");
-    }
-
     RootedString specifier(cx, args[1].toString());
     Rooted<PromiseObject*> promise(cx, &args[2].toObject().as<PromiseObject>());
-    Rooted<ErrorObject*> error(cx, &args[3].toObject().as<ErrorObject>());
-
-    Rooted<Value> value(cx, ObjectValue(*error));
-    cx->setPendingException(value);
+
+    cx->setPendingException(args[3]);
     return js::FinishDynamicModuleImport(cx, args[0], specifier, promise);
 }
 
 static bool
 ShellModuleDynamicImportHook(JSContext* cx, HandleValue referencingPrivate, HandleString specifier,
                              HandleObject promise)
 {
     Handle<GlobalObject*> global = cx->global();
--- a/js/src/tests/jstests.list
+++ b/js/src/tests/jstests.list
@@ -487,23 +487,16 @@ skip script test262/built-ins/RegExp/pro
 skip script test262/built-ins/RegExp/prototype/sticky/cross-realm.js
 skip script test262/built-ins/RegExp/prototype/ignoreCase/cross-realm.js
 skip script test262/built-ins/RegExp/prototype/unicode/cross-realm.js
 skip script test262/built-ins/RegExp/prototype/source/cross-realm.js
 
 # https://bugzilla.mozilla.org/show_bug.cgi?id=1508684
 skip script test262/language/expressions/import.meta/syntax/invalid-assignment-target-update-expr.js
 
-# https://bugzilla.mozilla.org/show_bug.cgi?id=1508672
-skip script test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen-yield.js
-skip script test262/language/expressions/dynamic-import/for-await-resolution-and-error.js
-skip script test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen.js
-skip script test262/language/expressions/dynamic-import/double-error-resolution-promise.js
-skip script test262/language/expressions/dynamic-import/double-error-resolution.js
-
 ###########################################################
 # Tests disabled due to issues in test262 importer script #
 ###########################################################
 
 # test262 importer merges all includes in a per directory shell.js file, breaking this harness test case.
 skip script test262/harness/detachArrayBuffer.js