super() on class that extends

Allen Wirfs-Brock allen at
Sat Apr 11 02:54:31 UTC 2015

> On Apr 10, 2015, at 10:29 PM, Axel Rauschmayer <axel at> wrote:
> No engine has implemented subclassing of `Array`, yet: <>
> 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 ``.

note totally true:

class SubArray extends Array {
   constructor(…args) {
      let newObj = new Array(…args);
      newObj.__proto__ = SubArray.prototype;  //or
      return newObj
    subclassMethiod() {}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list