From dafbb4ae904b93de93bd80a555bcf4fcc2a31f4f Mon Sep 17 00:00:00 2001 From: Mike Angell Date: Sat, 31 Aug 2019 20:03:54 +1000 Subject: [PATCH] Remove hasnling false scopes --- lib/liquid/context.rb | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/liquid/context.rb b/lib/liquid/context.rb index b341a31..bf12dc1 100644 --- a/lib/liquid/context.rb +++ b/lib/liquid/context.rb @@ -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