aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-21 06:40:27 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-21 06:40:27 +0000
commit32a5a098e39e377350e4696d2d9f2d8930f1ec41 (patch)
tree5729c5e3cf0171cb7e2c876f7734bbe85b3abd17
parentac9d6b050b6a475a3a6a683390a08a693e5835fa (diff)
downloadruby-32a5a098e39e377350e4696d2d9f2d8930f1ec41.tar.gz
* 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
-rw-r--r--ChangeLog8
-rw-r--r--test/ruby/test_module.rb3
-rw-r--r--vm_method.c6
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a77ab4781..7ef8a07117 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* proc.c (method_proc): rename to method_to_proc.
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index f1ca0b7cc1..1171e3bc84 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -836,7 +836,7 @@ class TestModule < Test::Unit::TestCase
end
def test_attr
- assert_in_out_err([], <<-INPUT, %w(:ok nil), /warning: private attribute\?$/)
+ assert_in_out_err([], <<-INPUT, %w(nil))
$VERBOSE = true
c = Class.new
c.instance_eval do
@@ -844,7 +844,6 @@ class TestModule < Test::Unit::TestCase
attr_reader :foo
end
o = c.new
- o.foo rescue p(:ok)
p(o.instance_eval { foo })
INPUT
diff --git a/vm_method.c b/vm_method.c
index c7caccb32f..853e66799e 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -917,9 +917,9 @@ rb_attr(VALUE klass, ID id, int read, int write, int ex)
else {
if (SCOPE_TEST(NOEX_PRIVATE)) {
noex = NOEX_PRIVATE;
- rb_warning((SCOPE_CHECK(NOEX_MODFUNC)) ?
- "attribute accessor as module_function" :
- "private attribute?");
+ if (SCOPE_CHECK(NOEX_MODFUNC)) {
+ rb_warning("attribute accessor as module_function");
+ }
}
else if (SCOPE_TEST(NOEX_PROTECTED)) {
noex = NOEX_PROTECTED;