Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support trees with immediate .start and .end (without .range) #401

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

GuyLewin
Copy link

Acorn and Meriyah are generating trees that have .start and .end properties without wrapping .range array.
I added support for parsing such trees + tests to check our range usage

@michaelficarra
Copy link
Member

I'd like to see integration tests here, not just synthetic unit tests. If you're claiming Acorn creates trees of this form, prove it by showing a failing integration test that is fixed by your change.

@GuyLewin
Copy link
Author

@michaelficarra done. Frankly, Acorn is working even without the fix when using ranges: true (like in the current integration test compare-acorn-es6). But without this flag, the default behaviour doesn't. New libraries such as Meriyah or Cherow don't even have this feature - they add .start and .end to nodes like Acorn does by default. When ranges is turned on in Acorn it just duplicates the same values into range and keeps both. I feel like we should support both node types to not break compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants