Make deep @data trigger the data option
This commit is contained in:
@@ -216,7 +216,7 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
}
|
||||
|
||||
if (id.type === 'DATA') {
|
||||
this.opcode('lookupData', id.id);
|
||||
this.DATA(id);
|
||||
} else if (id.parts.length) {
|
||||
this.opcode('lookupOnContext', id.parts[0]);
|
||||
for(var i=1, l=id.parts.length; i<l; i++) {
|
||||
@@ -252,6 +252,7 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
},
|
||||
|
||||
DATA: function(data) {
|
||||
this.options.data = true;
|
||||
this.opcode('lookupData', data.id);
|
||||
},
|
||||
|
||||
@@ -446,7 +447,8 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
if (!this.isChild) {
|
||||
var namespace = this.namespace;
|
||||
var copies = "helpers = helpers || " + namespace + ".helpers;";
|
||||
if(this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
|
||||
if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
|
||||
if (this.options.data) { copies = copies + " data = data || {};"; }
|
||||
out.push(copies);
|
||||
} else {
|
||||
out.push('');
|
||||
|
||||
Reference in New Issue
Block a user