diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 2 | ||||
| -rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions.cpp | 12 | ||||
| -rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions_p.h | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 687731c32b..9c63360107 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2827,6 +2827,8 @@ bool Codegen::visit(SwitchStatement *ast) RegisterScope scope(this); if (ast->block) { + ControlFlowBlock controlFlow(this, ast->block); + BytecodeGenerator::Label switchEnd = bytecodeGenerator->newLabel(); Reference lhs = expression(ast->expression); diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp index c2256537c4..372e240700 100644 --- a/src/qml/compiler/qv4compilerscanfunctions.cpp +++ b/src/qml/compiler/qv4compilerscanfunctions.cpp @@ -375,6 +375,18 @@ void ScanFunctions::endVisit(Block *) leaveEnvironment(); } +bool ScanFunctions::visit(CaseBlock *ast) +{ + enterEnvironment(ast, ContextType::Block); + _context->name = QLatin1String("CaseBlock"); + return true; +} + +void ScanFunctions::endVisit(CaseBlock *) +{ + leaveEnvironment(); +} + bool ScanFunctions::visit(Catch *ast) { TemporaryBoolAssignment allowFuncDecls(_allowFuncDecls, _context->isStrict ? false : _allowFuncDecls); diff --git a/src/qml/compiler/qv4compilerscanfunctions_p.h b/src/qml/compiler/qv4compilerscanfunctions_p.h index b9b41781c4..cb3866c596 100644 --- a/src/qml/compiler/qv4compilerscanfunctions_p.h +++ b/src/qml/compiler/qv4compilerscanfunctions_p.h @@ -134,6 +134,9 @@ protected: bool visit(AST::Block *ast) override; void endVisit(AST::Block *ast) override; + bool visit(AST::CaseBlock *ast) override; + void endVisit(AST::CaseBlock *ast) override; + bool visit(AST::Catch *ast) override; void endVisit(AST::Catch *ast) override; |
