improve error message on missing helper

Via @stefanpenner
Fixes #523
This commit is contained in:
kpdecker
2013-05-29 10:57:48 -04:00
parent da2aabe7bd
commit 293672432b
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ Handlebars.registerHelper('helperMissing', function(arg) {
if(arguments.length === 2) {
return undefined;
} else {
throw new Error("Could not find property '" + arg + "'");
throw new Error("Missing helper: '" + arg + "'");
}
});
+1 -1
View File
@@ -67,7 +67,7 @@ Handlebars.registerHelper('helperMissing', function(arg) {
if(arguments.length === 2) {
return undefined;
} else {
throw new Error("Could not find property '" + arg + "'");
throw new Error("Missing helper: '" + arg + "'");
}
});
+1 -1
View File
@@ -44,7 +44,7 @@ Handlebars.registerHelper('helperMissing', function(arg) {
if(arguments.length === 2) {
return undefined;
} else {
throw new Error("Could not find property '" + arg + "'");
throw new Error("Missing helper: '" + arg + "'");
}
});
+1 -1
View File
@@ -706,7 +706,7 @@ test("if a context is not found, helperMissing is used", function() {
shouldThrow(function() {
var template = CompilerContext.compile("{{hello}} {{link_to world}}");
template({});
}, [Error, "Could not find property 'link_to'"], "Should throw exception");
}, [Error, "Missing helper: 'link_to'"], "Should throw exception");
});
test("if a context is not found, custom helperMissing is used", function() {