summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-17 08:58:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-17 08:58:05 +0000
commit5c92de87b439d5c5cbe96132b28007bd7326d728 (patch)
treee67e72d57c2605c109d5180d1dec6f0c6e7d62af /eval.c
parent2c3522c3e403dfdadaaf6095564bde364cc4bddf (diff)
eval.c: singleton class constants
* 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/trunk@44628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 92fbceb1d9..c34dd2cdd9 100644
--- a/eval.c
+++ b/eval.c
@@ -378,8 +378,8 @@ rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
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) {