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

Port to acorn-node for modern syntax support #62

Closed
wants to merge 6 commits into from

Conversation

goto-bus-stop
Copy link

This patch moves from esprima to acorn-node, which has support for many new JS syntax features. It aims to keep up parity with Node.js. For example, async functions and object rest spread now work.

I've mostly kept the old logic intact, comparing nodes with === doesn't work in acorn so I've added an equalNodes function that I think covers all necessary bases.

Note this does not add support for destructuring process.env yet (eg #58), it just prevents envify from erroring out on files that contain new syntax features.

Fixes browserify/tinyify#18

@niftylettuce
Copy link

Amazing. 👏

@niftylettuce
Copy link

Can this be merged? Ping @goto-bus-stop @hughsk

@goto-bus-stop
Copy link
Author

Applied in https://github.com/browserify/envify

@goto-bus-stop goto-bus-stop deleted the new-syntax branch October 16, 2022 10:32
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.

Error: Unexpected token
2 participants