yixiaohui12345 / as3corelib

Automatically exported from code.google.com/p/as3corelib
1 stars 0 forks source link

parsing numbers with exponent fails #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. trace(JSON.decode("[3.6e-01]"));

What is the expected output? What do you see instead?
Expected: 0.36
Instead: "Unexpected e encountered"

What version of the product are you using? On what operating system?
AS 3 on Windows

Please provide any additional information below.
Browsing the source of JSONTokenizer.as reveals that exponents are not
handled at all.

Original issue reported on code.google.com by justinta...@gmail.com on 5 May 2008 at 8:47

GoogleCodeExporter commented 9 years ago

Original comment by mikechambers on 2 Jul 2008 at 4:51

GoogleCodeExporter commented 9 years ago
JSONTest::testDecodeScientificNegativeExponent demonstrates that "6.02e-23" is
correctly parsed as a number.  Also, if you look in JSONTokenizer at line 392 
(as of
revision 63) you'll see the code to check for scientific notation in numbers.

Rejecting as invalid - make sure you're using the latest from SVN.

Original comment by darron.schall on 23 Oct 2008 at 2:07