mirror of
https://github.com/Shopify/liquid.git
synced 2026-01-28 04:54:25 +00:00
Previously, strict2 case/when used `safe_parse_expression`
to parse when expressions causing `blank`/`empty` to be
treated as string literals (Expression::LITERALS maps 'empty' => ''),
rather than method literals
This caused unexpected behavior:
```
{%- case empty_obj -%}
{%- when empty -%}
previously: doesn't render (empty_obj == '' is false)
now: renders (empty_obj.empty? is true)
{%- endcase -%}
```
This commit instead calls `Condition.parse_expression`
with `safe: true`, which will correctly handle `blank`
and `empty`