| 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: 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.keyFor, OSymbol.keyFor); |
| 19 |
assert.sameValue(OSymbol.keyFor(parent), 'parent'); |
| 20 |
assert.sameValue(Symbol.keyFor(child), 'child'); |