-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Improve using declaration errors #17333
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
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/59504 |
this.match(tt._var) || | ||
this.isLet() || | ||
(this.hasPlugin("explicitResourceManagement") && | ||
((this.isContextual(tt._using) && this.startsUsing()) || |
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.
Nit: could we move the this.isContextual(tt._using)
inside this.startsUsing()
(and maybe rename it to isUsing
, similar to isLet
)? Just because we are checking this.isContextual(tt._using)
first every time we call this.startsUsing()
anyway.
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.
okay, we often call startsUsing
in a big switch case so isContextual
would introduce a duplicate using
token check. But it probably has little impact on the performance.
1672fe9
to
6efb2d9
Compare
c4af333
to
06e3516
Compare
@@ -524,7 +549,7 @@ export default abstract class StatementParser extends ExpressionParser { | |||
|
|||
case tt._await: | |||
// [+Await] await [no LineTerminator here] using [no LineTerminator here] BindingList[+Using] | |||
if (!this.state.containsEsc && this.startsAwaitUsing()) { |
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.
startsAwaitUsing
seems to have no reference anymore, let's remove it?
export default using x
and TSdeclare using x
.