mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:37:34 +00:00
LibJS: Treat '\\' as an escaped character in template literals
Before this change we would ignore that the second backslash is escaped and template strings ending with ` \\` would be unterminated as the second slash was used to escape the closing quote.
This commit is contained in:
parent
8e624c8f6d
commit
b3edd94869
2 changed files with 11 additions and 1 deletions
|
@ -7,6 +7,9 @@ test("plain literals with expression-like characters", () => {
|
|||
|
||||
test("plain literals with escaped special characters", () => {
|
||||
expect(`foo\``).toBe("foo`");
|
||||
expect(`foo\\`).toBe("foo\\");
|
||||
expect(`foo\\\``).toBe("foo\\`");
|
||||
expect(`foo\\\\`).toBe("foo\\\\");
|
||||
expect(`foo\$`).toBe("foo$");
|
||||
expect(`foo \${"bar"}`).toBe('foo ${"bar"}');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue