-
-
Notifications
You must be signed in to change notification settings - Fork 238
for tag does not support valueOf recognition in Drop #515
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
for tag does not support valueOf recognition in Drop #515
Comments
@harttle Hi~ |
Try adding json filter as you’re in Shopify template This {{ name }}: {{errors|json}} -- {% for field in errors %} ={{ field|json }}= {% endfor %}', {
name: 'valueOf', The way LiquidJS iterate objects can be different. I can try fix it as a bug. |
🎉 This issue has been resolved in version 9.39.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Try v9.39.0, now LiquidJS aligns with shopify in treating c3e51ca#diff-a78edf8898b08c521478be171016452cfe322e302f08d167e0f931376b2e7d68R64-R74 For Drop iteration, maybe you're interested in this: liquidjs/test/integration/builtin/tags/for.ts Lines 321 to 330 in 4289b4e
Note that if you decide to use |
Shopify Code example:
The above is the liquid code structure that outputs the error information in the form form in Shopify, in which for is used to traverse form.errors and use it as an index key.


The result of execution in Shopify is:
and
-------------------------------------------------------------problem lies in------------------------------------------------------------
Using liquidjs for simulation adaptation, it was found that the valueOf in Drop was not responded to.
I defined an object named ErrorsDrop, assigned it to the errors variable, and traversed the errors through the for tag, and got the following results:
Personally think that when for in is followed by a Drop object, it should respond to the result after its valueOf(). Otherwise, writing similar to Shopify will not take effect
The text was updated successfully, but these errors were encountered: