diff --git a/ChangeLog b/ChangeLog index 239d380afe..7821c559b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Nov 6 11:45:11 2016 Nobuyoshi Nakada + + * 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 * test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint): diff --git a/lib/e2mmap.rb b/lib/e2mmap.rb index e9cbd6a63d..ba1e87dd85 100644 --- a/lib/e2mmap.rb +++ b/lib/e2mmap.rb @@ -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