summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-27 11:58:10 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-27 11:58:10 +0000
commit956cc2934d9848fa4c5cc7bcf79edd76f1171053 (patch)
treebdcfcf6bbd3ab68b7797dd70208bd4efa6a322de /bootstraptest
parent5faf4cc77b6a223dc86fddc69e0f377d27f5585a (diff)
* vm.c (rb_vm_make_env_object): make Proc object if Env is possible
to point block. [ruby-core:41038] [ruby-trunk - Bug #5634] * vm.c (rb_vm_make_proc): No need to make Proc object here. * bootstraptest/test_proc.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_proc.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb
index 3d347004ea..c23394e8d2 100644
--- a/bootstraptest/test_proc.rb
+++ b/bootstraptest/test_proc.rb
@@ -456,3 +456,28 @@ assert_equal 'ok', %q{
end
}
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ b = x{|a| a }
+ b.eval('yield("ok")')
+}, '[Bug #5634]'
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ eval("x { 'ok' }").eval "yield"
+}, '[Bug #5634]'
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ def m
+ x{ 'ok' }
+ end
+ eval('yield', m)
+}, '[Bug #5634]'
+