Skip to content

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

Merged
Gabriela Araujo Britto (gabritto) merged 1 commit into
microsoft:mainfrom
Zzzen:used-before-decl-in-async-iife
Nov 2, 2022
Merged

do not report use-before-declaration error in async IIFE initializer#50199
Gabriela Araujo Britto (gabritto) merged 1 commit into
microsoft:mainfrom
Zzzen:used-before-decl-in-async-iife

Conversation

@Zzzen

Copy link
Copy Markdown
Contributor

Fixes #50123

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! ✨

@gabritto

Copy link
Copy Markdown
Member

Worth noting here that, as discussed in the original issue (#50123 (comment)), with this fix we will now allow (valid) cases like:

const promise = (async () => {
  await foo();
  promise;
})()

but also invalid ones like:

const promise = (async () => {
  promise;
  await foo();
})()

@gabritto
Gabriela Araujo Britto (gabritto) merged commit 6017625 into microsoft:main Nov 2, 2022
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Incorrect use-before-declaration error in async IIFE initializer

5 participants