diff options
author | Linus Groh <mail@linusgroh.de> | 2020-10-20 18:43:58 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-20 20:27:58 +0200 |
commit | 1e86379327053dabd88ff27560b8a3379bd9fd0d (patch) | |
tree | 99e71728efc463a1674b8dd31a72b942d1067929 /Libraries/LibJS/Tests | |
parent | 6331d45a6f0a111b483a5c4b84cc24926bc9205d (diff) | |
download | serenity-1e86379327053dabd88ff27560b8a3379bd9fd0d.zip |
LibJS: Rest parameter in setter functions is a syntax error
Diffstat (limited to 'Libraries/LibJS/Tests')
-rw-r--r-- | Libraries/LibJS/Tests/classes/class-errors.js | 5 | ||||
-rw-r--r-- | Libraries/LibJS/Tests/object-basic.js | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/classes/class-errors.js b/Libraries/LibJS/Tests/classes/class-errors.js index 93c50829d0..fb479a0af2 100644 --- a/Libraries/LibJS/Tests/classes/class-errors.js +++ b/Libraries/LibJS/Tests/classes/class-errors.js @@ -71,6 +71,11 @@ describe("syntax errors", () => { set foo(bar, baz) { } }`).not.toEval(); + expect(` + class A { + set foo(...bar) { + } + }`).not.toEval(); }); test("super reference inside different |this| scope", () => { diff --git a/Libraries/LibJS/Tests/object-basic.js b/Libraries/LibJS/Tests/object-basic.js index e00382fdc2..37f5c6e4dd 100644 --- a/Libraries/LibJS/Tests/object-basic.js +++ b/Libraries/LibJS/Tests/object-basic.js @@ -151,6 +151,7 @@ describe("errors", () => { expect("({ get ...[foo] })").not.toEval(); expect("({ get foo(bar) {} })").not.toEval(); expect("({ set foo() {} })").not.toEval(); + expect("({ set foo(...bar) {} })").not.toEval(); expect("({ set foo(bar, baz) {} })").not.toEval(); expect("({ ...foo: bar })").not.toEval(); }); |