From 36f47a31fa94a9cd06c6719c5c8ff033916b203d Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sun, 12 Jun 2011 23:13:53 -0400 Subject: [PATCH] fix NaN == NaN comparison in Asserts.js --- auto_tests/lib/Asserts.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/auto_tests/lib/Asserts.js b/auto_tests/lib/Asserts.js index b3ed441..b06ff29 100644 --- a/auto_tests/lib/Asserts.js +++ b/auto_tests/lib/Asserts.js @@ -178,6 +178,11 @@ function compare_(expected, actual) { return false; } + if (isNaN(expected) && isNaN(actual)) { + // This has to be special-cased because (NaN === NaN) == false. + return true; + } + var key = null; var actualLength = 0; var expectedLength = 0; -- 2.7.4