Bug 1476921 - Don't throw an error in GetModuleNamespace for errored modules. r=jonco
☠☠ backed out by 211b070bac73 ☠ ☠
authorAshley Hauck <khyperia@mozilla.com>
Mon, 27 Aug 2018 10:01:00 +0300
changeset 488771 873cd2e119b3296e3407969f1f7459726f5d2a17
parent 488770 709590a1a24fc8d55f891204dd1e105eaf787177
child 488772 25af0b19ec39666d33efe54a7feca0e7cb35fb6c
push id9734
push usershindli@mozilla.com
push dateThu, 30 Aug 2018 12:18:07 +0000
treeherdermozilla-beta@71c71ab3afae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1476921
milestone63.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 1476921 - Don't throw an error in GetModuleNamespace for errored modules. r=jonco
js/src/builtin/Module.js
--- a/js/src/builtin/Module.js
+++ b/js/src/builtin/Module.js
@@ -183,42 +183,37 @@ function IsResolvedBinding(resolution)
 }
 
 // 15.2.1.18 GetModuleNamespace(module)
 function GetModuleNamespace(module)
 {
     // Step 1
     assert(IsObject(module) && IsModule(module), "GetModuleNamespace called with non-module");
 
-    // Until issue https://github.com/tc39/ecma262/issues/1155 is resolved,
-    // violate the spec here and throw if called on an errored module.
-    if (module.status === MODULE_STATUS_EVALUATED_ERROR)
-        throw GetModuleEvaluationError(module);
-
-    // Steps 2-3
+    // Step 2
     assert(module.status !== MODULE_STATUS_UNINSTANTIATED,
            "Bad module state in GetModuleNamespace");
 
-    // Step 4
+    // Step 3
     let namespace = module.namespace;
 
-    // Step 3
+    // Step 4
     if (typeof namespace === "undefined") {
         let exportedNames = callFunction(module.getExportedNames, module);
         let unambiguousNames = [];
         for (let i = 0; i < exportedNames.length; i++) {
             let name = exportedNames[i];
             let resolution = callFunction(module.resolveExport, module, name);
             if (IsResolvedBinding(resolution))
                 _DefineDataProperty(unambiguousNames, unambiguousNames.length, name);
         }
         namespace = ModuleNamespaceCreate(module, unambiguousNames);
     }
 
-    // Step 4
+    // Step 5
     return namespace;
 }
 
 // 9.4.6.13 ModuleNamespaceCreate(module, exports)
 function ModuleNamespaceCreate(module, exports)
 {
     callFunction(ArraySort, exports);