Skip to content
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

Fix hosting destructured decl with movable initializer #17468

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

pfgithub
Copy link
Contributor

Fixes #17454

When hoisting a destructured decl with a movable initializer, it would copy the value into each key.

// a.ts
export const {a, b, c: [d, e, f]} = "hello!";
// b.ts
console.log(await import("./a"));
// bun build b.ts
  // before:
    var a = "hello!", b = "hello!", d = "hello!", e = "hello!", f = "hello!";
  // after:
    var { a, b, c: [d, e, f] } = "hello!";

@robobun
Copy link

robobun commented Feb 19, 2025

Updated 4:26 PM PT - Feb 19th, 2025

@pfgithub, your commit c1313b0 has 3 failures in Build #11851:


🧪   try this PR locally:

bunx bun-pr 17468

@pfgithub pfgithub marked this pull request as ready for review February 20, 2025 00:22
@Jarred-Sumner Jarred-Sumner merged commit 92a91ef into main Feb 20, 2025
65 of 70 checks passed
@Jarred-Sumner Jarred-Sumner deleted the pfg/fix-17454 branch February 20, 2025 04:21
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.

bun build breaks html-escaper
3 participants