Skip to content
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

Variable content forgotten when getting out of for loop #115

Closed
rnovacek opened this issue Mar 22, 2019 · 1 comment
Closed

Variable content forgotten when getting out of for loop #115

rnovacek opened this issue Mar 22, 2019 · 1 comment
Labels

Comments

@rnovacek
Copy link

There's a regression in 7.5.0 (it works fine in 7.4.0). Sometimes (I was not able to find out when precisely) a value of a variable assigned inside a for loop get forgotten when the loop is over.

I've made two fiddles:

This one works (using 7.4.0):
https://jsfiddle.net/9tLvrqm2/

This one does not (using 7.5.0):
https://jsfiddle.net/xharmp0f/

Latest version (8.0.0) behaves the same way as 7.5.0 (it's still broken).

It seems that some variable values are reverted when going out from a for loop.

@harttle harttle added the bug label Mar 22, 2019
harttle pushed a commit that referenced this issue Mar 22, 2019
## [8.0.1](v8.0.0...v8.0.1) (2019-03-22)

### Bug Fixes

* incorrect scope when using assign with for, fixes [#115](#115) ([defbb58](defbb58))
@harttle
Copy link
Owner

harttle commented Mar 22, 2019

Tags in liquidjs operates the context differently from shopify/liquid, I think we should also introduce Context#environments to simplify the situation.

It should be fixed now, try 8.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants