mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm.c: check frame is FINAL when creating env.
[ruby-core:14395] * bootstraptest/test_block.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
29962f8fb6
commit
b40dbc304e
3 changed files with 53 additions and 1 deletions
|
|
@ -507,3 +507,43 @@ assert_equal "ok", %q{
|
|||
end
|
||||
foo(&:bar)
|
||||
}, '[ruby-core:14279]'
|
||||
|
||||
assert_normal_exit %q{
|
||||
class Controller
|
||||
def respond_to(&block)
|
||||
responder = Responder.new
|
||||
block.call(responder)
|
||||
responder.respond
|
||||
end
|
||||
def test_for_bug
|
||||
respond_to{|format|
|
||||
format.js{
|
||||
puts "in test"
|
||||
render{|obj|
|
||||
puts obj
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
def render(&block)
|
||||
puts "in render"
|
||||
end
|
||||
end
|
||||
|
||||
class Responder
|
||||
def method_missing(symbol, &block)
|
||||
puts "enter method_missing"
|
||||
@response = Proc.new{
|
||||
puts 'in method missing'
|
||||
block.call
|
||||
}
|
||||
puts "leave method_missing"
|
||||
end
|
||||
def respond
|
||||
@response.call
|
||||
end
|
||||
end
|
||||
t = Controller.new
|
||||
t.test_for_bug
|
||||
}, '[ruby-core:14395]'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue