summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativerewrite.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-07-27 13:35:38 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-07-28 07:34:57 (GMT)
commit354bd0287c4178cbf512f10b5624a84c99e1d606 (patch)
treeb470de79a5b51dc7c1a20d64cccf86d49721a7a7 /src/declarative/qml/qdeclarativerewrite.cpp
parent104e9d2b3f8ac981a277cb0d63a1e5be8e352275 (diff)
downloadQt-354bd0287c4178cbf512f10b5624a84c99e1d606.zip
Qt-354bd0287c4178cbf512f10b5624a84c99e1d606.tar.gz
Qt-354bd0287c4178cbf512f10b5624a84c99e1d606.tar.bz2
QtDeclarative: Give name to function bindings and signals.
Currently, bindings and signals are annonymous javascript functions. If one give them a name, a proper name is then shown in the javascript debugger. Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/declarative/qml/qdeclarativerewrite.cpp')
-rw-r--r--src/declarative/qml/qdeclarativerewrite.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativerewrite.cpp b/src/declarative/qml/qdeclarativerewrite.cpp
index 3d40e77..bc9a114 100644
--- a/src/declarative/qml/qdeclarativerewrite.cpp
+++ b/src/declarative/qml/qdeclarativerewrite.cpp
@@ -102,7 +102,7 @@ QString RewriteBinding::rewrite(QString code, unsigned position,
unsigned startOfStatement = node->firstSourceLocation().begin() - _position;
unsigned endOfStatement = node->lastSourceLocation().end() - _position;
- _writer->replace(startOfStatement, 0, QLatin1String("(function() { "));
+ _writer->replace(startOfStatement, 0, QLatin1String("(function ") + QString::fromUtf8(_name) + QLatin1String("() { "));
_writer->replace(endOfStatement, 0, QLatin1String(" })"));
if (rewriteDump()) {