Remove hasnling false scopes

This commit is contained in:
Mike Angell
2019-08-31 20:03:54 +10:00
parent 2324564743
commit dafbb4ae90

View File

@@ -109,26 +109,11 @@ module Liquid
# end
#
# 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 = {})
push(new_scope) unless new_scope == false
push(new_scope)
yield
ensure
pop unless new_scope == false
pop
end
def clear_instance_assigns