summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/template-literal/tv-zwnbsp.js
blob: e5bf73574544e5cfe7c170f8f9364fb96d3f8a09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (C) 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 11.1.8.6.1
description: Template values of the zero width no-break space character
info: |
    The zero width no-break space format-control character may be used within
    template literals.
---*/

var callCount;

callCount = 0;
(function(s) {
  callCount++;
  assert.sameValue(
    s[0], 'test', 'TV (specified via unicode escape sequence)'
  );
  assert.sameValue(
    s.raw[0], '\\uFEFFtest', 'TV (specified via unicode escape sequence)'
  );
})`\uFEFFtest`;
assert.sameValue(callCount, 1);

callCount = 0;
(function(s) {
  callCount++;
  assert.sameValue(s[0], 'test', 'TV (specified via literal character)');
  assert.sameValue(
    s.raw[0], 'test', 'TV (specified via literal character)'
  );
})`test`;
assert.sameValue(callCount, 1);

reportCompare(0, 0);