summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/object/accessor-arguments-rest.js
blob: 82f37b62e3b61d64fccfd29dd6a88134d4ce21bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
assertThrowsInstanceOf(() => eval("({ get x(...a) { } })"), SyntaxError);
assertThrowsInstanceOf(() => eval("({ get x(a, ...b) { } })"), SyntaxError);
assertThrowsInstanceOf(() => eval("({ get x([a], ...b) { } })"), SyntaxError);
assertThrowsInstanceOf(() => eval("({ get x({a}, ...b) { } })"), SyntaxError);
assertThrowsInstanceOf(() => eval("({ get x({a: A}, ...b) { } })"), SyntaxError);

assertThrowsInstanceOf(() => eval("({ set x(...a) { } })"), SyntaxError);
assertThrowsInstanceOf(() => eval("({ set x(a, ...b) { } })"), SyntaxError);
assertThrowsInstanceOf(() => eval("({ set x([a], ...b) { } })"), SyntaxError);
assertThrowsInstanceOf(() => eval("({ set x({a: A}, ...b) { } })"), SyntaxError);

({ get(...a) { } });
({ get(a, ...b) { } });
({ get([a], ...b) { } });
({ get({a}, ...b) { } });
({ get({a: A}, ...b) { } });

({ set(...a) { } });
({ set(a, ...b) { } });
({ set([a], ...b) { } });
({ set({a: A}, ...b) { } });

if (typeof reportCompare === "function")
    reportCompare(true, true);