Fix helpers with recent Handlebars and improve server-side compatibility#4
Open
chromakode wants to merge 3 commits intoloicfrering:masterfrom
Open
Fix helpers with recent Handlebars and improve server-side compatibility#4chromakode wants to merge 3 commits intoloicfrering:masterfrom
chromakode wants to merge 3 commits intoloicfrering:masterfrom
Conversation
Handlebars helpers were broken due to `nameLookup` generating an unexpected ternary in the compiled code's helper lookup expression.
This eases compatibility with jQuery analogues like cheerio.
This helps when running in a non-browser environment like node.
Owner
|
Awesome, thanks a lot @chromakode! In order to be merged, could you please update the according test to get a successful build on Travis CI? |
Author
|
Sorry, missed your reply for some reason. Will do! |
Owner
|
Great, thanks! |
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 believe I've discovered a fix for #2 while hacking around running this module server-side tonight. It looks like Handlebars is applying the
nameLookupfunction to helper lookups now, generating code like this:I'd guess that order of operations is causing this to have an unexpected result. Surrounding the
nameLookupoutput with parentheses got things working again. :)