summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-12-01 01:23:15 -0600
committerkpdecker <kpdecker@gmail.com>2014-12-16 12:57:46 -0600
commit0d396ccd30b51d3c5ffb7fb3e79670d89b610163 (patch)
tree3849835138494016643d787eadbfc12668eea974 /lib/handlebars/compiler/compiler.js
parentae8c1d229f03558adec418bce6034bf27dcb9d67 (diff)
downloadhandlebars.js-0d396ccd30b51d3c5ffb7fb3e79670d89b610163.zip
handlebars.js-0d396ccd30b51d3c5ffb7fb3e79670d89b610163.tar.gz
handlebars.js-0d396ccd30b51d3c5ffb7fb3e79670d89b610163.tar.bz2
Remove Compiler.depths parameter
This is no longer necessary with the depths array tracking and adds compiler overhead.
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js20
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 534ddb8..71e0ccf 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -98,13 +98,7 @@ Compiler.prototype = {
this.usePartial = this.usePartial || result.usePartial;
this.children[guid] = result;
-
- for(var i=0, l=result.depths.list.length; i<l; i++) {
- depth = result.depths.list[i];
-
- if(depth < 2) { continue; }
- else { this.addDepth(depth - 1); }
- }
+ this.useDepths = this.useDepths || result.useDepths;
return guid;
},
@@ -125,9 +119,6 @@ Compiler.prototype = {
this.isSimple = l === 1;
- this.depths.list = this.depths.list.sort(function(a, b) {
- return a - b;
- });
return this;
},
@@ -303,12 +294,11 @@ Compiler.prototype = {
},
addDepth: function(depth) {
- if(depth === 0) { return; }
-
- if(!this.depths[depth]) {
- this.depths[depth] = true;
- this.depths.list.push(depth);
+ if (!depth) {
+ return;
}
+
+ this.useDepths = true;
},
classifySexpr: function(sexpr) {