Fix crash in String.arg()
authorChris Adams <christopher.adams@nokia.com>
Mon, 19 Sep 2011 01:00:14 +0000 (11:00 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 28 Sep 2011 03:25:55 +0000 (05:25 +0200)
commit8dd9eddb55663b83ca07bcedecf5ad2c93a14e52
tree7d65d7887536ea2455a67cd4ba157106360fe07a
parentb081df4a405632da3923f66ec32240c12f4acce9
Fix crash in String.arg()

This commit ensures that the String.arg() function works correctly,
by registering an anonymous function with the String Prototype object
which calls the StringArg function, ensuring that the "this" object
is valid (and passing the string as an argument to StringArg instead).

Change-Id: I0a8cbaa12b39beb03a237c3ab62c6e21fafdedbf
Reviewed-on: http://codereview.qt-project.org/4385
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp
src/declarative/qml/v8/qv8engine.cpp
tests/auto/declarative/qdeclarativeecmascript/data/stringArg.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp