From 56bff8f7abc2f0eeadd4d197667132af6eed6f3a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 23 Jun 2018 23:07:23 +0200 Subject: Clean up the property key API in StringOrSymbol Get rid of makeIdentifier(), as toPropertyKey() will take care of it. Rename identifier() to propertyKey() and check that the key is valid. Remove String/StringOrSymbol::asArrayIndex(), we don't need it anymore. Change-Id: I3c490fabc1475c9ea288b49b1638b6fa1bc237b7 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4lookup.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/qml/jsruntime/qv4lookup.cpp') diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index 43628ad4f5..446af3f9ef 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -466,8 +466,8 @@ bool Lookup::resolveSetter(ExecutionEngine *engine, Object *object, const Value ScopedString name(scope, scope.engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); Heap::InternalClass *c = object->internalClass(); - name->makeIdentifier(); - uint idx = c->find(name->identifier()); + PropertyKey key = name->toPropertyKey(); + uint idx = c->find(key); if (idx != UINT_MAX) { if (object->isArrayObject() && idx == Heap::ArrayObject::LengthPropertyIndex) { setter = arrayLengthSetter; @@ -485,7 +485,7 @@ bool Lookup::resolveSetter(ExecutionEngine *engine, Object *object, const Value } insertionLookup.protoId = c->protoId; - if (!object->put(name, value)) { + if (!object->put(key, value)) { setter = Lookup::setterFallback; return false; } @@ -495,8 +495,7 @@ bool Lookup::resolveSetter(ExecutionEngine *engine, Object *object, const Value setter = setterFallback; return true; } - name->makeIdentifier(); - idx = object->internalClass()->find(name->identifier()); + idx = object->internalClass()->find(key); if (idx == UINT_MAX) { // ### can this even happen? setter = setterFallback; return false; -- cgit v1.2.3