aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arrayobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4arrayobject.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp
index 434f6781a8..a82628e249 100644
--- a/src/qml/jsruntime/qv4arrayobject.cpp
+++ b/src/qml/jsruntime/qv4arrayobject.cpp
@@ -247,7 +247,7 @@ ReturnedValue ArrayPrototype::method_from(const FunctionObject *builtin, const V
mappedValue = *nextValue;
}
- if (!a->hasOwnProperty(k)) {
+ if (a->getOwnProperty(Identifier::fromArrayIndex(k)) == Attr_Invalid) {
a->arraySet(k, mappedValue);
} else {
// Don't return: we need to close the iterator.
@@ -289,7 +289,7 @@ ReturnedValue ArrayPrototype::method_from(const FunctionObject *builtin, const V
mappedValue = kValue;
}
- if (a->hasOwnProperty(k))
+ if (a->getOwnProperty(Identifier::fromArrayIndex(k)) != Attr_Invalid)
return scope.engine->throwTypeError(QString::fromLatin1("Cannot redefine property: %1").arg(k));
a->arraySet(k, mappedValue);
@@ -318,7 +318,7 @@ ReturnedValue ArrayPrototype::method_of(const FunctionObject *builtin, const Val
int k = 0;
while (k < argc) {
- if (a->hasOwnProperty(k)) {
+ if (a->getOwnProperty(Identifier::fromArrayIndex(k)) != Attr_Invalid) {
return scope.engine->throwTypeError(QString::fromLatin1("Cannot redefine property: %1").arg(k));
}
a->arraySet(k, argv[k]);