X Tutup
Skip to content

Fix export all bug and add NamespaceExport support#937

Merged
Perryvw merged 6 commits intoTypeScriptToLua:masterfrom
hazzard993:export-all-fix
Dec 14, 2020
Merged

Fix export all bug and add NamespaceExport support#937
Perryvw merged 6 commits intoTypeScriptToLua:masterfrom
hazzard993:export-all-fix

Conversation

@hazzard993
Copy link
Contributor

@hazzard993 hazzard993 commented Nov 24, 2020

Fixes #927
Resolves #928

@hazzard993 hazzard993 changed the title Fix export all bug #927 Fix export all bug Nov 24, 2020
@hazzard993 hazzard993 changed the title Fix export all bug Fix export all bug and add NamespaceExport support Nov 24, 2020

const ifBody = lua.createBlock([leftAssignment]);

const ifStatement = lua.createIfStatement(
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment explaining what the purpose of this if statement is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some more comments to transformExportAll, I think it should be much easier to read now

const declaration = lua.createVariableDeclarationStatement(tempModuleIdentifier, moduleRequire);
result.push(declaration);

if (node.exportClause && ts.isNamespaceExport(node.exportClause)) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment explaining in what case this if statement is needed and what this branch of this function does?

@Perryvw Perryvw merged commit a3bfc2d into TypeScriptToLua:master Dec 14, 2020
@hazzard993 hazzard993 deleted the export-all-fix branch December 14, 2020 22: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.

export * as ns from "..." export * from "..." shouldn't re-export default

2 participants

X Tutup