1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 esid: sec-weakset-iterable
6 Returns the new WeakSet adding Object values from the iterable parameter.
8 WeakSet ( [ _iterable_ ] )
10 d. Let _status_ be Completion(Call(_adder_, _set_, « _nextValue_ »)).
12 WeakSet.prototype.add ( _value_ ):
13 6. Append _value_ as the last element of _entries_.
20 var add = WeakSet.prototype.add;
21 WeakSet.prototype.add = function(value) {
23 return add.call(this, value);
25 var s = new WeakSet([first, second]);
27 assert.sameValue(added.length, 2, 'Called WeakSet#add for each object');
28 assert.sameValue(added[0], first, 'Adds object in order - first');
29 assert.sameValue(added[1], second, 'Adds object in order - second');