> On Mar 30, 2015, at 10:12 AM, Axel Rauschmayer <a...@rauschma.de> wrote:
> 
>>> It doesn’t seem that big of a deal, but one risk is: people mistaking a 
>>> class for a constructor, trying to subclass it as if it were a constructor 
>>> and things failing silently.
>>> 
>> Can you give an example of what you mean?
> 
> ```js
> class MySuperClass {}
> 
> // This function assumes that MySuperClass is an ES5 constructor function
> function MySubConstructor(foo) {
>     MySuperClass.call(this);
>     this.foo = foo;
> }
> MySubConstructor.prototype = Object.create(MySuperClass.prototype);
> MySubConstructor.prototype.constructor = MySubConstructor;
> ```

so if MySuperCall didn’t have the throw on [[Call]] behavior the above would 
work just fine.

Allen

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to