NameError (NoMethodError) is copyable

because ISeq is shareable now.
This commit is contained in:
Koichi Sasada 2025-10-22 03:52:40 +09:00
parent bc00c4468e
commit 024bbf5401
Notes: git 2025-10-23 04:09:07 +00:00

View File

@ -1381,18 +1381,17 @@ assert_equal "#{n}#{n}", %Q{
}.map{|r| r.value}.join
}
# NameError
assert_equal "ok", %q{
# Now NoMethodError is copyable
assert_equal "NoMethodError", %q{
obj = "".freeze # NameError refers the receiver indirectly
begin
obj.bar
rescue => err
end
begin
Ractor.new{} << err
rescue TypeError
'ok'
end
r = Ractor.new{ Ractor.receive }
r << err
r.value.class
}
assert_equal "ok", %q{