diff options
author | Lars Knoll <[email protected]> | 2018-04-08 14:28:40 +0200 |
---|---|---|
committer | Lars Knoll <[email protected]> | 2018-05-02 14:18:41 +0000 |
commit | 360a48aa3f5346aa7aaff741e4ef8f5dc8701f51 (patch) | |
tree | 4ba4fc520a1387c24a667ebd51203cc6cd1e5996 /src/qml/jsruntime/qv4string.cpp | |
parent | bab5e5adf578fb37402ff03f4bd5e9ed3ce4c2d2 (diff) |
Implement Symbol.for and Symbol.keyFor
Change-Id: I5fde731b3a1a6d7c15154881ed82549b2800d104
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4string.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4string.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp index 78377286de..27c73a2b77 100644 --- a/src/qml/jsruntime/qv4string.cpp +++ b/src/qml/jsruntime/qv4string.cpp @@ -238,10 +238,12 @@ void Heap::String::append(const String *data, QChar *ch) } } -void Heap::String::createHashValue() const +void Heap::StringOrSymbol::createHashValue() const { - if (!text) - simplifyString(); + if (!text) { + Q_ASSERT(internalClass->vtable->isString); + static_cast<const Heap::String *>(this)->simplifyString(); + } Q_ASSERT(text); const QChar *ch = reinterpret_cast<const QChar *>(text->data()); const QChar *end = ch + text->size; |