From 01a1ad296c2b8325476abd6d28c8cc2463c42eb6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 8 May 2018 14:34:58 +0200 Subject: Support destructuring inside catch() Change-Id: Ib60b56ac6a7111446e01235564a4cf92ad8ad025 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compilercontext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/compiler/qv4compilercontext.cpp') 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; -- cgit v1.2.3