From fb04917e8eb1f7cc5832b2f13ab1d208b0e1014f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 10 May 2018 23:29:23 +0200 Subject: Give case blocks a proper scope Change-Id: Id307c0426e1c9326ac085cebda71934cb5e612e0 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compilerscanfunctions.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp') 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); -- cgit v1.2.1