| 1 |
// Copyright (C) 2016 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
esid: sec-symbol.keyfor |
| 5 |
es6id: 19.4.2.5 |
| 6 |
description: > |
| 7 |
Called with Symbol value that does not exist in the global symbol registry |
| 8 |
info: | |
| 9 |
1. If Type(sym) is not Symbol, throw a TypeError exception. |
| 10 |
2. For each element e of the GlobalSymbolRegistry List (see 19.4.2.1), |
| 11 |
a. If SameValue(e.[[Symbol]], sym) is true, return e.[[Key]]. |
| 12 |
3. Assert: GlobalSymbolRegistry does not currently contain an entry for |
| 13 |
sym. |
| 14 |
4. Return undefined. |
| 15 |
features: [Symbol.iterator, Symbol] |
| 16 |
---*/ |
| 17 |
|
| 18 |
var constructed = Symbol('Symbol.iterator'); |
| 19 |
assert.sameValue(Symbol.keyFor(constructed), undefined, 'constructed symbol'); |
| 20 |
|
| 21 |
assert.sameValue( |
| 22 |
Symbol.keyFor(Symbol.iterator), undefined, 'well-known symbol' |
| 23 |
); |