You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 19, 2018. It is now read-only.
I find it a little unintuitive that if you apply a decorator to a method (or other target construct such as a class), the method's location data does not include the decorator, given that the decorators: [] array is a property of the node.
Both the TypeScript and Flow parsers (the only others I believe support decorators) behave differently to Babylon here, their relevant method node location includes the decorator content.
I find it a little unintuitive that if you apply a decorator to a method (or other target construct such as a class), the method's location data does not include the decorator, given that the
decorators: []array is a property of the node.Both the TypeScript and Flow parsers (the only others I believe support decorators) behave differently to Babylon here, their relevant method node location includes the decorator content.
I could not find any guidance on location data within https://github.com/tc39/proposal-decorators
Was this behaviour explicitly discussed and decided on in Babylon? Are there other precedents of nested nodes "overflowing" their parents?
Example Code
Live example: http://astexplorer.net/#/gist/c7692dd145ef9aaa2c9600f976257a2a/bf55ed4537b7520a6c19045d7e9fa4e6f3f11d14
...take a look at the highlighted method for Bablyon vs TypeScript and Flow (and the location data in the AST of course).