1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
ko1 2012-11-27 11:58:10 +00:00
parent 5faf4cc77b
commit 956cc2934d
3 changed files with 46 additions and 11 deletions

View file

@ -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]'