зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1476921) for build bustage. CLOSED TREE
Backed out changeset 25af0b19ec39 (bug 1476921) Backed out changeset 873cd2e119b3 (bug 1476921)
This commit is contained in:
Родитель
4cf62bfab3
Коммит
c70ff33958
|
@ -188,14 +188,19 @@ function GetModuleNamespace(module)
|
|||
// Step 1
|
||||
assert(IsObject(module) && IsModule(module), "GetModuleNamespace called with non-module");
|
||||
|
||||
// Step 2
|
||||
// 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
|
||||
assert(module.status !== MODULE_STATUS_UNINSTANTIATED,
|
||||
"Bad module state in GetModuleNamespace");
|
||||
|
||||
// Step 3
|
||||
// Step 4
|
||||
let namespace = module.namespace;
|
||||
|
||||
// Step 4
|
||||
// Step 3
|
||||
if (typeof namespace === "undefined") {
|
||||
let exportedNames = callFunction(module.getExportedNames, module);
|
||||
let unambiguousNames = [];
|
||||
|
@ -208,7 +213,7 @@ function GetModuleNamespace(module)
|
|||
namespace = ModuleNamespaceCreate(module, unambiguousNames);
|
||||
}
|
||||
|
||||
// Step 5
|
||||
// Step 4
|
||||
return namespace;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
load(libdir + "asserts.js");
|
||||
load(libdir + "dummyModuleResolveHook.js");
|
||||
|
||||
class UniqueError extends Error {}
|
||||
|
||||
let a = moduleRepo['a'] = parseModule(`
|
||||
throw new UniqueError();
|
||||
`);
|
||||
|
||||
let b = moduleRepo['b'] = parseModule(`
|
||||
import * as ns0 from "a";
|
||||
`);
|
||||
|
||||
instantiateModule(a);
|
||||
assertThrowsInstanceOf(() => evaluateModule(a), UniqueError);
|
||||
instantiateModule(b);
|
||||
assertThrowsInstanceOf(() => evaluateModule(b), UniqueError);
|
Загрузка…
Ссылка в новой задаче