aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arraybuffer.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/qv4arraybuffer.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/qv4arraybuffer.cpp')
-rw-r--r--src/qml/jsruntime/qv4arraybuffer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4arraybuffer.cpp b/src/qml/jsruntime/qv4arraybuffer.cpp
index dd28a90cb7..b0c2ba597a 100644
--- a/src/qml/jsruntime/qv4arraybuffer.cpp
+++ b/src/qml/jsruntime/qv4arraybuffer.cpp
@@ -41,6 +41,7 @@
#include "qv4dataview_p.h"
#include "qv4string_p.h"
#include "qv4jscall_p.h"
+#include "qv4symbol_p.h"
using namespace QV4;
@@ -157,6 +158,8 @@ void ArrayBufferPrototype::init(ExecutionEngine *engine, Object *ctor)
defineAccessorProperty(QStringLiteral("byteLength"), method_get_byteLength, nullptr);
defineDefaultProperty(QStringLiteral("slice"), method_slice, 2);
defineDefaultProperty(QStringLiteral("toString"), method_toString, 0);
+ ScopedString name(scope, engine->newString(QStringLiteral("ArrayBuffer")));
+ defineReadonlyConfigurableProperty(scope.engine->symbol_toStringTag(), name);
}
ReturnedValue ArrayBufferPrototype::method_get_byteLength(const FunctionObject *b, const Value *thisObject, const Value *, int)