rse / es6-features

ECMAScript 6: Feature Overview & Comparison

Home Page: https://rse.github.io/es6-features/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misleading test of value presence in WeakSet/WeakMap

oldium opened this issue · comments

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.