* eval.c (rb_alias): was warning for wrong condition.
[ruby-dev:24565] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e7a1207dcd
commit
1419b789ab
@ -1,3 +1,8 @@
|
|||||||
|
Fri Oct 22 12:02:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_alias): was warning for wrong condition.
|
||||||
|
[ruby-dev:24565]
|
||||||
|
|
||||||
Fri Oct 22 10:36:37 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
Fri Oct 22 10:36:37 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
* lib/webrick/httprequest.rb (WEBrick::HTTPRequest#meta_vars):
|
* lib/webrick/httprequest.rb (WEBrick::HTTPRequest#meta_vars):
|
||||||
|
10
eval.c
10
eval.c
@ -1996,7 +1996,7 @@ rb_alias(klass, name, def)
|
|||||||
ID name, def;
|
ID name, def;
|
||||||
{
|
{
|
||||||
VALUE origin;
|
VALUE origin;
|
||||||
NODE *orig, *body;
|
NODE *orig, *body, *node;
|
||||||
VALUE singleton = 0;
|
VALUE singleton = 0;
|
||||||
|
|
||||||
rb_frozen_class_p(klass);
|
rb_frozen_class_p(klass);
|
||||||
@ -2016,9 +2016,6 @@ rb_alias(klass, name, def)
|
|||||||
if (FL_TEST(klass, FL_SINGLETON)) {
|
if (FL_TEST(klass, FL_SINGLETON)) {
|
||||||
singleton = rb_iv_get(klass, "__attached__");
|
singleton = rb_iv_get(klass, "__attached__");
|
||||||
}
|
}
|
||||||
if (RTEST(ruby_verbose) && klass == origin && orig->nd_cnt == 0 && orig->nd_body) {
|
|
||||||
rb_warning("discarding old %s", rb_id2name(name));
|
|
||||||
}
|
|
||||||
body = orig->nd_body;
|
body = orig->nd_body;
|
||||||
orig->nd_cnt++;
|
orig->nd_cnt++;
|
||||||
if (nd_type(body) == NODE_FBODY) { /* was alias */
|
if (nd_type(body) == NODE_FBODY) { /* was alias */
|
||||||
@ -2028,6 +2025,11 @@ rb_alias(klass, name, def)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rb_clear_cache_by_id(name);
|
rb_clear_cache_by_id(name);
|
||||||
|
if (RTEST(ruby_verbose) && st_lookup(RCLASS(klass)->m_tbl, name, (st_data_t *)&node)) {
|
||||||
|
if (node->nd_cnt == 0 && node->nd_body) {
|
||||||
|
rb_warning("discarding old %s", rb_id2name(name));
|
||||||
|
}
|
||||||
|
}
|
||||||
st_insert(RCLASS(klass)->m_tbl, name,
|
st_insert(RCLASS(klass)->m_tbl, name,
|
||||||
(st_data_t)NEW_METHOD(NEW_FBODY(body, def, origin), orig->nd_noex));
|
(st_data_t)NEW_METHOD(NEW_FBODY(body, def, origin), orig->nd_noex));
|
||||||
if (singleton) {
|
if (singleton) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user