Fix determination of lookup mode in V4 code generator
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 11 Oct 2013 11:50:23 +0000 (13:50 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 11 Oct 2013 17:38:47 +0000 (19:38 +0200)
commit6adb0693a2e408c388a0939e0a3d711da7b651df
tree3f7a2c2d1cf53d8079f5ac8c2e4c6e4e11d69edf
parenta4449295c3051e42b1aa80a1c7cc91671ad05765
Fix determination of lookup mode in V4 code generator

In order to determine the type of lookup we need (name or directly in
environment members), we used Codegen::_mode, which is set to the currently
suitable mode depending on the function (parameter to defineFunction). However
that's not quite correct, the look-up mode depends on the function itself, not
where it was called from. This patch corrects that by moving the compilation
mode into the Environment itself.

This is needed by follow-up patches.

Additionally the "bool deletable" parameter to the builtin_declare_vars was
always set to false, because it used mode instead of _mode, which was never set
to Eval or QmlBinding. This will be cleaned up in a future patch.

Change-Id: I878f187945e5de091689ab5d70a0f33eb5a9e38f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/compiler/qqmlcodegenerator.cpp
src/qml/compiler/qqmlcodegenerator_p.h
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4codegen_p.h