added 'include' helper for #182#368
Closed
lwille wants to merge 1 commit intohandlebars-lang:masterfrom
Closed
Conversation
Author
|
I don't really understand why travis tests something else than It seems somehow related to |
Collaborator
|
I'm sorry for not giving this any attention after being opened so long ago. The hash passing approach is a good one but this should be part of the core partials syntax as it avoids the caveat above and make this a proper first level implementation. I will provide an update on #182 implementing something to that effect. |
jon-bell
pushed a commit
to FlakyTestDetection/handlebars-java
that referenced
this pull request
Jul 21, 2017
this is the include helper as proposed in this pull request of the js implementation: handlebars-lang/handlebars.js#368 the test case which accesses the parent context can't be run yet because the parser will have to be modified and I'll need some help with that once I know if this has a chance of being merged.
jon-bell
pushed a commit
to FlakyTestDetection/handlebars-java
that referenced
this pull request
Jul 21, 2017
….java during the evaluation of partials * See jknack/handlebars.java#140 * See handlebars-lang/handlebars.js#368 * See handlebars-lang/handlebars.js#182
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added an "include" helper to allow passing of distinct objects down to the partial. Mainly inspired by @chickenwing and @ustun.
I did so after investigating into the structure of the compiler because I didn't see any obvious solution to reference the correct context (mainly due to missing knowledge about bison compilers in general).
Caveat: The helper only finds partials that are correctly registered and not passed in through compile options.