aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-21 09:29:58 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-09-21 09:31:01 +0200
commit41f75250d5b391dd99a84712fa68f606ef5c06b9 (patch)
tree4911506e0d88ba2741861b0baf107270018ef17d /src/qml/compiler/qv4codegen.cpp
parent200a869441562d62e7fc0867599097e0599f0411 (diff)
parent642b2ce0e155df452821a84726a2b0226cb65f70 (diff)
Merge branch 'wip/v4' of qtdeclarative into dev
Pull in the remaining bits of the new compiler/vme branch. Change-Id: I4706011c5eaf35f893d0733c4e130a31ce0ebb66
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index a4da5ce116..bf2cb8e5c5 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -805,7 +805,7 @@ void Codegen::variableDeclaration(VariableDeclaration *ast)
assert(expr.code);
initializer = *expr;
- if (! _env->parent || _function->insideWithOrCatch) {
+ if (! _env->parent || _function->insideWithOrCatch || _mode == QmlBinding) {
// it's global code.
move(_block->NAME(ast->name.toString(), ast->identifierToken.startLine, ast->identifierToken.startColumn), initializer);
} else {
@@ -1356,6 +1356,9 @@ V4IR::Expr *Codegen::identifier(const QString &name, int line, int col)
Environment *e = _env;
V4IR::Function *f = _function;
+ if (_mode == QmlBinding)
+ return _block->NAME(name, line, col);
+
while (f && e->parent) {
if (f->insideWithOrCatch || (f->isNamedExpression && f->name == name))
return _block->NAME(name, line, col);