Add test for [[Description]] from `Symbol.for` (#2970)

* Add test for [[Description]] from `Symbol.for`

* fixup! Add test for [[Description]] from `Symbol.for`
This commit is contained in:
jugglinmike 2021-05-13 21:16:43 -04:00 committed by GitHub
parent 4f50cbfc77
commit 219ad6ff01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -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');