Subsume json (#7985)
* Add Subsume JSON transform https://github.com/tc39/proposal-json-superset is at stage 3. This allows U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped inside strings and directives. * Move to Stage 3 * Break diretive parsing * Update README * Handle multi-escape sequences * Remove babylon files after rename
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
expect("\u2029".length).toBe(1);
|
||||
expect("\u2029").toBe("\u2029");
|
||||
|
||||
|
||||
expect("before
after".length).toBe(12);
|
||||
expect("before
after").toBe("before\u2029after");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')
|
||||
|
||||
expect("
".length).toBe(1);
|
||||
expect("
").toBe("\u2029");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\
".length).toBe(0);
|
||||
expect("\
").toBe("");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\
".length).toBe(2);
|
||||
expect("\\
").toBe("\\\u2029");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\\
".length).toBe(1);
|
||||
expect("\\\
").toBe("\\");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\\\
".length).toBe(3);
|
||||
expect("\\\\
").toBe("\\\\\u2029");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
@@ -0,0 +1,27 @@
|
||||
expect("\u2029".length).toBe(1);
|
||||
expect("\u2029").toBe("\u2029");
|
||||
|
||||
|
||||
expect("before
after".length).toBe(12);
|
||||
expect("before
after").toBe("before\u2029after");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')
|
||||
|
||||
expect("
".length).toBe(1);
|
||||
expect("
").toBe("\u2029");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\
".length).toBe(0);
|
||||
expect("\
").toBe("");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\
".length).toBe(2);
|
||||
expect("\\
").toBe("\\\u2029");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\\
".length).toBe(1);
|
||||
expect("\\\
").toBe("\\");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\\\
".length).toBe(3);
|
||||
expect("\\\\
").toBe("\\\\\u2029");
|
||||
// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
@@ -0,0 +1,19 @@
|
||||
expect("\u2029".length).toBe(1);
|
||||
expect("\u2029").toBe("\u2029");
|
||||
expect("before\u2029after".length).toBe(12);
|
||||
expect("before\u2029after").toBe("before\u2029after"); // ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')
|
||||
|
||||
expect("\u2029".length).toBe(1);
|
||||
expect("\u2029").toBe("\u2029"); // ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\
".length).toBe(0);
|
||||
expect("\
").toBe(""); // ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\\u2029".length).toBe(2);
|
||||
expect("\\\u2029").toBe("\\\u2029"); // ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\\
".length).toBe(1);
|
||||
expect("\\\
").toBe("\\"); // ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
|
||||
expect("\\\\\u2029".length).toBe(3);
|
||||
expect("\\\\\u2029").toBe("\\\\\u2029"); // ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char
|
||||
Reference in New Issue
Block a user