Skip to content

[WIP] Port #60195 #8

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

Closed
wants to merge 1 commit into from
Closed

[WIP] Port #60195 #8

wants to merge 1 commit into from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jun 5, 2025

Port microsoft/TypeScript PR #60195: Include non-enumerable keys in __importStar helper

This change updates the __importStar emit helper to include non-enumerable properties when performing star imports, matching the behavior implemented in TypeScript commit 2e4f2c7.

Plan:

  • Analyze the changes needed from the original TypeScript commit
  • Locate the corresponding emit helper code in the Go port (internal/printer/helpers.go)
  • Verify current build and test status
  • Update the importStarHelper text to use Object.getOwnPropertyNames approach
  • Build the project to ensure it compiles
  • Run tests and expect baseline changes
  • Accept baseline changes if they align with expected behavior
  • Verify the change produces correct emit output

The key change involves replacing the simple for...in loop with a more sophisticated approach that:

  1. Uses Object.getOwnPropertyNames when available to include non-enumerable properties
  2. Falls back to the original for...in approach for compatibility
  3. Wraps the logic in an IIFE for proper scoping

Fixes #7.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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.

Port #60195
2 participants