diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-08 14:34:58 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 07:17:12 +0000 |
commit | 01a1ad296c2b8325476abd6d28c8cc2463c42eb6 (patch) | |
tree | 4acaaf72782e634615e74c2da52227206cd16a42 /src/qml/compiler/qv4compilercontext.cpp | |
parent | 4cf7e80c5740912804383e4d866ba12b2520d0e6 (diff) |
Support destructuring inside catch()
Change-Id: Ib60b56ac6a7111446e01235564a4cf92ad8ad025
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilercontext.cpp')
-rw-r--r-- | src/qml/compiler/qv4compilercontext.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compilercontext.cpp b/src/qml/compiler/qv4compilercontext.cpp index 67afea28ab..07e19811a8 100644 --- a/src/qml/compiler/qv4compilercontext.cpp +++ b/src/qml/compiler/qv4compilercontext.cpp @@ -81,7 +81,7 @@ bool Context::addLocalVar(const QString &name, Context::MemberType type, Variabl if (formals && formals->containsName(name)) return (scope == VariableScope::Var); } - if (!isCatchBlock || name != catchedVariable) { + if (!isCatchBlock || name != caughtVariable) { MemberMap::iterator it = members.find(name); if (it != members.end()) { if (scope != VariableScope::Var || (*it).scope != VariableScope::Var) @@ -178,7 +178,7 @@ int Context::emitBlockHeader(Codegen *codegen) Instruction::PushCatchContext catchContext; catchContext.index = blockIndex; catchContext.reg = contextReg = bytecodeGenerator->newRegister(); - catchContext.name = codegen->registerString(catchedVariable); + catchContext.name = codegen->registerString(caughtVariable); bytecodeGenerator->addInstruction(catchContext); } else { Instruction::PushBlockContext blockContext; |