cross-realm.js (757B)
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: 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.keyFor, OSymbol.keyFor); 18 assert.sameValue(OSymbol.keyFor(parent), 'parent'); 19 assert.sameValue(Symbol.keyFor(child), 'child'); 20 21 reportCompare(0, 0);