diff options
author | kpdecker <kpdecker@gmail.com> | 2011-07-31 21:44:27 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2011-07-31 21:44:27 -0500 |
commit | 318c08a97e6f8cce99be04f7fe04b8c6e790e7ae (patch) | |
tree | 12e3176db76d45190040697b6b79a7f06ff1c22b /lib/handlebars/compiler/compiler.js | |
parent | d6b97cf34da55e266aa064add08f6847a9031c17 (diff) | |
download | handlebars.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.js | 4 |
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 + "; }"); + } } }); }, |