Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failover content" not working in multiple levels of inline partials #1089

Closed
michaellopez opened this issue Sep 3, 2015 · 2 comments
Closed

Comments

@michaellopez
Copy link

This is a follow up on #1018

I came up with this test to illustrate the issue.

it('should support failover content in multiple levels of inline partials', function() {
    var string = '{{#> layout}}{{/layout}}';
    var partials = {
      doctype: 'doctype{{> content}}',
      layout: '{{#> doctype}}{{#*inline "content"}}layout{{#> subcontent}}subcontent{{/subcontent}}{{/inline}}{{/doctype}}'
    };
    shouldCompileToWithPartials(string, [{}, {}, partials], true, 'doctypelayoutsubcontent');
  });

Gives me this:

...
  1) Regressions should support failover content in multiple levels of inline partials:
     TypeError: Cannot read property 'inline' of undefined
      at Function.eval (eval at compile (.../handlebars.js/dist/cjs/handlebars/compiler/javascript-compiler.js:9:6645), <anonymous>:5:18)
      at executeDecorators (dist/handlebars.runtime.js:1206:16)
      at wrapProgram (dist/handlebars.runtime.js:1142:11)
      at Object.program (dist/handlebars.runtime.js:1046:27)
      at Object.eval (eval at createFunctionContext (.../handlebars.js/dist/cjs/handlebars/compiler/javascript-compiler.js:9:13103), <anonymous>:5:102)
      at main (dist/handlebars.runtime.js:1093:33)
      at Object.ret (dist/handlebars.runtime.js:1096:13)
      at Object.ret [as layout] (.../handlebars.js/dist/cjs/handlebars/compiler/compiler.js:9:28227)
      at Object.invokePartialWrapper [as invokePartial] (dist/handlebars.runtime.js:992:47)
      at Object.eval (eval at createFunctionContext (.../handlebars.js/dist/cjs/handlebars/compiler/javascript-compiler.js:9:13103), <anonymous>:5:31)
...

For all three environments: runtime, browser, node.

Unfortunatly I am not familiar with the code base, so I'm having a hard time writing the fix and submitting a PR.

@kpdecker

@kpdecker
Copy link
Collaborator

kpdecker commented Sep 4, 2015

Thanks for the test case!

@kpdecker
Copy link
Collaborator

kpdecker commented Sep 4, 2015

Released in 4.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants