Re: ES6 iteration over object values

2014-03-15 Thread David Bruant
Le 15/03/2014 01:32, Brandon Benvie a écrit : On 3/14/2014 5:16 PM, Mark Volkmann wrote: Does ES6 add any new ways to iterate over the values in an object? I've done a lot of searching, but haven't seen anything. I'm wondering if there is something more elegant than this:

Re: Initializer expression on for-in syntax subject

2014-03-15 Thread John Lenz
If we can get uglify and closure compiler to reject it it will go a long way toward making sure it doesn't crop up in the wild. On Mar 14, 2014 10:20 PM, Brendan Eich bren...@mozilla.org wrote: Peter van der Zee wrote: Which browsers currently don't accept this construct? I wasn't even aware

Re: ES6 iteration over object values

2014-03-15 Thread David Bruant
Le 15/03/2014 22:51, C. Scott Ananian a écrit : It would be nicer to add an Object.entries() method that would return that iterator. Object.prototype.entries or Object.entries(obj)? That would be less error prone than adding a default iterator to every object. The world has survived

Re: Initializer expression on for-in syntax subject

2014-03-15 Thread Oliver Hunt
I’ve landed the change to JSC to silently ignore the assignment in the non-strict “var ident =“ case, everything else is still an error so deconstruction and |of| enumeration will trigger a syntax error. —Oliver On Mar 15, 2014, at 2:01 PM, Brendan Eich bren...@mozilla.com wrote: Brendan

Re: ES6 iteration over object values

2014-03-15 Thread Jason Orendorff
On Sat, Mar 15, 2014 at 5:19 PM, David Bruant bruan...@gmail.com wrote: Even if error prone, I'd be interested to hear about arguments in the sense that the risk outweighs the benefits. Iterable-by-default objects is a nice battery included feature. I'm pretty sure es-discuss has been over

Re: ES6 iteration over object values

2014-03-15 Thread Rick Waldron
This thread's original question is answered by the Dict API ( https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-11/nov-29.md#conclusionresolution-5 ). (more inline below) On Sat, Mar 15, 2014 at 6:19 PM, David Bruant bruan...@gmail.com wrote: Le 15/03/2014 22:51, C. Scott Ananian a

Re: ES6 iteration over object values

2014-03-15 Thread Brendan Eich
Jason Orendorff wrote: I'd like to see an Object.entries method, and Object.values for completeness. Same visibility rules as Object.keys. for (let [k, v] of Object.entries(myObj)) { // do something with k and v } +1, or +2 counting static methods :-). /be

Re: ES6 iteration over object values

2014-03-15 Thread Rick Waldron
On Sat, Mar 15, 2014 at 7:38 PM, Jason Orendorff jason.orendo...@gmail.comwrote: On Sat, Mar 15, 2014 at 5:19 PM, David Bruant bruan...@gmail.com wrote: Even if error prone, I'd be interested to hear about arguments in the sense that the risk outweighs the benefits. Iterable-by-default

Re: Generalizable Function Modifier Syntax

2014-03-15 Thread Brendan Eich
Kevin Smith wrote: async function af() {} { async af() { } } This lines up with what Luke Hoban presented at the last TC39 meeting. So far, so good (but not a done deal by any means, of course). The main bone of contention is the use of ! in promises future-proposed syntax. The

Re: ES6 iteration over object values

2014-03-15 Thread C. Scott Ananian
On Sat, Mar 15, 2014 at 6:19 PM, David Bruant bruan...@gmail.com wrote: Le 15/03/2014 22:51, C. Scott Ananian a écrit : It would be nicer to add an Object.entries() method that would return that iterator. Object.prototype.entries or Object.entries(obj)? `Object.entries(obj)` and