Re: async/await improvements

2014-11-14 Thread Marius Gundersen
On Thu, Nov 13, 2014 at 7:42 PM, Anne van Kesteren ann...@annevk.nl wrote: http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Sep/thread.html#msg24 It seems in scope for the specification that defines window.onerror... Someone is working on standardizing parts of the console API

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Andrea Giammarchi
As quick parenthesis, I do hope the potentially evil code I've written will be possible in the future, as universal solution to `undefined is not defined` error in development code. evil is never necessarily evil, going with prohibitionism won't make anyone happy. About `Array.isArray` though, I

RE: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Domenic Denicola
From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Tom Van Cutsem Is the `length` invariant really the dominant meaning JS developers attribute to Array.isArray? I think to most developers Array.isArray(obj) returning true means that it's safe to call the array utilities

RE: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread MichaƂ Wadas
Hai. Why not Symbol.isArray? To me the most interesting question is how to create objects that get JSON-stringified as [], not {}. Some sort of symbol-based mechanism makes sense for that, IMO... toJSON method. `JSON.stringify({toJSON: () = [2,3,4,5]})`

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Kevin Smith
This is really interesting. It does argue for some kind of redefinition of Array.isArray to return is this an instance of some %ArrayPrototype% in some realm? Yeah, my guess would be that if (Array.isArray(obj) === true), then the user will infer that one or both of the following is true: -

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Allen Wirfs-Brock
On Nov 13, 2014, at 5:02 PM, Brendan Eich wrote: Allen Wirfs-Brock wrote: We might redefine Array.isArray to be based upon testing for @@isConcatSpreadable but that potentially would give different results for legacy uses that did __proto__ hacking such as I mentioned in my previous

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Allen Wirfs-Brock
On Nov 14, 2014, at 4:53 AM, Domenic Denicola wrote: From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Tom Van Cutsem Is the `length` invariant really the dominant meaning JS developers attribute to Array.isArray? I think to most developers Array.isArray(obj)

Re: Grammar question about ArrowFormalParameters

2014-11-14 Thread Allen Wirfs-Brock
On Nov 13, 2014, at 7:53 PM, Cyrus Najmabadi wrote: Specifically, while the spec says that : SomeProd[Yield,GeneratorParameter] Is equivalent to: 1) SomeProd 2) SomeProd_Yield 3) SomeProd_GeneratorParameter 4) SomeProd_Yield_GeneratorParameter

RE: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Domenic Denicola
From: Allen Wirfs-Brock [mailto:al...@wirfs-brock.com] What do you mean by is an instance of some %ArrayPrototype%? Do you mean that it has some %ArratPrototype% in it's prototype chain? Yeah, more or less. A realm-independent instanceof. This makes sense also from the historical

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Allen Wirfs-Brock
On Nov 14, 2014, at 11:41 AM, Domenic Denicola wrote: From: Allen Wirfs-Brock [mailto:al...@wirfs-brock.com] What do you mean by is an instance of some %ArrayPrototype%? Do you mean that it has some %ArratPrototype% in it's prototype chain? Yeah, more or less. A realm-independent

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Tom Van Cutsem
2014-11-14 21:00 GMT+01:00 Allen Wirfs-Brock al...@wirfs-brock.com: On Nov 14, 2014, at 11:41 AM, Domenic Denicola wrote: Yeah, more or less. A realm-independent instanceof. This makes sense also from the historical perspective that `Array.isArray` was meant to provide a cross-realm

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Brendan Eich
Tom Van Cutsem wrote: No really, it was a way to expose a test of the [[Class]] internal property. That test wasn't dependent upon the [[Prototype]] chain. I think what Domenic was saying is that Array.isArray used such a test *because* instanceof Array didn't work reliably

RE: Grammar question about ArrowFormalParameters

2014-11-14 Thread Cyrus Najmabadi
Perfect. -- Cyrus From: Allen Wirfs-Brock [mailto:al...@wirfs-brock.com] Sent: Friday, November 14, 2014 9:21 AM To: Cyrus Najmabadi Cc: Jason Freeman; es-discuss list Subject: Re: Grammar question about ArrowFormalParameters On Nov 13, 2014, at 7:53 PM, Cyrus Najmabadi wrote:

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Tom Van Cutsem
2014-11-13 22:35 GMT+01:00 Tom Van Cutsem tomvc...@gmail.com: My intuition is that Array.isArray is often used to branch based on whether code received just one versus a collection of values. E.g. a function may take a single parameter that can be bound to either a single value or a

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Jeremy Martin
I don't have the data to back this up, but I would argue that the developer community has essentially adopted `Array.isArray()` as a sane replacement for `Object.prototype.toString.call(maybeArray) === '[object Array]'`. I realize this forum doesn't have the luxury of *not* considering the

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Tom Van Cutsem
2014-11-14 21:52 GMT+01:00 Jeremy Martin jmar...@gmail.com: Allen's previous comments: Proxies are not transparent forwarders! In particular their default handling of the `this` value on method invokes will break any built-in method that needs to access internal slots of an object.

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Brendan Eich
Tom Van Cutsem wrote: 2014-11-14 21:52 GMT+01:00 Jeremy Martin jmar...@gmail.com mailto:jmar...@gmail.com: Allen's previous comments: Proxies are not transparent forwarders! In particular their default handling of the `this` value on method invokes will break any

Re: Array.isArray(new Proxy([], {})) should be false (Bug 1096753)

2014-11-14 Thread Jeremy Martin
(Mostly) transparent forwarding seems to be one of the more compelling and generally useful characteristics of Proxies. I have to lean heavily on the deeper knowledge of the group here, but *if* `new Proxy([], {})` otherwise behaves like a bonafide array when you treat it like one, then it would