Skip to content

WeakMap remove .clear()? #1539

Closed
Closed
@kitsonk

Description

@kitsonk

Are there any plans to remove .clear() from WeakMap to make the implementation compliant with the specification? Other engines have removed it and aligned to the final spec. Having deprecated/removed API isn't a zero sum game as it maintaining the feature in perpetuity can have future consequences and developers can latch onto functionality that they shouldn't. Wouldn't it be better to "break" anyone mistanklingly using this API now than in 10 years.

I would have also assumed by the nature of the ECMAScript WeakMap that there could be an optimisation by not having to track the pointers in the map directly in the WeakMap to support clear, making the GC algorithm/detection more efficient.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions