mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* variable.c (Init_var_tables): initializes __classid__ ID.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d67e9aeae2
commit
08fa9bad5b
2 changed files with 6 additions and 7 deletions
|
@ -1,4 +1,6 @@
|
|||
Thu Jul 30 16:10:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Thu Jul 30 16:12:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* variable.c (Init_var_tables): initializes __classid__ ID.
|
||||
|
||||
* variable.c: use st_data_t for st functions.
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ void rb_vm_inc_const_missing_count(void);
|
|||
|
||||
st_table *rb_global_tbl;
|
||||
st_table *rb_class_tbl;
|
||||
static ID autoload, classpath, tmp_classpath;
|
||||
static ID autoload, classpath, tmp_classpath, classid;
|
||||
|
||||
void
|
||||
Init_var_tables(void)
|
||||
|
@ -31,6 +31,7 @@ Init_var_tables(void)
|
|||
CONST_ID(autoload, "__autoload__");
|
||||
CONST_ID(classpath, "__classpath__");
|
||||
CONST_ID(tmp_classpath, "__tmp_classpath__");
|
||||
CONST_ID(classid, "__classid__");
|
||||
}
|
||||
|
||||
struct fc_result {
|
||||
|
@ -147,10 +148,6 @@ classname(VALUE klass)
|
|||
if (!klass) klass = rb_cObject;
|
||||
if (RCLASS_IV_TBL(klass)) {
|
||||
if (!st_lookup(RCLASS_IV_TBL(klass), (st_data_t)classpath, &n)) {
|
||||
ID classid;
|
||||
|
||||
CONST_ID(classid, "__classid__");
|
||||
|
||||
if (!st_lookup(RCLASS_IV_TBL(klass), (st_data_t)classid, &n)) {
|
||||
return find_class_path(klass);
|
||||
}
|
||||
|
@ -273,7 +270,7 @@ rb_path2class(const char *path)
|
|||
void
|
||||
rb_name_class(VALUE klass, ID id)
|
||||
{
|
||||
rb_iv_set(klass, "__classid__", ID2SYM(id));
|
||||
rb_ivar_set(klass, classid, ID2SYM(id));
|
||||
}
|
||||
|
||||
VALUE
|
||||
|
|
Loading…
Reference in a new issue