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

DavidBruant opened this Issue Jan 18, 2013 · 2 comments


None yet
3 participants

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.


Constellation commented Jan 19, 2013

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

getify commented Sep 22, 2013

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: Constellation#133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment