-
-
Notifications
You must be signed in to change notification settings - Fork 498
feat: add IsNullOrUndefined #909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -269,8 +269,9 @@ namespace Napi { | |
|
|
||
| napi_valuetype Type() const; ///< Gets the type of the value. | ||
|
|
||
| bool IsUndefined() const; ///< Tests if a value is an undefined JavaScript value. | ||
| bool IsNull() const; ///< Tests if a value is a null JavaScript value. | ||
| bool IsUndefined() const; ///< Tests if a value is an undefined JavaScript value. | ||
| bool IsNullOrUndefined() const; ///< Tests if a value is a null or undefined JavaScript value. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New changes have been submitted |
||
| bool IsBoolean() const; ///< Tests if a value is a JavaScript boolean. | ||
| bool IsNumber() const; ///< Tests if a value is a JavaScript number. | ||
| #if NAPI_VERSION > 5 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compiler may optimize this since it is
const, but let's store theType()call in a variable or use a switch statement to ensure it isn't called twice.