re initializing const throws error which is unable to catch

2015-02-14 Thread Boopathi Rajaa
http://jsbin.com/quvujecuro/5/edit?html,js,console Is it the problem with implementation or am I doing something wrong here in terms of philosophy that redeclaring should throw independent of try..catch block around it ? - Boopathi ___ es-discuss

Re: re initializing const throws error which is unable to catch

2015-02-14 Thread Kevin Smith
It is a compile-time error to have a var declaration to conflict with or shadow a block scope declaration. On Feb 14, 2015 1:31 PM, Boopathi Rajaa legend.r...@gmail.com wrote: http://jsbin.com/quvujecuro/5/edit?html,js,console Is it the problem with implementation or am I doing something

extends null

2015-02-14 Thread Axel Rauschmayer
If I’m reading the latest spec draft correctly then ```js class C extends null { } ``` produces the following result: 1. Constructor kind: derived 2. Prototype of `C`: `Function.prototype` 3. Prototype of `C.prototype`: `null` Neither #2 nor #3 seems very useful: * #2 means that a

Re: extends null

2015-02-14 Thread Axel Rauschmayer
But it’s not an error! Either of the following two classes fail later, when you instantiate them, but not right away. ```js const X = null; class C extends X {} class D extends null {} ``` I’m arguing that both produce weird constructors. I’d much prefer an early error. Or dynamically

Re: Suggestion: for-of-and loops

2015-02-14 Thread Kevin Smith
Have you tried writing a combinator which does exactly that? Take a look at zip in python. On Feb 14, 2015 2:52 PM, Brian Blakely anewpage.me...@gmail.com wrote: Apologies if this isn't the correct forum for this, and please point me the right way if not. The motivation is that it would be

Re: extends null

2015-02-14 Thread Mark S. Miller
On Sat, Feb 14, 2015 at 1:45 PM, Axel Rauschmayer a...@rauschma.de wrote: On 14 Feb 2015, at 22:26, Mark S. Miller erig...@google.com wrote: On Sat, Feb 14, 2015 at 1:21 PM, Axel Rauschmayer a...@rauschma.de wrote: But it’s not an error! Either of the following two classes fail later,

Re: extends null

2015-02-14 Thread Mark S. Miller
On Sat, Feb 14, 2015 at 1:21 PM, Axel Rauschmayer a...@rauschma.de wrote: But it’s not an error! Either of the following two classes fail later, when you instantiate them, but not right away. ```js const X = null; class C extends X {} class D extends null {} ``` I didn't mean to imply