summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-08-15 00:40:07 -0500
committerkpdecker <kpdecker@gmail.com>2014-08-15 00:40:07 -0500
commitf2b5519e76e769842bea8cc92142a4cd792d3921 (patch)
tree19c4c9c322095a1f344b76854df20e8527df025c
parentcc5de5df3c6d5ecd6d3d63d6162e487459494e2f (diff)
downloadhandlebars.js-f2b5519e76e769842bea8cc92142a4cd792d3921.zip
handlebars.js-f2b5519e76e769842bea8cc92142a4cd792d3921.tar.gz
handlebars.js-f2b5519e76e769842bea8cc92142a4cd792d3921.tar.bz2
Strip dead code from javascript compiler
-rw-r--r--lib/handlebars/compiler/javascript-compiler.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js
index 7638fc7..d9c23ee 100644
--- a/lib/handlebars/compiler/javascript-compiler.js
+++ b/lib/handlebars/compiler/javascript-compiler.js
@@ -403,9 +403,6 @@ JavaScriptCompiler.prototype = {
} else {
this.pushStackLiteral('this.data(data, ' + depth + ')');
}
- if (!parts) {
- return;
- }
var len = parts.length;
for (var i = 0; i < len; i++) {
@@ -702,10 +699,6 @@ JavaScriptCompiler.prototype = {
},
programExpression: function(guid) {
- if(guid == null) {
- return 'this.noop';
- }
-
var child = this.environment.children[guid],
depths = child.depths.list,
useDepths = this.useDepths,
@@ -854,11 +847,11 @@ JavaScriptCompiler.prototype = {
}
},
- topStack: function(wrapped) {
+ topStack: function() {
var stack = (this.isInline() ? this.inlineStack : this.compileStack),
item = stack[stack.length - 1];
- if (!wrapped && (item instanceof Literal)) {
+ if (item instanceof Literal) {
return item.value;
} else {
return item;