From 94a99985f8f7335ff1eb23dc8c0e02af12f7edb6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 22 Jun 2013 14:55:05 +0200 Subject: [PATCH] Small cleanup Change-Id: If46ef96f0ab64240b4811645f768844ad43ef48d Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlxmlhttprequest.cpp | 6 ++---- src/qml/qml/v4/qv4script.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index adb2a95..46f9237 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -1457,13 +1457,11 @@ void QQmlXMLHttpRequest::dispatchCallback(const Value &me) try { Object *o = me.asObject(); if (!o) - __qmljs_throw(ctx, Value::fromObject( - v4->newErrorObject(Value::fromString(ctx, QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject"))))); + ctx->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject")); Object *thisObj = o->get(v4->newString(QStringLiteral("ThisObject"))).asObject(); if (!thisObj) - __qmljs_throw(ctx, Value::fromObject( - v4->newErrorObject(Value::fromString(ctx, QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject"))))); + ctx->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject")); FunctionObject *callback = thisObj->get(v4->newString(QStringLiteral("onreadystatechange"))).asFunctionObject(); if (!callback) { diff --git a/src/qml/qml/v4/qv4script.cpp b/src/qml/qml/v4/qv4script.cpp index 2d47ae6..3de2b15 100644 --- a/src/qml/qml/v4/qv4script.cpp +++ b/src/qml/qml/v4/qv4script.cpp @@ -170,7 +170,7 @@ void Script::parse() if (!vmFunction) // ### FIX file/line number - __qmljs_throw(v4->current, QV4::Value::fromObject(v4->newSyntaxErrorObject(v4->current, 0))); + v4->current->throwError(QV4::Value::fromObject(v4->newSyntaxErrorObject(v4->current, 0))); } Value Script::run() -- 2.7.4