Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Throw an error if comments can't be attached #86

DavidBruant opened this Issue · 2 comments

3 participants

David Bruant Yusuke Suzuki Kyle Simpson
David Bruant

If esprima has been used to generate a tree without any of range, tokens or comment options, I think escodegen can't output the comments. I think escodegen should just throw (or at least console.warn) in these cases to indicate that comments can't be properly outputed.

Yusuke Suzuki

Thanks. You're right.
I'll add guard to escodegen.generate method.

Kyle Simpson

I've submitted a PR which I think would provide a mechanism that would allow all validly trackable comments to be encoded into the AST in a way that escodegen can then output: #133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.