mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 00:54:01 +02:00
compile.c: disallow next in once
* compile.c (iseq_compile_each0): turned dregx context in "once" into "guarded" type from "block" type, to disallow `next`, `break`, `redo` as well as outside "once". [ruby-core:81805] [Bug #13690] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f73498196f
commit
0a11abfc7e
3 changed files with 12 additions and 12 deletions
|
@ -1080,15 +1080,4 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||
}
|
||||
end;
|
||||
end
|
||||
|
||||
def test_break_in_once
|
||||
assert_separately([], "#{<<-"begin;"}\n#{<<~'end;'}")
|
||||
begin;
|
||||
obj = Object.new
|
||||
def obj.try
|
||||
/#{break}/o
|
||||
end
|
||||
assert_raise(LocalJumpError, /proc-closure/) {obj.try}
|
||||
end;
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue