aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-06-29 13:15:33 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-04 11:57:06 +0200
commit7481adc7d72665de7873b99f58764f2a6b906c9c (patch)
tree9d417a6615c91380f1c70d21f7149a270807c250 /src/qml/qml
parent1d7471d93b4463657f2721074f2a63a12ea18752 (diff)
Add some private V8ASSERT macros.
Simple variation on the V8THROW macros to consilidate the normal usage pattern of if (!condition) THROW. Change-Id: I71aaabab705c3f73922efdaf8bb40b5dcc390101 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/v8/qv8engine_p.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h
index 649edcdbb2..1e91de91b6 100644
--- a/src/qml/qml/v8/qv8engine_p.h
+++ b/src/qml/qml/v8/qv8engine_p.h
@@ -108,6 +108,17 @@ QT_BEGIN_NAMESPACE
return; \
}
+#define V8ASSERT_TYPE(condition, string) \
+ if (!(condition)) { \
+ v8::ThrowException(v8::Exception::TypeError(v8::String::New(string))); \
+ return v8::Handle<v8::Value>(); \
+ }
+#define V8ASSERT_TYPE_SETTER(condition, string) \
+ if (!(condition)) { \
+ v8::ThrowException(v8::Exception::TypeError(v8::String::New(string))); \
+ return; \
+ }
+
#define V8_DEFINE_EXTENSION(dataclass, datafunction) \
static inline dataclass *datafunction(QV8Engine *engine) \
{ \