define isNaN as function(n) { return n !== n; }

Note that isNan() and n !== n is not the same because isNaN() can take
non-number type values e.g. isNaN("foo") -> true
Merge branch 'gfx/fast-isNaN'