Repository navigation
Commit 178f141
authored
feat(javascript): fold optional calls of a nullish const in the minifier (#22653)
* feat(javascript): fold optional calls of a nullish const in the minifier
terser reads a variable as nullish only when its fixed value is stored as a
node, so a `const d = void 0` read more than once keeps every `d?.(…)`.
Refs terser/terser#1400
* docs(changeset): keep the minifier entry within 80 characters
* fix(javascript): keep an optional read of an exposed nullish const in the minifier
An exposed variable stays declared, so folding its `?.` read to `void 0`
saves no bytes and can cost gzip.1 parent ff064c2 commit 178f141
3 files changed
Lines changed: 22 additions & 2 deletions
File tree
- .changeset
- lib/javascript
- test/unitCases
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38021 | 38021 | | |
38022 | 38022 | | |
38023 | 38023 | | |
38024 | | - | |
| 38024 | + | |
| 38025 | + | |
| 38026 | + | |
| 38027 | + | |
| 38028 | + | |
| 38029 | + | |
| 38030 | + | |
| 38031 | + | |
| 38032 | + | |
| 38033 | + | |
| 38034 | + | |
38025 | 38035 | | |
38026 | 38036 | | |
38027 | 38037 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
266 | 272 | | |
267 | 273 | | |
268 | 274 | | |
| |||
1189 | 1195 | | |
1190 | 1196 | | |
1191 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1192 | 1202 | | |
1193 | 1203 | | |
1194 | 1204 | | |
| |||
0 commit comments