1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:58:12 +00:00

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
parent 2e00731ddb
commit ccbc54358d
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();
});