Skip to content

Commit

Permalink
Use Value::IsEmpty to check for empty value
Browse files Browse the repository at this point in the history
PR-URL: #478
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
NickNaso authored and mhdawson committed May 17, 2019
1 parent 3ad5dfc commit e1cf9a3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ inline bool Value::IsEmpty() const {
}

inline napi_valuetype Value::Type() const {
if (_value == nullptr) {
if (IsEmpty()) {
return napi_undefined;
}

Expand Down Expand Up @@ -314,7 +314,7 @@ inline bool Value::IsSymbol() const {
}

inline bool Value::IsArray() const {
if (_value == nullptr) {
if (IsEmpty()) {
return false;
}

Expand All @@ -325,7 +325,7 @@ inline bool Value::IsArray() const {
}

inline bool Value::IsArrayBuffer() const {
if (_value == nullptr) {
if (IsEmpty()) {
return false;
}

Expand All @@ -336,7 +336,7 @@ inline bool Value::IsArrayBuffer() const {
}

inline bool Value::IsTypedArray() const {
if (_value == nullptr) {
if (IsEmpty()) {
return false;
}

Expand All @@ -355,7 +355,7 @@ inline bool Value::IsFunction() const {
}

inline bool Value::IsPromise() const {
if (_value == nullptr) {
if (IsEmpty()) {
return false;
}

Expand All @@ -366,7 +366,7 @@ inline bool Value::IsPromise() const {
}

inline bool Value::IsDataView() const {
if (_value == nullptr) {
if (IsEmpty()) {
return false;
}

Expand All @@ -377,7 +377,7 @@ inline bool Value::IsDataView() const {
}

inline bool Value::IsBuffer() const {
if (_value == nullptr) {
if (IsEmpty()) {
return false;
}

Expand Down

0 comments on commit e1cf9a3

Please sign in to comment.