diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-20 01:51:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-20 01:51:32 +0000 |
commit | a59b244d032fc5e30891c2700b52683a464eda81 (patch) | |
tree | aa56137f881b95134afd3005e857d13e16f53be5 /eval.c | |
parent | d1c398660bf18a0954086d969b400592619b63c9 (diff) | |
download | ruby-a59b244d032fc5e30891c2700b52683a464eda81.tar.gz ruby-a59b244d032fc5e30891c2700b52683a464eda81.tar.xz ruby-a59b244d032fc5e30891c2700b52683a464eda81.zip |
* eval.c (rb_f_missing): create exception instance by ordinal
method.
* error.c (rb_name_error, rb_sys_fail): ditto.
* error.c (exc_to_s, exit_status, name_err_name,
nometh_err_args, syserr_errno, syserr_eqq): access
attributes.
* error.c (name_err_initialize, nometh_err_initialize,
syserr_initialize): initialize attributes.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -4599,13 +4599,18 @@ rb_f_missing(argc, argv, obj) { char buf[BUFSIZ]; int noclass = (!d || desc[0]=='#'); + int n = 0; + VALUE args[3]; snprintf(buf, BUFSIZ, format, rb_id2name(id), desc, noclass ? "" : ":", noclass ? "" : rb_obj_classname(obj)); - exc = rb_exc_new2(exc, buf); - rb_iv_set(exc, "name", argv[0]); - rb_iv_set(exc, "args", rb_ary_new4(argc-1, argv+1)); + args[n++] = rb_str_new2(buf); + args[n++] = argv[0]; + if (exc == rb_eNoMethodError) { + args[n++] = rb_ary_new4(argc-1, argv+1); + } + exc = rb_class_new_instance(n, args, exc); rb_exc_raise(exc); } POP_FRAME(); |