[前][次][番号順一覧][スレッド一覧]

ruby-changes:32931

From: nagachika <ko1@a...>
Date: Mon, 17 Feb 2014 01:32:14 +0900 (JST)
Subject: [ruby-changes:32931] nagachika:r45010 (ruby_2_0_0): merge revision(s) r44628: [Backport #9413]

nagachika	2014-02-17 01:32:08 +0900 (Mon, 17 Feb 2014)

  New Revision: 45010

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45010

  Log:
    merge revision(s) r44628: [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_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/eval.c
    branches/ruby_2_0_0/test/ruby/test_module.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 45009)
+++ ruby_2_0_0/ChangeLog	(revision 45010)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Mon Feb 17 01:18:04 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]
+
 Mon Feb 17 01:16:00 2014  Eric Wong <e@8...>
 
 	* ext/json/generator/depend: add build dependencies for json extension
Index: ruby_2_0_0/eval.c
===================================================================
--- ruby_2_0_0/eval.c	(revision 45009)
+++ ruby_2_0_0/eval.c	(revision 45010)
@@ -377,8 +377,8 @@ rb_mod_s_constants(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/eval.c#L377
     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_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 45009)
+++ ruby_2_0_0/version.h	(revision 45010)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-02-17"
-#define RUBY_PATCHLEVEL 428
+#define RUBY_PATCHLEVEL 429
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 2
Index: ruby_2_0_0/test/ruby/test_module.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_module.rb	(revision 45009)
+++ ruby_2_0_0/test/ruby/test_module.rb	(revision 45010)
@@ -777,6 +777,19 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_module.rb#L777
     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_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r44628


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]