зеркало из https://github.com/github/ruby.git
* sample/test.rb (proc_return3): return within non lambda block
should terminate surrounding method. [ruby-dev:28741] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e3cd29bc63
Коммит
9612bd51f4
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Jun 19 17:02:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* sample/test.rb (proc_return3): return within non lambda block
|
||||||
|
should terminate surrounding method. [ruby-dev:28741]
|
||||||
|
|
||||||
Mon Jun 19 13:22:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Mon Jun 19 13:22:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* ext/socket/socket.c (unix_sysaccept): typo fixed.
|
* ext/socket/socket.c (unix_sysaccept): typo fixed.
|
||||||
|
|
|
@ -1099,13 +1099,21 @@ def proc_yield()
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
def proc_return1
|
def proc_return1
|
||||||
proc_call{return 42}+1
|
lambda{return 42}.call+1
|
||||||
end
|
end
|
||||||
test_ok(proc_return1() == 43)
|
test_ok(proc_return1() == 43)
|
||||||
def proc_return2
|
def proc_return2
|
||||||
|
->{return 42}.call+1
|
||||||
|
end
|
||||||
|
test_ok(proc_return2() == 43)
|
||||||
|
def proc_return3
|
||||||
|
proc_call{return 42}+1
|
||||||
|
end
|
||||||
|
test_ok(proc_return3() == 42)
|
||||||
|
def proc_return4
|
||||||
proc_yield{return 42}+1
|
proc_yield{return 42}+1
|
||||||
end
|
end
|
||||||
test_ok(proc_return2() == 42)
|
test_ok(proc_return4() == 42)
|
||||||
|
|
||||||
def ljump_test(state, proc, *args)
|
def ljump_test(state, proc, *args)
|
||||||
x = state
|
x = state
|
||||||
|
|
Загрузка…
Ссылка в новой задаче