aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2016-10-12 11:15:09 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2016-10-13 10:48:09 +0000
commit9d2169a2d8b81b8707b20ab892550f4a55c07feb (patch)
tree8f7d36960f8c27ca95b23c455441becedaf12d89 /src/qml/jsruntime/qv4value_p.h
parentaf002b8df9b084fd7f26e9eead9844aab36bdc4d (diff)
V4: Fix usage of QV4::Value tags/types
These two were mixed, but have completely different values. Task-number: QTBUG-56471 Change-Id: Ifbf6da3032335ea89bfbc3acde17f64a571b9dc0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_p.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index ebe43b505d..13339129eb 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -220,6 +220,17 @@ public:
setTagValue(Empty_Type_Internal, quint32(i));
}
+ Q_ALWAYS_INLINE void setEmpty(quint32 i)
+ {
+ setTagValue(Empty_Type_Internal, i);
+ }
+
+ Q_ALWAYS_INLINE quint32 emptyValue()
+ {
+ Q_ASSERT(isEmpty());
+ return quint32(value());
+ }
+
enum Type {
Undefined_Type,
Managed_Type,
@@ -524,6 +535,7 @@ ReturnedValue Heap::Base::asReturnedValue() const
struct Q_QML_PRIVATE_EXPORT Primitive : public Value
{
inline static Primitive emptyValue();
+ inline static Primitive emptyValue(uint v);
static inline Primitive fromBoolean(bool b);
static inline Primitive fromInt32(int i);
inline static Primitive undefinedValue();
@@ -553,6 +565,13 @@ inline Primitive Primitive::emptyValue()
return v;
}
+inline Primitive Primitive::emptyValue(uint e)
+{
+ Primitive v;
+ v.setEmpty(e);
+ return v;
+}
+
inline Primitive Primitive::nullValue()
{
Primitive v;