| 1 |
// Copyright (C) 2013 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
es6id: 19.4 |
| 5 |
description: > |
| 6 |
Symbol as Set entry |
| 7 |
features: [Symbol, Set] |
| 8 |
---*/ |
| 9 |
var set = new Set(); |
| 10 |
var sym = Symbol(); |
| 11 |
|
| 12 |
set.add(sym); |
| 13 |
|
| 14 |
assert.sameValue(set.size, 1, "The value of `set.size` is `1`, after executing `set.add(sym)`"); |
| 15 |
assert.sameValue(set.has(sym), true, "`set.has(sym)` returns `true`"); |
| 16 |
assert.sameValue(set.delete(sym), true, "`set.delete(sym)` returns `true`"); |
| 17 |
assert.sameValue(set.size, 0, "The value of `set.size` is `0`"); |