Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Issue 10257029: Add a space at the end of line being parsed to correctly process cases like 3.14. (Closed)

Created:
8 years, 8 months ago by Anton Muhin
Modified:
8 years, 8 months ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add a space at the end of line being parsed to correctly process cases like 3.14. TBR=ajohnsen@google.com BUG=2782 TEST=json_test.dart Committed: https://code.google.com/p/dart/source/detail?r=7121

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -4 lines) Patch
M lib/json/json.dart View 1 chunk +1 line, -1 line 3 comments Download
M tests/json/json.status View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Anton Muhin
8 years, 8 months ago (2012-04-28 08:21:34 UTC) #1
Anders Johnsen
https://chromiumcodereview.appspot.com/10257029/diff/1/lib/json/json.dart File lib/json/json.dart (right): https://chromiumcodereview.appspot.com/10257029/diff/1/lib/json/json.dart#newcode99 lib/json/json.dart:99: _JsonParser._internal(String json) : this.json = '${json} ' { This ...
8 years, 8 months ago (2012-04-28 08:23:22 UTC) #2
Anton Muhin
https://chromiumcodereview.appspot.com/10257029/diff/1/lib/json/json.dart File lib/json/json.dart (right): https://chromiumcodereview.appspot.com/10257029/diff/1/lib/json/json.dart#newcode99 lib/json/json.dart:99: _JsonParser._internal(String json) : this.json = '${json} ' { On ...
8 years, 8 months ago (2012-04-28 08:25:07 UTC) #3
Anders Johnsen
8 years, 8 months ago (2012-04-28 09:03:07 UTC) #4
LGTM

https://chromiumcodereview.appspot.com/10257029/diff/1/lib/json/json.dart
File lib/json/json.dart (right):

https://chromiumcodereview.appspot.com/10257029/diff/1/lib/json/json.dart#new...
lib/json/json.dart:99: _JsonParser._internal(String json) : this.json = '${json}
' {
On 2012/04/28 08:25:07, antonmuhin wrote:
> On 2012/04/28 08:23:22, ajohnsen wrote:
> > This is not the correct way to fix this. This will re-allocate the string.
> I'll
> > fix my number parsing.
> 
> I didn't do performance measurements, I'd prefer it work correctly first.
> 
> Regarding number parsing code.  I was considering this as well, but it's not
> obvious what is better in the long run: additional checks if the string is
> exhausted or one additional allocation.

Agreed! I'll fix the number parsing error in another CL.

Powered by Google App Engine
This is Rietveld 408576698