-
-
Notifications
You must be signed in to change notification settings - Fork 256
Unable to decorate generator functions #13
Comments
@loganfsmyth It seems that Parser#parseDecorator() will swallow up the asterisk and parse everything until after the method's name, or rather what it considers to be a call expression, i.e. And since Parser#parseDecorator() calls upon Parser#parseMaybeAssign() I am quite unsure how to proceed further as this is being used all over the place. Perhaps a little help from you guys? |
For reference: @jayphelps proposed a different production for decorators here: |
Yeah I have no idea what the expectation was. When I originally directed you here I thought that the spec had already been updated to cover this. If it hasn't, I'm not sure there is much we can do until there's an official spec decision. |
@loganfsmyth well, you seem to be the go-to guy in all aspects, so I thought that maybe you can call upon someone to also have a look into this, so maybe with the help of @wycats this can then be sorted out, chiming in the guys who implemented babylon and fixing the issues as the spec gets updated... |
I'd love to be able to experiment with this syntax for ember-concurrency.com
but I'm running into this same issue. While there are probably a handful of things that need to be settled about decorators, @wycats tells me the above syntax is uncontroversial; would it be possible to sneak in a fix just for the above (without having to wait for a brand new plugin)? |
This is handled by #587 and will be in the next beta release which should be 7.0.0-beta.15 (soon) |
With the latest babylon@6.7.0 I am unable to decorate generator functions, i.e.
will result in an unexpected error.
Here, it will fail if isGenerator is true.
I am currently working on a patch for this and will report back.
RATIONALE
According to 14.3/14.4 of the ECMAScript specification, a GeneratorMethod (14.4) is a valid MethodDefinition (14.3). And in the decorator specification also states that it can be used with a MethodDefinition and makes no limitations whatsoever.
The text was updated successfully, but these errors were encountered: