| 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.4 |
| 5 |
description: > |
| 6 |
Returns abrupt completion from ToLength(template.raw.length). |
| 7 |
info: | |
| 8 |
21.1.2.4 String.raw ( template , ...substitutions ) |
| 9 |
|
| 10 |
1. Let substitutions be a List consisting of all of the arguments passed to |
| 11 |
this function, starting with the second argument. If fewer than two arguments |
| 12 |
were passed, the List is empty. |
| 13 |
2. Let numberOfSubstitutions be the number of elements in substitutions. |
| 14 |
3. Let cooked be ToObject(template). |
| 15 |
4. ReturnIfAbrupt(cooked). |
| 16 |
5. Let raw be ToObject(Get(cooked, "raw")). |
| 17 |
6. ReturnIfAbrupt(raw). |
| 18 |
7. Let literalSegments be ToLength(Get(raw, "length")). |
| 19 |
8. ReturnIfAbrupt(literalSegments). |
| 20 |
features: [Symbol] |
| 21 |
---*/ |
| 22 |
|
| 23 |
assert.throws(TypeError, function() { |
| 24 |
String.raw({ |
| 25 |
raw: { |
| 26 |
length: Symbol(1) |
| 27 |
} |
| 28 |
}); |
| 29 |
}); |