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

Decorators on nested classes attach to wrong class #357

Closed
loganfsmyth opened this issue Feb 11, 2017 · 2 comments
Closed

Decorators on nested classes attach to wrong class #357

loganfsmyth opened this issue Feb 11, 2017 · 2 comments

Comments

@loganfsmyth
Copy link
Member

Input Code

@id
export default class Sample {
  method() {
    class Child {}
  }
}

Babylon/Babel Configuration

{
  "plugins": ["decorators"],
}

Expected Behavior

Should output an AST with the decorators property attached to the outer Sample class.

Current Behavior

Outputs an AST with the decorators property attached to the Child class instead.

I'm assuming we're not clearing and then restoring the tracked decorators state when entering a nested class declaration.

@xtuc
Copy link
Member

xtuc commented Feb 12, 2017

Isn't it the same as #259?

@loganfsmyth
Copy link
Member Author

Ah definitely is, not sure how I missed that.

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

No branches or pull requests

3 participants