Use template string for error message and double-quotes for quoting partial name

This commit is contained in:
Mark Christian
2015-10-19 09:44:53 -07:00
parent f08d48764d
commit 33b53ef989
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 called `' + name + '` 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 called `undefined_test` 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() {