Commit 47ce190
authored
Turbopack's analyzer: always treat promises as truth-y and non-nullish (vercel#94186)
Promises are not included in the list of JavaScript's falsy values,
therefore, they are always truthy. See
https://developer.mozilla.org/en-US/docs/Glossary/Truthy. Additionally,
promises are neither `null` or `undefined` so they are not nullish:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing.
This PR updates Turbopack's analyzer to reflect this + adds unit tests
for `is_truthy` and `is_nullish`.1 parent 5ee7005 commit 47ce190
1 file changed
Lines changed: 43 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2430 | 2430 | | |
2431 | 2431 | | |
2432 | 2432 | | |
| 2433 | + | |
2433 | 2434 | | |
2434 | 2435 | | |
2435 | 2436 | | |
| |||
2515 | 2516 | | |
2516 | 2517 | | |
2517 | 2518 | | |
| 2519 | + | |
2518 | 2520 | | |
2519 | 2521 | | |
2520 | 2522 | | |
| |||
4017 | 4019 | | |
4018 | 4020 | | |
4019 | 4021 | | |
4020 | | - | |
| 4022 | + | |
4021 | 4023 | | |
4022 | 4024 | | |
4023 | 4025 | | |
| |||
4686 | 4688 | | |
4687 | 4689 | | |
4688 | 4690 | | |
| 4691 | + | |
| 4692 | + | |
| 4693 | + | |
| 4694 | + | |
| 4695 | + | |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
| 4703 | + | |
| 4704 | + | |
| 4705 | + | |
| 4706 | + | |
| 4707 | + | |
| 4708 | + | |
| 4709 | + | |
| 4710 | + | |
| 4711 | + | |
| 4712 | + | |
| 4713 | + | |
| 4714 | + | |
| 4715 | + | |
| 4716 | + | |
| 4717 | + | |
| 4718 | + | |
| 4719 | + | |
| 4720 | + | |
| 4721 | + | |
| 4722 | + | |
| 4723 | + | |
| 4724 | + | |
| 4725 | + | |
| 4726 | + | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
4689 | 4731 | | |
0 commit comments