This repository has been archived by the owner. It is now read-only.

Fix lookahead to not add comments to arrays which are not cloned #76

Merged
merged 1 commit into from Jul 17, 2016

Conversation

Projects
None yet
2 participants
@danez
Copy link
Member

danez commented Jul 13, 2016

We do not clone arrays in lookahead() but comments are added to the leading/trailing arrays during lookahead. The next next() call would then add the comments again, leading to this comments being in this arrays twice.
This was showing as test failure since #42 was merged, but was not a problem introduced by this PR.

Also extracted parsing of JSXSpreadChild to own parse function.

cc @kittens @calebmer

Fix lookahead to not add comments to arrays which are not cloned
We do not clone arrays in lookahead() but comments were added
to leading/trailing arrays during lookahead, leading to leak to the next next() call.

Also extracted parsing of JSXSpreadChild to own parse function.

@danez danez added the Tag: Bug Fix label Jul 13, 2016

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jul 13, 2016

Current coverage is 96.69%

No coverage report found for master at 3fad8cc.

Powered by Codecov. Last updated by 3fad8cc...700068b

@divmain divmain referenced this pull request Jul 17, 2016

Merged

Comment node loc.filename #80

@danez danez merged commit 88d7e20 into babel:master Jul 17, 2016

3 checks passed

codecov/patch 100% of diff hit (target 96.69%)
Details
codecov/project Absolute coverage decreased by -0.31% but relative coverage increased by +2.99% compared to b00ba47
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@danez danez deleted the danez:fix-lookahead-in-spread-child branch Jul 17, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.