diff options
author | Kevin Decker <kpdecker@gmail.com> | 2014-01-17 16:07:02 -0800 |
---|---|---|
committer | Kevin Decker <kpdecker@gmail.com> | 2014-01-17 16:07:02 -0800 |
commit | 363cb4b0fb56ad98d19c94b0da797cc52fbbfafd (patch) | |
tree | edb6e3838315de835d5200d54bdb9d328e1d8da2 /lib/handlebars/compiler/compiler.js | |
parent | 93a3725480d07235afcb4155fd876d650e2ff8c0 (diff) | |
parent | e290ec24f131f89ddf2c6aeb707a4884d41c3c6d (diff) | |
download | handlebars.js-363cb4b0fb56ad98d19c94b0da797cc52fbbfafd.zip handlebars.js-363cb4b0fb56ad98d19c94b0da797cc52fbbfafd.tar.gz handlebars.js-363cb4b0fb56ad98d19c94b0da797cc52fbbfafd.tar.bz2 |
Merge pull request #182 from wycats/partial-hash
Context different for partial
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 3c4a9b7..b92289a 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -203,8 +203,14 @@ Compiler.prototype = { var partialName = partial.partialName; this.usePartial = true; - if(partial.context) { - this.ID(partial.context); + if (partial.hash) { + this.accept(partial.hash); + } else { + this.opcode('push', 'undefined'); + } + + if (partial.context) { + this.accept(partial.context); } else { this.opcode('push', 'depth0'); } |