-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/compat): Visit AssignExpr right branch in FnEnvHoister (#8633)
**Related issue:** - Closes #8632
- Loading branch information
1 parent
52b6fd8
commit e5d6de0
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": false | ||
}, | ||
"target": "es2015", | ||
"loose": false, | ||
"minify": { | ||
"compress": false, | ||
"mangle": false | ||
} | ||
}, | ||
"module": { | ||
"type": "commonjs" | ||
}, | ||
"minify": false, | ||
"isModule": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export class Test { | ||
public async bad(): Promise<void> { | ||
let foo = false; | ||
|
||
[foo] = await Promise.all( | ||
[ | ||
this.foo(), | ||
] | ||
); | ||
} | ||
|
||
public async good(): Promise<void> { | ||
let [foo] = await Promise.all( | ||
[ | ||
this.foo(), | ||
]); | ||
} | ||
|
||
private async foo(): Promise<boolean> { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "Test", { | ||
enumerable: true, | ||
get: function() { | ||
return Test; | ||
} | ||
}); | ||
const _async_to_generator = require("@swc/helpers/_/_async_to_generator"); | ||
class Test { | ||
bad() { | ||
var _this = this; | ||
return _async_to_generator._(function*() { | ||
let foo = false; | ||
[foo] = yield Promise.all([ | ||
_this.foo() | ||
]); | ||
})(); | ||
} | ||
good() { | ||
var _this = this; | ||
return _async_to_generator._(function*() { | ||
let [foo] = yield Promise.all([ | ||
_this.foo() | ||
]); | ||
})(); | ||
} | ||
foo() { | ||
return _async_to_generator._(function*() { | ||
return true; | ||
})(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters