added NaN special case...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-10-15 22:43:06 +03:00
parent a7573e8f19
commit 3be394b85d
2 changed files with 92 additions and 88 deletions

View File

@ -1393,6 +1393,8 @@ module.Types = {
// NOTE: we can't use a == b directly because of things like
// [2] == 2 -> true...
return a === b
// special-case: NaN...
|| (isNaN(a) && isNaN(b))
// basic patters...
|| a === that.ANY
|| b === that.ANY
@ -1515,6 +1517,8 @@ module.Types = {
// NOTE: we can't use a == b directly because of things like
// [2] == 2 -> true...
return a === b
// special-case: NaN...
|| (isNaN(a) && isNaN(b))
// basic patters...
|| a === that.ANY
|| b === that.ANY

0
test.js Normal file → Executable file
View File