From 219ad6ff014b57d11efcb05a8f30d22a73fe5671 Mon Sep 17 00:00:00 2001 From: jugglinmike Date: Thu, 13 May 2021 21:16:43 -0400 Subject: [PATCH] Add test for [[Description]] from `Symbol.for` (#2970) * Add test for [[Description]] from `Symbol.for` * fixup! Add test for [[Description]] from `Symbol.for` --- test/built-ins/Symbol/for/description.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/built-ins/Symbol/for/description.js diff --git a/test/built-ins/Symbol/for/description.js b/test/built-ins/Symbol/for/description.js new file mode 100644 index 0000000000..7665067254 --- /dev/null +++ b/test/built-ins/Symbol/for/description.js @@ -0,0 +1,18 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-symbol.for +description: Assigns the string value to the [[Description]] slot +info: | + 1. Let stringKey be ? ToString(key). + [...] + 4. Let newSymbol be a new unique Symbol value whose [[Description]] value + is stringKey. + [...] + 6. Return newSymbol. +features: [Symbol, Symbol.prototype.description] +---*/ + +var symbol = Symbol.for({toString: function() { return 'test262'; }}); + +assert.sameValue(symbol.description, 'test262');