Skip to content

Commit 024bbf5

Browse files
committed
NameError (NoMethodError) is copyable
because ISeq is shareable now.
1 parent bc00c44 commit 024bbf5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

bootstraptest/test_ractor.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,18 +1381,17 @@ class C
13811381
}.map{|r| r.value}.join
13821382
}
13831383

1384-
# NameError
1385-
assert_equal "ok", %q{
1384+
# Now NoMethodError is copyable
1385+
assert_equal "NoMethodError", %q{
13861386
obj = "".freeze # NameError refers the receiver indirectly
13871387
begin
13881388
obj.bar
13891389
rescue => err
13901390
end
1391-
begin
1392-
Ractor.new{} << err
1393-
rescue TypeError
1394-
'ok'
1395-
end
1391+
1392+
r = Ractor.new{ Ractor.receive }
1393+
r << err
1394+
r.value.class
13961395
}
13971396

13981397
assert_equal "ok", %q{

0 commit comments

Comments
 (0)