You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,28 @@
27
27
a:e:try{for(;;)break a}catch{break e}
28
28
```
29
29
30
+
* The minifier now strips empty `finally`clauses ([#4353](https://github.com/evanw/esbuild/issues/4353))
31
+
32
+
This improvement means that `finally` clauses containing dead code can potentially cause the associated `try` statement to be removed from the output entirely in minified builds:
33
+
34
+
```js
35
+
// Original code
36
+
function foo(callback) {
37
+
if (DEBUG) stack.push(callback.name);
38
+
try {
39
+
callback();
40
+
} finally {
41
+
if (DEBUG) stack.pop();
42
+
}
43
+
}
44
+
45
+
// Old output (with --minify --define:DEBUG=false)
46
+
function foo(a){try{a()}finally{}}
47
+
48
+
// New output (with --minify --define:DEBUG=false)
49
+
function foo(a){a()}
50
+
```
51
+
30
52
* Allow tree-shaking of the `Symbol`constructor
31
53
32
54
With this release, calling `Symbol` is now considered to be side-effect free when the argument is known to be a primitive value. This means esbuild can now tree-shake module-level symbol variables:
0 commit comments