Commit d1eeaa0
fix(bundler): escape backslashes in metafile paths and memoize getter
Two fixes for the metafile feature:
1. Properly JSON-escape paths in MetafileBuilder to handle Windows
backslashes (e.g., C:\Users\... becomes C:\Users\...). Without
this, JSON.parse fails with "Invalid escape character U".
2. Memoize the lazy metafile getter by replacing it with the parsed
value after first access. This prevents assertion failures when
the metafile property is accessed multiple times.
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent 9aa9d21 commit d1eeaa0
File tree
2 files changed
+12
-10
lines changed- src
- bun.js/bindings
- bundler/linker_context
2 files changed
+12
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
236 | 236 | | |
237 | | - | |
238 | | - | |
| 237 | + | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 244 | + | |
| 245 | + | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| |||
0 commit comments