Debian Codegraph @

js/src/tests/test262/built-ins/String/symbol-wrapping.js

raw
1 // Copyright (C) 2013 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-string-constructor
5 description: Symbol value may not be wrapped
6 info: |
7 1. If no arguments were passed to this function invocation, let s be "".
8 2. Else,
9 a. If NewTarget is undefined and Type(value) is Symbol, return
10 SymbolDescriptiveString(value).
11 b. Let s be ? ToString(value).
12 features: [Symbol]
13 ---*/
14
15 var s = Symbol('66');
16
17 assert.throws(TypeError, function() {
18 new String(s);
19 });
20
21 reportCompare(0, 0);