acornjs / acorn-jsx

Alternative, faster React.js JSX parser
MIT License
646 stars 72 forks source link

Fix loc.end in multi-line jsx attribute values, basic test runner #21

Closed jenseng closed 9 years ago

jenseng commented 9 years ago

This PR ensures multi-line jsx attribute values get the correct loc.end info. Previously it didn't handle newlines, so it treated it as if it were just one really long line. This bad data would cause some really weird behavior when transforming and reprinting via recast. See the updated test and commit message in c3bf25e for more info.

I also brought back just enough of the old test runner code to make sure i didn't break anything ... now npm run test works again :smile:

RReverser commented 9 years ago

Thanks for contribution! I left a few small comments for clean-up, could you please update PR and I'll gladly accept it?

jenseng commented 9 years ago

changes made! let me know if anything else needs tweaking :+1:

RReverser commented 9 years ago

Thanks! Merged and published as 1.0.1.