Project

General

Profile

Actions

Bug #19779

closed

`eval "return"` at top level raises `LocalJumpError`

Added by andrykonchin (Andrew Konchin) over 1 year ago. Updated 12 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:114251]

Description

Wondering whether it's intentional behaviour. It seems it's the only difference I've noticed between calling return with and without eval:

ruby -e 'return'
ruby -e 'eval "return"'
(eval):1:in `<main>': unexpected return (LocalJumpError)
	from -e:1:in `eval'
	from -e:1:in `<main>'
Actions

Also available in: Atom PDF

Like0
Like0Like0Like1Like0Like0