summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2011-07-31 21:44:27 -0500
committerkpdecker <kpdecker@gmail.com>2011-07-31 21:44:27 -0500
commit318c08a97e6f8cce99be04f7fe04b8c6e790e7ae (patch)
tree12e3176db76d45190040697b6b79a7f06ff1c22b /lib/handlebars/compiler/compiler.js
parentd6b97cf34da55e266aa064add08f6847a9031c17 (diff)
downloadhandlebars.js-318c08a97e6f8cce99be04f7fe04b8c6e790e7ae.zip
handlebars.js-318c08a97e6f8cce99be04f7fe04b8c6e790e7ae.tar.gz
handlebars.js-318c08a97e6f8cce99be04f7fe04b8c6e790e7ae.tar.bz2
Do not perform unnecessary self-assign
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 0679135..5f4dca6 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -552,7 +552,9 @@ Handlebars.JavaScriptCompiler = function() {};
this.context.aliases.helperMissing = 'helpers.helperMissing';
this.context.aliases.undef = 'void 0';
this.source.push("else if(" + id + "=== undef) { " + nextStack + " = helperMissing.call(" + helperMissingString + "); }");
- this.source.push("else { " + nextStack + " = " + id + "; }");
+ if (nextStack !== id) {
+ this.source.push("else { " + nextStack + " = " + id + "; }");
+ }
}
});
},