mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-28 22:55:12 -07:00
Clean-up Context#stack.
This commit is contained in:
@@ -86,19 +86,13 @@ module Liquid
|
|||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# context['var] #=> nil
|
# context['var] #=> nil
|
||||||
def stack(new_scope={},&block)
|
def stack(new_scope={})
|
||||||
result = nil
|
|
||||||
push(new_scope)
|
push(new_scope)
|
||||||
|
yield
|
||||||
begin
|
|
||||||
result = yield
|
|
||||||
ensure
|
ensure
|
||||||
pop
|
pop
|
||||||
end
|
end
|
||||||
|
|
||||||
result
|
|
||||||
end
|
|
||||||
|
|
||||||
def clear_instance_assigns
|
def clear_instance_assigns
|
||||||
@scopes[0] = {}
|
@scopes[0] = {}
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user