bug-1994871-2.js (332B)
1 // Check a gray symbol keeps a weak map entry alive. 2 3 let wm = new WeakMap(); 4 s = Symbol(); 5 wm.set(s, {}); 6 gc(); 7 assertEq(nondeterministicGetWeakMapSize(wm), 1); 8 9 grayRoot().push(s); 10 s = undefined; 11 gc(); 12 assertEq(nondeterministicGetWeakMapSize(wm), 1); 13 14 grayRoot().length = 0; 15 gc(); 16 assertEq(nondeterministicGetWeakMapSize(wm), 0);