2015-07-17 17:34:33 +02:00
|
|
|
|
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
2015-03-30 23:36:38 +02:00
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
/*---
|
2015-06-12 17:02:07 +02:00
|
|
|
|
es6id: 11.8.6.1
|
|
|
|
|
description: Template values of line terminator sequences
|
2018-01-05 18:26:51 +01:00
|
|
|
|
info: |
|
2015-06-11 19:19:07 +02:00
|
|
|
|
The TV of TemplateCharacter :: LineTerminatorSequence is the TRV of
|
|
|
|
|
LineTerminatorSequence.
|
2015-03-30 23:36:38 +02:00
|
|
|
|
The TRV of LineTerminatorSequence :: <LF> is the code unit value 0x000A.
|
|
|
|
|
The TRV of LineTerminatorSequence :: <CR> is the code unit value 0x000A.
|
2015-04-15 16:47:15 +02:00
|
|
|
|
The TRV of LineTerminatorSequence :: <LS> is the code unit value 0x2028.
|
|
|
|
|
The TRV of LineTerminatorSequence :: <PS> is the code unit value 0x2029.
|
2015-03-30 23:36:38 +02:00
|
|
|
|
The TRV of LineTerminatorSequence :: <CR><LF> is the sequence consisting of
|
|
|
|
|
the code unit value 0x000A.
|
|
|
|
|
---*/
|
2015-06-11 19:19:07 +02:00
|
|
|
|
|
|
|
|
|
|
2015-03-30 23:36:38 +02:00
|
|
|
|
var calls;
|
|
|
|
|
|
|
|
|
|
calls = 0;
|
|
|
|
|
(function(s) {
|
|
|
|
|
calls++;
|
2015-06-11 19:19:07 +02:00
|
|
|
|
assert.sameValue(s[0], '\n\n\n', 'Line Feed and Carriage Return');
|
2015-04-15 16:47:15 +02:00
|
|
|
|
assert.sameValue(s.raw[0], '\n\n\n', 'Line Feed and Carriage Return');
|
2015-03-30 23:36:38 +02:00
|
|
|
|
})`
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
assert.sameValue(calls, 1);
|
2015-04-15 16:47:15 +02:00
|
|
|
|
|
|
|
|
|
calls = 0;
|
|
|
|
|
(function(cs) {
|
|
|
|
|
calls++;
|
2015-06-11 19:19:07 +02:00
|
|
|
|
assert.sameValue(cs[0], '\u2028', 'Line Separator');
|
2015-04-15 16:47:15 +02:00
|
|
|
|
assert.sameValue(cs.raw[0], '\u2028', 'Line Separator');
|
|
|
|
|
})`
`
|
|
|
|
|
assert.sameValue(calls, 1);
|
|
|
|
|
|
|
|
|
|
calls = 0;
|
|
|
|
|
(function(cs) {
|
|
|
|
|
calls++;
|
2015-06-11 19:19:07 +02:00
|
|
|
|
assert.sameValue(cs[0], '\u2029', 'Paragraph Separator');
|
2015-04-15 16:47:15 +02:00
|
|
|
|
assert.sameValue(cs.raw[0], '\u2029', 'Paragraph Separator');
|
|
|
|
|
})`
`
|
|
|
|
|
assert.sameValue(calls, 1);
|