Forum: Ruby-core [ruby-trunk - Bug #9038][Open] instance_eval throws RuntimeError for bad syntax (regression from 2.0

91eeff0aae76794bad5d0eb72d577386?d=identicon&s=25 "indirect (André Arko)" <mail@arko.net> (Guest)
on 2013-10-21 08:23
(Received via mailing list)
Issue #9038 has been reported by indirect (André Arko).

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

Author: indirect (André Arko)
Status: Open
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: UNKNOWN


=begin
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).
=end
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-10-23 05:06
(Received via mailing list)
Issue #9038 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: UNKNOWN,
2.0.0: REQUIRED

Even though this issue is not reproducible with 2.0.0, the same flaw
exists on ruby_2_0_0. I'll backport r43376 to fix a potential bug.
----------------------------------------
Bug #9038: instance_eval throws RuntimeError for bad syntax (regression
from 2.0.0)
https://bugs.ruby-lang.org/issues/9038#change-42555

Author: indirect (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: REQUIRED


=begin
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).
=end
5cf8f058a4c094bb708174fb43e7a387?d=identicon&s=25 nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-10-24 15:48
(Received via mailing list)
Issue #9038 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 1.9.3: UNKNOWN, 2.0.0: REQUIRED to 1.9.3: UNKNOWN,
2.0.0: DONE

r43376 is backported to ruby_2_0_0 branch at r43414. I modify test code
not to use new assertion of Test::Unit.
----------------------------------------
Bug #9038: instance_eval throws RuntimeError for bad syntax (regression
from 2.0.0)
https://bugs.ruby-lang.org/issues/9038#change-42600

Author: indirect (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


=begin
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).
=end
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2014-05-06 16:21
(Received via mailing list)
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)
This topic is locked and can not be replied to.