bublejs / buble

https://buble.surge.sh
MIT License
871 stars 64 forks source link

Make sure closing parens and braces are added in the right order #153

Closed marijnh closed 6 years ago

marijnh commented 6 years ago

See issue #152

Before, the if a destructuring assignment expression was wrapped in parens, but also wrapped in braces because it was a brace-less if statement's body, the closing brace would end up before the closing parenthesis.

On the whole, magic-string seems to be scarily fragile for stuff like this, but this fix seems to address the problem.

adrianheine commented 6 years ago

Merged as 8117b6902507374a2a88da3e763eda3e37387869.

marijnh commented 6 years ago

Thanks!