mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
LibJS: Parse line continuations in string literals properly
Newlines after line continuation were inserted into the string literals. This patch makes the parser ignore the newlines after \ and also makes it so that "use strict" containing a line continuation is not a valid "use strict".
This commit is contained in:
parent
e6505a95f1
commit
e5ddcadd3c
4 changed files with 18 additions and 0 deletions
|
@ -53,6 +53,9 @@ test("toHaveLength", () => {
|
|||
expect([1]).toHaveLength(1);
|
||||
expect({ length: 1 }).toHaveLength(1);
|
||||
|
||||
expect("a\
|
||||
b").toHaveLength(2);
|
||||
|
||||
expect(() => {
|
||||
expect(1).toHaveLength();
|
||||
}).toThrow(ExpectationError);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue