e2mmap.rb: remove old definition

* lib/e2mmap.rb (E2MM.def_exception): remove old definition if
  exists so that works multiple times.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-11-06 02:45:14 +00:00
Родитель 75ca064623
Коммит d903681a13
2 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sun Nov 6 11:45:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/e2mmap.rb (E2MM.def_exception): remove old definition if
exists so that works multiple times.
Sun Nov 6 10:03:00 2016 Shugo Maeda <shugo@ruby-lang.org>
* test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint):

Просмотреть файл

@ -134,6 +134,7 @@ module Exception2MessageMapper
def E2MM.def_exception(k, n, m, s = StandardError)
e = Class.new(s)
E2MM.instance_eval{@MessageMap[[k, e]] = m}
k.module_eval {remove_const(n)} if k.const_defined?(n, false)
k.const_set(n, e)
end