do not report use-before-declaration error in async IIFE initializer (#50199)

This commit is contained in:
Zzzen
2022-11-03 02:41:04 +08:00
committed by GitHub
parent 46b015f2bf
commit 6017625ad5
6 changed files with 150 additions and 1 deletions

View File

@@ -2648,7 +2648,7 @@ namespace ts {
*/
function isSameScopeDescendentOf(initial: Node, parent: Node | undefined, stopAt: Node): boolean {
return !!parent && !!findAncestor(initial, n => n === parent
|| (n === stopAt || isFunctionLike(n) && !getImmediatelyInvokedFunctionExpression(n) ? "quit" : false));
|| (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) || isAsyncFunction(n)) ? "quit" : false));
}
function getAnyImportSyntax(node: Node): AnyImportSyntax | undefined {