File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ function registerDefaultHelpers(instance) {
151151 // We're running the iterations one step out of sync so we can detect
152152 // the last iteration without have to scan the object twice and create
153153 // an itermediate keys array.
154- if ( priorKey ) {
154+ if ( priorKey !== undefined ) {
155155 execIteration ( priorKey , i - 1 ) ;
156156 }
157157 priorKey = key ;
Original file line number Diff line number Diff line change @@ -172,4 +172,14 @@ describe('Regressions', function() {
172172 var result = template ( context ) ;
173173 equals ( result , 'foo' ) ;
174174 } ) ;
175+
176+ it ( 'GH-1021: Each empty string key' , function ( ) {
177+ var data = {
178+ '' : 'foo' ,
179+ 'name' : 'Chris' ,
180+ 'value' : 10000
181+ } ;
182+
183+ shouldCompileTo ( '{{#each data}}Key: {{@key}}\n{{/each}}' , { data : data } , 'Key: \nKey: name\nKey: value\n' ) ;
184+ } ) ;
175185} ) ;
You can’t perform that action at this time.
0 commit comments