From 51ea2cf4e431d2265a255cb3bfedc91461acf8d4 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 26 Jan 2008 08:44:43 +0000 Subject: * compile.c (iseq_compile_each): validate argument expr of "next" statement. * bootstraptest/test_syntax.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_syntax.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bootstraptest/test_syntax.rb') diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb index 1c5121cdaa..8a6e622f61 100644 --- a/bootstraptest/test_syntax.rb +++ b/bootstraptest/test_syntax.rb @@ -758,3 +758,11 @@ assert_equal 'ok', %q{ end :ok }, '[ruby-dev:32882]' + +assert_equal "1\n2\n", %q{ + i = 0 + while i<2 + i += 1 + next p(i) + end +} -- cgit v1.2.3