-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unescaped paragraph and line separators in string literal (#53869)
Co-authored-by: Liviu Gheorghe <[email protected]> Co-authored-by: Jake Bailey <[email protected]>
- Loading branch information
1 parent
e9af22a
commit e654f96
Showing
5 changed files
with
223 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/baselines/reference/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//// [tests/cases/conformance/es2019/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts] //// | ||
|
||
//// [allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts] | ||
// Strings containing unescaped line / paragraph separators | ||
// Using both single quotes, double quotes and template literals | ||
|
||
var stringContainingUnescapedLineSeparator1 = " STRING_CONTENT "; | ||
var stringContainingUnescapedParagraphSeparator1 = " STRING_CONTENT "; | ||
|
||
|
||
var stringContainingUnescapedLineSeparator2 = ' STRING_CONTENT '; | ||
var stringContainingUnescapedParagraphSeparator2 = ' STRING_CONTENT '; | ||
|
||
|
||
var stringContainingUnescapedLineSeparator3 = ` STRING_CONTENT `; | ||
var stringContainingUnescapedParagraphSeparator3 = ` STRING_CONTENT `; | ||
|
||
// Array of unescaped line / paragraph separators | ||
|
||
var arr = [ | ||
" STRING_CONTENT ", | ||
" STRING_CONTENT ", | ||
"STRING_CONTENT ", | ||
" STRING_CONTENT", | ||
`\ `, | ||
' ' | ||
]; | ||
|
||
//// [allowUnescapedParagraphAndLineSeparatorsInStringLiteral.js] | ||
// Strings containing unescaped line / paragraph separators | ||
// Using both single quotes, double quotes and template literals | ||
var stringContainingUnescapedLineSeparator1 = " STRING_CONTENT "; | ||
var stringContainingUnescapedParagraphSeparator1 = " STRING_CONTENT "; | ||
var stringContainingUnescapedLineSeparator2 = ' STRING_CONTENT '; | ||
var stringContainingUnescapedParagraphSeparator2 = ' STRING_CONTENT '; | ||
var stringContainingUnescapedLineSeparator3 = "\u2028STRING_CONTENT\u2028"; | ||
var stringContainingUnescapedParagraphSeparator3 = "\u2029STRING_CONTENT\u2029"; | ||
// Array of unescaped line / paragraph separators | ||
var arr = [ | ||
" STRING_CONTENT ", | ||
" STRING_CONTENT ", | ||
"STRING_CONTENT ", | ||
" STRING_CONTENT", | ||
"", | ||
' ' | ||
]; |
67 changes: 67 additions & 0 deletions
67
tests/baselines/reference/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//// [tests/cases/conformance/es2019/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts] //// | ||
|
||
=== allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts === | ||
// Strings containing unescaped line / paragraph separators | ||
// Using both single quotes, double quotes and template literals | ||
|
||
var stringContainingUnescapedLineSeparator1 = " | ||
>stringContainingUnescapedLineSeparator1 : Symbol(stringContainingUnescapedLineSeparator1, Decl(allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts, 3, 3)) | ||
|
||
STRING_CONTENT | ||
"; | ||
var stringContainingUnescapedParagraphSeparator1 = " | ||
>stringContainingUnescapedParagraphSeparator1 : Symbol(stringContainingUnescapedParagraphSeparator1, Decl(allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts, 6, 3)) | ||
|
||
STRING_CONTENT | ||
"; | ||
|
||
|
||
var stringContainingUnescapedLineSeparator2 = ' | ||
>stringContainingUnescapedLineSeparator2 : Symbol(stringContainingUnescapedLineSeparator2, Decl(allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts, 11, 3)) | ||
|
||
STRING_CONTENT | ||
'; | ||
var stringContainingUnescapedParagraphSeparator2 = ' | ||
>stringContainingUnescapedParagraphSeparator2 : Symbol(stringContainingUnescapedParagraphSeparator2, Decl(allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts, 14, 3)) | ||
|
||
STRING_CONTENT | ||
'; | ||
|
||
|
||
var stringContainingUnescapedLineSeparator3 = ` | ||
>stringContainingUnescapedLineSeparator3 : Symbol(stringContainingUnescapedLineSeparator3, Decl(allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts, 19, 3)) | ||
|
||
STRING_CONTENT | ||
`; | ||
var stringContainingUnescapedParagraphSeparator3 = ` | ||
>stringContainingUnescapedParagraphSeparator3 : Symbol(stringContainingUnescapedParagraphSeparator3, Decl(allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts, 22, 3)) | ||
|
||
STRING_CONTENT | ||
`; | ||
|
||
// Array of unescaped line / paragraph separators | ||
|
||
var arr = [ | ||
>arr : Symbol(arr, Decl(allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts, 28, 3)) | ||
|
||
" | ||
|
||
STRING_CONTENT | ||
|
||
", | ||
" | ||
|
||
|
||
STRING_CONTENT | ||
|
||
|
||
", | ||
"STRING_CONTENT | ||
", | ||
" | ||
STRING_CONTENT", | ||
`\ | ||
`, | ||
' | ||
' | ||
]; |
84 changes: 84 additions & 0 deletions
84
tests/baselines/reference/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
//// [tests/cases/conformance/es2019/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts] //// | ||
|
||
=== allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts === | ||
// Strings containing unescaped line / paragraph separators | ||
// Using both single quotes, double quotes and template literals | ||
|
||
var stringContainingUnescapedLineSeparator1 = " | ||
>stringContainingUnescapedLineSeparator1 : string | ||
>" STRING_CONTENT " : "\u2028STRING_CONTENT\u2028" | ||
|
||
STRING_CONTENT | ||
"; | ||
var stringContainingUnescapedParagraphSeparator1 = " | ||
>stringContainingUnescapedParagraphSeparator1 : string | ||
>" STRING_CONTENT " : "\u2029STRING_CONTENT\u2029" | ||
|
||
STRING_CONTENT | ||
"; | ||
|
||
|
||
var stringContainingUnescapedLineSeparator2 = ' | ||
>stringContainingUnescapedLineSeparator2 : string | ||
>' STRING_CONTENT ' : "\u2028STRING_CONTENT\u2028" | ||
|
||
STRING_CONTENT | ||
'; | ||
var stringContainingUnescapedParagraphSeparator2 = ' | ||
>stringContainingUnescapedParagraphSeparator2 : string | ||
>' STRING_CONTENT ' : "\u2029STRING_CONTENT\u2029" | ||
|
||
STRING_CONTENT | ||
'; | ||
|
||
|
||
var stringContainingUnescapedLineSeparator3 = ` | ||
>stringContainingUnescapedLineSeparator3 : string | ||
>` STRING_CONTENT ` : "\u2028STRING_CONTENT\u2028" | ||
|
||
STRING_CONTENT | ||
`; | ||
var stringContainingUnescapedParagraphSeparator3 = ` | ||
>stringContainingUnescapedParagraphSeparator3 : string | ||
>` STRING_CONTENT ` : "\u2029STRING_CONTENT\u2029" | ||
|
||
STRING_CONTENT | ||
`; | ||
|
||
// Array of unescaped line / paragraph separators | ||
|
||
var arr = [ | ||
>arr : string[] | ||
>[ " STRING_CONTENT ", " STRING_CONTENT ", "STRING_CONTENT ", " STRING_CONTENT", `\ `, ' '] : string[] | ||
|
||
" | ||
>" STRING_CONTENT " : "\u2029\u2028STRING_CONTENT\u2028\u2029" | ||
|
||
STRING_CONTENT | ||
|
||
", | ||
" | ||
>" STRING_CONTENT " : "\u2028\u2029\u2029STRING_CONTENT\u2029\u2029\u2028" | ||
|
||
|
||
STRING_CONTENT | ||
|
||
|
||
", | ||
"STRING_CONTENT | ||
>"STRING_CONTENT " : "STRING_CONTENT\u2029" | ||
|
||
", | ||
" | ||
>" STRING_CONTENT" : "\u2028STRING_CONTENT" | ||
|
||
STRING_CONTENT", | ||
`\ | ||
>`\ ` : "" | ||
|
||
`, | ||
' | ||
>' ' : "\u2028" | ||
|
||
' | ||
]; |
24 changes: 24 additions & 0 deletions
24
tests/cases/conformance/es2019/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Strings containing unescaped line / paragraph separators | ||
// Using both single quotes, double quotes and template literals | ||
|
||
var stringContainingUnescapedLineSeparator1 = " STRING_CONTENT "; | ||
var stringContainingUnescapedParagraphSeparator1 = " STRING_CONTENT "; | ||
|
||
|
||
var stringContainingUnescapedLineSeparator2 = ' STRING_CONTENT '; | ||
var stringContainingUnescapedParagraphSeparator2 = ' STRING_CONTENT '; | ||
|
||
|
||
var stringContainingUnescapedLineSeparator3 = ` STRING_CONTENT `; | ||
var stringContainingUnescapedParagraphSeparator3 = ` STRING_CONTENT `; | ||
|
||
// Array of unescaped line / paragraph separators | ||
|
||
var arr = [ | ||
" STRING_CONTENT ", | ||
" STRING_CONTENT ", | ||
"STRING_CONTENT ", | ||
" STRING_CONTENT", | ||
`\ `, | ||
' ' | ||
]; |