Skip to content

Commit

Permalink
Add WeakMap and WeakSet features to tests affected by symbols-as-weak…
Browse files Browse the repository at this point in the history
…map-keys

Originally taken from Rick's draft commit for symbols-as-weakmap-keys
tests.
  • Loading branch information
rwaldron authored and Ms2ger committed Oct 12, 2022
1 parent 145c440 commit 735f95a
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions test/built-ins/WeakMap/iterable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ info: |
9. Repeat
k. Let status be Call(adder, map, «k.[[value]], v.[[value]]»).
l. If status is an abrupt completion, return IteratorClose(iter, status).
features: [WeakMap]
---*/

var first = {};
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/WeakMap/iterator-items-are-not-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ info: |
i. Let error be Completion{[[type]]: throw, [[value]]: a newly created
TypeError object, [[target]]:empty}.
ii. Return IteratorClose(iter, error).
features: [Symbol]
features: [Symbol, WeakMap]
---*/

assert.throws(TypeError, function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ info: |
ii. Set p.[[value]] to empty.
iii. Return true.
...
features: [WeakMap]
---*/

var foo = {};
Expand Down
1 change: 1 addition & 0 deletions test/built-ins/WeakMap/prototype/delete/delete-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ info: |
ii. Set p.[[value]] to empty.
iii. Return true.
...
features: [WeakMap]
---*/

var foo = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ info: |
WeakMap.prototype.delete ( value )
5. If Type(key) is not Object, return false.
features: [Symbol]
features: [Symbol, WeakMap]
---*/

var map = new WeakMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ info: |
...
7. Return false.
features: [WeakMap]
---*/

var map = new WeakMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ info: |
slot.
5. If Type(key) is not Object, return undefined.
...
features: [Symbol]
features: [Symbol, WeakMap]
---*/

var map = new WeakMap();
Expand Down
1 change: 1 addition & 0 deletions test/built-ins/WeakMap/prototype/get/returns-undefined.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ info: |
p.[[value]].
7. Return undefined.
...
features: [WeakMap]
---*/

var map = new WeakMap();
Expand Down
1 change: 1 addition & 0 deletions test/built-ins/WeakMap/prototype/get/returns-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ info: |
a. If p.[[key]] is not empty and SameValue(p.[[key]], key) is true, return
p.[[value]].
...
features: [WeakMap]
---*/

var foo = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ info: |
WeakMap.prototype.has ( value )
5. If Type(key) is not Object, return false.
features: [Symbol]
features: [Symbol, WeakMap]
---*/

var map = new WeakMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info: |
...
7. Return false.
features: [WeakMap]
---*/

var foo = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ info: |
a. If p.[[key]] is not empty and SameValue(p.[[key]], key) is true, return
true.
...
features: [WeakMap]
---*/

var foo = {};
Expand Down
1 change: 1 addition & 0 deletions test/built-ins/WeakMap/prototype/set/adds-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ info: |
7. Let p be the Record {[[key]]: key, [[value]]: value}.
8. Append p as the last element of entries.
...
features: [WeakMap]
---*/

var map = new WeakMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info: |
WeakMap.prototype.set ( key, value )
5. If Type(key) is not Object, throw a TypeError exception.
features: [Symbol]
features: [Symbol, WeakMap]
---*/

var s = new WeakMap();
Expand Down
1 change: 1 addition & 0 deletions test/built-ins/WeakSet/iterable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ info: |
9. Repeat
f. Let status be Call(adder, set, «nextValue»).
g. If status is an abrupt completion, return IteratorClose(iter, status).
features: [WeakSet]
---*/

var first = {};
Expand Down
1 change: 1 addition & 0 deletions test/built-ins/WeakSet/prototype/add/adds-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ info: |
...
7. Append value as the last element of entries.
...
features: [WeakSet]
---*/

var s = new WeakSet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info: |
WeakSet.prototype.add ( value )
4. If Type(value) is not Object, throw a TypeError exception.
features: [Symbol]
features: [Symbol, WeakSet]
---*/

var s = new WeakSet();
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/WeakSet/prototype/delete/delete-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ info: |
value is empty.
ii. Return true.
...
features: [WeakSet]
---*/

var foo = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ info: |
WeakSet.prototype.delete ( value )
4. If Type(value) is not Object, return false.
features: [Symbol]
features: [Symbol, WeakSet]
---*/

var s = new WeakSet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ info: |
WeakSet.prototype.has ( value )
5. If Type(value) is not Object, return false.
features: [Symbol]
features: [Symbol, WeakSet]
---*/

var s = new WeakSet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info: |
...
7. Return false.
features: [WeakSet]
---*/

var foo = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ info: |
6. Repeat for each e that is an element of entries,
a. If e is not empty and SameValue(e, value) is true, return true.
...
features: [WeakSet]
---*/

var foo = {};
Expand Down

0 comments on commit 735f95a

Please sign in to comment.