Fix failure when using decorators in partials

This commit is contained in:
kpdecker
2015-09-02 20:43:54 -05:00
parent f71f4e759e
commit 05b82a203e
2 changed files with 10 additions and 0 deletions
@@ -703,6 +703,7 @@ JavaScriptCompiler.prototype = {
}
options.helpers = 'helpers';
options.partials = 'partials';
options.decorators = 'container.decorators';
if (!isDynamic) {
params.unshift(this.nameLookup('partials', name, 'partial'));
+9
View File
@@ -203,4 +203,13 @@ describe('Regressions', function() {
array[3] = 'bar';
shouldCompileTo('{{#each array}}{{@index}}{{.}}{{/each}}', {array: array}, '1foo3bar');
});
it('should support multiple levels of inline partials', function() {
var string = '{{#> layout}}{{#*inline "subcontent"}}subcontent{{/inline}}{{/layout}}';
var partials = {
doctype: 'doctype{{> content}}',
layout: '{{#> doctype}}{{#*inline "content"}}layout{{> subcontent}}{{/inline}}{{/doctype}}'
};
shouldCompileToWithPartials(string, [{}, {}, partials], true, 'doctypelayoutsubcontent');
});
});