Skip to content

Commit e1cf9a3

Browse files
NickNasomhdawson
authored andcommitted
Use Value::IsEmpty to check for empty value
PR-URL: #478 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 3ad5dfc commit e1cf9a3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

napi-inl.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ inline bool Value::IsEmpty() const {
271271
}
272272

273273
inline napi_valuetype Value::Type() const {
274-
if (_value == nullptr) {
274+
if (IsEmpty()) {
275275
return napi_undefined;
276276
}
277277

@@ -314,7 +314,7 @@ inline bool Value::IsSymbol() const {
314314
}
315315

316316
inline bool Value::IsArray() const {
317-
if (_value == nullptr) {
317+
if (IsEmpty()) {
318318
return false;
319319
}
320320

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

327327
inline bool Value::IsArrayBuffer() const {
328-
if (_value == nullptr) {
328+
if (IsEmpty()) {
329329
return false;
330330
}
331331

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

338338
inline bool Value::IsTypedArray() const {
339-
if (_value == nullptr) {
339+
if (IsEmpty()) {
340340
return false;
341341
}
342342

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

357357
inline bool Value::IsPromise() const {
358-
if (_value == nullptr) {
358+
if (IsEmpty()) {
359359
return false;
360360
}
361361

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

368368
inline bool Value::IsDataView() const {
369-
if (_value == nullptr) {
369+
if (IsEmpty()) {
370370
return false;
371371
}
372372

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

379379
inline bool Value::IsBuffer() const {
380-
if (_value == nullptr) {
380+
if (IsEmpty()) {
381381
return false;
382382
}
383383

0 commit comments

Comments
 (0)