Mohsin26 / as3corelib

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

JSON decode cannot parse $ in object parameters #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. if you have a string to decode like: "{$name: 'jon', $gender: 'male'}", 
where one of the parameters 
begins with a $, the dollar sign causes a parseError during JSON.decode.

What is the expected output? What do you see instead?
$ is a valid character in a parameter name and should be parsed.  (We are using 
it as a namespace.)

What version of the product are you using? On what operating system?
Revision 42, Mac OSX Leopard with latest Safari

Original issue reported on code.google.com by walkerf...@gmail.com on 29 May 2008 at 6:22

GoogleCodeExporter commented 9 years ago
I do not know how to delete issues, but this issue should now be deleted.  I 
reported it before looking at the 
source code to see what was going on.  My JSON was improperly formed for this 
library and looked like this: 
"{$name: "jon", $gender: "male"}".  There were no quotes around the parameter 
names.  This style of JSON works 
fine in Javascript, where the whole thing is evaled, but with this library, all 
strings, even parameter names, need 
to be enclosed in quotes.  My JSON string properly formatted looks like this: 
"{"$name": "jon", "$gender": 
"male"}".  That properly formatted JSON will decode just fine.

Original comment by walkerf...@gmail.com on 30 May 2008 at 5:28

GoogleCodeExporter commented 9 years ago
it's still a valid problem imho

Original comment by ionel...@gmail.com on 25 Jun 2008 at 3:17

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Marking this issue as invalid (since the original poster discovered that the 
JSON
string they were trying to decode was not valid JSON).

However, as a followup, I'll create a new ticket to allow for decoding of 
non-quoted
object identifier strings in non-strict mode.

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

GoogleCodeExporter commented 9 years ago
Actually, scratch that last comment.  There already is an issue present for the
non-quoted feature in a non-strict decoding mode - issue #35.  Marking this as a
duplicate instead since the core issue is the same.

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