From 1685cf32d984713fe30183168f43daa96e2e3010 Mon Sep 17 00:00:00 2001 From: Jack Horton Date: Fri, 8 Sep 2017 15:14:45 -0700 Subject: [PATCH] chakrashim: added v8::Value::IsNullOrUndefined --- deps/chakrashim/include/v8.h | 1 + deps/chakrashim/src/v8value.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/deps/chakrashim/include/v8.h b/deps/chakrashim/include/v8.h index 47d0b6208af..df23d12e95a 100644 --- a/deps/chakrashim/include/v8.h +++ b/deps/chakrashim/include/v8.h @@ -1012,6 +1012,7 @@ class V8_EXPORT Value : public Data { public: bool IsUndefined() const; bool IsNull() const; + bool IsNullOrUndefined() const; bool IsTrue() const; bool IsFalse() const; bool IsName() const; diff --git a/deps/chakrashim/src/v8value.cc b/deps/chakrashim/src/v8value.cc index a1ca1b2f247..002e778b4b2 100644 --- a/deps/chakrashim/src/v8value.cc +++ b/deps/chakrashim/src/v8value.cc @@ -52,6 +52,10 @@ bool Value::IsNull() const { return IsOfType(this, JsValueType::JsNull); } +bool Value::IsNullOrUndefined() const { + return IsNull() || IsUndefined(); +} + bool Value::IsTrue() const { bool isTrue; if (JsEquals(jsrt::GetTrue(), (JsValueRef)this, &isTrue) != JsNoError) {