Closed chris-morgan closed 5 years ago
Minimal test case:
[...a ? b : c, d]
Result:
a ? b : c.concat( [d])
Expected:
(a ? b : c).concat( [d])
These two are wildly different!
The workaround is manual parenthesisation:
[...(a ? b : c), d]
Given that you can only spread iterables in array spread, I think ternaries are the only realistic situation where this will matter. (Well, I guess strings could wreck it too—...a + b—but #166 shows spreading strings is broken anyway.)
...a + b
Minimal test case:
Result:
Expected:
These two are wildly different!
The workaround is manual parenthesisation:
Given that you can only spread iterables in array spread, I think ternaries are the only realistic situation where this will matter. (Well, I guess strings could wreck it too—
...a + b
—but #166 shows spreading strings is broken anyway.)