diff options
-rw-r--r-- | src/qml/jsruntime/qv4arraydata.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4globalobject.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4stringobject.cpp | 3 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp index 654d33b8d1..ba62f078f0 100644 --- a/src/qml/jsruntime/qv4arraydata.cpp +++ b/src/qml/jsruntime/qv4arraydata.cpp @@ -654,6 +654,8 @@ bool ArrayElementLessThan::operator()(Value v1, Value v2) const jsCallData->args[0] = v1; jsCallData->args[1] = v2; result = o->call(jsCallData); + if (scope.hasException()) + return false; return result->toNumber() < 0; } diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index becdc3bc55..107aebc502 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -376,12 +376,12 @@ ReturnedValue EvalFunction::evalCall(const Value *, const Value *argv, int argc, if (function->isStrict() || isStrict) { ScopedFunctionObject e(scope, FunctionObject::createScriptFunction(ctx, function)); ScopedValue thisObject(scope, directCall ? scope.engine->currentStackFrame->thisObject() : scope.engine->globalObject->asReturnedValue()); - return e->call(thisObject, nullptr, 0); + return checkedResult(v4, e->call(thisObject, nullptr, 0)); } ScopedValue thisObject(scope, scope.engine->currentStackFrame->thisObject()); - return function->call(thisObject, nullptr, 0, ctx); + return checkedResult(v4, function->call(thisObject, nullptr, 0, ctx)); } diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index 1eef12a491..e01aadb5cf 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -440,6 +440,8 @@ public: argv[0] = convertElementToValue(m_v4, lhs); argv[1] = convertElementToValue(m_v4, rhs); QV4::ScopedValue result(scope, compare->call(m_v4->globalObject, argv, 2)); + if (scope.engine->hasException) + return false; return result->toNumber() < 0; } diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index 7a78e0a177..43185db676 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -570,7 +570,7 @@ ReturnedValue StringPrototype::method_match(const FunctionObject *b, const Value ScopedFunctionObject fo(scope, f); if (!fo) return scope.engine->throwTypeError(); - return fo->call(r, thisObject, 1); + return checkedResult(scope.engine, fo->call(r, thisObject, 1)); } } @@ -861,6 +861,7 @@ ReturnedValue StringPrototype::method_replace(const FunctionObject *b, const Val Value that = Value::undefinedValue(); replacement = searchCallback->call(&that, arguments, numCaptures + 2); + CHECK_EXCEPTION(); result += string.midRef(lastEnd, matchStart - lastEnd); result += replacement->toQString(); lastEnd = matchEnd; |