⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Backport191
All Projects
Ruby
»
Backport191
Overview
Activity
Issues
Like
Download (647 Bytes)
Backport #2728
» ensure_dynamic_method.rb
Script which will reproduce the crash. -
Ethan (Ethan -)
, 02/10/2010 01:26 AM
class
Object
define_method
'dynamically_defined_method'
do
puts
"hello from a dynamically defined method!"
end
end
module
SomeEnumerator
# pretend to be an enumerable over one thing (:foo)
def
self
.
each
begin
# yield to the block passed from whatever Enumerable method
yield
:foo
ensure
dynamically_defined_method
puts
"done with the dynamically defined method"
end
end
extend
Enumerable
end
# these all segfault
SomeEnumerator
.
detect
{
true
}
# => :foo
SomeEnumerator
.
any?
{
true
}
# => true
SomeEnumerator
.
all?
{
false
}
# => false
SomeEnumerator
.
include?
(
:foo
)
# => true
« Previous
1
2
3
Next »
(1-1/3)
Loading...