aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-06-23 23:07:23 +0200
committerLars Knoll <lars.knoll@qt.io>2018-07-02 19:29:43 +0000
commit56bff8f7abc2f0eeadd4d197667132af6eed6f3a (patch)
tree13990d34f9239e1845dedaa452bc1093f38b027a /src/qml/jsruntime/qv4runtime.cpp
parent86f88521fbea59e8ec53e50cc1e3e68a61f53c40 (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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 6969dd4eee..8a6b011aa2 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -329,10 +329,6 @@ bool Runtime::method_deleteProperty(ExecutionEngine *engine, const Value &base,
return Encode::undefined();
Q_ASSERT(o);
- uint n = index.asArrayIndex();
- if (n < UINT_MAX)
- return o->deleteProperty(PropertyKey::fromArrayIndex(n));
-
ScopedPropertyKey key(scope, index.toPropertyKey(engine));
if (engine->hasException)
return false;
@@ -451,10 +447,10 @@ ReturnedValue RuntimeHelpers::ordinaryToPrimitive(ExecutionEngine *engine, const
String *meth1 = engine->id_toString();
String *meth2 = engine->id_valueOf();
- if (typeHint->identifier() == engine->id_number()->identifier()) {
+ if (typeHint->propertyKey() == engine->id_number()->propertyKey()) {
qSwap(meth1, meth2);
} else {
- Q_ASSERT(typeHint->identifier() == engine->id_string()->identifier());
+ Q_ASSERT(typeHint->propertyKey() == engine->id_string()->propertyKey());
}
Scope scope(engine);
@@ -1535,7 +1531,8 @@ ReturnedValue Runtime::method_createClass(ExecutionEngine *engine, int classInde
return Encode::undefined();
++computedNames;
} else {
- propertyName = PropertyKey::fromStringOrSymbol(unit->runtimeStrings[methods[i].name]);
+ name = unit->runtimeStrings[methods[i].name];
+ propertyName = name->toPropertyKey();
}
QV4::Function *f = unit->runtimeFunctions[methods[i].function];
Q_ASSERT(f);