Re: Array detection (was Re: Final iterator spec)

2014-03-02 Thread Allen Wirfs-Brock
On Mar 2, 2014, at 9:04 AM, Peter van der Zee wrote: Peter van der Zee e...@qfox.nl wrote: On Sun, Mar 2, 2014 at 4:18 AM, Domenic Denicola dome...@domenicdenicola.com wrote: You can just do `if (Symbol.iterator in potentialIterable)`. Does that work cross-frame? On Sun, Mar 2, 2014

Re: Array detection (was Re: Final iterator spec)

2014-03-02 Thread Peter van der Zee
Depends upon what you mean by Array detection. If you mean is obj an exotic array object (ie, an object that automatically updates the length property value as integer indexed properties are added or deleted) then Array.isArray(obj) detects exactly that. Okay cool. Is there merit in

Re: let and file scope

2014-03-02 Thread Rick Waldron
Here is the consensus from the revisit: https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-09/sept-19.md#conclusionresolution-8 Rick On Sun, Mar 2, 2014 at 2:37 AM, Ryan Scheel ryan.ha...@gmail.com wrote: It creates a variable scoped to the source file. On Sat, Mar 1, 2014 at

Re: let and file scope

2014-03-02 Thread Allen Wirfs-Brock
On Mar 2, 2014, at 11:51 AM, Rick Waldron wrote: Here is the consensus from the revisit: https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-09/sept-19.md#conclusionresolution-8 Rick On Sun, Mar 2, 2014 at 2:37 AM, Ryan Scheel ryan.ha...@gmail.com wrote: It creates a variable

Re: Array detection (was Re: Final iterator spec)

2014-03-02 Thread Allen Wirfs-Brock
On Mar 2, 2014, at 10:58 AM, Peter van der Zee wrote: Depends upon what you mean by Array detection. If you mean is obj an exotic array object (ie, an object that automatically updates the length property value as integer indexed properties are added or deleted) then Array.isArray(obj)

Re: let and file scope

2014-03-02 Thread Rick Waldron
On Sun, Mar 2, 2014 at 3:07 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Mar 2, 2014, at 11:51 AM, Rick Waldron wrote: Here is the consensus from the revisit: https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-09/sept-19.md#conclusionresolution-8 Rick On Sun, Mar 2, 2014

Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-02 Thread Andrea Giammarchi
I wonder if by any chance this could sneak into ES6 ... we have only singular version here: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.getownpropertydescriptor **rationale** The easiest way to create a shallow copy of a generic object could be: ```javascript var shallowCopy

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-02 Thread Brandon Benvie
Further rational: * Symmetry with defineProperty/defineProperties. * One of the benefits of defineProperties (and create) is that they handle errors such that the failure of any individual property doesn't necessarily fail all the remaining ones. It is, of course, possible for a developer to

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-02 Thread Andrea Giammarchi
actually, since `Object.getOwnPropertyDescriptor` accepts `Symbols` too as second argument, the equivalent with current ES6 would be even more prolix than that ```javascript var shallowCopy = Object.create( Object.getPrototypeOf(originalObject),

Re: Object.getOwnPropertyDescriptors(O) ? // plural

2014-03-02 Thread Andrea Giammarchi
Brandon I take your answer as +1, thanks. I've also gisted a possible/basic polyfill here: https://gist.github.com/WebReflection/9317065 Cheers On Sun, Mar 2, 2014 at 5:16 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: actually, since `Object.getOwnPropertyDescriptor` accepts

Array.of

2014-03-02 Thread Mark Volkmann
What is an example of a use case where one would choose to use Array.of instead of the literal array syntax? -- R. Mark Volkmann Object Computing, Inc. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Array.of

2014-03-02 Thread Claude Pache
Le 3 mars 2014 à 04:22, Mark Volkmann r.mark.volkm...@gmail.com a écrit : What is an example of a use case where one would choose to use Array.of instead of the literal array syntax? Here is one case where literal array syntax is not possible: class ImprovedArray extends Array {