Debian Codegraph @

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