mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
NameError (NoMethodError) is copyable
because ISeq is shareable now.
This commit is contained in:
parent
bc00c4468e
commit
024bbf5401
Notes:
git
2025-10-23 04:09:07 +00:00
@ -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{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user