diff --git a/ChangeLog b/ChangeLog index 2f48b3553d..adc2871914 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Jan 19 17:39:38 2004 Nobuyoshi Nakada + + * error.c (NameError::message): internal use only. + + * eval.c (rb_method_missing): use hidden constant. + Mon Jan 19 16:30:53 2004 akira yamada * test/ruby/test_time.rb: added tests for [ruby-dev:22614] and diff --git a/error.c b/error.c index 5de902888c..14e622917b 100644 --- a/error.c +++ b/error.c @@ -682,7 +682,7 @@ name_err_mesg_mark(ptr) /* :nodoc: */ static VALUE -name_err_mesg_init(obj, mesg, recv, method) +name_err_mesg_new(obj, mesg, recv, method) VALUE obj, mesg, recv, method; { VALUE *ptr = ALLOC_N(VALUE, 3); @@ -984,8 +984,8 @@ Init_Exception() rb_define_method(rb_eNameError, "initialize", name_err_initialize, -1); rb_define_method(rb_eNameError, "name", name_err_name, 0); rb_define_method(rb_eNameError, "to_s", name_err_to_s, 0); - rb_define_singleton_method(rb_eNameError, "message", name_err_mesg_init, 3); - rb_cNameErrorMesg = rb_define_class_under(rb_eNameError, "Message", rb_cData); + rb_cNameErrorMesg = rb_define_class_under(rb_eNameError, "message", rb_cData); + rb_define_singleton_method(rb_cNameErrorMesg, "!", name_err_mesg_new, 3); rb_define_method(rb_cNameErrorMesg, "to_str", name_err_mesg_to_str, 0); rb_define_method(rb_cNameErrorMesg, "_dump", name_err_mesg_to_str, 1); rb_define_singleton_method(rb_cNameErrorMesg, "_load", name_err_mesg_load, 1); diff --git a/eval.c b/eval.c index 85ed4592a4..4fd9cc6a5e 100644 --- a/eval.c +++ b/eval.c @@ -5230,7 +5230,8 @@ rb_method_missing(argc, argv, obj) int n = 0; VALUE args[3]; - args[n++] = rb_funcall(exc, rb_intern("message"), 3, rb_str_new2(format), obj, argv[0]); + args[n++] = rb_funcall(rb_const_get(exc, rb_intern("message")), '!', + 3, rb_str_new2(format), obj, argv[0]); args[n++] = argv[0]; if (exc == rb_eNoMethodError) { args[n++] = rb_ary_new4(argc-1, argv+1);