Throw a handlebars exception when attempting to use template partials in VM mode.

This commit is contained in:
kpdecker
2011-07-30 16:01:43 -05:00
parent 8e23ce87d3
commit ccf32821df
2 changed files with 14 additions and 1 deletions
+11
View File
@@ -410,6 +410,17 @@ test("rendering undefined partial throws an exception", function() {
}, Handlebars.Exception, "Should throw exception");
});
test("rendering template partial in vm mode throws an exception", function() {
shouldThrow(function() {
var template = CompilerContext.compile("{{> whatever}}");
var string = "Dudes: {{>dude}} {{another_dude}}";
var dude = "{{name}}";
var hash = {name:"Jeepers", another_dude:"Creepers"};
template();
}, Handlebars.Exception, "Should throw exception");
});
test("GH-14: a partial preceding a selector", function() {
var string = "Dudes: {{>dude}} {{another_dude}}";
var dude = "{{name}}";