Fix empty string compilation
This commit is contained in:
@@ -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('')(), '');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ function stripFlags(open, close) {
|
||||
|
||||
root
|
||||
: statements EOF { return new yy.ProgramNode($1); }
|
||||
| EOF { return new yy.ProgramNode([]); }
|
||||
;
|
||||
|
||||
program
|
||||
|
||||
Reference in New Issue
Block a user