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

Issue 2333044: Remove parser failure in the prescence of unrepresentably large number literals (Closed)

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

Description

What steps will reproduce the problem? 1. var x= 99999999999999999999999; What is the expected output? What do you see instead? Caused by: java.lang.NumberFormatException: For input string: "99999999999999999999999" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:441) at java.lang.Long.valueOf(Long.java:508) at java.lang.Long.decode(Long.java:653) at com.google.caja.parser.js.Parser.toIntegerLiteral(Parser.java:996) at com.google.caja.parser.js.Parser.parseExpressionAtom(Parser.java:1026) at com.google.caja.parser.js.Parser.parseOp(Parser.java:792) at com.google.caja.parser.js.Parser.parseOp(Parser.java:858) at com.google.caja.parser.js.Parser.parseExpressionInt(Parser.java:727) This change reparses the number literal as a BigDecimal before evaluating whether or not it can be represented

Patch Set 1 #

Patch Set 2 : Remove parser failure in the prescence of unrepresentably large number literals #

Patch Set 3 : Remove parser failure in the prescence of unrepresentably large number literals #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -2 lines) Patch
M src/com/google/caja/parser/js/Parser.java View 2 chunks +12 lines, -2 lines 0 comments Download
M tests/com/google/caja/parser/js/ParserTest.java View 1 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 3
Jasvir
15 years, 9 months ago (2010-09-30 23:00:09 UTC) #1
Jasvir
15 years, 8 months ago (2010-10-19 18:22:23 UTC) #2
metaweta
15 years, 8 months ago (2010-10-19 18:37:08 UTC) #3
LGTM
Sign in to reply to this message.

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