| 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-constructor |
| 5 |
es6id: 19.4.1 |
| 6 |
description: The first argument is coerced to a String value (from a Symbol) |
| 7 |
info: | |
| 8 |
1. If NewTarget is not undefined, throw a TypeError exception. |
| 9 |
2. If description is undefined, let descString be undefined. |
| 10 |
2. Else, let descString be ? ToString(description). |
| 11 |
3. Return a new unique Symbol value whose [[Description]] value is |
| 12 |
descString. |
| 13 |
features: [Symbol] |
| 14 |
---*/ |
| 15 |
|
| 16 |
var s = Symbol('1'); |
| 17 |
|
| 18 |
assert.throws(TypeError, function() { |
| 19 |
Symbol(s); |
| 20 |
}); |