-
-
Notifications
You must be signed in to change notification settings - Fork 238
A few built-in filters don't support undefined values #481
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
Labels
Comments
I checked the behavior of shopify/liquid for these cases (except that they don't have a json filter). Here's some changes will be made on LiquidJS to align with Ruby:
|
harttle
added a commit
that referenced
this issue
Feb 26, 2022
github-actions bot
pushed a commit
that referenced
this issue
Feb 26, 2022
## [9.35.1](v9.35.0...v9.35.1) (2022-02-26) ### Bug Fixes * some filters throw on nil input, see [#481](#481) ([7dfb620](7dfb620))
Awesome, thanks… Here's the current results for 9.35.1 (where
Looks like the only curious entry in 9.35.1 is <p>{{ foo | concat | size }} === 1</p>
<p>{{ foo | concat | json }} === [null]</p> |
harttle
added a commit
that referenced
this issue
Mar 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #479
[email protected]
Apologies for the bad code:
OUTPUT
Interestingly it looks like
{{ undefined | escape_once }}
returns the literal string "undefined". Otherwise nothing too suspicious looking here (all the math functions seems to return NaN, which is semi-expected).If I append the
| json
filter to each test case, it gets more interesting:It looks like the
NaN
now converts tonull
(presumablyNaN
isn't valid JSON). Interesting cases might be:The text was updated successfully, but these errors were encountered: