Re: Nailing object property order

2015-04-18 Thread Leon Arnott
(I meant "getOwnPropertyDescriptor" instead of "defineProperty" in that last paragraph.) ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Nailing object property order

2015-04-18 Thread Leon Arnott
I was the one who authored that commit, but thanks. Incidentally, I left off checks for the following behaviour which also uses the OwnPropertyKeys ordering, on the basis that they're generally too obscure to manifest in usual programs (but then, what do I know?): * Object.freeze/Object.seal/Obj

Re: Nailing object property order

2015-04-18 Thread Tom Schuster
Thanks Juriy, for writing a test for this. The problem in SpiderMonkey/Firefox is the line Object.defineProperty(obj, '4', { value: true, enumerable: true }); which defines a non-writable/non-configurable element. We don't store those with "normal" elements and thus they fall into the insertion

Re: Nailing object property order

2015-04-17 Thread Juriy Zaytsev
fwiw, tests for enumeration order now in compat table — https://github.com/kangax/compat-table/commit/a267f2233ce3b25dfbee876f4a4786ad85b31049 Results — https://kangax.github.io/compat-table/es6/#own_property_order -- kangax On Thu, Apr 16, 2015 at 8:37 PM, Brendan Eich wrote: > Also, it's to

Re: Nailing object property order

2015-04-16 Thread Brendan Eich
Also, it's too late. Engines are converging, inter-operation pressure points in one direction only: greater convergence and standardization. It's true engines are not converging on the ancient insertion order, and that caused some interop stress, but we are over that hump now. See https://code

Re: Nailing object property order

2015-04-16 Thread Mark S. Miller
Developer productivity > hypothetical minor performance gains. +1 to all steps to make the specified behavior more deterministic, including this one. On Thu, Apr 16, 2015 at 10:07 AM, liorean wrote: > I'm very much opposed to locking this down for general objects because > it locks the impleme

Re: Nailing object property order

2015-04-16 Thread liorean
I'm very much opposed to locking this down for general objects because it locks the implementation choices for generic objects down. What if the engine backing implementation was, say, some variation of a trie for instance? It cannot really be done today without adding extraneous data into the stru

Re: Nailing object property order

2015-04-16 Thread Bergi
Scott Sauyet schrieb: > Do you see good reasons *not* to do it, or are you just wondering if > there actually were pros to this? Oh, I can see the use cases (you've given a good example, thanks). Everyone needs ordered dictionaries/maps once in a while. Maybe even sortable ones, including `ins

Re: Nailing object property order

2015-04-16 Thread Scott Sauyet
I don't have pointers to other es-discuss threads where this was mentioned, but I do have a reason of my own for wanting this. I started and help maintain Ramda [1], a functional programming library for ES. It is a collection of utility functions similar in scope to Underscore or lodash, although

Re: Nailing object property order

2015-04-15 Thread Bergi
Tab Atkins Jr. schrieb: On Wed, Apr 15, 2015 at 6:39 PM, wrote: What was the motivation to pin these down in ES6? Because, for objects at least, all implementations used approximately the same order (matching the current spec), and lots of code was inadvertently written that depended on th

Re: Nailing object property order

2015-04-15 Thread Jordan Harband
For what it's worth, forcing an enumeration order does make polyfilling harder, assuming there's an engine out there that *doesn't* already use that ordering. On Wed, Apr 15, 2015 at 6:39 PM, wrote: > Hello! > Why does ES6 specify the order of keys in objects, maps and sets? > Specifically secti

Re: Nailing object property order

2015-04-15 Thread Tab Atkins Jr.
On Wed, Apr 15, 2015 at 6:39 PM, wrote: > Hello! > Why does ES6 specify the order of keys in objects, maps and sets? > Specifically section 9.1.12 [[OwnPropertyKeys]] says the result list must be > "integer indices in ascending numeric, then strings in property creation > order, then symbols in

Nailing object property order

2015-04-15 Thread a . d . bergi
Hello! Why does ES6 specify the order of keys in objects, maps and sets? Specifically section 9.1.12 [[OwnPropertyKeys]] says the result list must be "integer indices in ascending numeric, then strings in property creation order, then symbols in property creation order". Similarly, 23.1.3.5 Map.p