ljharb at gmail.com
Thu Apr 30 21:57:30 UTC 2015
I don't see how it would be possible in ES6 user code to ever make a
Map/Set or a Map/Set subclass instance immutable, since
`Map.prototype.set.call`/`Set.prototype.add.call` will operate on any
Map/Set-like object's `[[MapData]]`/`[[SetData]]` internal slot. The only
thing I can think of would be using a Proxy to a collection rather than a
I'm probably missing something - can anybody confirm or refute?
On Thu, Apr 30, 2015 at 1:25 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
> On 4/30/15 3:46 PM, C. Scott Ananian wrote:
>> I like the idea of snapshot methods, but they can be implemented in user
>> code using subclasses in ES6.
> Can they? You can't create immutable snapshots in user code afaict...
> 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.
> More likely an internal slot check, not an instanceof check.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss