mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibJS: Don't parse arrow function with newline between ) and =>
If there's a newline between the closing paren and arrow it's not a valid arrow function, ASI should kick in instead (it'll then fail with "Unexpected token Arrow")
This commit is contained in:
parent
965d952ff3
commit
e898c98873
Notes:
sideshowbarker
2024-07-19 01:50:44 +09:00
Author: https://github.com/linusg
Commit: e898c98873
Pull-request: https://github.com/SerenityOS/serenity/pull/3796
2 changed files with 5 additions and 0 deletions
|
@ -160,4 +160,5 @@ test("syntax errors", () => {
|
|||
expect("(a b) => {}").not.toEval();
|
||||
expect("(a ...b) => {}").not.toEval();
|
||||
expect("(a = 1 = 2) => {}").not.toEval();
|
||||
expect("()\n=> {}").not.toEval();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue