-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object unexpectedly undefined #52104
Comments
Duplicate of #9998. |
Is this a duplicate? I've read the bug, and am still reading through all of the comments, but I don't believe this is a situation where control flow analysis is having to contend with a function call. The problem isn't What am I missing? |
Narrowing is reset in closures. It is a duplicate. |
Ok, thank you. |
Bug Report
🔎 Search Terms
undefined object, callback, closure, hoisting, arrow function
🕗 Version & Regression Information
undefined
,closure
,hoisting
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
A variable (in this case,
foo
) is being marked as possibly undefined when used inside of a closure, although it will never be null at that point.🙂 Expected behavior
I expect
foo
to be not-null.I apologize if the observed behaviour is expected -- but, if it is, can someone explain why?
The text was updated successfully, but these errors were encountered: