mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 1463373 - Throw rather than assert if buggy module resolve hook returns a module we didn't expect r=anba
This commit is contained in:
parent
3659b3ea86
commit
b95fd0ded3
@ -350,8 +350,8 @@ function InnerModuleInstantiation(module, stack, index)
|
||||
}
|
||||
|
||||
// Step 3
|
||||
assert(module.status === MODULE_STATUS_UNINSTANTIATED,
|
||||
"Bad module status in ModuleDeclarationInstantiation");
|
||||
if (module.status !== MODULE_STATUS_UNINSTANTIATED)
|
||||
ThrowInternalError(JSMSG_BAD_MODULE_STATUS);
|
||||
|
||||
// Steps 4
|
||||
ModuleSetStatus(module, MODULE_STATUS_INSTANTIATING);
|
||||
|
11
js/src/jit-test/tests/modules/bug-1463373.js
Normal file
11
js/src/jit-test/tests/modules/bug-1463373.js
Normal file
@ -0,0 +1,11 @@
|
||||
// |jit-test| error: InternalError
|
||||
|
||||
let m = parseModule(`
|
||||
let c = parseModule(\`
|
||||
import "a";
|
||||
\`);
|
||||
c.declarationInstantiation();
|
||||
`);
|
||||
setModuleResolveHook(function(module, specifier) { return m; });
|
||||
m.declarationInstantiation();
|
||||
m.evaluation();
|
Loading…
Reference in New Issue
Block a user