This reverts commit 7148184d65.
There are four types of literals where escapes were normalized:
1. Strings ('\xAb' and "\xAb")
2. Regexes (/\xAb/)
3. Untagged template literals (`\xAb`)
4. Tagged template literals (tag`\xAb`)
However, changing the case of the escapes alters the runtime behavior of
in two of the above cases.
```js
/\xAb/.source === '\\xAb' // true
String.raw`\xAb` === '\\xAb' // true
```
So for regexes and tagged template literals the escapes must not be
changed. Instead of enforcing lowercase escapes in only 50% of the
different cases, it was decided not to bother with escapes at all.
Closes #562.
26 lines
156 B
JavaScript
26 lines
156 B
JavaScript
[
|
|
"abc",
|
|
'abc',
|
|
|
|
'\'',
|
|
|
|
'"',
|
|
'\"',
|
|
'\\"',
|
|
|
|
"'",
|
|
"\'",
|
|
"\\'",
|
|
|
|
"'\"",
|
|
'\'"',
|
|
|
|
'\\',
|
|
"\\",
|
|
|
|
'\0',
|
|
'🐶',
|
|
|
|
'\uD801\uDC28',
|
|
];
|