Fix multiple hash handling in subexpressions

This commit is contained in:
kpdecker
2013-12-31 16:10:51 -06:00
parent f2df220a1f
commit af3358d195
2 changed files with 6 additions and 2 deletions
@@ -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(',') + '}');
+1 -1
View File
@@ -76,7 +76,7 @@ describe('subexpressions', function() {
});
it("as hashes", function() {
var string = '{{blog fun=(equal true true)}}';
var string = '{{blog fun=(equal (blog fun=1) "val is 1")}}';
var helpers = {
blog: function(options) {