Axel Rauschmayer (2015-02-14T20:52:31.000Z)
d at domenic.me (2015-02-21T00:44:45.227Z)
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 super-constructor call is allowed but throws an exception, because `Function.prototype` is not constructible. The default constructor will perform a super-constructor call. As a result, you are forced to explicitly return an object from the constructor if you don’t want an exception to be thrown. * \#3 means that the constructor doesn’t even create objects whose prototype is `null`, but objects whose prototype is an object whose prototype is `null`. Therefore my question: is this useful for anything? Can’t `extends null` be turned into something useful? Even treating `extends null` as equivalent to a missing `extends` clause seems preferable.
dignifiedquire at gmail.com (2015-02-17T19:55:28.764Z)
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 super-constructor call is allowed but throws an exception, because `Function.prototype` is not constructible. The default constructor will perform a super-constructor call. As a result, you are forced to explicitly return an object from the constructor if you don’t want an exception to be thrown. * \#3 means that the constructor doesn’t even create objects whose prototype is `null`, but objects whose prototype is an object whose prototype is `null`. Therefore my question: is this useful for anything? Can’t `extends null` be turned into something useful? Even treating `extends null` as equivalent to a missing `extends` clause seems preferable. Thanks! Axel