Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate() error has no message #250

Closed
drom opened this issue Aug 18, 2015 · 9 comments
Closed

generate() error has no message #250

drom opened this issue Aug 18, 2015 · 9 comments

Comments

@drom
Copy link

drom commented Aug 18, 2015

While calling escodegen.generate() it throws an error. try - catch is an empty object. How can I get a little more diagnostics or error messages?

@michaelficarra
Copy link
Member

Are you sure? The only objects thrown by escodegen are instances of Error, which should have a message field. Try running Object.getOwnPropertyNames on it if you are currently using Object.keys; the fields are non-enumerable.

@drom
Copy link
Author

drom commented Aug 19, 2015

Yes, you are right. The is a message. My mistake, I tried to stringify() an Error object and got an empty {}. The message was very short anyway. Something like: Cannot read property 'type' of null so I have to run esvalid in case of error in order to get more info. But it is good. Thank you for help.

@drom drom closed this as completed Aug 19, 2015
@michaelficarra
Copy link
Member

Be careful, esvalid hasn't been updated with support for any of the nodes introduced for ES6 support.

@drom
Copy link
Author

drom commented Aug 19, 2015

woops. Are you serious? Not even let?

@michaelficarra
Copy link
Member

Let uses the existing variable declaration node, so it should be fine. I would love to get a PR that adds ES6 support if someone wants to take it.

@drom
Copy link
Author

drom commented Aug 19, 2015

We have some volunteers for adding ES6 support, if I understand the following issue correctly: #221

@michaelficarra
Copy link
Member

No, I think #221 expresses a desire to change the implementation of escodegen to make use of ES6 features, not add support for generating programs from ES6 AST nodes.

@drom
Copy link
Author

drom commented Aug 21, 2015

Does this sound relevant? estools/esvalid#7

@michaelficarra
Copy link
Member

Yes.

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

No branches or pull requests

2 participants