diff options
author | Jon Jensen <jenseng@gmail.com> | 2014-02-20 17:10:53 -0600 |
---|---|---|
committer | Jon Jensen <jenseng@gmail.com> | 2014-02-20 17:37:25 -0600 |
commit | 8493822b621470a7423ec05d9f09e717725e3943 (patch) | |
tree | 2776c9ba7034c9c1b32678111fb549410c392c1e /lib/handlebars/compiler/javascript-compiler.js | |
parent | a5ff1f3d22178b3889983be29b31b850a4528719 (diff) | |
download | handlebars.js-8493822b621470a7423ec05d9f09e717725e3943.zip handlebars.js-8493822b621470a7423ec05d9f09e717725e3943.tar.gz handlebars.js-8493822b621470a7423ec05d9f09e717725e3943.tar.bz2 |
properly handle multiple subexpressions in the same hash, fixes #748
push all hash params before popping any so as to avoid the last stackN var
stomping previous ones
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r-- | lib/handlebars/compiler/javascript-compiler.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index 769179b..4c59aae 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -606,11 +606,10 @@ JavaScriptCompiler.prototype = { // [assignToHash] // - // On stack, before: value, hash, ... - // On stack, after: hash, ... + // On stack, before: value, ..., hash, ... + // On stack, after: ..., hash, ... // - // Pops a value and hash off the stack, assigns `hash[key] = value` - // and pushes the hash back onto the stack. + // Pops a value off the stack and assigns it to the current hash assignToHash: function(key) { var value = this.popStack(), context, |