mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
90d94de3b0
commit
86d4408ce9
4 changed files with 21 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Feb 14 14:58:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@gmail.com>
|
Fri Feb 14 14:40:27 2014 Masaki Matsushita <glass.saga@gmail.com>
|
||||||
|
|
||||||
* array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new().
|
* array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new().
|
||||||
|
|
4
eval.c
4
eval.c
|
@ -313,8 +313,8 @@ rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
|
||||||
VALUE cbase = 0;
|
VALUE cbase = 0;
|
||||||
void *data = 0;
|
void *data = 0;
|
||||||
|
|
||||||
if (argc > 0) {
|
if (argc > 0 || mod != rb_cModule) {
|
||||||
return rb_mod_constants(argc, argv, rb_cModule);
|
return rb_mod_constants(argc, argv, mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (cref) {
|
while (cref) {
|
||||||
|
|
|
@ -669,6 +669,19 @@ class TestModule < Test::Unit::TestCase
|
||||||
m.instance_eval { remove_const(:Foo) }
|
m.instance_eval { remove_const(:Foo) }
|
||||||
end
|
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
|
def test_frozen_class
|
||||||
m = Module.new
|
m = Module.new
|
||||||
m.freeze
|
m.freeze
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#define RUBY_VERSION "1.9.3"
|
#define RUBY_VERSION "1.9.3"
|
||||||
#define RUBY_PATCHLEVEL 520
|
#define RUBY_PATCHLEVEL 521
|
||||||
|
|
||||||
#define RUBY_RELEASE_DATE "2014-02-14"
|
#define RUBY_RELEASE_DATE "2014-02-14"
|
||||||
#define RUBY_RELEASE_YEAR 2014
|
#define RUBY_RELEASE_YEAR 2014
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue