Skip to content

Commit

Permalink
Do not flush subexpressions
Browse files Browse the repository at this point in the history
They are no longer duplicated with the new helper calling pattern and this also introduced stack corruption issues due to improper value lookups.

Fixes #767
Fixes #768
  • Loading branch information
kpdecker committed Aug 23, 2014
1 parent f4b8c52 commit 19ce981
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lib/handlebars/compiler/javascript-compiler.js
Expand Up @@ -545,13 +545,6 @@ JavaScriptCompiler.prototype = {

var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing';
this.push('((' + lookup + ').call(' + helper.callParams + '))');

// Always flush subexpressions. This is both to prevent the compounding size issue that
// occurs when the code has to be duplicated for inlining and also to prevent errors
// due to the incorrect options object being passed due to the shared register.
if (!isRoot) {
this.flushInline();
}
},

// [invokeKnownHelper]
Expand Down

0 comments on commit 19ce981

Please sign in to comment.