File tree 4 files changed +23
-2
lines changed
test/cases/parsing/issue-4870
4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -993,8 +993,9 @@ class Parser extends Tapable {
993
993
}
994
994
} else {
995
995
this . walkExpression ( expression . right ) ;
996
- this . scope . renames [ "$" + expression . left . name ] = undefined ;
997
- this . walkExpression ( expression . left ) ;
996
+ this . enterPattern ( expression . left , ( name , decl ) => {
997
+ this . scope . renames [ "$" + name ] = undefined ;
998
+ } ) ;
998
999
}
999
1000
}
1000
1001
Original file line number Diff line number Diff line change
1
+ export var test = "test" ;
Original file line number Diff line number Diff line change
1
+ import { test } from "./file" ;
2
+
3
+ it ( "should allow import in array destructing" , function ( ) {
4
+ var other ;
5
+ [ other = test ] = [ ] ;
6
+ other . should . be . eql ( "test" ) ;
7
+ } ) ;
8
+
9
+ it ( "should allow import in object destructing" , function ( ) {
10
+ var other ;
11
+ ( { other = test } = { } ) ;
12
+ other . should . be . eql ( "test" ) ;
13
+ } ) ;
Original file line number Diff line number Diff line change
1
+ var supportsIteratorDestructuring = require ( "../../../helpers/supportsIteratorDestructuring" ) ;
2
+ var supportsObjectDestructuring = require ( "../../../helpers/supportsObjectDestructuring" ) ;
3
+
4
+ module . exports = function ( config ) {
5
+ return ! config . minimize && supportsObjectDestructuring ( ) && supportsIteratorDestructuring ( ) ;
6
+ } ;
You can’t perform that action at this time.
0 commit comments