summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/javascript-compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-12-16 17:58:26 -0600
committerkpdecker <kpdecker@gmail.com>2014-12-16 17:59:32 -0600
commit59e80c510391c4535aa07780dc407524f83a9f11 (patch)
tree03b29b7e6324441925a07b5d9f85006fea602694 /lib/handlebars/compiler/javascript-compiler.js
parent69b1bdd32e99e31eec3079171818636812c8bda8 (diff)
downloadhandlebars.js-59e80c510391c4535aa07780dc407524f83a9f11.zip
handlebars.js-59e80c510391c4535aa07780dc407524f83a9f11.tar.gz
handlebars.js-59e80c510391c4535aa07780dc407524f83a9f11.tar.bz2
Track depths on deduped children
Fixes a very specific error case where deduped children won’t receive the depths object due to it being omitted by the caller when optimizing. Fixes #926
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r--lib/handlebars/compiler/javascript-compiler.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js
index 356424b..9bd70be 100644
--- a/lib/handlebars/compiler/javascript-compiler.js
+++ b/lib/handlebars/compiler/javascript-compiler.js
@@ -696,6 +696,8 @@ JavaScriptCompiler.prototype = {
} else {
child.index = index;
child.name = 'program' + index;
+
+ this.useDepths = this.useDepths || child.depths.list.length;
}
}
},