Skip to content

Commit 219ad6f

Browse files
authored
Add test for [[Description]] from Symbol.for (#2970)
* Add test for [[Description]] from `Symbol.for` * fixup! Add test for [[Description]] from `Symbol.for`
1 parent 4f50cbf commit 219ad6f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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');

0 commit comments

Comments
 (0)