You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current Handlebars.java behavior, the first parameter to a Helper function is either the current context object OR the parameter supplied in the template. From a Helper's perspective, it is not possible to disambiguate these two cases. Thus, it is not possible to do proper parameter validation on the helper's arguments.
The following two calls look identical from a Helper function's perspective:
{{foo}}
{{foo this}}
This behavior of automatically injecting the context object in the first parameter's position when no arguments are supplied also causes Handlebars.java to behave differently than Handlebars JS. Consider the following template:
{{#if}}Yes{{else}}No{{/if}}
In Handlebars.java, this evaluates to Yes.
In Handlebars JS, this produces a runtime error - #if requires exactly one argument.
Please consider providing a mechanism for a Helper function to obtain its actual argument values for all cases.
The text was updated successfully, but these errors were encountered:
In the current Handlebars.java behavior, the first parameter to a Helper function is either the current context object OR the parameter supplied in the template. From a Helper's perspective, it is not possible to disambiguate these two cases. Thus, it is not possible to do proper parameter validation on the helper's arguments.
The following two calls look identical from a Helper function's perspective:
This behavior of automatically injecting the context object in the first parameter's position when no arguments are supplied also causes Handlebars.java to behave differently than Handlebars JS. Consider the following template:
In Handlebars.java, this evaluates to
Yes
.In Handlebars JS, this produces a runtime error -
#if requires exactly one argument
.Please consider providing a mechanism for a Helper function to obtain its actual argument values for all cases.
The text was updated successfully, but these errors were encountered: