Commit 7bb66f2
committed
[compiler][patch] Emit unary expressions instead of negative numbers
This is a babel bug + edge case.
Babel compact mode produces invalid JavaScript (i.e. parse error) when given a `NumericLiteral` with a negative value.
See https://codesandbox.io/p/devbox/5d47fr for repro.
As a followup, we could change our test infra parse babel options (e.g. a babel transform options pragma) which could let us track regressions. We may add an "exhaustive" mode to the compiler test runner to test (1) different babel options and (2) commonly used versions.1 parent 14094f8 commit 7bb66f2
1 file changed
Lines changed: 8 additions & 2 deletions
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1726 | 1726 | | |
1727 | 1727 | | |
1728 | 1728 | | |
1729 | | - | |
| 1729 | + | |
1730 | 1730 | | |
1731 | 1731 | | |
1732 | 1732 | | |
| |||
2582 | 2582 | | |
2583 | 2583 | | |
2584 | 2584 | | |
2585 | | - | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
2586 | 2592 | | |
2587 | 2593 | | |
2588 | 2594 | | |
| |||
0 commit comments