diff options
author | kpdecker <kpdecker@gmail.com> | 2013-05-31 13:12:06 -0400 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-05-31 13:12:06 -0400 |
commit | 16fd601a5caab026f26fa8adb63e90e22d9f5d77 (patch) | |
tree | da41e66239e486270dd1178e51611211f58dc4d0 /lib/handlebars/compiler/compiler.js | |
parent | ef062adcc24ea2c1c617cbe54de6d8982d739a40 (diff) | |
download | handlebars.js-16fd601a5caab026f26fa8adb63e90e22d9f5d77.zip handlebars.js-16fd601a5caab026f26fa8adb63e90e22d9f5d77.tar.gz handlebars.js-16fd601a5caab026f26fa8adb63e90e22d9f5d77.tar.bz2 |
Merge global and passed helpers and partials
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index c003ce6..8bb1fc5 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -508,8 +508,9 @@ JavaScriptCompiler.prototype = { if (!this.isChild) { var namespace = this.namespace; - var copies = "helpers = helpers || " + namespace + ".helpers;"; - if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; } + + var copies = "helpers = this.merge(helpers, " + namespace + ".helpers);"; + if (this.environment.usePartial) { copies = copies + " partials = this.merge(partials, " + namespace + ".partials);"; } if (this.options.data) { copies = copies + " data = data || {};"; } out.push(copies); } else { |