Avoid exporting anonymous identifiers#756
Merged
Perryvw merged 5 commits intoTypeScriptToLua:masterfrom Dec 3, 2019
Merged
Conversation
Perryvw
approved these changes
Dec 1, 2019
ark120202
reviewed
Dec 2, 2019
| @@ -0,0 +1 @@ | |||
| export const [x, , y] = [1, 2, 3]; | |||
Contributor
There was a problem hiding this comment.
We already have a (disabled) test in destructuring.spec.ts:
ark120202
reviewed
Dec 3, 2019
Co-Authored-By: ark120202 <ark120202@gmail.com>
ark120202
reviewed
Dec 3, 2019
Co-Authored-By: ark120202 <ark120202@gmail.com>
ark120202
approved these changes
Dec 3, 2019
Contributor
ark120202
left a comment
There was a problem hiding this comment.
I'm not a huge fan of adding such a flag to something as generic as an identifier, but I don't see any better solutions
GameStreakerDE
added a commit
to NxeGamingNetwork/TypeScriptToLua
that referenced
this pull request
Dec 6, 2019
Avoid exporting anonymous identifiers (TypeScriptToLua#756)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #695
createLocalOrExportedOrGlobalDeclaration's logic couldn't tell if an identifier was anOmittedExpressionso it treated it like any other identifier and put____exportsin front of it.For this particular case I added an
exportableflag to identifiers to indicate whether or not the identifier is intended to be exported / accessible.