mirror of
https://github.com/hanzoai/swc.git
synced 2026-10-30 19:42:53 +00:00
**Description:**
I was seeing this snapshot test failure when trying to upgrade swc in
Turbopack:
```js
--- expected
+++ actual
@@ -1,3 +1,3 @@
-module.exports=["index.js",(t,e,o)=>{let s="Hello";console.log("Hello, world!",3,s),console.log(s)}];
+module.exports=["index.js",(o,s,t)=>{const e="Hello";console.log("Hello, world!",3,e),console.log(e)}];
```
The problem was that `is_top_level` was true here, even though the code
is inside an arrow function:
https://github.com/swc-project/swc/blob/27931895f59135e11f83a4ddf1d311bdcde97321/crates/swc_ecma_minifier/src/compress/optimize/mod.rs#L2836
Probably caused by https://github.com/swc-project/swc/pull/11035