mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue