Last Comment Bug 577060 - JSON.parse should allow only numbers conforming to NFA spec at
: JSON.parse should allow only numbers conforming to NFA spec at
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Saint Wesonga
: Jason Orendorff [:jorendorff]
Depends on: 589664
Blocks: 512442
  Show dependency treegraph
Reported: 2010-07-05 22:55 PDT by Saint Wesonga
Modified: 2014-04-26 02:22 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

WIP (8.87 KB, patch)
2010-07-05 22:57 PDT, Saint Wesonga
no flags Details | Diff | Splinter Review
Patch (10.31 KB, patch)
2010-07-13 19:31 PDT, Saint Wesonga
no flags Details | Diff | Splinter Review

Description Saint Wesonga 2010-07-05 22:55:49 PDT
Only { x | abs(x) < 1 } can have a leading 0
At most 1 leading zero is allowed
there MUST be at least one digit after the decimal point
ONLY a digit or a minus sign can start a number
Comment 1 Saint Wesonga 2010-07-05 22:57:39 PDT
Created attachment 456142 [details] [diff] [review]
Comment 2 Saint Wesonga 2010-07-13 19:31:13 PDT
Created attachment 457224 [details] [diff] [review]
Comment 3 Robert Sayre 2010-07-13 20:14:07 PDT
I will test perf on this before reviewing.
Comment 4 Jeff Walden [:Waldo] (remove +bmo to email) 2010-07-14 10:05:59 PDT
The JSONParserState additions aren't commented, according with the current entries.  That's changing in bug 564621, whose patch is finished but which can't land quite yet for yak-shaving reasons.  However, the JSONParserState documentation can be split out of it, so I'm going to do that now so you can make additions here without having them either undocumented or anomalously documented.  The rest of those changes should (fingers crossed) have minimal intersection with the patch here.
Comment 5 Jeff Walden [:Waldo] (remove +bmo to email) 2010-07-14 12:20:44 PDT
Pushed those docs changes, so you should be able to update the patch with docs for the JSONParserState changes now:

You may fire when ready, Gridley.
Comment 6 Jeff Walden [:Waldo] (remove +bmo to email) 2011-04-08 14:02:39 PDT
The parser rewrite fixes this.  (And sigh, yet another patch that got left dangling.  :-( )
Comment 7 Jeff Walden [:Waldo] (remove +bmo to email) 2011-05-27 22:52:36 PDT
Fixed by the parser rewrite in bug 589664.
Comment 8 Jeff Walden [:Waldo] (remove +bmo to email) 2011-06-30 17:44:52 PDT
For the record, rejecting leading zeroes broke someone's intranet application.  Worth knowing, perhaps, although I don't think we should do anything about it (nor should we have done differently at the time if we'd known):

They targeted Firefox 3 and 4 only, hence why no other browser complained to make them fix.

Note You need to log in before you can comment on or make changes to this bug.