Debian Codegraph @

js/src/tests/test262/language/destructuring/binding/syntax/property-list-single-name-bindings.js

raw
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es6id: 13.3.3
6 description: >
7 The ObjectBindingPattern with a simple property list and single name binding
8 info: |
9 Destructuring Binding Patterns - Syntax
10
11 ObjectBindingPattern[Yield] :
12 { }
13 { BindingPropertyList[?Yield] }
14 { BindingPropertyList[?Yield] , }
15
16 BindingPropertyList[Yield] :
17 BindingProperty[?Yield]
18 BindingPropertyList[?Yield] , BindingProperty[?Yield]
19
20 BindingProperty[Yield] :
21 SingleNameBinding[?Yield]
22 PropertyName[?Yield] : BindingElement[?Yield]
23
24 SingleNameBinding[Yield] :
25 BindingIdentifier[?Yield] Initializer[In, ?Yield]opt
26
27 features: [destructuring-binding]
28 ---*/
29
30 function fna({x}) {}
31 function fnb({x, y}) {}
32 function fnc({x = 42}) {}
33 function fnd({x, y = 42}) {}
34
35 reportCompare(0, 0);