Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12)

Issue 4711048: Fix parsing numbers using parseInt (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 4 months ago by Jasvir
Modified:
15 years, 4 months ago
Reviewers:
Mark S. Miller
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

parseInt was broken because: * it ignored the second "radix" argument * removed signs from numbers * turned 0 into NaN * turned hex numbers into 0 This change fixes this by detecting when parseInt is called with an octal number and in heuristic mode and explicitly passes a radix of 10. In all other cases, it calls the browser's parseInt with the given number and radix @4552

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fix parsing numbers using parseInt #

Patch Set 3 : Fix parsing numbers using parseInt #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -2 lines) Patch
M src/com/google/caja/es53.js View 1 2 1 chunk +11 lines, -2 lines 1 comment Download
M tests/com/google/caja/plugin/es53-test-language-guest.html View 1 2 1 chunk +49 lines, -0 lines 0 comments Download

Messages

Total messages: 4
Jasvir
15 years, 4 months ago (2011-07-13 23:34:29 UTC) #1
Mark S. Miller
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 ...
15 years, 4 months ago (2011-07-14 00:03:49 UTC) #2
Jasvir
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. ...
15 years, 4 months ago (2011-07-14 00:44:50 UTC) #3
Mark S. Miller
15 years, 4 months ago (2011-07-14 01:36:38 UTC) #4
LGTM module hilarious typo

http://codereview.appspot.com/4711048/diff/6001/src/com/google/caja/es53.js
File src/com/google/caja/es53.js (right):

http://codereview.appspot.com/4711048/diff/6001/src/com/google/caja/es53.js#n...
src/com/google/caja/es53.js:5173: // This turns an undefined radix but is ok
since NaN
"This turns an undefined radix" into what? This typo is most amusing, since the
whole point is that NaN and absence are interchangeable in this context!
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b