mmlemon / as3corelib

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

Order of objects lost during decode #51

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call JSON.decode() on JSON object containing several elements
2. View or traverse structure of resultant Object (ie: with thunderbolt and
firebug)

What is the expected output? What do you see instead?
Ordering of AS3 objects is inconsistent with order of JSON objects.

What version of the product are you using? On what operating system?
SVN revision 42, in Flash CS3 on Mac OS X 10.5.2

Please provide any additional information below.
I've attached an example fla and as files that demonstrate the problem. 
(Requires viewing in Firefox w/ firebug to see the debug messages in the
console.)

I searched for any existing issues and didn't see any.  I'm not sure if AS3
objects even hold specific order when iterating through them, so this may
be a lost cause.  At any rate, I'd still like to know for sure.

Original issue reported on code.google.com by evan.kaufman on 4 Apr 2008 at 10:44

Attachments:

GoogleCodeExporter commented 8 years ago
Per the RFC:

http://tools.ietf.org/html/rfc4627

--
An object is an unordered collection of zero or more name/value
   pairs, where a name is a string and a value is a string, number,
   boolean, null, object, or array.
--

Object values are unordered.

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