aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qv4domerrors_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-05-07 11:22:52 +0200
committerLars Knoll <lars.knoll@digia.com>2013-05-07 12:28:58 +0200
commit5963aead75991ea8b0fded251e18ef75f099ab8f (patch)
tree17d6fdcb52fc1d59fa2ab3037121c679b9dd20aa /src/qml/qml/v8/qv4domerrors_p.h
parent40d2e435cfa29ba7465adc0486e6dabcdfc49773 (diff)
More steps towards eliminating the v8 layer
* Changed the return type of the InvocationCallback from a v8 handle to a QV4::Value * Removed v4 auto tests and fixed build of other tests Change-Id: Ic927b925923ca8785170689a5c260969fd1cb794 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qv4domerrors_p.h')
-rw-r--r--src/qml/qml/v8/qv4domerrors_p.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/qml/v8/qv4domerrors_p.h b/src/qml/qml/v8/qv4domerrors_p.h
index 434f9c5846..3d612cb397 100644
--- a/src/qml/qml/v8/qv4domerrors_p.h
+++ b/src/qml/qml/v8/qv4domerrors_p.h
@@ -83,6 +83,14 @@ QT_BEGIN_NAMESPACE
return v8::Handle<v8::Value>(); \
}
+#define V4THROW_DOM(error, string) { \
+ QV4::ExecutionContext *ctx = v8::Isolate::GetEngine()->current; \
+ QV4::Value v = QV4::Value::fromString(ctx, QStringLiteral(string)); \
+ QV4::Object *ex = ctx->engine->newErrorObject(v); \
+ ex->put(ctx, ctx->engine->newIdentifier(QStringLiteral("code")), QV4::Value::fromInt32(error)); \
+ ctx->throwError(QV4::Value::fromObject(ex)); \
+}
+
namespace QV4 {
struct ExecutionEngine;
}