Project

General

Profile

This project is closed and read-only.

Actions

Backport #2099

closed

Error when getting binding for a method via converting it to a Proc

Backport #2099: Error when getting binding for a method via converting it to a Proc

Added by webnov8 (Todd A) about 17 years ago. Updated over 15 years ago.

Status:
Closed
[ruby-core:25589]

Description

=begin
Not sure if this is allowed in Ruby 1.9.1 but from a poll on #ruby-lang it seems like it works in 1.8. I am running 1.9.1p243 and the following throws an argument error:

class Foo
def bar
a = 'apple'
b= 22
puts 'inside bar'
end
end

obj = Foo.new
pro = obj.method(:bar).to_proc
pro.call # 'inside bar'

b = pro.binding # Can't create Binding from C level Proc (ArgumentError)
=end


Related issues 1 (0 open1 closed)

Related to Ruby - Bug #10428: Segmentation fault when modifying local variables of binding obtained from the result of Method#to_procClosedActions
Actions

Also available in: PDF Atom