aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
index 9213b61a3c..721c719911 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
@@ -101,6 +101,12 @@ public:
void setWidth(int) { }
};
+void MyQmlObject::v8function(QDeclarativeV8Function *args)
+{
+ const char *error = "Exception thrown from within QObject slot";
+ v8::ThrowException(v8::Exception::Error(v8::String::New(error)));
+}
+
static QJSValue script_api(QDeclarativeEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)