mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
dd523f1e28d836c8c36f7d75e8ccbc9ae3793102
## Summary
`-constant` is represented as a `UnaryExpression` node that is currently
not part of constant folding. If the operand is a constant number, the
node is folded to `constant * -1`. This also coerces `-0` to `0`,
resulting in `0 === -0` being folded to `true`.
## How did you test this change?
See attached tests
DiffTrain build for [946da518eb](https://github.com/facebook/react/commit/946da518eb2d64d808f9204a72e05892d3005f3f)
react-fbsource-import
Description
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%