tv-no-substitution.js (977B)
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.8.6.1 5 description: Template values of templates without substitution patterns 6 info: | 7 The TV and TRV of NoSubstitutionTemplate :: `` is the empty code unit 8 sequence. 9 The TV of NoSubstitutionTemplate :: ` TemplateCharacters ` is the TV of 10 TemplateCharacters. 11 The TRV of NoSubstitutionTemplate :: ` TemplateCharacters ` is the TRV of 12 TemplateCharacters. 13 ---*/ 14 15 var calls; 16 17 calls = 0; 18 (function(s) { 19 calls++; 20 assert.sameValue(s[0], '', 'Template value (empty)'); 21 assert.sameValue(s.raw[0], '', 'Template raw value (empty)'); 22 })``; 23 assert.sameValue(calls, 1); 24 25 calls = 0; 26 (function(s) { 27 calls++; 28 assert.sameValue(s[0], 'foo', 'Template value (with content)'); 29 assert.sameValue(s.raw[0], 'foo', 'Template raw value (with content)'); 30 })`foo`; 31 assert.sameValue(calls, 1); 32 33 reportCompare(0, 0);