mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* error.c (NameError::message): internal use only.
* eval.c (rb_method_missing): use hidden constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8ccba1d12f
commit
8e877fc517
3 changed files with 11 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Jan 19 17:39:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* error.c (NameError::message): internal use only.
|
||||
|
||||
* eval.c (rb_method_missing): use hidden constant.
|
||||
|
||||
Mon Jan 19 16:30:53 2004 akira yamada <akira@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_time.rb: added tests for [ruby-dev:22614] and
|
||||
|
|
6
error.c
6
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);
|
||||
|
|
3
eval.c
3
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);
|
||||
|
|
Loading…
Reference in a new issue