Added checking for an exception from Object#inspect in mirb #1238

Closed
wants to merge 1 commit into from

2 participants

@h2so5
mruby member

mirb fails to print results when Object#inspect throws an exception.

$ bin/mirb
mirb - Embeddable Interactive Ruby Shell

This is a very early version, please test and report errors.
Thanks :)

> 2 ** 1000
 =>
> aaa
RangeError: Too large expornent.
>

fixed:

$ bin/mirb
mirb - Embeddable Interactive Ruby Shell

This is a very early version, please test and report errors.
Thanks :)

> 2 ** 1000
RangeError: Too large expornent.
>
@matz
mruby member
  • 2 ** 1000 returns inf on my linux box. What is your platform?
  • I understand the problem of exception raised from #inspect, but don't like calling #inspect twice.
@h2so5
mruby member

I tested it on Mac OS X 10.7 (clang) and CentOS 6.3 (gcc 4.4.6).
I'm going to write another patch avoids calling #inspect twice.

@matz
mruby member

Hmm, CentOS may behave differently from Ubuntu.
I think I can fix it anyway.

@matz matz closed this in 595b199 May 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment