Repository navigation
standalone_graph: zero-copy source string for compiled JS modules when contents are ASCII - #31557
Merged
Merged
Claude / Claude Code Review
completed
May 29, 2026 in 17m 18s
Code review found 1 important issue
Found 3 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/standalone_graph/StandaloneModuleGraph.rs:642 |
Latin1 encoding corrupts non-ASCII --banner/--footer in compiled executables |
Annotations
Check failure on line 642 in src/standalone_graph/StandaloneModuleGraph.rs
claude / Claude Code Review
Latin1 encoding corrupts non-ASCII --banner/--footer in compiled executables
Honoring `module.encoding` activates the `Latin1 → create_static_external` path for JS modules, but `to_bytes()` tags JS as Latin1 purely by loader type with no ASCII check — and `postProcessJSChunk` concatenates `--banner`/`--footer`/hashbang verbatim as UTF-8. So `bun build --compile --footer 'console.log("résumé")'` now prints `résumé` (and non-ASCII identifiers can SyntaxError), whereas before this PR the hardcoded `Binary → clone_utf8` path decoded it correctly. Also, the PR description's
Loading