summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/javascript-compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-12-31 16:10:51 -0600
committerkpdecker <kpdecker@gmail.com>2013-12-31 16:10:51 -0600
commitaf3358d1950317db17737baddffdd39895cdb320 (patch)
tree3c21bda15058edfd7b99bdd5af2af4ac18faea81 /lib/handlebars/compiler/javascript-compiler.js
parentf2df220a1f8ecbf2f07ef5b9ba9a317a1d3d6dbc (diff)
downloadhandlebars.js-af3358d1950317db17737baddffdd39895cdb320.zip
handlebars.js-af3358d1950317db17737baddffdd39895cdb320.tar.gz
handlebars.js-af3358d1950317db17737baddffdd39895cdb320.tar.bz2
Fix multiple hash handling in subexpressions
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r--lib/handlebars/compiler/javascript-compiler.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js
index d920d52..7fbddf7 100644
--- a/lib/handlebars/compiler/javascript-compiler.js
+++ b/lib/handlebars/compiler/javascript-compiler.js
@@ -76,6 +76,7 @@ JavaScriptCompiler.prototype = {
this.stackSlot = 0;
this.stackVars = [];
this.registers = { list: [] };
+ this.hashes = [];
this.compileStack = [];
this.inlineStack = [];
@@ -415,11 +416,14 @@ JavaScriptCompiler.prototype = {
}
},
pushHash: function() {
+ if (this.hash) {
+ this.hashes.push(this.hash);
+ }
this.hash = {values: [], types: [], contexts: []};
},
popHash: function() {
var hash = this.hash;
- this.hash = undefined;
+ this.hash = this.hashes.pop();
if (this.options.stringParams) {
this.push('{' + hash.contexts.join(',') + '}');