Skip to content

Retain undefined initializations - #36806

Merged
Wesley Wigham (weswigham) merged 4 commits into
microsoft:masterfrom
weswigham:retain-undefined-initializations
Feb 26, 2020
Merged

Retain undefined initializations#36806
Wesley Wigham (weswigham) merged 4 commits into
microsoft:masterfrom
weswigham:retain-undefined-initializations

Conversation

@weswigham

@weswigham Wesley Wigham (weswigham) commented Feb 14, 2020

Copy link
Copy Markdown
Member

This is a followup to #35967 based on this comment that causes us to still produce an assignment for exports without initializers, this way they can still be found by importers and have getters made for them. (92aeea3 is the unique commit in this PR)

Comment thread src/compiler/transformers/module/module.ts

@rbuckton Ron Buckton (rbuckton) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just in case, undefined isn't valid in ES3.

Comment thread src/compiler/transformers/module/module.ts Outdated

@rbuckton Ron Buckton (rbuckton) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is adding an unnecessary exports.x = undefined for downlevel enums and modules, which includes the comments.

Comment thread tests/baselines/reference/commentOnExportEnumDeclaration.js Outdated
Comment thread tests/baselines/reference/commentsDottedModuleName.js Outdated
Comment thread src/compiler/transformers/module/module.ts Outdated
@weswigham
Wesley Wigham (weswigham) merged commit 454cdb8 into microsoft:master Feb 26, 2020
@weswigham
Wesley Wigham (weswigham) deleted the retain-undefined-initializations branch February 27, 2020 21:59
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants