aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4dataview.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-05-29 12:14:53 +0200
committerLars Knoll <lars.knoll@qt.io>2018-06-04 13:02:09 +0000
commit8e23235181eb25faf99324e136412da23dc8386f (patch)
tree97071ffe480c175200e8cb765a80015aa11cf890 /src/qml/jsruntime/qv4dataview.cpp
parenta0fcf724ef1d8586301a913d2cd744aed33e3605 (diff)
Use Symbol.toStringTag in Object.prototype.toString
This should make toString comply fully with the JS Spec. Also add a couple of missing Symbol.toStringTag properties. Change-Id: I29e2018b486a0e1d174b58ce7a14f0e42cc78767 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dataview.cpp')
-rw-r--r--src/qml/jsruntime/qv4dataview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4dataview.cpp b/src/qml/jsruntime/qv4dataview.cpp
index 5a6599aca0..354eaad7dc 100644
--- a/src/qml/jsruntime/qv4dataview.cpp
+++ b/src/qml/jsruntime/qv4dataview.cpp
@@ -40,6 +40,7 @@
#include "qv4dataview_p.h"
#include "qv4arraybuffer_p.h"
#include "qv4string_p.h"
+#include "qv4symbol_p.h"
#include <QtCore/private/qnumeric_p.h>
#include "qendian.h"
@@ -110,6 +111,9 @@ void DataViewPrototype::init(ExecutionEngine *engine, Object *ctor)
defineDefaultProperty(QStringLiteral("setFloat32"), method_setFloat<float>, 2);
defineDefaultProperty(QStringLiteral("setFloat64"), method_setFloat<double>, 2);
+ ScopedString name(scope, engine->newString(QStringLiteral("DataView")));
+ defineReadonlyConfigurableProperty(scope.engine->symbol_toStringTag(), name);
+
// For backword compatibility
defineDefaultProperty(QStringLiteral("getUInt8"), method_getChar<unsigned char>, 1);
defineDefaultProperty(QStringLiteral("getUInt16"), method_get<unsigned short>, 1);