snapshot

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;
On 2011/07/14 00:03:49, Mark S. Miller wrote:
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.

Done.

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)) {
On 2011/07/14 00:03:49, Mark S. Miller wrote:
Don't ever ever ever call isNan, since isNaN('foo') === true. Use x
!== x.

Done.

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);
Development cruft.

On 2011/07/14 00:03:49, Mark S. Miller wrote:
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?

Done.

http://codereview.appspot.com/4711048/

Reply via email to