ruby-changes:32860
From: usa <ko1@a...>
Date: Fri, 14 Feb 2014 14:58:56 +0900 (JST)
Subject: [ruby-changes:32860] usa:r44939 (ruby_1_9_3): merge revision(s) 44628: [Backport #9413]
usa 2014-02-14 14:58:51 +0900 (Fri, 14 Feb 2014) New Revision: 44939 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44939 Log: merge revision(s) 44628: [Backport #9413] * eval.c (rb_mod_s_constants): return its own constants for other than Module itself. [ruby-core:59763] [Bug #9413] Modified directories: branches/ruby_1_9_3/ Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/eval.c branches/ruby_1_9_3/test/ruby/test_module.rb branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 44938) +++ ruby_1_9_3/ChangeLog (revision 44939) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1 +Fri Feb 14 14:58:19 2014 Nobuyoshi Nakada <nobu@r...> + + * eval.c (rb_mod_s_constants): return its own constants for other + than Module itself. [ruby-core:59763] [Bug #9413] + Fri Feb 14 14:40:27 2014 Masaki Matsushita <glass.saga@g...> * array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new(). Index: ruby_1_9_3/eval.c =================================================================== --- ruby_1_9_3/eval.c (revision 44938) +++ ruby_1_9_3/eval.c (revision 44939) @@ -313,8 +313,8 @@ rb_mod_s_constants(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/eval.c#L313 VALUE cbase = 0; void *data = 0; - if (argc > 0) { - return rb_mod_constants(argc, argv, rb_cModule); + if (argc > 0 || mod != rb_cModule) { + return rb_mod_constants(argc, argv, mod); } while (cref) { Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 44938) +++ ruby_1_9_3/version.h (revision 44939) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1 #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 520 +#define RUBY_PATCHLEVEL 521 #define RUBY_RELEASE_DATE "2014-02-14" #define RUBY_RELEASE_YEAR 2014 Index: ruby_1_9_3/test/ruby/test_module.rb =================================================================== --- ruby_1_9_3/test/ruby/test_module.rb (revision 44938) +++ ruby_1_9_3/test/ruby/test_module.rb (revision 44939) @@ -669,6 +669,19 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/ruby/test_module.rb#L669 m.instance_eval { remove_const(:Foo) } end + class Bug9413 + class << self + Foo = :foo + end + end + + def test_singleton_constants + bug9413 = '[ruby-core:59763] [Bug #9413]' + c = Bug9413.singleton_class + assert_include(c.constants(true), :Foo, bug9413) + assert_include(c.constants(false), :Foo, bug9413) + end + def test_frozen_class m = Module.new m.freeze Property changes on: ruby_1_9_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r44628 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/