From a927483326e54e6a4e9387009af0b57f38636497 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 19 Dec 2007 16:10:54 +0000 Subject: * 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 --- bootstraptest/test_eval.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bootstraptest/test_eval.rb') diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb index 2f5e912074..b2a5762460 100644 --- a/bootstraptest/test_eval.rb +++ b/bootstraptest/test_eval.rb @@ -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 -- cgit v1.2.3