Fix empty string compilation

This commit is contained in:
kpdecker
2013-11-04 22:11:53 -06:00
parent 508bb2d55d
commit eea708a18d
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -115,5 +115,9 @@ describe('Regressions', function() {
it("can pass through an already-compiled AST via compile/precompile", function() {
equal(Handlebars.compile(new Handlebars.AST.ProgramNode([ new Handlebars.AST.ContentNode("Hello")]))(), 'Hello');
});
it("can pass through an empty string", function() {
equal(Handlebars.compile('')(), '');
});
}
});
+1
View File
@@ -17,6 +17,7 @@ function stripFlags(open, close) {
root
: statements EOF { return new yy.ProgramNode($1); }
| EOF { return new yy.ProgramNode([]); }
;
program