[ruby-core:84469] [Ruby trunk Bug#14229] An exception in eval has strange message

From: nobu@...
Date: 2017-12-26 08:47:12 UTC
List: ruby-core #84469
Issue #14229 has been updated by nobu (Nobuyoshi Nakada).


It was https://bugs.ruby-lang.org/issues/12338#change-58690

----------------------------------------
Bug #14229: An exception in eval has strange message
https://bugs.ruby-lang.org/issues/14229#change-68977

* Author: mame (Yusuke Endoh)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 2.6
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Is this intentional?  If so, I'm curious what purpose it is for.

    begin
      eval("raise")
    rescue
      p e.message  #=> "(eval):1:in `<main>'"
    end

This leads to progressive backtrace message:

    $ ./miniruby -e 'eval("raise")'
    Traceback (most recent call last):
            2: from -e:1:in `<main>'
            1: from -e:1:in `eval'
    -e:1:in `eval': (eval):1:in `<main>' (RuntimeError)
                    ^^^^^^^^^^^^^^^^^^^^ HIGHLIGHTED



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next