Allow subclasses to customize the namespace
This commit is contained in:
@@ -336,6 +336,8 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
initializeBuffer: function() {
|
||||
return this.quotedString("");
|
||||
},
|
||||
|
||||
namespace: "Handlebars",
|
||||
// END PUBLIC API
|
||||
|
||||
compile: function(environment, options, context, asObject) {
|
||||
@@ -406,8 +408,9 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
var out = [];
|
||||
|
||||
if (!this.isChild) {
|
||||
var copies = "helpers = helpers || Handlebars.helpers;";
|
||||
if(this.environment.usePartial) { copies = copies + " partials = partials || Handlebars.partials;"; }
|
||||
var namespace = this.namespace;
|
||||
var copies = "helpers = helpers || " + namespace + ".helpers;";
|
||||
if(this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
|
||||
out.push(copies);
|
||||
} else {
|
||||
out.push('');
|
||||
|
||||
Reference in New Issue
Block a user