@@ -151,7 +151,7 @@ function registerDefaultHelpers(instance) {
|
||||
// We're running the iterations one step out of sync so we can detect
|
||||
// the last iteration without have to scan the object twice and create
|
||||
// an itermediate keys array.
|
||||
if (priorKey) {
|
||||
if (priorKey !== undefined) {
|
||||
execIteration(priorKey, i - 1);
|
||||
}
|
||||
priorKey = key;
|
||||
|
||||
@@ -172,4 +172,14 @@ describe('Regressions', function() {
|
||||
var result = template(context);
|
||||
equals(result, 'foo');
|
||||
});
|
||||
|
||||
it('GH-1021: Each empty string key', function() {
|
||||
var data = {
|
||||
'': 'foo',
|
||||
'name': 'Chris',
|
||||
'value': 10000
|
||||
};
|
||||
|
||||
shouldCompileTo('{{#each data}}Key: {{@key}}\n{{/each}}', {data: data}, 'Key: \nKey: name\nKey: value\n');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user