summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/handlebars/compiler/ast.js1
-rw-r--r--spec/string-params.js15
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index 002fd3b..dda682e 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -189,6 +189,7 @@ var AST = {
LocationInfo.call(this, locInfo);
this.type = "DATA";
this.id = id;
+ this.stringModeValue = id.stringModeValue;
},
StringNode: function(string, locInfo) {
diff --git a/spec/string-params.js b/spec/string-params.js
index 920b855..1cebc6f 100644
--- a/spec/string-params.js
+++ b/spec/string-params.js
@@ -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!');
+ });
});