diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/tests/test262/language/literals/string/line-continuation-single.js | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/literals/string/line-continuation-single.js')
-rw-r--r-- | js/src/tests/test262/language/literals/string/line-continuation-single.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/literals/string/line-continuation-single.js b/js/src/tests/test262/language/literals/string/line-continuation-single.js new file mode 100644 index 0000000000..6c0a5184bf --- /dev/null +++ b/js/src/tests/test262/language/literals/string/line-continuation-single.js @@ -0,0 +1,62 @@ +// Copyright (C) 2018 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-literals-string-literals +description: > + Line terminators may occur within string literals as part of a |LineContinuation| + to produce the empty code points sequence. +info: | + 11.8.4 String Literals + + StringLiteral :: + `"` DoubleStringCharacters? `"` + `'` SingleStringCharacters? `'` + + SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters? + + SingleStringCharacter :: + SourceCharacter but not one of `'` or `\` or LineTerminator + <LS> + <PS> + `\` EscapeSequence + LineContinuation + + LineContinuation :: + `\` LineTerminatorSequence + + 11.3 Line Terminators + + LineTerminatorSequence :: + <LF> + <CR> [lookahead != <LF>] + <LS> + <PS> + <CR> <LF> + + 11.8.4.2 Static Semantics: SV + + The SV of SingleStringCharacter :: LineContinuation is the empty code unit sequence. +---*/ + +// LineTerminatorSequence :: <LF> +assert.sameValue('\ +', ''); + +// LineTerminatorSequence :: <CR> [lookahead ≠ <LF>] +assert.sameValue('\
', ''); + +// LineTerminatorSequence :: <LS> +// <LS> is U+2028 LINE SEPARATOR; UTF8(0x2028) = 0xE2 0x80 0xA8 +assert.sameValue('\
', ''); + +// LineTerminatorSequence :: <PS> +// <PS> is U+2029 PARAGRAPH SEPARATOR; UTF8(0x2029) = 0xE2 0x80 0xA9 +assert.sameValue('\
', ''); + +// LineTerminatorSequence :: <CR> <LF> +assert.sameValue('\
+', ''); + +reportCompare(0, 0); |