Project

General

Profile

Actions

Bug #14229

closed

An exception in eval has strange message

Added by mame (Yusuke Endoh) over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:84434]

Description

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

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #12338: bypass Exception.newClosedActions
Actions

Also available in: Atom PDF