diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-15 14:03:09 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-23 13:19:05 +0000 |
commit | df616013cabfe255398868ab742d54e8558bff12 (patch) | |
tree | bd9e1d8d29998760c5621c3e62d6b43cd9ee48bf /src/qml/compiler/qv4compilercontext.cpp | |
parent | 6f1e2722b9eef73a4fe19951b47c4b172642a2ba (diff) |
Cleanup handling of direct evals
There's no need to force lookups by name in an outer function
just because an inner function uses eval(). The lookup by name
is only required on the call context level, where eval() could
add new variables.
Change-Id: I8cad6d27524f496304342dfe1449ea913ef99fca
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, 3 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compilercontext.cpp b/src/qml/compiler/qv4compilercontext.cpp index c4f7e51f6c..7acc8256f0 100644 --- a/src/qml/compiler/qv4compilercontext.cpp +++ b/src/qml/compiler/qv4compilercontext.cpp @@ -143,8 +143,10 @@ Context::ResolvedName Context::resolveName(const QString &name) return result; } } - if (!c->isStrict && c->hasDirectEval && c->contextType != ContextType::Block) + if (c->hasDirectEval) { + Q_ASSERT(!c->isStrict && c->contextType != ContextType::Block); return result; + } if (c->requiresExecutionContext) ++scope; |