mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* class.c (ins_methods_i): should not show ID_ALLOCATOR.
* class.c (ins_methods_prot_i): ditto. * class.c (ins_methods_priv_i): ditto. * class.c (ins_methods_pub_i): ditto. * eval.c (call_trace_func): ditto. * eval.c (rb_undefined): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2b334012fc
commit
e274c3ab76
6 changed files with 32 additions and 8 deletions
14
ChangeLog
14
ChangeLog
|
@ -27,6 +27,20 @@ Sun Dec 22 00:36:43 2002 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* lib/mkmf.rb (create_makefile): accept pure ruby libraries.
|
* lib/mkmf.rb (create_makefile): accept pure ruby libraries.
|
||||||
|
|
||||||
|
Sat Dec 21 23:59:42 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* class.c (ins_methods_i): should not show ID_ALLOCATOR.
|
||||||
|
|
||||||
|
* class.c (ins_methods_prot_i): ditto.
|
||||||
|
|
||||||
|
* class.c (ins_methods_priv_i): ditto.
|
||||||
|
|
||||||
|
* class.c (ins_methods_pub_i): ditto.
|
||||||
|
|
||||||
|
* eval.c (call_trace_func): ditto.
|
||||||
|
|
||||||
|
* eval.c (rb_undefined): ditto.
|
||||||
|
|
||||||
Sat Dec 21 07:27:24 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Sat Dec 21 07:27:24 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* misc/ruby-mode.el (ruby-parse-partial): keywords must not be
|
* misc/ruby-mode.el (ruby-parse-partial): keywords must not be
|
||||||
|
|
1
MANIFEST
1
MANIFEST
|
@ -197,6 +197,7 @@ lib/ping.rb
|
||||||
lib/pp.rb
|
lib/pp.rb
|
||||||
lib/prettyprint.rb
|
lib/prettyprint.rb
|
||||||
lib/profile.rb
|
lib/profile.rb
|
||||||
|
lib/profiler.rb
|
||||||
lib/pstore.rb
|
lib/pstore.rb
|
||||||
lib/racc/parser.rb
|
lib/racc/parser.rb
|
||||||
lib/rational.rb
|
lib/rational.rb
|
||||||
|
|
4
class.c
4
class.c
|
@ -459,6 +459,7 @@ ins_methods_i(key, body, ary)
|
||||||
NODE *body;
|
NODE *body;
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
|
if (key == ID_ALLOCATOR) return ST_CONTINUE;
|
||||||
if (!body->nd_body) {
|
if (!body->nd_body) {
|
||||||
rb_ary_push(ary, Qnil);
|
rb_ary_push(ary, Qnil);
|
||||||
rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
|
rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
|
||||||
|
@ -483,6 +484,7 @@ ins_methods_prot_i(key, body, ary)
|
||||||
NODE *body;
|
NODE *body;
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
|
if (key == ID_ALLOCATOR) return ST_CONTINUE;
|
||||||
if (!body->nd_body) {
|
if (!body->nd_body) {
|
||||||
rb_ary_push(ary, Qnil);
|
rb_ary_push(ary, Qnil);
|
||||||
rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
|
rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
|
||||||
|
@ -507,6 +509,7 @@ ins_methods_priv_i(key, body, ary)
|
||||||
NODE *body;
|
NODE *body;
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
|
if (key == ID_ALLOCATOR) return ST_CONTINUE;
|
||||||
if (!body->nd_body) {
|
if (!body->nd_body) {
|
||||||
rb_ary_push(ary, Qnil);
|
rb_ary_push(ary, Qnil);
|
||||||
rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
|
rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
|
||||||
|
@ -531,6 +534,7 @@ ins_methods_pub_i(key, body, ary)
|
||||||
NODE *body;
|
NODE *body;
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
|
if (key == ID_ALLOCATOR) return ST_CONTINUE;
|
||||||
if (!body->nd_body) {
|
if (!body->nd_body) {
|
||||||
rb_ary_push(ary, Qnil);
|
rb_ary_push(ary, Qnil);
|
||||||
rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
|
rb_ary_push(ary, rb_str_new2(rb_id2name(key)));
|
||||||
|
|
17
eval.c
17
eval.c
|
@ -230,7 +230,7 @@ rb_clear_cache_by_class(klass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ID init, alloc, eqq, each, aref, aset, match, missing;
|
static ID init, eqq, each, aref, aset, match, missing;
|
||||||
static ID added, singleton_added;
|
static ID added, singleton_added;
|
||||||
static ID __id__, __send__;
|
static ID __id__, __send__;
|
||||||
|
|
||||||
|
@ -247,10 +247,13 @@ rb_add_method(klass, mid, node, noex)
|
||||||
if (ruby_safe_level >= 4 && (klass == rb_cObject || !OBJ_TAINTED(klass))) {
|
if (ruby_safe_level >= 4 && (klass == rb_cObject || !OBJ_TAINTED(klass))) {
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't define method");
|
rb_raise(rb_eSecurityError, "Insecure: can't define method");
|
||||||
}
|
}
|
||||||
if (mid == init && !FL_TEST(klass, FL_SINGLETON) && node && nd_type(node) != NODE_ZSUPER) {
|
if (!FL_TEST(klass, FL_SINGLETON) &&
|
||||||
|
node && nd_type(node) != NODE_ZSUPER &&
|
||||||
|
mid == rb_intern("initialize")) {
|
||||||
noex = NOEX_PRIVATE | (noex & NOEX_NOSUPER);
|
noex = NOEX_PRIVATE | (noex & NOEX_NOSUPER);
|
||||||
}
|
}
|
||||||
else if (mid == alloc && FL_TEST(klass, FL_SINGLETON) && node && nd_type(node) == NODE_CFUNC) {
|
else if (FL_TEST(klass, FL_SINGLETON) && node && nd_type(node) == NODE_CFUNC &&
|
||||||
|
mid == rb_intern("allocate")) {
|
||||||
rb_warn("defining %s.allocate is deprecated; use rb_define_alloc_func()",
|
rb_warn("defining %s.allocate is deprecated; use rb_define_alloc_func()",
|
||||||
rb_class2name(rb_iv_get(klass, "__attached__")));
|
rb_class2name(rb_iv_get(klass, "__attached__")));
|
||||||
mid = ID_ALLOCATOR;
|
mid = ID_ALLOCATOR;
|
||||||
|
@ -2105,6 +2108,7 @@ call_trace_func(event, node, self, id, klass)
|
||||||
if (!trace_func) return;
|
if (!trace_func) return;
|
||||||
if (tracing) return;
|
if (tracing) return;
|
||||||
if (ruby_in_compile) return;
|
if (ruby_in_compile) return;
|
||||||
|
if (id == ID_ALLOCATOR) return;
|
||||||
|
|
||||||
node_save[0] = ruby_last_node;
|
node_save[0] = ruby_last_node;
|
||||||
if (!(node_save[1] = ruby_current_node)) {
|
if (!(node_save[1] = ruby_current_node)) {
|
||||||
|
@ -4408,7 +4412,7 @@ rb_f_missing(argc, argv, obj)
|
||||||
if (last_call_status & CSTAT_PRIV) {
|
if (last_call_status & CSTAT_PRIV) {
|
||||||
format = "private method `%s' called for %s%s%s";
|
format = "private method `%s' called for %s%s%s";
|
||||||
}
|
}
|
||||||
if (last_call_status & CSTAT_PROT) {
|
else if (last_call_status & CSTAT_PROT) {
|
||||||
format = "protected method `%s' called for %s%s%s";
|
format = "protected method `%s' called for %s%s%s";
|
||||||
}
|
}
|
||||||
else if (last_call_status & CSTAT_VCALL) {
|
else if (last_call_status & CSTAT_VCALL) {
|
||||||
|
@ -4460,6 +4464,9 @@ rb_undefined(obj, id, argc, argv, call_status)
|
||||||
rb_f_missing(argc, argv, obj);
|
rb_f_missing(argc, argv, obj);
|
||||||
POP_FRAME();
|
POP_FRAME();
|
||||||
}
|
}
|
||||||
|
else if (id == ID_ALLOCATOR) {
|
||||||
|
rb_fatal("allocator undefined for %s", rb_class2name(obj));
|
||||||
|
}
|
||||||
|
|
||||||
nargv = ALLOCA_N(VALUE, argc+1);
|
nargv = ALLOCA_N(VALUE, argc+1);
|
||||||
nargv[0] = ID2SYM(id);
|
nargv[0] = ID2SYM(id);
|
||||||
|
@ -4608,7 +4615,6 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
|
||||||
if (trace_func) {
|
if (trace_func) {
|
||||||
int state;
|
int state;
|
||||||
|
|
||||||
if (id == ID_ALLOCATOR) id = alloc;
|
|
||||||
call_trace_func("c-call", ruby_current_node, recv, id, klass);
|
call_trace_func("c-call", ruby_current_node, recv, id, klass);
|
||||||
PUSH_TAG(PROT_FUNC);
|
PUSH_TAG(PROT_FUNC);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
|
@ -6160,7 +6166,6 @@ void
|
||||||
Init_eval()
|
Init_eval()
|
||||||
{
|
{
|
||||||
init = rb_intern("initialize");
|
init = rb_intern("initialize");
|
||||||
alloc = rb_intern("allocate");
|
|
||||||
eqq = rb_intern("===");
|
eqq = rb_intern("===");
|
||||||
each = rb_intern("each");
|
each = rb_intern("each");
|
||||||
|
|
||||||
|
|
2
intern.h
2
intern.h
|
@ -17,7 +17,7 @@
|
||||||
* the kernel.
|
* the kernel.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ID_ALLOCATOR 1
|
#define ID_ALLOCATOR 0
|
||||||
|
|
||||||
/* array.c */
|
/* array.c */
|
||||||
void rb_mem_clear _((register VALUE*, register long));
|
void rb_mem_clear _((register VALUE*, register long));
|
||||||
|
|
|
@ -122,7 +122,7 @@ module IRB
|
||||||
|
|
||||||
gv = eval "global_variables", bind
|
gv = eval "global_variables", bind
|
||||||
lv = eval "local_variables", bind
|
lv = eval "local_variables", bind
|
||||||
cv = eval "type.constants", bind
|
cv = eval "self.type.constants", bind
|
||||||
|
|
||||||
if (gv | lv | cv).include?(receiver)
|
if (gv | lv | cv).include?(receiver)
|
||||||
# foo.func and foo is local var.
|
# foo.func and foo is local var.
|
||||||
|
|
Loading…
Add table
Reference in a new issue