*.empty Idea

Mark S. Miller erights at google.com
Thu Apr 30 19:48:35 UTC 2015


On Thu, Apr 30, 2015 at 12:46 PM, C. Scott Ananian <ecmascript at cscott.net>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150430/126aedab/attachment-0001.html>


More information about the es-discuss mailing list