Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Dynamic props in class body #117

Closed
danez opened this issue Sep 8, 2016 · 2 comments
Closed

Dynamic props in class body #117

danez opened this issue Sep 8, 2016 · 2 comments
Labels

Comments

@danez
Copy link
Member

danez commented Sep 8, 2016

reported by imaxmaxmaximus in phabricator

The parse interprets this

class Cat {

  symbol = 10
  [symbol] = 10
}

as

class Cat {

  symbol = 10[symbol] = 10
}

With semicolon there is a parsing error:

class Cat {

  symbol = 10;
  [symbol] = 10;
}
@danez danez added the i: bug label Sep 8, 2016
@motiz88
Copy link
Contributor

motiz88 commented Sep 22, 2016

Is this still the case now, with #121 merged?

@kaicataldo
Copy link
Member

kaicataldo commented Oct 11, 2016

Edit: Ah, actually, scratch that - forgot to include the classProperties plugin. Looks like it is indeed fixed!

Testing locally with the current master branch, I'm still seeing a parsing error when Babylon tries to parse:

class Cat {
  symbol = 10;
  [symbol] = 10;
}

yields

SyntaxError: Unexpected token (2:9)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants