Skip to content

Remove unused JSGlobalAugmentations #1155

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
merged 1 commit into from
Jun 10, 2025

Conversation

jakebailey
Copy link
Member

This is unused.

@jakebailey jakebailey requested review from sandersn and Copilot June 10, 2025 21:23
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 removes the unused JSGlobalAugmentations from the AST and binder logic to clean up dead code.

  • Deleted the JSGlobalAugmentations lookup in Binder.lookupName
  • Removed the JSGlobalAugmentations field and its copy logic from SourceFile

Reviewed Changes

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

File Description
internal/binder/binder.go Removed code block that retrieved JSGlobalAugmentations symbols
internal/ast/ast.go Deleted JSGlobalAugmentations field and its copy in copyFrom
Comments suppressed due to low confidence (3)

internal/ast/ast.go:10033

  • Verify that SymbolTable is no longer needed; if it's only used for JSGlobalAugmentations, remove its import and definition to avoid unused declarations.
JSGlobalAugmentations SymbolTable // !!! remove me

internal/ast/ast.go:10132

  • Since JSGlobalAugmentations is removed, ensure that copyFrom still correctly initializes all necessary fields and that no consumers rely on this assignment.
node.JSGlobalAugmentations = other.JSGlobalAugmentations

internal/binder/binder.go:1225

  • After removing the JSGlobalAugmentations lookup, double-check that symbol resolution behavior remains correct and update or add tests to cover any changed code paths.
if ast.IsSourceFile(container) {

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

js global augmentations were the worst

@jakebailey jakebailey added this pull request to the merge queue Jun 10, 2025
Merged via the queue into main with commit b00279c Jun 10, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/remove-JSGlobalAugmentations branch June 10, 2025 22:40
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