Debian Codegraph @

js/src/tests/test262/language/rest-parameters/object-pattern.js

raw
1 // Copyright (C) 2015 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-destructuring-binding-patterns
6 description: >
7 The rest parameter can be a binding pattern.
8 info: |
9 Destructuring Binding Patterns - Syntax
10
11 BindingRestElement[Yield]:
12 ...BindingPattern[?Yield]
13 ---*/
14
15 function empty(...{}) {}
16
17 function emptyWithArray(...{p: []}) {}
18
19 function emptyWithObject(...{p: {}}) {}
20
21 function emptyWithLeading(x, ...{}) {}
22
23
24 function singleElement(...{a: b}) {}
25
26 function singleElementWithInitializer(...{a: b = 0}) {}
27
28 function singleElementWithArray(...{p: [a]}) {}
29
30 function singleElementWithObject(...{p: {a: b}}) {}
31
32 function singleElementWithLeading(x, ...{a: b}) {}
33
34
35 function multiElement(...{a: r, b: s, c: t}) {}
36
37 function multiElementWithInitializer(...{a: r = 0, b: s, c: t = 1}) {}
38
39 function multiElementWithArray(...{p: [a], b, q: [c]}) {}
40
41 function multiElementWithObject(...{a: {p: q}, b: {r}, c: {s = 0}}) {}
42
43 function multiElementWithLeading(x, y, ...{a: r, b: s, c: t}) {}
44
45
46 reportCompare(0, 0);