summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-entry-initial-iterable.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-entry-initial-iterable.js')
-rw-r--r--js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-entry-initial-iterable.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-entry-initial-iterable.js b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-entry-initial-iterable.js
new file mode 100644
index 0000000000..be17a549fa
--- /dev/null
+++ b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-entry-initial-iterable.js
@@ -0,0 +1,29 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-weakset.prototype.delete
+description: >
+ Delete an entry from initial iterable.
+info: |
+ WeakSet.prototype.delete ( value )
+
+ ...
+ 5. Let entries be the List that is the value of S’s [[WeakSetData]] internal
+ slot.
+ 6. Repeat for each e that is an element of entries,
+ a. If e is not empty and SameValue(e, value) is true, then
+ i. Replace the element of entries whose value is e with an element whose
+ value is empty.
+ ii. Return true.
+ ...
+---*/
+
+var foo = {};
+var s = new WeakSet([foo]);
+
+var result = s.delete(foo);
+
+assert.sameValue(s.has(foo), false);
+assert.sameValue(result, true, 'WeakSet#delete returns true');
+
+reportCompare(0, 0);