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

Code generation produces invalid JavaScript #251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

levjj
Copy link
Contributor

@levjj levjj commented Apr 7, 2014

The default code generation for an AST that calls a function node is in broken.

In the following example...

var src = "(function() { return 23; })()";
var src2 = lively.ast.Parser.parse(src, "topLevel").asJS();  //  "function() { return 23 }()";

...src2 omits the parantheses around the function literal which produces code that cannot be parsed. This effects both Chrome and Firefox.

The attached patch fixes this bug.

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

Successfully merging this pull request may close these issues.

None yet

1 participant