diff options
Diffstat (limited to 'src/qml/jsruntime/qv4string.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4string.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp index 27c73a2b77..cfd2d0a5b2 100644 --- a/src/qml/jsruntime/qv4string.cpp +++ b/src/qml/jsruntime/qv4string.cpp @@ -250,6 +250,14 @@ void Heap::StringOrSymbol::createHashValue() const stringHash = QV4::String::calculateHashValue(ch, end, &subtype); } +Identifier StringOrSymbol::toPropertyKey() const { + uint index = asArrayIndex(); + if (index < UINT_MAX) + return Identifier::fromArrayIndex(index); + makeIdentifier(); + return identifier(); +} + uint String::getLength(const Managed *m) { return static_cast<const String *>(m)->d()->length(); |