Small cleanup
authorLars Knoll <lars.knoll@digia.com>
Sat, 22 Jun 2013 12:55:05 +0000 (14:55 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Sun, 23 Jun 2013 06:56:06 +0000 (08:56 +0200)
Change-Id: If46ef96f0ab64240b4811645f768844ad43ef48d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/qqmlxmlhttprequest.cpp
src/qml/qml/v4/qv4script.cpp

index adb2a95..46f9237 100644 (file)
@@ -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) {
index 2d47ae6..3de2b15 100644 (file)
@@ -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()