diff --git a/History.md b/History.md index c66a5a8fba..4d464eee58 100644 --- a/History.md +++ b/History.md @@ -14,6 +14,8 @@ * Remove support for the undocumented earliestCompatibleVersion feature of the package system. +* Fix audit-argument-checks spurious failure when an argument is NaN. #2914 + * Upgraded dependencies: - node: 0.10.33 (from 0.10.29) - source-map-support: 0.2.8 (from 0.2.5) diff --git a/packages/check/match.js b/packages/check/match.js index 61f59438cf..9b15b8e6a7 100644 --- a/packages/check/match.js +++ b/packages/check/match.js @@ -343,7 +343,7 @@ _.extend(ArgumentChecker.prototype, { // Is this value one of the arguments? (This can have a false positive if // the argument is an interned primitive, but it's still a good enough // check.) - // Special check for NaN, need to use underscores method for number type checking + // (NaN is not === to itself, so we have to check specially.) if (value === self.args[i] || (_.isNaN(value) && _.isNaN(self.args[i]))) { self.args.splice(i, 1); return true;