Allen Wirfs-Brock (2015-04-11T02:54:31.000Z)
d at domenic.me (2015-04-19T23:39:23.577Z)
On Apr 10, 2015, at 10:29 PM, Axel Rauschmayer <axel at rauschma.de> wrote: > And, as Sebastian mentioned, you can’t transpile it, because it depends on the cooperation of `Array`: it becomes the base constructor and allocates an exotic array instance (with special handling for `length` etc.) whose prototype is `new.target`. not totally true: ```js class SubArray extends Array { constructor(…args) { let newObj = new Array(…args); newObj.__proto__ = SubArray.prototype; //or new.target.prototype return newObj } subclassMethiod() {} } ```
d at domenic.me (2015-04-19T23:39:16.710Z)
On Apr 10, 2015, at 10:29 PM, Axel Rauschmayer <axel at rauschma.de> wrote: > And, as Sebastian mentioned, you can’t transpile it, because it depends on the cooperation of `Array`: it becomes the base constructor and allocates an exotic array instance (with special handling for `length` etc.) whose prototype is `new.target`. note totally true: ```js class SubArray extends Array { constructor(…args) { let newObj = new Array(…args); newObj.__proto__ = SubArray.prototype; //or new.target.prototype return newObj } subclassMethiod() {} } ```