Fix tst_qqmlecmascript::functionAssignment_fromBinding
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 18 Jun 2013 11:47:33 +0000 (13:47 +0200)
committerLars Knoll <lars.knoll@digia.com>
Tue, 18 Jun 2013 14:44:54 +0000 (16:44 +0200)
Function declarations in QML mode should be similar to function expressions and
therefore need to go to the return value of the function..

Change-Id: Ib1dd8a970a967f2456d0558be74edf5d74d288e5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4/qv4codegen.cpp

index 310272c..f4482db 100644 (file)
@@ -1805,8 +1805,10 @@ bool Codegen::visit(VoidExpression *ast)
     return false;
 }
 
-bool Codegen::visit(FunctionDeclaration * /*ast*/)
+bool Codegen::visit(FunctionDeclaration * ast)
 {
+    if (_mode == QmlBinding)
+        move(_block->TEMP(_returnAddress), _block->NAME(ast->name.toString(), 0, 0));
     _expr.accept(nx);
     return false;
 }