Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: added v8::Value::IsNullOrUndefined
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhorton authored and MSLaguana committed Sep 25, 2017
1 parent 270d15f commit 1685cf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions deps/chakrashim/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions deps/chakrashim/src/v8value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1685cf3

Please sign in to comment.