mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 18:30:40 -07:00
Remove hasnling false scopes
This commit is contained in:
+2
-17
@@ -109,26 +109,11 @@ module Liquid
|
|||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# context['var] #=> nil
|
# context['var] #=> nil
|
||||||
#
|
|
||||||
# false or {} can be used to control if a new scope is needed
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# new_scope = false
|
|
||||||
# context.stack(new_scope) do
|
|
||||||
# # no scope created
|
|
||||||
# end
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# new_scope = {}
|
|
||||||
# context.stack(new_scope) do
|
|
||||||
# # scope created
|
|
||||||
# end
|
|
||||||
#
|
|
||||||
def stack(new_scope = {})
|
def stack(new_scope = {})
|
||||||
push(new_scope) unless new_scope == false
|
push(new_scope)
|
||||||
yield
|
yield
|
||||||
ensure
|
ensure
|
||||||
pop unless new_scope == false
|
pop
|
||||||
end
|
end
|
||||||
|
|
||||||
def clear_instance_assigns
|
def clear_instance_assigns
|
||||||
|
|||||||
Reference in New Issue
Block a user