… which I would be very happy to discuss, nonetheless. It's indeed a little painful to work with derived built-ins if you can't use literals.
Could we maybe have a syntax that, for its current block, declares how to
interpret literals? Maybe something along the lines of:
```js
class MyArray extends Array {};
Array as MyArray;
const array = [1, 2, 3];
assert(array instanceof MyArray);
```
On Wednesday, July 5, 2017 8:47:53 PM CEST kdex wrote:
> Overriding literals with a derived class is an entirely different problem.
> :)
> On Wednesday, July 5, 2017 8:42:39 PM CEST Boris Cherny wrote:
> > I tried that approach, but it doesn’t work when creating objects via
> > literal notation ([], {}). A bit clumsy to have to write “new
> > Array(1,2,3)", or “Array(1,2,3)” every time.
> > _______________________________________________ es-discuss mailing list
> > [email protected]
> > https://mail.mozilla.org/listinfo/es-discuss
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

