diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-object-entry.js')
-rw-r--r-- | js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-object-entry.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-object-entry.js b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-object-entry.js new file mode 100644 index 0000000000..419c0e9d11 --- /dev/null +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/delete-object-entry.js @@ -0,0 +1,28 @@ +// 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 that is an Object +info: | + WeakSet.prototype.delete ( _value_ ) + 4. Let _entries_ be the List that is _S_.[[WeakSetData]]. + 5. For each element _e_ of _entries_, do + 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*. +features: [WeakSet] +---*/ + +var foo = {}; +var s = new WeakSet(); + +s.add(foo); + +var result = s.delete(foo); + +assert.sameValue(s.has(foo), false); +assert.sameValue(result, true, 'WeakSet#delete returns true'); + +reportCompare(0, 0); |