Skip to content
This repository was archived by the owner on Jan 1, 2019. It is now read-only.

Conversation

@gabeklein
Copy link

Changed FunctionBody to insert a new BlockStatementNode into the AST, as body for FunctionDeclarationNode and FunctionExpressionNode. Reason for this is to maximize compatibility with escodegen, as it expects the node when printing out a function.

It's my opinion that compatibility with escodegen, or any of the other predominant code generators for that matter, is important in making this grammar a valuable tool for those attempting to build supersets of the language.

@@ -0,0 +1 @@
/Users/termtm/Projects/jsparser/ecmascript.js No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack didn't get that in the gitignore; will edit the PR and also get 1 or 2 other fixes in there I also found.

FunctionBody
: SourceElements
{
$$ = new BlockStatementNode($1, createSourceLocation(null, @1, @1))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide a test to illustrate why this is needed.

@cjihrig
Copy link
Owner

cjihrig commented Dec 6, 2016

A lot has changed since this project was originally created. I don't think ecmascript.js should be part of the repo. It should be created at npm publish time.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants