summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/ast.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-02-09 15:11:12 -0600
committerkpdecker <kpdecker@gmail.com>2014-02-09 15:11:12 -0600
commit14b7ef9066d107dc83deedc8e6791947811cc764 (patch)
tree0ed872da5edb87edc052d34bc45af255864494ae /lib/handlebars/compiler/ast.js
parent9b14dc40a5ff5c3db0b62278dc0ea794c9a16593 (diff)
downloadhandlebars.js-14b7ef9066d107dc83deedc8e6791947811cc764.zip
handlebars.js-14b7ef9066d107dc83deedc8e6791947811cc764.tar.gz
handlebars.js-14b7ef9066d107dc83deedc8e6791947811cc764.tar.bz2
Make raw blocks operate like blocks
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r--lib/handlebars/compiler/ast.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index b9e67d7..286917d 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -131,13 +131,18 @@ var AST = {
}
},
- RawBlockNode: function(mustache, content, locInfo) {
+ RawBlockNode: function(mustache, content, close, locInfo) {
LocationInfo.call(this, locInfo);
+ if (mustache.sexpr.id.original !== close) {
+ throw new Exception(mustache.sexpr.id.original + " doesn't match " + close, this);
+ }
+
+ content = new AST.ContentNode(content, locInfo);
+
this.type = 'block';
this.mustache = mustache;
- mustache.sexpr.isHelper = mustache.isHelper = true;
- mustache.params.splice(0, 0, new AST.StringNode(content, locInfo));
+ this.program = new AST.ProgramNode([content], locInfo);
},
ContentNode: function(string, locInfo) {