Debian Codegraph @

js/src/tests/test262/language/expressions/template-literal/tv-zwnbsp.js

raw
1 // Copyright (C) 2014 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 es6id: 11.1.8.6.1
5 description: Template values of the zero width no-break space character
6 info: |
7 The zero width no-break space format-control character may be used within
8 template literals.
9 ---*/
10
11 var callCount;
12
13 callCount = 0;
14 (function(s) {
15 callCount++;
16 assert.sameValue(
17 s[0], 'test', 'TV (specified via unicode escape sequence)'
18 );
19 assert.sameValue(
20 s.raw[0], '\\uFEFFtest', 'TV (specified via unicode escape sequence)'
21 );
22 })`\uFEFFtest`;
23 assert.sameValue(callCount, 1);
24
25 callCount = 0;
26 (function(s) {
27 callCount++;
28 assert.sameValue(s[0], 'test', 'TV (specified via literal character)');
29 assert.sameValue(
30 s.raw[0], 'test', 'TV (specified via literal character)'
31 );
32 })`test`;
33 assert.sameValue(callCount, 1);
34
35 reportCompare(0, 0);