diff options
| -rw-r--r-- | src/qml/compiler/qv4compilercontext.cpp | 17 | ||||
| -rw-r--r-- | tests/auto/qml/ecmascripttests/TestExpectations | 3 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/qml/compiler/qv4compilercontext.cpp b/src/qml/compiler/qv4compilercontext.cpp index ba9b270601..4ee6d2c179 100644 --- a/src/qml/compiler/qv4compilercontext.cpp +++ b/src/qml/compiler/qv4compilercontext.cpp @@ -321,14 +321,6 @@ void Context::setupFunctionIndices(Moth::BytecodeGenerator *bytecodeGenerator) Q_ASSERT(nRegisters == 0); registerOffset = bytecodeGenerator->currentRegister(); - if (contextType == ContextType::ESModule && !localNameForDefaultExport.isEmpty()) { - if (!members.contains(localNameForDefaultExport)) { - // allocate a local slot for the default export, to be used in - // CodeGen::visit(ExportDeclaration*). - locals.append(localNameForDefaultExport); - } - } - QVector<Context::MemberMap::Iterator> localsInTDZ; const auto registerLocal = [this, &localsInTDZ](Context::MemberMap::iterator member) { if (member->isLexicallyScoped()) { @@ -383,6 +375,15 @@ void Context::setupFunctionIndices(Moth::BytecodeGenerator *bytecodeGenerator) locals.append(member.key()); } + if (contextType == ContextType::ESModule && !localNameForDefaultExport.isEmpty()) { + if (!members.contains(localNameForDefaultExport)) { + // allocate a local slot for the default export, to be used in + // CodeGen::visit(ExportDeclaration*). + locals.append(localNameForDefaultExport); + ++sizeOfLocalTemporalDeadZone; + } + } + sizeOfRegisterTemporalDeadZone = registersInTDZ.count(); firstTemporalDeadZoneRegister = bytecodeGenerator->currentRegister(); for (auto &member: qAsConst(registersInTDZ)) diff --git a/tests/auto/qml/ecmascripttests/TestExpectations b/tests/auto/qml/ecmascripttests/TestExpectations index 5f422766b7..fd372abaf1 100644 --- a/tests/auto/qml/ecmascripttests/TestExpectations +++ b/tests/auto/qml/ecmascripttests/TestExpectations @@ -1051,9 +1051,6 @@ language/global-code/script-decl-var.js fails language/identifiers/other_id_continue.js fails language/identifiers/other_id_start-escaped.js fails language/identifiers/other_id_start.js fails -language/module-code/instn-named-bndng-dflt-expr.js strictFails -language/module-code/instn-named-bndng-dflt-named.js strictFails -language/module-code/instn-named-bndng-dflt-star.js strictFails language/module-code/namespace/internals/delete-exported-uninit.js strictFails language/module-code/namespace/internals/enumerate-binding-uninit.js strictFails language/module-code/namespace/internals/get-own-property-str-found-uninit.js strictFails |
