Backport #9296

please backport r44380 (visibility of methods defined by define_method)

Added by Usaku NAKAMURA over 1 year ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assignee:Yui NARUSE

Description

this seems a severe incompatibility with ruby 2.0 or earlier.


Related issues

Related to Ruby trunk - Bug #9005: object.send(:define_method, ...){...} creates private method Closed 10/09/2013
Related to Ruby trunk - Bug #9141: define_singleton_method creates private method Closed 11/22/2013

Associated revisions

Revision 44410
Added by Yui NARUSE over 1 year ago

merge revision(s) 44380: [Backport #9296]

* proc.c (rb_mod_define_method): consider visibility only if self
  in the caller is same as the receiver, otherwise make public as
  well as old behavior.   [Bug #9005]
   [Bug #9141]

* vm.c (rb_vm_cref_in_context): return ruby level cref if self is
  same.

Revision 44415
Added by Yui NARUSE over 1 year ago

merge revision(s) 44381: [Backport #9296]

test_method.rb: fix test

* test/ruby/test_method.rb (test_define_method_in_private_scope):

remove extra *, to get the argument itself.

History

#1 Updated by Yui NARUSE over 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r44410.
Usaku, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 44380: [Backport #9296]

* proc.c (rb_mod_define_method): consider visibility only if self
  in the caller is same as the receiver, otherwise make public as
  well as old behavior.   [Bug #9005]
   [Bug #9141]

* vm.c (rb_vm_cref_in_context): return ruby level cref if self is
  same.

Also available in: Atom PDF