From 5ec61453c5012088ee9719925ad1937a0bc61102 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 27 Feb 2004 13:30:00 +0000 Subject: * eval.c (proc_invoke): no orphan block check is needed when pcall is true. * eval.c (localjump_destination): update localjump condition. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sample') diff --git a/sample/test.rb b/sample/test.rb index 65cfcad47..d37c97877 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1127,6 +1127,17 @@ test_ok(lambda{|a|}.arity == 1) test_ok(lambda{|a,|}.arity == 1) test_ok(lambda{|a,b|}.arity == 2) +def yield_in_lambda + lambda{ yield }[] +end + +def return_in_lambda + yield_in_lambda{ return true } + false +end + +test_ok(return_in_lambda()) + def marity_test(m) method = method(m) test_ok(method.arity == method.to_proc.arity) -- cgit