Skip to content

Commit

Permalink
Remove Ruby 1.9 code from Lint/ShadowedException cop
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Oct 8, 2017
1 parent 7b97f9b commit 7ef0cf4
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/rubocop/cop/lint/shadowed_exception.rb
Expand Up @@ -116,12 +116,6 @@ def sorted?(rescued_groups)
def rescued_exceptions(rescue_group)
klasses = *rescue_group
klasses.map do |klass|
# `rescue nil` is valid syntax in all versions of Ruby. In Ruby
# 1.9.3, it effectively disables the `rescue`. In versions
# after 1.9.3, a `TypeError` is thrown when the statement is
# rescued. In order to account for this, we convert `nil` to
# `NilClass`.
next 'NilClass' if klass.nil_type?
next unless klass.const_type?
klass.source
end.compact
Expand Down

0 comments on commit 7ef0cf4

Please sign in to comment.