summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 44228d6..e25e826 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -129,7 +129,7 @@ Handlebars.JavaScriptCompiler = function() {};
// evaluate it by executing `blockHelperMissing`
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
- this.opcode('pushHash');
+ this.opcode('emptyHash');
this.opcode('blockValue');
} else {
this.ambiguousMustache(mustache, program, inverse);
@@ -138,7 +138,7 @@ Handlebars.JavaScriptCompiler = function() {};
// evaluate it by executing `blockHelperMissing`
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
- this.opcode('pushHash');
+ this.opcode('emptyHash');
this.opcode('ambiguousBlockValue');
}
@@ -343,7 +343,7 @@ Handlebars.JavaScriptCompiler = function() {};
if(mustache.hash) {
this.hash(mustache.hash);
} else {
- this.opcode('pushHash');
+ this.opcode('emptyHash');
}
return params;
@@ -360,7 +360,7 @@ Handlebars.JavaScriptCompiler = function() {};
if(mustache.hash) {
this.hash(mustache.hash);
} else {
- this.opcode('pushHash');
+ this.opcode('emptyHash');
}
return params;
@@ -694,6 +694,13 @@ Handlebars.JavaScriptCompiler = function() {};
}
},
+ emptyHash: function() {
+ this.pushStackLiteral('{}');
+
+ if (this.options.stringParams) {
+ this.register('hashTypes', '{}');
+ }
+ },
pushHash: function() {
this.push('{}');