mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibJS: Allow patterns in parenthesized arrow function parameters
This commit is contained in:
parent
2e00731ddb
commit
ccbc54358d
Notes:
sideshowbarker
2024-07-18 11:07:30 +09:00
Author: https://github.com/alimpfard
Commit: ccbc54358d
Pull-request: https://github.com/SerenityOS/serenity/pull/8384
2 changed files with 10 additions and 1 deletions
|
@ -162,3 +162,10 @@ test("syntax errors", () => {
|
|||
expect("(a = 1 = 2) => {}").not.toEval();
|
||||
expect("()\n=> {}").not.toEval();
|
||||
});
|
||||
|
||||
test("destructuring parameters", () => {
|
||||
expect(`({ a }) => {}`).toEval();
|
||||
expect(`([ a ]) => {}`).toEval();
|
||||
expect(`{ a } => {}`).not.toEval();
|
||||
expect(`[ a ] => {}`).not.toEval();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue