Bug 1233179 - Allow bytecode emitter to access module environment before module declarations are instantiated r=shu

This commit is contained in:
Jon Coppeard 2016-01-07 12:04:50 +00:00
parent 0d3f2c7933
commit ed6335fe8c
2 changed files with 7 additions and 1 deletions

View File

@ -1592,7 +1592,7 @@ BytecodeEmitter::tryConvertFreeName(ParseNode* pn)
}
// Convert module import accesses to use JSOP_GETIMPORT.
RootedModuleEnvironmentObject env(cx, ssi.module().environment());
RootedModuleEnvironmentObject env(cx, &ssi.module().initialEnvironment());
RootedPropertyName propName(cx, name);
MOZ_ASSERT(env);
if (env->hasImportBinding(propName)) {

View File

@ -0,0 +1,6 @@
let c = parseModule(`
function a(x) { return x; }
function b(x) { return i<40; }
function d(x) { return x + 3; }
`);
getLcovInfo();