Skip to content

Commit

Permalink
Set Context#initialize instance variables before squashing assigns (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith authored Oct 7, 2020
1 parent b0f4632 commit d250a7f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/liquid/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ def initialize(environments = {}, outer_scope = {}, registers = {}, rethrow_erro
@strict_variables = false
@resource_limits = resource_limits || ResourceLimits.new(Template.default_resource_limits)
@base_scope_depth = 0
squash_instance_assigns_with_environments
@interrupts = []
@filters = []
@global_filter = nil
@disabled_tags = {}

self.exception_renderer = Template.default_exception_renderer
if rethrow_errors
self.exception_renderer = ->(_e) { raise }
end

@interrupts = []
@filters = []
@global_filter = nil
@disabled_tags = {}
# Do this last, since it could result in this object being passed to a Proc in the environment
squash_instance_assigns_with_environments
end
# rubocop:enable Metrics/ParameterLists

Expand Down

0 comments on commit d250a7f

Please sign in to comment.