File tree 4 files changed +77
-1
lines changed
swc/tests/fixture/issues-8xxx/8632
swc_ecma_utils/src/function
4 files changed +77
-1
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "jsc" : {
3
+ "parser" : {
4
+ "syntax" : " typescript" ,
5
+ "tsx" : false
6
+ },
7
+ "target" : " es2015" ,
8
+ "loose" : false ,
9
+ "minify" : {
10
+ "compress" : false ,
11
+ "mangle" : false
12
+ }
13
+ },
14
+ "module" : {
15
+ "type" : " commonjs"
16
+ },
17
+ "minify" : false ,
18
+ "isModule" : true
19
+ }
Original file line number Diff line number Diff line change
1
+ export class Test {
2
+ public async bad ( ) : Promise < void > {
3
+ let foo = false ;
4
+
5
+ [ foo ] = await Promise . all (
6
+ [
7
+ this . foo ( ) ,
8
+ ]
9
+ ) ;
10
+ }
11
+
12
+ public async good ( ) : Promise < void > {
13
+ let [ foo ] = await Promise . all (
14
+ [
15
+ this . foo ( ) ,
16
+ ] ) ;
17
+ }
18
+
19
+ private async foo ( ) : Promise < boolean > {
20
+ return true ;
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+ Object . defineProperty ( exports , "__esModule" , {
3
+ value : true
4
+ } ) ;
5
+ Object . defineProperty ( exports , "Test" , {
6
+ enumerable : true ,
7
+ get : function ( ) {
8
+ return Test ;
9
+ }
10
+ } ) ;
11
+ const _async_to_generator = require ( "@swc/helpers/_/_async_to_generator" ) ;
12
+ class Test {
13
+ bad ( ) {
14
+ var _this = this ;
15
+ return _async_to_generator . _ ( function * ( ) {
16
+ let foo = false ;
17
+ [ foo ] = yield Promise . all ( [
18
+ _this . foo ( )
19
+ ] ) ;
20
+ } ) ( ) ;
21
+ }
22
+ good ( ) {
23
+ var _this = this ;
24
+ return _async_to_generator . _ ( function * ( ) {
25
+ let [ foo ] = yield Promise . all ( [
26
+ _this . foo ( )
27
+ ] ) ;
28
+ } ) ( ) ;
29
+ }
30
+ foo ( ) {
31
+ return _async_to_generator . _ ( function * ( ) {
32
+ return true ;
33
+ } ) ( ) ;
34
+ }
35
+ }
Original file line number Diff line number Diff line change @@ -386,7 +386,7 @@ impl VisitMut for FnEnvHoister {
386
386
} ) => {
387
387
let expr = match left {
388
388
AssignTarget :: Simple ( e) => e,
389
- AssignTarget :: Pat ( e ) => {
389
+ AssignTarget :: Pat ( .. ) => {
390
390
e. visit_mut_children_with ( self ) ;
391
391
return ;
392
392
}
You can’t perform that action at this time.
0 commit comments