Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Symbol/for/cross-realm.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.for
5 es6id: 19.4.2.1
6 description: Global symbol registry is shared by all realms
7 info: |
8 The GlobalSymbolRegistry is a List that is globally available. It is shared
9 by all realms. Prior to the evaluation of any ECMAScript code it is
10 initialized as a new empty List.
11 features: [cross-realm, Symbol]
12 ---*/
13
14 var OSymbol = $262.createRealm().global.Symbol;
15 var parent = Symbol.for('parent');
16 var child = OSymbol.for('child');
17
18 assert.notSameValue(Symbol.for, OSymbol.for);
19 assert.sameValue(parent, OSymbol.for('parent'));
20 assert.sameValue(Symbol.for('child'), child);