[ruby-core:62422] [ruby-trunk - Bug #9038] instance_eval throws RuntimeError for bad syntax (regression from 2.0.0)

From: nobu@...
Date: 2014-05-06 14:21:21 UTC
List: ruby-core #62422
Issue #9038 has been updated by Nobuyoshi Nakada.

Description updated

----------------------------------------
Bug #9038: instance_eval throws RuntimeError for bad syntax (regression from 2.0.0)
https://bugs.ruby-lang.org/issues/9038#change-46571

* Author: Andr辿 Arko
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.1.0dev (2013-10-20 trunk 43373) [x86_64-linux]
* Backport: 1.9.3: UNKNOWN, 2.0.0: DONE
----------------------------------------
In Ruby 2.1.0dev (2013-10-20 trunk 43373), `instance_eval` throws a `RuntimeError` when it should throw a `SyntaxError`, but only the first time it is called. If you use an IRB session to call `instance_eval` a second time with the exact same arguments, it produces the expected `SyntaxError` instead of .

Here is an example: `ruby -e "instance_eval('/unquoted/string/syntax/error')"`

That example raises a `SyntaxError` on Ruby 2.0.0p247, but raises a `RuntimeError` on 2.1.0dev (2013-10-20 trunk 43373).

 

---Files--------------------------------
error.rb (30 Bytes)


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

In This Thread

Prev Next