diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-07 11:45:11 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-10 08:18:21 +0000 |
commit | 475f4559d97dca4e85e6601f77593b354193393d (patch) | |
tree | e2186a0e8c44221fc5ec9aca51b35b9cf28ece97 /src/qml/jsruntime/qv4objectproto.cpp | |
parent | 5109cbed6dcd56dc283235a3a72de23358b955f7 (diff) |
Don't throw from within defineOwnProperty
There's no need to to this there, rather throw from the places
we call those methods. This also removes some more places where we
access the strictMode flag of the context.
Change-Id: I4bebc9d3c242850f06230d9116479a85a944dca3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index 6dff3107cf..37bf5c3cb6 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -561,7 +561,9 @@ ReturnedValue ObjectPrototype::method_defineGetter(const BuiltinFunction *b, Cal ScopedProperty pd(scope); pd->value = f; pd->set = Primitive::emptyValue(); - o->__defineOwnProperty__(scope.engine, prop, pd, Attr_Accessor); + bool ok = o->__defineOwnProperty__(scope.engine, prop, pd, Attr_Accessor); + if (!ok) + THROW_TYPE_ERROR(); RETURN_UNDEFINED(); } @@ -589,7 +591,9 @@ ReturnedValue ObjectPrototype::method_defineSetter(const BuiltinFunction *b, Cal ScopedProperty pd(scope); pd->value = Primitive::emptyValue(); pd->set = f; - o->__defineOwnProperty__(scope.engine, prop, pd, Attr_Accessor); + bool ok = o->__defineOwnProperty__(scope.engine, prop, pd, Attr_Accessor); + if (!ok) + THROW_TYPE_ERROR(); RETURN_UNDEFINED(); } |