diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-10 23:29:23 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 07:17:33 +0000 |
commit | fb04917e8eb1f7cc5832b2f13ab1d208b0e1014f (patch) | |
tree | 9018734b467c7b049180b104e84fa586f9d1912f /src/qml/compiler/qv4compilerscanfunctions.cpp | |
parent | fd183d3db9d1eba4f7dd3e978192a247bf7dba85 (diff) | |
download | qtdeclarative-fb04917e8eb1f7cc5832b2f13ab1d208b0e1014f.tar.gz |
Give case blocks a proper scope
Change-Id: Id307c0426e1c9326ac085cebda71934cb5e612e0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp')
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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); |