LibJS: Allow patterns in parenthesized arrow function parameters

This commit is contained in:
Ali Mohammad Pur 2021-07-02 15:21:46 +04:30 committed by Andreas Kling
commit ccbc54358d
Notes: sideshowbarker 2024-07-18 11:07:30 +09:00
2 changed files with 10 additions and 1 deletions

View file

@ -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();
});