Adopt 'undef context='

This commit is contained in:
Guilherme Carreiro
2026-05-13 10:36:44 +02:00
parent 8d8105a452
commit 3f5a7faeb2
3 changed files with 17 additions and 8 deletions
+2 -2
View File
@@ -31,10 +31,10 @@ module Liquid
@self_context.variable_defined?(key)
end
undef context
def to_liquid
self
end
undef context=
end
end
+4 -2
View File
@@ -151,8 +151,10 @@ module Liquid
c
when Liquid::Drop
drop = args.shift
drop.context = Context.new([drop, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits, {}, @environment)
drop = args.shift
c = Context.new([drop, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits, {}, @environment)
drop.context = c if drop.respond_to?(:context=)
c
when Hash
Context.new([args.shift, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits, {}, @environment)
when nil