Re: Type restriction of elements in Array

On Mon, Oct 17, 2011 at 07:27, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> No need for proxies.  Any property with a setter can enforce whatever
> restrictions it wants on the arguments passed to that setter.

You can only have setters for known properties which would only work
for fixed length arrays.

> But since we're talking about "host" objects, why are we excluding proxies,
> anyway, exactly?

...

> That's a really bad antipattern where a failure is reported at a point far
> separated from where it actually happens.  Sometimes that just has to be,
> but in those cases it's a necessary evil, not a desired property.

I'm with you here. These kind of objects would be painful to use if
they do not throw on [[Put]].

I'd rather have painless magical host objects than painful js objects.

-- 
erik

Received on Monday, 17 October 2011 17:51:45 UTC