mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* compile.c (iseq_compile_each): should handle upper level eval iseq
from break/next, and COMPILE_ERROR() breaks only one block. [ruby-dev:31372] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5e8e08d74e
commit
a927483326
4 changed files with 29 additions and 9 deletions
|
|
@ -189,7 +189,12 @@ assert_equal %q{[10, main]}, %q{
|
|||
$ans
|
||||
}
|
||||
|
||||
assert_match /Illegal break/, %q{
|
||||
STDERR.reopen(STDOUT)
|
||||
eval "0 rescue break"
|
||||
}, '[ruby-dev:31372]'
|
||||
%w[break next redo].each do |keyword|
|
||||
assert_match %r"Can't escape from eval with #{keyword}\z", %{
|
||||
begin
|
||||
eval "0 rescue #{keyword}"
|
||||
rescue SyntaxError => e
|
||||
e.message
|
||||
end
|
||||
}, '[ruby-dev:31372]'
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue