Skip to content

Commit

Permalink
Remove old @_context ivar
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Feb 6, 2025
1 parent f155108 commit 537b76d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/phlex/sgml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@ def call(buffer = +"", context: {}, view_context: nil, fragments: nil, &)
def internal_call(parent: nil, state: nil, &block)
return "" unless render?

if @_context
if @_state
raise Phlex::DoubleRenderError.new(
"You can't render a #{self.class.name} more than once."
)
end

@_context = state
@_state = state

block ||= @_content_block
Expand Down Expand Up @@ -197,7 +196,7 @@ def render(renderable = nil, &)
case renderable
when Phlex::SGML
Thread.current[:__phlex_component__] = [renderable, Fiber.current.object_id].freeze
renderable.internal_call(state: @_context, parent: self, &)
renderable.internal_call(state: @_state, parent: self, &)
Thread.current[:__phlex_component__] = [self, Fiber.current.object_id].freeze
when Class
if renderable < Phlex::SGML
Expand Down

0 comments on commit 537b76d

Please sign in to comment.