Cache SelfDrop per context

This commit is contained in:
Guilherme Carreiro
2026-06-05 10:12:13 +02:00
parent b18930f2ea
commit 771ceccf41
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -79,8 +79,12 @@ class SelfDropContextTest < Minitest::Test
def test_self_drop_repeated_lookups_compare_equal_for_same_context
context = Context.new
drop = context.find_variable("self")
cached_drop = context.find_variable("self")
assert_equal(context.find_variable("self"), context.find_variable("self"))
assert_same(drop, cached_drop)
assert_equal(drop.object_id, cached_drop.object_id)
assert_equal(drop, cached_drop)
end
def test_assigned_self_drop_compares_equal_to_itself