From 1974aa5277c28150463e6d31135b091818291112 Mon Sep 17 00:00:00 2001 From: wycats Date: Wed, 29 Dec 2010 19:23:23 -0800 Subject: [PATCH] If the partial is not found, an exception should be thrown --- lib/handlebars/vm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/handlebars/vm.js b/lib/handlebars/vm.js index f67277e6..17c03109 100644 --- a/lib/handlebars/vm.js +++ b/lib/handlebars/vm.js @@ -615,7 +615,9 @@ Handlebars.VM = { return new Handlebars.JavaScriptCompiler().compile(environment); }, invokePartial: function(partial, name, context, helpers, partials) { - if(partial instanceof Function) { + if(partial === undefined) { + throw new Handlebars.Exception("The partial " + name + " could not be found"); + } else if(partial instanceof Function) { return partial(context, helpers, partials); } else { partials[name] = Handlebars.VM.compile(partial);