-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Strange context change behavior when custom helper inside #each (v4.0.5) #1135
Comments
Thanks for the report. Something certainly seems wrong here. Will have to take a look. |
The issue here is the use of |
Thank you for the fix! |
Please refer to this jsfiddle: http://jsfiddle.net/7ywsdydr/ .
Base on #1028 , when a block customhelper execute options.fn(this) , the context stack should not be pushed.
Here is test 1 to confirm the behavior:
The input data is:
The test 1 output is:
Compare output 1.IF and 2.MYIF we can know the context is not changed when inside the {{#if}} or {{#myif}} block. The {{#myif}} helper is defined as:
Which almost same with {{#if}}. But, when this test be placed into a {{#each}} :
Output will be:
Note on difference between 1.IF and 2.MYIF . The issue is: when {{#if}} do not change the context, in the same time {{#myif}} changed the context. Why?
The text was updated successfully, but these errors were encountered: