summaryrefslogtreecommitdiffstats
path: root/spec/partials.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-11-03 10:54:24 -0600
committerkpdecker <kpdecker@gmail.com>2013-11-03 10:58:37 -0600
commitded0a1617fda248252a92d71b12c62a5e8536c33 (patch)
tree62ee34c5f6d749365872bd8f37a74a1431d66017 /spec/partials.js
parent88fefc1521641084d18fe1abf9697a852eedf28c (diff)
downloadhandlebars.js-ded0a1617fda248252a92d71b12c62a5e8536c33.zip
handlebars.js-ded0a1617fda248252a92d71b12c62a5e8536c33.tar.gz
handlebars.js-ded0a1617fda248252a92d71b12c62a5e8536c33.tar.bz2
Protect context-lookups from undefined values
Fixes #166 Fixes #587
Diffstat (limited to 'spec/partials.js')
-rw-r--r--spec/partials.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/partials.js b/spec/partials.js
index fa2fa56..7ff9d3c 100644
--- a/spec/partials.js
+++ b/spec/partials.js
@@ -16,6 +16,13 @@ describe('partials', function() {
"Partials can be passed a context");
});
+ it("partials with undefined context", function() {
+ var string = "Dudes: {{>dude dudes}}";
+ var partial = "{{foo}} Empty";
+ var hash = {};
+ shouldCompileToWithPartials(string, [hash, {}, {dude: partial}], true, "Dudes: Empty");
+ });
+
it("partial in a partial", function() {
var string = "Dudes: {{#dudes}}{{>dude}}{{/dudes}}";
var dude = "{{name}} {{> url}} ";