Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.
/ babylon Public archive

Bug fix - #772#778

Closed
rajasekarm wants to merge 4 commits intobabel:masterfrom
rajasekarm:bugfix-772
Closed

Bug fix - #772#778
rajasekarm wants to merge 4 commits intobabel:masterfrom
rajasekarm:bugfix-772

Conversation

@rajasekarm
Copy link
Copy Markdown
Member

Existential return type annot in arrow function confused with *= operator

Q A
Bug fix? yes
Breaking change? no
New feature? yes/no
Deprecations? yes/no
Spec compliancy? no
Tests added/pass? yes
Fixed tickets comma-separated list of tickets fixed by the PR, if any
License MIT

Existential return type annot in arrow function confused with `*=` operator
Copy link
Copy Markdown
Member

@xtuc xtuc left a comment

Choose a reason for hiding this comment

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

Thanks for your pr.

lgtm apart of the linting.

Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

This doesn't work if the *= operator is inside a potential arrow function:

  • (a *= 2)
  • (a = b *= 2): T => a

I'd suggest checking if this.state.exprAllowed is true: if an expression is expected, then *= is not allowed. Doing so would probably also fix the bug with class fields (class A { foo:*=2 })

@xtuc
Copy link
Copy Markdown
Member

xtuc commented Nov 1, 2017

right @nicolo-ribaudo good catch.

@nicolo-ribaudo
Copy link
Copy Markdown
Member

Can you also add a test for class properties?

@danez
Copy link
Copy Markdown
Member

danez commented Nov 1, 2017

We moved babylon back into the monorepo at https://github.com/babel/babel/tree/master/packages/babylon.

Unfortunately pull requests cannot be migrated between repositories automatically. If this PR is still valid please reopen it there.
Thanks for your effort.

@danez danez closed this Nov 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants