bublejs / buble

https://buble.surge.sh
MIT License
869 stars 67 forks source link

Fix trailingFunctionCommas bugs #194

Closed mourner closed 5 years ago

mourner commented 5 years ago

cc @adrianheine

mourner commented 5 years ago

Both bugs happened because */ is two characters while \n is one character, so getting it's index + 1 and then incrementing the index again made us skip the closing parens of a call if there was no white space before it in the \n case, essentially making the code look for "trailing commas" way past the actual call, either freezing or finding a comma from a different context.

adrianheine commented 5 years ago

Thanks!