Project

General

Profile

Actions

Bug #14094

closed

IRB does not obey frame-level visibility modifiers

Added by headius (Charles Nutter) over 6 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.3.4
[ruby-core:83705]
Tags:

Description

I noticed the following today; IRB does not appear to obey the frame-local visibility modifiers like public and private:

$ irb
:here
irb(main):001:0> private
=> Object
irb(main):002:0> def foo; end; self.class.public_instance_methods.grep :foo
=> [:foo]
irb(main):003:0> private def foo; end; self.class.public_instance_methods.grep :foo
=> []

Note that the binding these commands are executed in is a method scope binding that also has its frame-local visibility set to private, so it seems like IRB is not working properly here.

Updated by jeremyevans0 (Jeremy Evans) about 3 years ago

  • Status changed from Open to Closed

This was fixed in Ruby 3.0, with the change of the default irb context mode from 3 to 4.

Actions

Also available in: Atom PDF

Like0
Like0