Skip to content

Don't change global keyword to namespace in transformModuleDeclaration #1223

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

Merged

Conversation

Andarist
Copy link
Contributor

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 16:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR prevents the transformer from converting declare global into declare namespace global and updates the expected baselines accordingly.

  • Adjusted the module-declaration transformer to preserve the global keyword.
  • Updated all relevant test baselines to use declare global.
  • Removed redundant export {} lines in the baselines where appropriate.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/transformers/declarations/transform.go Skip namespace conversion when original keyword is global.
testdata/baselines/reference/submodule/conformance/symbolProperty61.js.diff Diff baseline updated to declare global.
testdata/baselines/reference/submodule/conformance/symbolProperty61.js Baseline updated to declare global and cleaned up export {};.
testdata/baselines/reference/submodule/conformance/leaveOptionalParameterAsWritten.js.diff Diff baseline updated to declare global.
testdata/baselines/reference/submodule/conformance/leaveOptionalParameterAsWritten.js Baseline updated to declare global and removed extra export {}.
testdata/baselines/reference/submodule/compiler/moduleDeclarationExportStarShadowingGlobalIsNameable.js.diff Diff baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/moduleDeclarationExportStarShadowingGlobalIsNameable.js Baseline updated to declare global and removed export {}.
testdata/baselines/reference/submodule/compiler/moduleAugmentationGlobal4.js.diff Diff baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/moduleAugmentationGlobal4.js Baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/moduleAugmentationGlobal3.js.diff Diff baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/moduleAugmentationGlobal3.js Baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/moduleAugmentationGlobal2.js.diff Diff baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/moduleAugmentationGlobal2.js Baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/moduleAugmentationGlobal1.js.diff Diff baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/moduleAugmentationGlobal1.js Baseline updated to declare global and removed export {}.
testdata/baselines/reference/submodule/compiler/declarationEmitRetainsJsdocyComments.js.diff Diff baseline updated to declare global.
testdata/baselines/reference/submodule/compiler/declarationEmitRetainsJsdocyComments.js Baseline updated to declare global and removed export {}.

@jakebailey
Copy link
Member

I think this is probably fine, but does require a merge from main and baseline update.

@jakebailey jakebailey enabled auto-merge June 19, 2025 11:11
@jakebailey jakebailey added this pull request to the merge queue Jun 19, 2025
Merged via the queue into microsoft:main with commit e29f35a Jun 19, 2025
22 checks passed
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.

2 participants