summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/WeakSet/prototype/add/adds-object-element.js
blob: 89c946b92347e90269bed269dbafe173775a90da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 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.add
description: >
  Adds an Object value.
info: |
  WeakSet.prototype.add ( _value_ )
  6. Append _value_ as the last element of _entries_.
features: [WeakSet]
---*/

var s = new WeakSet();
var foo = {};
var bar = {};
var baz = {};

s.add(foo);
s.add(bar);
s.add(baz);

assert(s.has(foo));
assert(s.has(bar));
assert(s.has(baz));

reportCompare(0, 0);