diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-11 08:51:25 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-11 08:51:25 +0000 |
commit | 190156054e33bc3b3bdd9e7965a1fe4a8cd50ebf (patch) | |
tree | 32141f69a654ed835642b64bf19e3ff8b6e73bd0 /bootstraptest | |
parent | 1ab4abf8c35148d8bceb6f24bdc41ebae0f94d58 (diff) |
[Backport #5634]
* 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/branches/ruby_1_9_3@38314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_proc.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb index 3d347004ea..dfe89033d8 100644 --- a/bootstraptest/test_proc.rb +++ b/bootstraptest/test_proc.rb @@ -456,3 +456,27 @@ 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]' |