-
Notifications
You must be signed in to change notification settings - Fork 284
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
Bug with recursive partials #53
Comments
Related: mustache/mustache#29 |
Interesting. There is supposedly a test for this in the spec. Thanks for the report. |
I just added something like this as a test and it passes (commit ebf8cbe). Can you send me a pull request with one that doesn't work? If someCondition is always true in your test (or at least a very large number of recursions), it will result in a stack overflow. If it isn't, it should work. |
It was indeed trickier than simple recursion. The template I compile actually extends the one that does recursion. I submitted a test case that shows the StackOverflowError. Sorry for the incomplete report! |
I believe that I have heavy-handidly fixed this issue with this commit: Your test now passes and the other tests still pass. |
I confirm the fix works on my real-world use case with nested partials and recursion. Thanks for looking into this ! |
When trying to use a recursive partial (ie partial that has itself as a partial), for instance
example.mustache
:Mustache fails with a StackOverflowError in
DefaultCode.clone()
:The text was updated successfully, but these errors were encountered: