Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading test of value presence in WeakSet/WeakMap #126

Open
oldium opened this issue Jan 21, 2020 · 0 comments
Open

Misleading test of value presence in WeakSet/WeakMap #126

oldium opened this issue Jan 21, 2020 · 0 comments

Comments

@oldium
Copy link

oldium commented Jan 21, 2020

After this assignment:

6| foo |=| null /* remove only reference to foo */

See the following lines:

es6-features/features.txt

Lines 1323 to 1324 in 75bf0b4

6| attachedData.has(foo) === |false|
6| isMarked.has(foo) === |false|

Those basically test if value null is in the map/set, not if foo is still in the map/set. There exists no way to check whether the value is in the map/set when the last reference is lost, so those tests actually do not test what they are trying to show.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant