aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4reflect.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/qv4reflect.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/qv4reflect.cpp')
-rw-r--r--src/qml/jsruntime/qv4reflect.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4reflect.cpp b/src/qml/jsruntime/qv4reflect.cpp
index 2bfd2bc401..20ea39d4e5 100644
--- a/src/qml/jsruntime/qv4reflect.cpp
+++ b/src/qml/jsruntime/qv4reflect.cpp
@@ -192,16 +192,11 @@ ReturnedValue Reflect::method_has(const FunctionObject *f, const Value *, const
Value undef = Primitive::undefinedValue();
const Value *index = argc > 1 ? &argv[1] : &undef;
- bool hasProperty = false;
- uint n = index->asArrayIndex();
- if (n < UINT_MAX) {
- (void) o->get(n, &hasProperty);
- return Encode(hasProperty);
- }
-
ScopedPropertyKey name(scope, index->toPropertyKey(scope.engine));
if (scope.engine->hasException)
return false;
+
+ bool hasProperty = false;
(void) o->get(name, nullptr, &hasProperty);
return Encode(hasProperty);
}