Skip to content

Commit

Permalink
Create data frame for @partial-block
Browse files Browse the repository at this point in the history
Fixes #1099
  • Loading branch information
kpdecker committed Sep 24, 2015
1 parent 861d6f7 commit 94c840b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/handlebars/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export function invokePartial(partial, context, options) {

let partialBlock;
if (options.fn && options.fn !== noop) {
options.data = createFrame(options.data);
partialBlock = options.data['partial-block'] = options.fn;

if (partialBlock.partials) {
Expand Down
8 changes: 8 additions & 0 deletions spec/regressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,12 @@ describe('Regressions', function() {
};
shouldCompileToWithPartials(string, [{}, {}, partials], true, 'doctypelayoutsubcontent');
});
it('GH-1099: should support greater than 3 nested levels of inline partials', function() {
var string = '{{#> layout}}Outer{{/layout}}';
var partials = {
layout: '{{#> inner}}Inner{{/inner}}{{> @partial-block }}',
inner: ''
};
shouldCompileToWithPartials(string, [{}, {}, partials], true, 'Outer');
});
});

0 comments on commit 94c840b

Please sign in to comment.