Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: address comment
  • Loading branch information
BridgeAR committed Aug 29, 2018
commit e80c5452d254eab70dd5043ba36c8186d38e9c63
6 changes: 6 additions & 0 deletions lib/internal/util/comparisons.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,15 @@ function findLooseMatchingPrimitives(prim) {
return false;
case 'string':
const number = +prim;
// Loose equal entries exist only if the string is possible to convert to
// a regular number and not NaN.
if (Number.isNaN(number)) {
return false;

@jdalton jdalton Aug 27, 2018 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️ might pluck the Number.isNaN reference above.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment addressed.

}
case 'number':
if (Number.isNaN(prim)) {
return false;
}
}
return true;
}
Expand Down