On Thu, Apr 30, 2015 at 12:46 PM, C. Scott Ananian <[email protected]>
wrote:

> I like the idea of snapshot methods, but they can be implemented in user
> code using subclasses in ES6.  I'm particularly interested in the "lock
> down in place" mechanism because it *cannot* be implemented in user code.
>
> And yes, if we had it all to do over again, it would have been nice if the
> Map prototype chain was:
>
> Map instance -> Map.prototype -> ReadOnlyMap.prototype -> null
>
> And clear/set/delete were properties of Map.prototype.
>
> But that would still have required an explicit test in
> Map.clear/set/delete to ensure that they were operating on an instanceof
> Map and not just on a ReadOnlyMap.
>

Yes, it does not save a test. Rather it only rationalizes the types of
objects so that the type of an immutable or readOnly collection does not
include useless mutation methods; that's all.




>   --scott
> ​
>



-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to