Fix DATA value in stringParams mode

Fixes #699
This commit is contained in:
kpdecker
2014-01-06 02:40:43 -06:00
parent 08fab253ef
commit fc60f16475
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -189,6 +189,7 @@ var AST = {
LocationInfo.call(this, locInfo);
this.type = "DATA";
this.id = id;
this.stringModeValue = id.stringModeValue;
},
StringNode: function(string, locInfo) {
+15
View File
@@ -158,4 +158,19 @@ describe('string params mode', function() {
var result = template({}, {helpers: helpers});
equals(result, "WITH");
});
it('should handle DATA', function() {
var template = CompilerContext.compile('{{foo @bar}}', { stringParams: true });
var helpers = {
foo: function(bar, options) {
equal(bar, 'bar');
equal(options.types[0], 'DATA');
return 'Foo!';
}
};
var result = template({}, { helpers: helpers });
equal(result, 'Foo!');
});
});