array-elements-with-object-patterns.js (971B)
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 ArrayBindingPattern with Object patterns on the element list 8 info: | 9 Destructuring Binding Patterns - Syntax 10 11 ArrayBindingPattern[Yield] : 12 [ Elisionopt BindingRestElement[?Yield]opt ] 13 [ BindingElementList[?Yield] ] 14 [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] 15 16 BindingElementList[Yield] : 17 BindingElisionElement[?Yield] 18 BindingElementList[?Yield] , BindingElisionElement[?Yield] 19 20 BindingElisionElement[Yield] : 21 Elisionopt BindingElement[?Yield] 22 23 BindingElement[Yield ] : 24 SingleNameBinding[?Yield] 25 BindingPattern[?Yield] Initializer[In, ?Yield]opt 26 features: [destructuring-binding] 27 ---*/ 28 29 function fn1([{}]) {} 30 31 function fn2([{} = 42]) {} 32 33 function fn3([a, {b: c}]) {} 34 35 function fn4([a, {b: []}]) {} 36 37 reportCompare(0, 0);