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

flow: allow generic method with name get or set #55

Merged
merged 2 commits into from Jun 24, 2016

Conversation

Projects
None yet
2 participants
@vkurchatkin
Copy link
Contributor

vkurchatkin commented Jun 24, 2016

No description provided.

@@ -692,9 +693,13 @@ pp.parseClassBody = function (node) {
if (!method.computed) {
let { key } = method;

if (this.hasPlugin("flow") && this.isRelational("<")) {
isGeneric = true;

This comment has been minimized.

@kittens

kittens Jun 24, 2016

Contributor

This logic should be done inside of plugins/flow.js via method overloading.

This comment has been minimized.

@kittens

kittens Jun 24, 2016

Contributor

ie. you could do something like:

pp.isClassMutatorStarter = function () {
  return doSomethingHere;
};

and use this.isClassMutatorStarter() in the if check and then overload isClassMutatorStarter to do your checking.

This comment has been minimized.

@vkurchatkin

vkurchatkin Jun 24, 2016

Author Contributor

Ok! I thought about that, but saw a bunch of hasPlugin just above

This comment has been minimized.

@vkurchatkin

vkurchatkin Jun 24, 2016

Author Contributor

Finding a good name is tricky though, so I'll just use isClassMutatorStarter for now

@kittens kittens merged commit f30f194 into babel:master Jun 24, 2016

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@kittens

This comment has been minimized.

Copy link
Contributor

kittens commented Jun 24, 2016

Awesome, thank you so much @vkurchatkin!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.