diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-10-08 11:44:57 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-11 22:54:52 +0200 |
commit | c39393e7de5b808adbc9c5771ecca161c9660d7c (patch) | |
tree | c52afa21711b88deee42f85b7fc79c152089c399 /tests/auto/qml/debugger/qqmlenginedebugservice | |
parent | 74a02a83809f6942732ec18125403e8ee32c574f (diff) |
Compile binding expressions in the QQmlCompiler
This is done by re-using the JS code generator from the new compiler. A few bugs were
fixed on the way:
* The index into the compiledData->runtimeFunctions array is not the same as the function
index when they are collected (from the AST), as for example binding expressions may create
extra V4IR::Function objects that break the 1:1 mapping. Therefore the JS code gen will return
a mapping from incoming function index to V4IR::Module::Function (and thus runtimeFunction)
* Binding expressions in the old backend get usually unpacked from their ExpressionStatement node.
The reference to that node is lost, and instead of trying to preserve it, we simply synthesize it
again. This won't be necessary anymore with the new compiler in the future.
* Commit 1c29d63d6045cf9d58cbc0f850de8fa50bf75d09 ensured to always look up locals by name, and so
we have to do the same when initializing the closures of nested functions inside binding expressions
(in qv4codegen.cpp)
* Had to change the Qml debugger service auto-test, which does toString() on a function that is now compiled.
Even if we implemented FunctionPrototype::toString() to do what v8 does by extracting the string from the
file, it wouldn't help in this test, because it feeds the input from a string instead of a file.
* In tst_parserstress we now end up compiling all JS code, which previously was only parsed. This triggers
some bugs in the SSA handling. Those tests are skipped and tracked in QTBUG-34047
Change-Id: I44df51085510da0fd3d99eb5f1c7d4d17bcffdcf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/debugger/qqmlenginedebugservice')
-rw-r--r-- | tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp index 11afc9ea22..8024df99b6 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp @@ -969,7 +969,8 @@ void tst_QQmlEngineDebugService::setBindingForObject() QmlDebugPropertyReference onEnteredRef = findProperty(mouseAreaObject.properties, "onEntered"); QCOMPARE(onEnteredRef.name, QString("onEntered")); - QCOMPARE(onEnteredRef.value, QVariant("{ console.log('hello') }")); + // Sorry, can't do that anymore: QCOMPARE(onEnteredRef.value, QVariant("{ console.log('hello') }")); + QCOMPARE(onEnteredRef.value, QVariant("function() { [code] }")); m_dbg->setBindingForObject(mouseAreaObject.debugId, "onEntered", "{console.log('hello, world') }", false, |