-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
fix(noUndeclaredVariables): bind read in ambient context to import type #4547
Conversation
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit
is_closure: bool, | ||
implies_strict_mode: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document all the new types an fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not new, I just encapsulated them in a type to make it simpler to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some doctests.
21954bc
to
4b1e836
Compare
Summary
Fix #4526 and fix #4547
The semantic model now tracks if the traversed node is in an ambient context not.
The scope registers if it is in ambient context to properly restore the information once we leave a scope.
When we are in an ambient context we emit
AmbientRead
instead ofRead
.This allows us to bind ambient read to type-only imports.
Test Plan
I added some tests.