ruby-changes:46707
From: k0kubun <ko1@a...>
Date: Sun, 21 May 2017 01:20:14 +0900 (JST)
Subject: [ruby-changes:46707] k0kubun:r58822 (trunk): erb.rb: Prevent potential unexpected rescue
k0kubun 2017-05-21 01:20:07 +0900 (Sun, 21 May 2017) New Revision: 58822 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58822 Log: erb.rb: Prevent potential unexpected rescue of LoadError in some method calls, not from `require "strscan"`. Modified files: trunk/lib/erb.rb Index: lib/erb.rb =================================================================== --- lib/erb.rb (revision 58821) +++ lib/erb.rb (revision 58822) @@ -501,6 +501,8 @@ class ERB https://github.com/ruby/ruby/blob/trunk/lib/erb.rb#L501 begin require 'strscan' + rescue LoadError + else class SimpleScanner < Scanner # :nodoc: def scan stag_reg = /(.*?)(#{stags.join('|')}|\z)/m @@ -540,8 +542,6 @@ class ERB https://github.com/ruby/ruby/blob/trunk/lib/erb.rb#L542 end end Scanner.regist_scanner(ExplicitScanner, '-', false) - - rescue LoadError end class Buffer # :nodoc: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/