File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ pp.parseExprSubscripts = function(refDestructuringErrors) {
270
270
if ( refDestructuringErrors && result . type === "MemberExpression" ) {
271
271
if ( refDestructuringErrors . parenthesizedAssign >= result . start ) refDestructuringErrors . parenthesizedAssign = - 1
272
272
if ( refDestructuringErrors . parenthesizedBind >= result . start ) refDestructuringErrors . parenthesizedBind = - 1
273
+ if ( refDestructuringErrors . trailingComma >= result . start ) refDestructuringErrors . trailingComma = - 1
273
274
}
274
275
return result
275
276
}
Original file line number Diff line number Diff line change @@ -16572,3 +16572,52 @@ test("const myFn = ({ set = '' }) => {};", {
16572
16572
}
16573
16573
]
16574
16574
} , { ecmaVersion : 6 } )
16575
+
16576
+
16577
+ test ( "[[...[], 0].x] = []" , {
16578
+ type : "Program" ,
16579
+ body : [
16580
+ {
16581
+ type : "ExpressionStatement" ,
16582
+ expression : {
16583
+ type : "AssignmentExpression" ,
16584
+ operator : "=" ,
16585
+ left : {
16586
+ type : "ArrayPattern" ,
16587
+ elements : [
16588
+ {
16589
+ type : "MemberExpression" ,
16590
+ object : {
16591
+ type : "ArrayExpression" ,
16592
+ elements : [
16593
+ {
16594
+ type : "SpreadElement" ,
16595
+ argument : {
16596
+ type : "ArrayExpression" ,
16597
+ elements : [ ]
16598
+ }
16599
+ } ,
16600
+ {
16601
+ type : "Literal" ,
16602
+ value : 0 ,
16603
+ raw : "0"
16604
+ }
16605
+ ]
16606
+ } ,
16607
+ property : {
16608
+ type : "Identifier" ,
16609
+ name : "x"
16610
+ } ,
16611
+ computed : false
16612
+ }
16613
+ ]
16614
+ } ,
16615
+ right : {
16616
+ type : "ArrayExpression" ,
16617
+ elements : [ ]
16618
+ }
16619
+ }
16620
+ }
16621
+ ] ,
16622
+ sourceType : "script"
16623
+ } , { ecmaVersion : 6 } )
You can’t perform that action at this time.
0 commit comments