Debian Codegraph @

js/src/tests/test262/built-ins/Symbol/keyFor/arg-symbol-registry-miss.js

raw
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 description: >
6 Called with Symbol value that does not exist in the global symbol registry
7 info: |
8 1. If Type(sym) is not Symbol, throw a TypeError exception.
9 2. For each element e of the GlobalSymbolRegistry List (see 19.4.2.1),
10 a. If SameValue(e.[[Symbol]], sym) is true, return e.[[Key]].
11 3. Assert: GlobalSymbolRegistry does not currently contain an entry for
12 sym.
13 4. Return undefined.
14 features: [Symbol.iterator, Symbol]
15 ---*/
16
17 var constructed = Symbol('Symbol.iterator');
18 assert.sameValue(Symbol.keyFor(constructed), undefined, 'constructed symbol');
19
20 assert.sameValue(
21 Symbol.keyFor(Symbol.iterator), undefined, 'well-known symbol'
22 );
23
24 reportCompare(0, 0);