mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* class.c (rb_make_metaclass): Made class of class of class
from Class into its own eigenclass. Now meta^(n)-class hierarchy regresses infinitely, again. (This feature was decided on developer-meeting-20080922.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
faefcc8249
commit
788001a9c8
2 changed files with 26 additions and 6 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,10 +1,17 @@
|
||||||
2008-09-25 Jim Weirich <jim@tardis.local>
|
Thu Sep 25 18:40:42 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||||
|
|
||||||
|
* class.c (rb_make_metaclass): Made class of class of class
|
||||||
|
from Class into its own eigenclass. Now meta^(n)-class
|
||||||
|
hierarchy regresses infinitely, again.
|
||||||
|
(This feature was decided on developer-meeting-20080922.)
|
||||||
|
|
||||||
|
Thu Sep 25 16:01:07 2008 Jim Weirich <jim@tardis.local>
|
||||||
|
|
||||||
* lib/rake.rb: Update rake source to version 0.8.3. This
|
* lib/rake.rb: Update rake source to version 0.8.3. This
|
||||||
version includes some fixes for running Rake on windows. (1)
|
version includes some fixes for running Rake on windows.
|
||||||
better APPDATA/HOMExxx/USERPROFILE integration for system
|
(1) better APPDATA/HOMExxx/USERPROFILE integration for
|
||||||
rakefiles, (2) Better handling of the :ruby command when
|
system rakefiles, (2) Better handling of the :ruby command
|
||||||
installed in directory containing spaces.
|
when installed in directory containing spaces.
|
||||||
|
|
||||||
Thu Sep 25 11:22:51 2008
|
Thu Sep 25 11:22:51 2008
|
||||||
|
|
||||||
|
|
15
class.c
15
class.c
|
@ -190,7 +190,20 @@ VALUE
|
||||||
rb_make_metaclass(VALUE obj, VALUE super)
|
rb_make_metaclass(VALUE obj, VALUE super)
|
||||||
{
|
{
|
||||||
if (BUILTIN_TYPE(obj) == T_CLASS && FL_TEST(obj, FL_SINGLETON)) {
|
if (BUILTIN_TYPE(obj) == T_CLASS && FL_TEST(obj, FL_SINGLETON)) {
|
||||||
return RBASIC(obj)->klass = rb_cClass;
|
VALUE metaclass;
|
||||||
|
if (RBASIC(obj)->klass == obj) { /* for meta^(n)-class of Class */
|
||||||
|
metaclass = rb_class_boot(obj);
|
||||||
|
RBASIC(metaclass)->klass = metaclass;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
metaclass = rb_class_boot(super);
|
||||||
|
RBASIC(metaclass)->klass = rb_singleton_class(RBASIC(obj)->klass);
|
||||||
|
}
|
||||||
|
FL_SET(metaclass, FL_SINGLETON);
|
||||||
|
rb_singleton_class_attached(metaclass, obj);
|
||||||
|
RBASIC(obj)->klass = metaclass;
|
||||||
|
RCLASS(metaclass)->ptr->super = rb_singleton_class(RCLASS(obj)->ptr->super);
|
||||||
|
return metaclass;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VALUE metasuper;
|
VALUE metasuper;
|
||||||
|
|
Loading…
Add table
Reference in a new issue