From: Michael Edgar Date: 2011-06-27T00:20:26+09:00 Subject: [ruby-core:37535] [Ruby 1.9 - Bug #4438] rescue args type check omitted Issue #4438 has been updated by Michael Edgar. =begin Right now, the current behavior simply calls (({===})) on whichever handlers are listed; this results in interesting possibilities (()). I had assumed it was intended. One could construct interesting possibilities which this behavior: raise an integer, and rescue with a proc which checks if the integer is nonzero, for example. Are we sure we don't want this more general behavior? I personally find the flexibility attractive. =end ---------------------------------------- Bug #4438: rescue args type check omitted http://redmine.ruby-lang.org/issues/4438 Author: Hiroshi Nakamura Status: Assigned Priority: Low Assignee: Koichi Sasada Category: Target version: 1.9.3 ruby -v: - =begin Rescue arg must be class or module in 1.8. 1.9 looks to ignore when it's not a class or module. Is this expected behavior? 0% ruby -ve 'begin; raise; rescue nil; end' ruby 1.9.3dev (2011-02-23 trunk 30945) [x86_64-linux] -e:1:in `
': unhandled exception 1% ruby187 -ve 'begin; raise; rescue nil; end' ruby 1.8.7 (2010-12-23 patchlevel 330) [x86_64-linux] -e:1: class or module required for rescue clause (TypeError) =end -- http://redmine.ruby-lang.org