Merged
Conversation
When function has no default parameter values, Esprima 2 provided an empty array, but Esprima 3 has no `defaults` field at all. So take care of creating the array when needed.
When using Espree parser, it also adds `start` & `end` fields to each node, which we also want to ignore when comparing the nodes.
ECMAScript strict mode forbids octal escapes and Espree parser simply throws an error when it sees one.
Created separate parser module that exposes Esprima-like parse() method, inside which it configures the parser.
This will allow us to extend ESTraverse functionality and make it available for everybody who want to use the traversing.
Extend ESTraverse to support JSX AST node types. Added tests for the full range of JSX syntax. With this, Lebab should now work fine with code containing JSX. Hurray!
Our package.json define Node 0.10 as the baseline - we better test against that. At the same time Node 6 is already out - we better test against the latest stuff as well.
The latter isn't supported by Node < 4.x
This way it's also available for tests, which only require the Traverser class, allowing the tests to run in NodeJS 0.10.x As an added bonus, the polyfill is now imported in just one place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using Espree instead of Esprima to parse the code.
Relatively few small fixes were needed to get our tests to pass with Espree.
New branch without the experiments I did in the other one to get the tests working with old NodeJS versions.
Refs: #128