diff options
author | Lars Knoll <[email protected]> | 2018-06-23 23:07:23 +0200 |
---|---|---|
committer | Lars Knoll <[email protected]> | 2018-07-02 19:29:43 +0000 |
commit | 56bff8f7abc2f0eeadd4d197667132af6eed6f3a (patch) | |
tree | 13990d34f9239e1845dedaa452bc1093f38b027a /src/qml/jsruntime/qv4lookup.cpp | |
parent | 86f88521fbea59e8ec53e50cc1e3e68a61f53c40 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4lookup.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4lookup.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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; |