From 0a17c152895ea3b482614082d18e39f5c26c1975 Mon Sep 17 00:00:00 2001 From: Michael Go Date: Mon, 25 Nov 2024 15:39:48 -0400 Subject: [PATCH] freeze '-' VariableLookup in Expression --- lib/liquid/expression.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/liquid/expression.rb b/lib/liquid/expression.rb index b3e0b36e..32f357e7 100644 --- a/lib/liquid/expression.rb +++ b/lib/liquid/expression.rb @@ -58,7 +58,9 @@ module Liquid 'false' => false, 'blank' => '', 'empty' => '', - '-' => VariableLookup.parse("-", nil), + # in lax mode, minus sign can be a VariableLookup + # For simplicity and performace, we treat it like a literal + '-' => VariableLookup.parse("-", nil).freeze, }.freeze DOT = ".".ord