Re: Destructuring object outside of var declaration

2016-12-14 Thread Jeff Walden
On 11/13/2016 12:33 PM, Isiah Meadows wrote: > Okay. Is it a spec bug then? Throwing a ReferenceError is surprising and odd > IMHO. I think so -- having different sorts of early errors makes it a little less clear what sort of error should be thrown when two early errors of different types are

Re: Destructuring object outside of var declaration

2016-11-15 Thread Boris Zbarsky
On 11/15/16 1:57 PM, Claude Pache wrote: My guess is that Thaddee Tyl was confused by a Chrome DevTools feature, as in: I considered that, but I actually got consistent results both in Chrome's console and in a webpage... -Boris ___ es-discuss

Re: Destructuring object outside of var declaration

2016-11-15 Thread Claude Pache
> Le 14 nov. 2016 à 22:53, Boris Zbarsky a écrit : > >> On 11/13/16 1:28 PM, Thaddee Tyl wrote: >>var foo, bar; >>{foo, bar} = {foo: 2, bar: 3}; >> >> is a "SyntaxError: expected expression, got '='" in Firefox, and *it >> works in Google Chrome*. > > I get

Re: Destructuring object outside of var declaration

2016-11-14 Thread Boris Zbarsky
On 11/13/16 1:28 PM, Thaddee Tyl wrote: var foo, bar; {foo, bar} = {foo: 2, bar: 3}; is a "SyntaxError: expected expression, got '='" in Firefox, and *it works in Google Chrome*. I get "Uncaught SyntaxError: Unexpected token =" in Chrome "56.0.2914.3 dev" and in Chrome "54.0.2840.9"

Re: Destructuring object outside of var declaration

2016-11-13 Thread Isiah Meadows
Okay. Is it a spec bug then? Throwing a ReferenceError is surprising and odd IMHO. On Sun, Nov 13, 2016, 14:45 Allen Wirfs-Brock wrote: > On Nov 13, 2016, at 10:49 AM, Isiah Meadows > wrote: > > Firefox likely has a parser bug (it should never

Re: Destructuring object outside of var declaration

2016-11-13 Thread Allen Wirfs-Brock
> On Nov 13, 2016, at 10:49 AM, Isiah Meadows wrote: > > Firefox likely has a parser bug (it should never throw a ReferenceError in > that situation). > > FireFox is correct, Chrome is wrong. See the second early error rule at

Re: Destructuring object outside of var declaration

2016-11-13 Thread Bob Myers
er 17, 2013 10:06 AM > >> I'm wondering what the best syntax is for object destructuring outside > of > >> a var declaration. For instance, the following works in Firefox > Nightly and > >> Traceur: > >> > >> […] > >> > >>

Re: Destructuring object outside of var declaration

2016-11-13 Thread Isiah Meadows
2013 at 4:27 PM, Brendan Eich <bren...@mozilla.com> wrote: > >> Nathan Wall <mailto:nathan.w...@live.com> > >> September 17, 2013 10:06 AM > >> I'm wondering what the best syntax is for object destructuring outside > of > >> a var declarat

Re: Destructuring object outside of var declaration

2016-11-13 Thread Thaddee Tyl
On Tue, Sep 17, 2013 at 4:27 PM, Brendan Eich <bren...@mozilla.com> wrote: >> Nathan Wall <mailto:nathan.w...@live.com> >> September 17, 2013 10:06 AM >> I'm wondering what the best syntax is for object destructuring outside of >> a var declaration. For inst

Destructuring object outside of var declaration

2013-09-17 Thread Nathan Wall
I'm wondering what the best syntax is for object destructuring outside of a var declaration. For instance, the following works in Firefox Nightly and Traceur: var { a, b } = foo; but the following doesn't: var a, b;{ a, b } = foo; I presume this is because in the second case

Re: Destructuring object outside of var declaration

2013-09-17 Thread Brendan Eich
Nathan Wall mailto:nathan.w...@live.com September 17, 2013 10:06 AM I'm wondering what the best syntax is for object destructuring outside of a var declaration. For instance, the following works in Firefox Nightly and Traceur: var { a, b } = foo; but the following doesn't: var a, b

Re: Destructuring object outside of var declaration

2013-09-17 Thread Brendan Eich
. /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss Nathan Wall mailto:nathan.w...@live.com September 17, 2013 10:06 AM I'm wondering what the best syntax is for object destructuring outside of a var declaration. For instance

Re: Destructuring object outside of var declaration

2013-09-17 Thread Axel Rauschmayer
I say use var/let/const, it's better style; or else suffer a parentheses tax. This is pretty much a non-issue in practice, AFAICT. I don’t think so, either. But error message could give appropriate hints, just in case (beyond the scope of TC39/ECMA-262, but still important, usability-wise).