From ffcdbfa03f8bb36b521f8c1a703ee24085fe25bd Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 22 Oct 2013 13:26:08 +0200 Subject: Protect write accesses to objects Don't write to objects if we have a pending exception to avoid any side effects. Change-Id: I9f93a9195a652dbae7033cc6ebb355d5d86e9b5e Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4objectproto.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qml/jsruntime/qv4objectproto.cpp') diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index 061487f8af..c8202a5bad 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -158,6 +158,8 @@ ReturnedValue ObjectPrototype::method_getOwnPropertyDescriptor(SimpleCallContext ScopedValue v(scope, ctx->argument(1)); Scoped name(scope, v->toString(ctx)); + if (scope.hasException()) + return Encode::undefined(); PropertyAttributes attrs; Property *desc = O->__getOwnProperty__(name, &attrs); return fromPropertyDescriptor(ctx, desc, attrs); -- cgit v1.2.3