Skip to content

Update parser to support ES 2018#6452

Merged
sokra merged 3 commits intomasterfrom
update_acorn
Feb 24, 2018
Merged

Update parser to support ES 2018#6452
sokra merged 3 commits intomasterfrom
update_acorn

Conversation

@ooflorent
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

feature

Did you add tests for your changes?

yes

If relevant, link to documentation update:

n/a

Summary

Update the Parser to suport ES2018 new features.

Does this PR introduce a breaking change?

no

Copy link
Copy Markdown
Member

@sokra sokra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add a test for asynchronous iteration

Comment thread lib/Parser.js
for(let propIndex = 0, len = expression.properties.length; propIndex < len; propIndex++) {
const prop = expression.properties[propIndex];
if(prop.type === "SpreadElement") {
this.walkExpression(prop.argument);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the test, but for some reason code coverage seem to say it's not covered...

It's would also be great to add a test with ModuleConcatenation to see if the renaming would correctly rename SpreadElements

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not that simple. Here we are in walkObjectExpression so it only matches for object spread which is not supported in node 6 and node 8. If I add a test, it would break the CI.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a CI/test filter you can add. Have you seen how we do it with uglifyjs-webpack-plugin?

@sokra sokra changed the base branch from next to master February 13, 2018 12:00
@sokra sokra removed the PR: next label Feb 13, 2018
@sokra sokra added this to the webpack 4 milestone Feb 24, 2018
@webpack-bot
Copy link
Copy Markdown
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@webpack-bot
Copy link
Copy Markdown
Contributor

The minimum test ratio has been reached. Thanks!

@sokra sokra merged commit c7eb895 into master Feb 24, 2018
@sokra
Copy link
Copy Markdown
Member

sokra commented Feb 24, 2018

Thanks

@sokra sokra deleted the update_acorn branch February 24, 2018 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants