* vm_method.c: Remove private attribute warning [Bug #10967]
Patch by @spastorino [Fixes GH-849] https://github.com/ruby/ruby/pull/849 * test/ruby/test_module.rb: Update test for changes git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ac9d6b050b
commit
32a5a098e3
@ -1,3 +1,11 @@
|
|||||||
|
Thu May 21 15:37:32 2015 Zachary Scott <e@zzak.io>
|
||||||
|
|
||||||
|
* vm_method.c: Remove private attribute warning [Bug #10967]
|
||||||
|
Patch by @spastorino [Fixes GH-849]
|
||||||
|
https://github.com/ruby/ruby/pull/849
|
||||||
|
|
||||||
|
* test/ruby/test_module.rb: Update test for changes
|
||||||
|
|
||||||
Thu May 21 10:59:43 2015 Koichi Sasada <ko1@atdot.net>
|
Thu May 21 10:59:43 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* proc.c (method_proc): rename to method_to_proc.
|
* proc.c (method_proc): rename to method_to_proc.
|
||||||
|
@ -836,7 +836,7 @@ class TestModule < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_attr
|
def test_attr
|
||||||
assert_in_out_err([], <<-INPUT, %w(:ok nil), /warning: private attribute\?$/)
|
assert_in_out_err([], <<-INPUT, %w(nil))
|
||||||
$VERBOSE = true
|
$VERBOSE = true
|
||||||
c = Class.new
|
c = Class.new
|
||||||
c.instance_eval do
|
c.instance_eval do
|
||||||
@ -844,7 +844,6 @@ class TestModule < Test::Unit::TestCase
|
|||||||
attr_reader :foo
|
attr_reader :foo
|
||||||
end
|
end
|
||||||
o = c.new
|
o = c.new
|
||||||
o.foo rescue p(:ok)
|
|
||||||
p(o.instance_eval { foo })
|
p(o.instance_eval { foo })
|
||||||
INPUT
|
INPUT
|
||||||
|
|
||||||
|
@ -917,9 +917,9 @@ rb_attr(VALUE klass, ID id, int read, int write, int ex)
|
|||||||
else {
|
else {
|
||||||
if (SCOPE_TEST(NOEX_PRIVATE)) {
|
if (SCOPE_TEST(NOEX_PRIVATE)) {
|
||||||
noex = NOEX_PRIVATE;
|
noex = NOEX_PRIVATE;
|
||||||
rb_warning((SCOPE_CHECK(NOEX_MODFUNC)) ?
|
if (SCOPE_CHECK(NOEX_MODFUNC)) {
|
||||||
"attribute accessor as module_function" :
|
rb_warning("attribute accessor as module_function");
|
||||||
"private attribute?");
|
}
|
||||||
}
|
}
|
||||||
else if (SCOPE_TEST(NOEX_PROTECTED)) {
|
else if (SCOPE_TEST(NOEX_PROTECTED)) {
|
||||||
noex = NOEX_PROTECTED;
|
noex = NOEX_PROTECTED;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user