description.js (623B)
1 // Copyright (C) 2021 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: Assigns the string value to the [[Description]] slot 6 info: | 7 1. Let stringKey be ? ToString(key). 8 [...] 9 4. Let newSymbol be a new unique Symbol value whose [[Description]] value 10 is stringKey. 11 [...] 12 6. Return newSymbol. 13 features: [Symbol, Symbol.prototype.description] 14 ---*/ 15 16 var symbol = Symbol.for({toString: function() { return 'test262'; }}); 17 18 assert.sameValue(symbol.description, 'test262'); 19 20 reportCompare(0, 0);