Skip to content
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

using ... for ... supporting functions and global #683

Merged
merged 3 commits into from
May 28, 2022

Conversation

Janther
Copy link
Contributor

@Janther Janther commented May 22, 2022

Closes #674

Adding support for a list of functions for UsingForDeclarations
Adding support for the word global

'using ',
node.libraryName,
node.functions && node.functions.length
Copy link
Member

Choose a reason for hiding this comment

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

I would remove the .length check:

Suggested change
node.functions && node.functions.length
node.functions

Even if this is not technically allowed by the grammar, I think it's more future-proof to allow a potential result of using {} for .... The alternative is to use node.libraryName, which will be undefined and make the process fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

node.functions is always an Array even if it's an empty one :(

Copy link
Member

Choose a reason for hiding this comment

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

Oh 🤦‍♂️ You are right, sorry.

@Janther Janther force-pushed the feature/using_functions_for branch from 75db84b to 8f504ee Compare May 26, 2022 16:09
@Janther Janther merged commit fc77fd6 into main May 28, 2022
@Janther Janther deleted the feature/using_functions_for branch May 28, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"using ... for T global;" not supported
2 participants