Skip to content

Commit

Permalink
fixed files form Closure #37
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 969377f commit 7e38bc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ private void traverseFunction(Node n, Node parent) {

// Body
Preconditions.checkState(body.getNext() == null &&
body.isBlock());
body.isBlock(), body);
traverseBranch(body, n);

popScope();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,13 @@ Node processFunctionNode(FunctionNode functionNode) {
node.addChildToBack(lp);

Node bodyNode = transform(functionNode.getBody());
if (!bodyNode.isBlock()) {
// When in ideMode Rhino tries to parse some constructs the compiler
// doesn't support, repair it here. see Rhino's
// Parser#parseFunctionBodyExpr.
Preconditions.checkState(config.isIdeMode);
bodyNode = IR.block();
}
parseDirectives(bodyNode);
node.addChildToBack(bodyNode);
return node;
Expand Down

0 comments on commit 7e38bc5

Please sign in to comment.