summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4compilerscanfunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp')
-rw-r--r--src/qml/compiler/qv4compilerscanfunctions.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp
index 2a217fbb99..b59beb0315 100644
--- a/src/qml/compiler/qv4compilerscanfunctions.cpp
+++ b/src/qml/compiler/qv4compilerscanfunctions.cpp
@@ -305,6 +305,13 @@ void ScanFunctions::endVisit(FunctionDeclaration *)
leaveEnvironment();
}
+bool ScanFunctions::visit(TryStatement *)
+{
+ // ### should limit to catch(), as try{} finally{} should be ok without
+ _context->hasTry = true;
+ return true;
+}
+
bool ScanFunctions::visit(WithStatement *ast)
{
if (_context->isStrict) {
@@ -312,6 +319,7 @@ bool ScanFunctions::visit(WithStatement *ast)
return false;
}
+ _context->hasWith = true;
return true;
}
@@ -436,6 +444,11 @@ void ScanFunctions::calcEscapingVariables()
c = c->parent;
}
}
+ Context *c = inner->parent;
+ while (c) {
+ c->hasDirectEval |= inner->hasDirectEval;
+ c = c->parent;
+ }
}
static const bool showEscapingVars = qEnvironmentVariableIsSet("QV4_SHOW_ESCAPING_VARS");