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:
parent
2e00731ddb
commit
ccbc54358d
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