Thanks, I had missed the `Reflect.construct()` method. One problem with
your solution is that the `Array` iterator methods like `.map()` use
`this.constructor[Symbol.species]` to construct their result, so the
prototype actually needs to be set like this:

```
SubArray.prototype = Object.create(Array.prototype, {
  constructor: {
    value: SubArray,
    writeable: true,
    enumerable: false,
    configurable: false,
  }
})
```

Setting the `constructor` property on the prototype is part of the
MakeConstructor operation (for full parity the `prototype` property should
be defined as non-enumerable, non-configurable as well).
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to