Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ var foo = Symbol('a description');
var bar = Symbol('a description');
var map = new WeakMap();

assert.sameValue(map.has(foo), false, 'Map is initially empty of regular symbol');
assert.sameValue(map.has(Symbol.hasInstance), false, 'Map is initially empty of well-known symbol');
assert.sameValue(map.has(foo), false, 'WeakMap is initially empty of regular symbol');
assert.sameValue(map.has(Symbol.hasInstance), false, 'WeakMap is initially empty of well-known symbol');

map.set(foo, 1);
assert.sameValue(map.has(bar), false, "Symbols with the same description don't alias each other");

map.delete(foo);
assert.sameValue(map.has(foo), false, 'Map is empty again of regular symbol after deleting');
assert.sameValue(map.has(foo), false, 'WeakMap is empty again of regular symbol after deleting');

map.set(Symbol.hasInstance, 2);
map.delete(Symbol.hasInstance);
assert.sameValue(map.has(Symbol.hasInstance), false, 'Map is empty again of well-known symbol after deleting');
assert.sameValue(map.has(Symbol.hasInstance), false, 'WeakMap is empty again of well-known symbol after deleting');
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ var foo = Symbol('a description');
var bar = Symbol('a description');
var s = new WeakSet();

assert.sameValue(s.has(foo), false, 'Set is initially empty of regular symbol');
assert.sameValue(s.has(Symbol.hasInstance), false, 'Set is initially empty of well-known symbol');
assert.sameValue(s.has(foo), false, 'WeakSet is initially empty of regular symbol');
assert.sameValue(s.has(Symbol.hasInstance), false, 'WeakSet is initially empty of well-known symbol');

s.add(foo);
assert.sameValue(s.has(bar), false, 'Symbols with the same description are not aliased to each other');

s.delete(foo);
assert.sameValue(s.has(foo), false, 'Set is again empty of regular symbol after deleting');
assert.sameValue(s.has(foo), false, 'WeakSet is again empty of regular symbol after deleting');
s.delete(Symbol.hasInstance);
assert.sameValue(s.has(Symbol.hasInstance), false, 'Set is again empty of well-known symbol after deleting');
assert.sameValue(s.has(Symbol.hasInstance), false, 'WeakSet is again empty of well-known symbol after deleting');
Loading