Skip to content

Commit

Permalink
suppress redefinition warnings
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse authored and znz committed Apr 27, 2019
1 parent 8990779 commit c8b675a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/irb/workspace.rb
Expand Up @@ -49,7 +49,7 @@ def initialize(*main)
@binding = BINDING_QUEUE.pop

when 3 # binding in function on TOPLEVEL_BINDING(default)
@binding = eval("def irb_binding; private; binding; end; irb_binding",
@binding = eval("self.class.remove_method(:irb_binding) if defined?(irb_binding); def irb_binding; private; binding; end; irb_binding",
TOPLEVEL_BINDING,
__FILE__,
__LINE__ - 3)
Expand Down

0 comments on commit c8b675a

Please sign in to comment.