diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-08-27 14:41:47 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-02 17:27:36 +0200 |
commit | 4a5e32f4f7221be5fc5ab79d5283ce89f7ccbeae (patch) | |
tree | 7b5cc4b15619449e1916dbbb8eff0916208774a9 /src/qml/jsruntime/qv4value_def_p.h | |
parent | 819b4ef8b1e196596b4f56cb0d729f6b5fa93b0b (diff) |
Add Value::isNullOrUndefined()
Allows for some smaller optimization in the call stack.
Change-Id: Id5beeb04e9f9dbf9e61280cee7bf6758a4c02310
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4value_def_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4value_def_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_def_p.h b/src/qml/jsruntime/qv4value_def_p.h index a44af16b6a..7d037f3d49 100644 --- a/src/qml/jsruntime/qv4value_def_p.h +++ b/src/qml/jsruntime/qv4value_def_p.h @@ -80,6 +80,7 @@ struct Q_QML_EXPORT Value Type_Mask = 0xffff8000, Immediate_Mask = NotDouble_Mask | 0x00008000, IsManaged_Mask = Type_Mask & ~0x10000, + IsNullOrUndefined_Mask = Immediate_Mask | 0x20000, Tag_Shift = 32 }; enum ValueType { @@ -128,6 +129,7 @@ struct Q_QML_EXPORT Value inline bool isObject() const { return tag == Object_Type; } #endif inline bool isManaged() const { return (tag & IsManaged_Mask) == Object_Type; } + inline bool isNullOrUndefined() const { return (tag & IsNullOrUndefined_Mask) == Undefined_Type; } inline bool isConvertibleToInt() const { return (tag & ConvertibleToInt) == ConvertibleToInt; } inline bool isInt32() { if (tag == _Integer_Type) |