From 5c92de87b439d5c5cbe96132b28007bd7326d728 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 17 Jan 2014 08:58:05 +0000 Subject: 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 --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'eval.c') 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) { -- cgit v1.2.3