Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Symbol/keyFor/arg-symbol-registry-hit.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 es6id: 19.4.2.5
6 description: Called with Symbol value that exists 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 features: [Symbol]
12 ---*/
13
14 var canonical = Symbol.for('s');
15
16 assert.sameValue(Symbol.keyFor(canonical), 's');