summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-07-30 10:24:09 -0500
committerkpdecker <kpdecker@gmail.com>2013-10-14 22:50:50 -0500
commit14ef86f9ca5717033499e69ad47f5a2847dd1261 (patch)
tree8f9e54cea7d63f66d6b63cf8e5a883e1215d895f /lib/handlebars/compiler/compiler.js
parenta1edab6ef578d4dacb7811c8587306194fa9d54a (diff)
downloadhandlebars.js-14ef86f9ca5717033499e69ad47f5a2847dd1261.zip
handlebars.js-14ef86f9ca5717033499e69ad47f5a2847dd1261.tar.gz
handlebars.js-14ef86f9ca5717033499e69ad47f5a2847dd1261.tar.bz2
Use accept for all compiler traversal
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 50195e3..5b782c4 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -72,6 +72,7 @@ Compiler.prototype = {
guid: 0,
compile: function(program, options) {
+ this.opcodes = [];
this.children = [];
this.depths = {list: []};
this.options = options;
@@ -93,7 +94,7 @@ Compiler.prototype = {
}
}
- return this.program(program);
+ return this.accept(program);
},
accept: function(node) {
@@ -102,11 +103,9 @@ Compiler.prototype = {
program: function(program) {
var statements = program.statements, statement;
- this.opcodes = [];
for(var i=0, l=statements.length; i<l; i++) {
- statement = statements[i];
- this[statement.type](statement);
+ this.accept(statements[i]);
}
this.isSimple = l === 1;