1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* iseq.c (iseq_inspect): don't raise on uninitialized object.

show real class name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-08-21 17:25:43 +00:00
parent 2de66ecbfc
commit 32c7a56555
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Aug 22 02:25:04 2008 Tanaka Akira <akr@fsij.org>
* iseq.c (iseq_inspect): don't raise on uninitialized object.
show real class name.
Fri Aug 22 02:08:58 2008 Tanaka Akira <akr@fsij.org>
* io.c (rb_io_initialize): accept hash argument.

9
iseq.c
View file

@ -548,9 +548,14 @@ iseq_eval(VALUE self)
static VALUE
iseq_inspect(VALUE self)
{
rb_iseq_t *iseq = iseq_check(self);
rb_iseq_t *iseq;
GetISeqPtr(self, iseq);
if (!iseq->name) {
return rb_sprintf("#<%s: uninitialized>", rb_obj_classname(self));
}
return rb_sprintf("<ISeq:%s@%s>",
return rb_sprintf("<%s:%s@%s>",
rb_obj_classname(self),
RSTRING_PTR(iseq->name), RSTRING_PTR(iseq->filename));
}