Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/String/fromCodePoint/argument-is-Symbol.js

raw
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 es6id: 21.1.2.2
5 description: >
6 Return abrupt from ToNumber(next).
7 info: |
8 String.fromCodePoint ( ...codePoints )
9
10 1. Let codePoints be a List containing the arguments passed to this function.
11 2. Let length be the number of elements in codePoints.
12 3. Let elements be a new List.
13 4. Let nextIndex be 0.
14 5. Repeat while nextIndex < length
15 a. Let next be codePoints[nextIndex].
16 b. Let nextCP be ToNumber(next).
17 c. ReturnIfAbrupt(nextCP).
18 features: [Symbol]
19 ---*/
20
21 assert.throws(TypeError, function() {
22 String.fromCodePoint(Symbol());
23 });
24
25 assert.throws(TypeError, function() {
26 String.fromCodePoint(42, Symbol());
27 });