aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arrayobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-07 14:26:42 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-10 08:18:46 +0000
commite9a8252305fa5e3b3cd4a18261990820975a79da (patch)
treebdc6ae7afdd73ac5d6b8ae98bef8e03f92fd2f95 /src/qml/jsruntime/qv4arrayobject.cpp
parentfee680b24a41c177a23f82fc7334ab593931afea (diff)
Don't throw exceptions in Object::delete(indexed) anymore
Change-Id: I8613ab21eb1435903e2a8514c21fe51f4a305a2f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4arrayobject.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp
index 67781bcbb1..5201924bcc 100644
--- a/src/qml/jsruntime/qv4arrayobject.cpp
+++ b/src/qml/jsruntime/qv4arrayobject.cpp
@@ -334,13 +334,15 @@ ReturnedValue ArrayPrototype::method_pop(const BuiltinFunction *b, CallData *cal
ScopedValue result(scope, instance->getIndexed(len - 1));
CHECK_EXCEPTION();
- instance->deleteIndexedProperty(len - 1);
- CHECK_EXCEPTION();
+ if (!instance->deleteIndexedProperty(len - 1))
+ return scope.engine->throwTypeError();
if (instance->isArrayObject())
instance->setArrayLength(len - 1);
- else
- instance->put(scope.engine->id_length(), ScopedValue(scope, Primitive::fromDouble(len - 1)));
+ else {
+ if (!instance->put(scope.engine->id_length(), ScopedValue(scope, Primitive::fromDouble(len - 1))))
+ return scope.engine->throwTypeError();
+ }
return result->asReturnedValue();
}
@@ -589,8 +591,8 @@ ReturnedValue ArrayPrototype::method_splice(const BuiltinFunction *b, CallData *
return scope.engine->throwTypeError();
}
for (uint k = len; k > len - deleteCount + itemCount; --k) {
- instance->deleteIndexedProperty(k - 1);
- CHECK_EXCEPTION();
+ if (!instance->deleteIndexedProperty(k - 1))
+ return scope.engine->throwTypeError();
}
} else if (itemCount > deleteCount) {
uint k = len - deleteCount;