summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/ast.js
diff options
context:
space:
mode:
authorMartin Muñoz <im.mmun@gmail.com>2014-11-02 14:54:54 -0500
committerMartin Muñoz <im.mmun@gmail.com>2014-11-02 18:19:20 -0500
commit12e3d210e8b3b22d19823e59bb789dc8768eb34b (patch)
tree777cf884a4ccb1791221e65e3a1cb89d552d06f2 /lib/handlebars/compiler/ast.js
parent632fadcea39b6328983c459ff7e8c4010a976837 (diff)
downloadhandlebars.js-12e3d210e8b3b22d19823e59bb789dc8768eb34b.zip
handlebars.js-12e3d210e8b3b22d19823e59bb789dc8768eb34b.tar.gz
handlebars.js-12e3d210e8b3b22d19823e59bb789dc8768eb34b.tar.bz2
Simplify BlockNode by removing intermediate MustacheNode
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r--lib/handlebars/compiler/ast.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index e05ceec..05de762 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -79,11 +79,11 @@ var AST = {
this.strip.inlineStandalone = true;
},
- BlockNode: function(mustache, program, inverse, strip, locInfo) {
+ BlockNode: function(sexpr, program, inverse, strip, locInfo) {
LocationInfo.call(this, locInfo);
this.type = 'block';
- this.mustache = mustache;
+ this.sexpr = sexpr;
this.program = program;
this.inverse = inverse;
this.strip = strip;
@@ -93,17 +93,11 @@ var AST = {
}
},
- RawBlockNode: function(mustache, content, close, locInfo) {
+ RawBlockNode: function(sexpr, content, 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;
+ this.sexpr = sexpr;
this.program = new AST.ProgramNode([content], {}, locInfo);
},