diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-30 22:57:22 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-09-01 12:31:01 +0000 |
commit | 37195fe928494cb192220f115254bfe084cc3ab8 (patch) | |
tree | ff056acc97f7f112610ce70fb42a08cc347f54b4 /src/qml/jsruntime/qv4value_p.h | |
parent | 424965fa4572da34c2a4010374e13c41d65576c5 (diff) |
Add a Value::isFunctionObject() method
This is just as fast as isObject(), and allows for
some smaller optimizations.
Change-Id: Icc2117941a2851e56e9ef2baf87ba3bca9538581
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.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index c17caed8d6..d49dde2557 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -357,6 +357,7 @@ public: } inline bool isString() const; inline bool isObject() const; + inline bool isFunctionObject() const; inline bool isInt32() { if (tag() == quint32(ValueTypeInternal::Integer)) return true; @@ -520,6 +521,12 @@ inline bool Value::isObject() const return b && b->vtable()->isObject; } +inline bool Value::isFunctionObject() const +{ + Heap::Base *b = heapObject(); + return b && b->vtable()->isFunctionObject; +} + inline bool Value::isPrimitive() const { return !isObject(); |