1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
parent 75ca064623
commit d903681a13
2 changed files with 6 additions and 0 deletions

View file

@ -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):

View file

@ -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