erb.rb: Prevent potential unexpected rescue
of LoadError in some method calls, not from `require "strscan"`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9aa33d5ddf
commit
a6986f10d0
@ -501,6 +501,8 @@ class ERB
|
||||
|
||||
begin
|
||||
require 'strscan'
|
||||
rescue LoadError
|
||||
else
|
||||
class SimpleScanner < Scanner # :nodoc:
|
||||
def scan
|
||||
stag_reg = /(.*?)(#{stags.join('|')}|\z)/m
|
||||
@ -540,8 +542,6 @@ class ERB
|
||||
end
|
||||
end
|
||||
Scanner.regist_scanner(ExplicitScanner, '-', false)
|
||||
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
class Buffer # :nodoc:
|
||||
|
Loading…
x
Reference in New Issue
Block a user