Condition#evaluate to receive mandatory context argument

This commit is contained in:
Thierry Joyal
2022-03-02 14:35:31 -05:00
parent fbdab19358
commit 1d2bee1f60
4 changed files with 40 additions and 17 deletions
+7 -1
View File
@@ -61,7 +61,7 @@ module Liquid
@child_condition = nil
end
def evaluate(context = Context.new)
def evaluate(context = deprecated_default_context)
condition = self
result = nil
loop do
@@ -150,6 +150,12 @@ module Liquid
end
end
def deprecated_default_context
warn("DEPRECATION WARNING: Condition#evaluate without a context argument is deprecated" \
" and will be removed from Liquid 6.0.0.")
Context.new
end
class ParseTreeVisitor < Liquid::ParseTreeVisitor
def children
[
+1 -1
View File
@@ -2,5 +2,5 @@
# frozen_string_literal: true
module Liquid
VERSION = "5.2.0"
VERSION = "5.3.0.alpha"
end