-
Notifications
You must be signed in to change notification settings - Fork 73
Reference value NaN assertion. #94
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
Conversation
cjihrig
left a comment
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.
There is a difference between the behavior of isNaN() and Number.isNaN(). Since this is only targeting the NaN value, this should use Number.isNaN(). Please add a test that asserts a string to see the difference.
API.md
Outdated
|
|
||
| ##### `NaN()` | ||
|
|
||
| Asserts that the reference value is NaN. |
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.
NaN should be in backticks.
lib/index.js
Outdated
|
|
||
| internals.addMethod('NaN', function () { | ||
|
|
||
| return this.assert(isNaN(this._ref), 'be NaN'); |
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.
isNaN() -> Number.isNaN()
8216913 to
cca691f
Compare
|
This still needs a test for a string. |
cca691f to
1de2fa0
Compare
|
Landed with some edits in 3d9dfc3. |
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
To check whether the reference value is NaN or not.
For Example: