summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorAlan Johnson <alan@commondream.net>2011-09-02 10:56:37 -0400
committerAlan Johnson <alan@commondream.net>2011-09-02 10:56:37 -0400
commit6b18873d235bcfe40540d3cf569053f795f01405 (patch)
treef55bd5adce20ef9c48997a4a82b67daa135e3952 /lib/handlebars/compiler/compiler.js
parentc1c455acc80ff17b6ef49abd24d0b01fa21e072a (diff)
downloadhandlebars.js-6b18873d235bcfe40540d3cf569053f795f01405.zip
handlebars.js-6b18873d235bcfe40540d3cf569053f795f01405.tar.gz
handlebars.js-6b18873d235bcfe40540d3cf569053f795f01405.tar.bz2
Fixed errors occurring because of undefined properties on nested paths.
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 86b7361..f174393 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -532,7 +532,7 @@ Handlebars.JavaScriptCompiler = function() {};
lookup: function(name) {
var topStack = this.topStack();
- this.source.push(topStack + " = " + this.nameLookup(topStack, name, 'context') + ";");
+ this.source.push(topStack + " = " + topStack + " ? " + this.nameLookup(topStack, name, 'context') + " : " + topStack + ";");
},
pushStringParam: function(string) {