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

Remove ForAwaitStatement, add await flag to ForOfStatement #349

Merged
merged 2 commits into from Feb 9, 2017

Conversation

@aweary
Copy link
Contributor

commented Feb 8, 2017

Q A
Bug fix? no
Breaking change? yes
New feature? no
Deprecations? no
Spec compliancy? yes
Tests added/pass? yes
Fixed tickets #348
License MIT

Removes the ForAwaitStatement node type and adds an await flag to the existing ForOfStatement node!

@codecov-io

This comment has been minimized.

Copy link

commented Feb 8, 2017

Codecov Report

Merging #349 into 7.0 will not change coverage.

@@           Coverage Diff           @@
##              7.0     #349   +/-   ##
=======================================
  Coverage   97.65%   97.65%           
=======================================
  Files          19       19           
  Lines        3277     3277           
  Branches      867      867           
=======================================
  Hits         3200     3200           
  Misses         31       31           
  Partials       46       46
Impacted Files Coverage Δ
src/parser/statement.js 97.91% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0309a5b...3e9cb98. Read the comment docs.

@hzoo

This comment has been minimized.

Copy link
Member

commented Feb 8, 2017

Oops forgot to add the extra steps about changing to 7.0 branch (did it)

@hzoo hzoo changed the base branch from master to 7.0 Feb 8, 2017
@hzoo hzoo added this to the 7.0.0 milestone Feb 8, 2017
@hzoo
hzoo approved these changes Feb 8, 2017
Copy link
Member

left a comment

haha I need to make the same change in estree

this.eatContextual("of");
type = "ForAwaitStatement";
} else {

This comment has been minimized.

Copy link
@xtuc

xtuc Feb 8, 2017

Member

Should we set the node.await to false there? According to the changes in the spec I would expect a boolean.

Since undefined is falsy this isn't an issue.

This comment has been minimized.

Copy link
@hzoo

hzoo Feb 8, 2017

Member

Do we do this elsewhere for other flags (false/true)? I think we might

This comment has been minimized.

Copy link
@xtuc

xtuc Feb 8, 2017

Member

I also think so. Don't have much context to answer you. Maybe @danez can.

This comment has been minimized.

Copy link
@aweary

aweary Feb 8, 2017

Author Contributor

Using Function as a reference, the generator and async flags are explicitly set to false when they don't apply, so it seems like it should do the same here.

@aweary

This comment has been minimized.

Copy link
Contributor Author

commented Feb 9, 2017

@xtuc @hzoo I updated so the await flag should always be set on ForOfStatement nodes.

@xtuc

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

I updated the Babel 7 upgrade guide accordingly in babel/website@dd2586a

@danez
danez approved these changes Feb 9, 2017
@danez

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

We need a follow-up story in babel-types, babel-generator and the transforms using ForAwaitStatement to account for this changes.

@xtuc
xtuc approved these changes Feb 9, 2017
Copy link
Member

left a comment

LGTM, nice job 👍

@hzoo

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

why I wish babylon was in the monorepo again

@danez

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

I created a ticket babel/babel#5286

@aweary aweary referenced this pull request Feb 9, 2017
0 of 7 tasks complete
@hzoo hzoo merged commit 56928dc into babel:7.0 Feb 9, 2017
3 checks passed
3 checks passed
codecov/patch 100% of diff hit (target 97.65%)
Details
codecov/project 97.65% (+0%) compared to 0309a5b
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.