summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2025-10-22 03:52:40 +0900
committerKoichi Sasada <ko1@atdot.net>2025-10-23 13:08:26 +0900
commit024bbf54018dce223663be4057316006faab4295 (patch)
tree50c5a39490620fedb9fe56124d1276dfd4c39448
parentbc00c4468e0054ca896d2b83d3020180915f64cf (diff)
NameError (NoMethodError) is copyable
because ISeq is shareable now.
-rw-r--r--bootstraptest/test_ractor.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index 634a3e3e61..65ef07fb73 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -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{