Include partial name in 'undefined partial' exception message

This commit is contained in:
Mark Christian
2015-10-19 09:21:32 -07:00
parent 9365b82900
commit f08d48764d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ HandlebarsEnvironment.prototype = {
extend(this.partials, name);
} else {
if (typeof partial === 'undefined') {
throw new Exception('Attempting to register a partial as undefined');
throw new Exception('Attempting to register a partial called `' + name + '` as undefined');
}
this.partials[name] = partial;
}
+1 -1
View File
@@ -103,7 +103,7 @@ describe('partials', function() {
shouldThrow(function() {
var undef;
handlebarsEnv.registerPartial('undefined_test', undef);
}, Handlebars.Exception, 'Attempting to register a partial as undefined');
}, Handlebars.Exception, 'Attempting to register a partial called `undefined_test` as undefined');
});
it('rendering template partial in vm mode throws an exception', function() {