From 2c23299ecd94dbcce0a90b3b374a674cad6a3683 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 6 Apr 2018 11:33:20 +0200 Subject: Cleanup handling of with() statements Add a CompilerContext for with, whose only purpose it is to trigger variable lookup by name. This avoids looking up variables declared inside the with() {} block by name and we do not lookup variables outside the with block by name neither anymore. Change-Id: I52e9fb2daa9601f9e5102714c002dc506ad5ed23 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compilercontext_p.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/qml/compiler/qv4compilercontext_p.h') diff --git a/src/qml/compiler/qv4compilercontext_p.h b/src/qml/compiler/qv4compilercontext_p.h index 8c7da397a9..20bee6583a 100644 --- a/src/qml/compiler/qv4compilercontext_p.h +++ b/src/qml/compiler/qv4compilercontext_p.h @@ -150,11 +150,10 @@ struct Context { bool isGenerator = false; bool usesThis = false; bool hasTry = false; - bool hasWith = false; bool returnsClosure = false; mutable bool argumentsCanEscape = false; bool requiresExecutionContext = false; - bool forceLookupByName = false; + bool isWithBlock = false; bool isCatchBlock = false; QString catchedVariable; -- cgit v1.2.3