Must pop the stack extra for hashes

This commit is contained in:
tomhuda
2013-01-18 15:37:09 -08:00
parent ccd6a22ea5
commit cd9895061b
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -840,6 +840,7 @@ Handlebars.JavaScriptCompiler = function() {};
if (this.options.stringParams) {
var type = this.popStack();
this.popStack();
this.source.push("hashTypes['" + key + "'] = " + type + ";");
}
+5 -2
View File
@@ -1213,10 +1213,13 @@ test("in string mode, information about the types is passed along", function() {
});
test("in string mode, hash parameters get type information", function() {
var template = CompilerContext.compile('{{tomdale desire="need" noun=dad.joke bool=true}}', { stringParams: true });
var template = CompilerContext.compile('{{tomdale he.says desire="need" noun=dad.joke bool=true}}', { stringParams: true });
var helpers = {
tomdale: function(options) {
tomdale: function(exclamation, options) {
equal(exclamation, "he.says");
equal(options.types[0], "ID");
equal(options.hashTypes.desire, "STRING");
equal(options.hashTypes.noun, "ID");
equal(options.hashTypes.bool, "BOOLEAN");