http://codereview.appspot.com/4711048/diff/1/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right):
http://codereview.appspot.com/4711048/diff/1/src/com/google/caja/es53.js#newcode5170 src/com/google/caja/es53.js:5170: radix = +radix; This will turn an absent radix into a NaN, which means goodParseInt(n) cannot be distinguished from goodParseInt(n, NaN). I suppose this is cool, since step 6 of parseInt says "Let R = ToInt32(radix)" which should convert a NaN to a 0, and the algorithm treats a 0 radix like an absent one. But this is tricky enough that it deserves a comment. http://codereview.appspot.com/4711048/diff/1/src/com/google/caja/es53.js#newcode5174 src/com/google/caja/es53.js:5174: if (isOct && (isNaN(radix) || 0 === radix)) { Don't ever ever ever call isNan, since isNaN('foo') === true. Use x !== x. http://codereview.appspot.com/4711048/diff/1/src/com/google/caja/es53.js#newcode5175 src/com/google/caja/es53.js:5175: return parseInt(n, isOct ? 10 : radix); Why are you doing an "isOct ?" test when you're in the then-part of an if guarded by "if (isOct &&"? Won't the "isOct ?" always be true? http://codereview.appspot.com/4711048/
