diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 435b1b4cf..0d232a324 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -1385,7 +1385,7 @@ BytecodeEmitter::atBodyLevel(StmtInfoBCE* stmt) const .enclosingStaticScope() == sc->staticScope()); return bl; } - return !stmt || sc->isModuleBox(); + return !stmt; } uint32_t diff --git a/js/src/jit-test/tests/modules/bug-1236875.js b/js/src/jit-test/tests/modules/bug-1236875.js new file mode 100644 index 000000000..41751f947 --- /dev/null +++ b/js/src/jit-test/tests/modules/bug-1236875.js @@ -0,0 +1,2 @@ +let m = parseModule(`{ function x() {} }`); +m.declarationInstantiation();