tc39 / proposal-collection-normalization

MIT License
41 stars 8 forks source link

Use within WebIDL? #19

Open dead-claudia opened 4 years ago

dead-claudia commented 4 years ago

I did some research trying to figure out what precisely WebIDL would need to move to actual Map/Set subclasses for maplike and setlike, and this appears to be it for read/write collections. Specifically:

What Infra basically mandates is the same kind of workaround that this proposal tries to avoid, just using composition instead of inheritance.

dead-claudia commented 4 years ago

Also, having a hook for read-only maps and sets to modify their data could also be potentially useful, allowing readonly maplike/readonly setlike to also extend from Map and Set respectively.