Skip to content
Browse files

fix node creation for empty program

  • Loading branch information...
1 parent 6cd689c commit a8380a61b81dba041e9775f1cc4363079525e8db @zaach zaach committed Jul 6, 2011
Showing with 9 additions and 8 deletions.
  1. +1 −1 lib/grammar.y
  2. +7 −7 standalone/reflect.js
  3. +1 −0 test/reflect-parse.js
View
2 lib/grammar.y
@@ -1066,7 +1066,7 @@ FunctionBody
Program
:
- { return yy.Node('Program'); }
+ { return yy.Node('Program',[],yy.loc(@$)); }
| SourceElements
{ return yy.Node('Program',$1,yy.loc(@1)); }
;
View
14 standalone/reflect.js
7 additions, 7 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 test/reflect-parse.js
@@ -638,6 +638,7 @@ assertDecl("function f(a,b,c) { function b() { } }",
// blockStmt([funDecl(ident("b"), [], blockStmt([]))])));
+program([]).assert(Reflect.parse(""));
// expressions
assertStmt("{(/[]/,']');/1/}", blockStmt([exprStmt(seqExpr([lit(/[]/),lit("]")])),exprStmt(lit(/1/))]));

0 comments on commit a8380a6

Please sign in to comment.
Something went wrong with that request. Please try again.