File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,10 +227,11 @@ var failOnBadTokens = function(tokens) {
227227
228228
229229var pullRoot = function ( tokens ) {
230- var template = R . repeatN ( '#' , tokens . length || 0 ) . join ( '' ) ;
230+ var template = '' ;
231231 if ( lex . check ( tokens [ 0 ] , { token : 'space' } ) ) {
232232 template = tokens . shift ( ) . repr + template ;
233233 }
234+ template += R . repeatN ( '#' , tokens . length || 0 ) . join ( '' ) ;
234235 return astNode ( 'expr' , tokens , { template : template } ) ;
235236} ;
236237
Original file line number Diff line number Diff line change @@ -323,6 +323,9 @@ describe('Parser', function() {
323323
324324describe ( 'Echo compiler' , function ( ) {
325325 describe ( 'on simple minimal-node ASTs' , function ( ) {
326+ it ( 'should work on just whitespace' , function ( ) {
327+ assert . equal ( compileE ( ' ' ) , ' ' ) ;
328+ } ) ;
326329 it ( 'should work for literals' , function ( ) {
327330 assert . equal ( compileE ( '1' ) , '1' ) ;
328331 } ) ;
You can’t perform that action at this time.
0 commit comments