Fix performance regression from introduction of Template#disable_tags (#1274)

This commit is contained in:
Dylan Thacker-Smith
2020-08-18 11:25:51 -04:00
committed by GitHub
parent a1d982ca76
commit 2b11efc3ae
16 changed files with 164 additions and 199 deletions
+11 -4
View File
@@ -98,10 +98,17 @@ module Minitest
end
def with_custom_tag(tag_name, tag_class)
Liquid::Template.register_tag(tag_name, tag_class)
yield
ensure
Liquid::Template.tags.delete(tag_name)
old_tag = Liquid::Template.tags[tag_name]
begin
Liquid::Template.register_tag(tag_name, tag_class)
yield
ensure
if old_tag
Liquid::Template.tags[tag_name] = old_tag
else
Liquid::Template.tags.delete(tag_name)
end
end
end
end
end