* ext/dl/lib/dl/func.rb (DL::Function#bind): fixes an error in
test/dl/test_import.rb (DL::TestImport#test_carried_function) introduced by r36718. the instance of the anonymous class which wraps the block should have same methods and instance variables of self. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
68c09dec0e
commit
3401fc5984
@ -1,3 +1,11 @@
|
|||||||
|
Tue Aug 21 15:44:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/dl/lib/dl/func.rb (DL::Function#bind): fixes an error in
|
||||||
|
test/dl/test_import.rb (DL::TestImport#test_carried_function)
|
||||||
|
introduced by r36718.
|
||||||
|
the instance of the anonymous class which wraps the block should have
|
||||||
|
same methods and instance variables of self.
|
||||||
|
|
||||||
Tue Aug 21 14:29:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
Tue Aug 21 14:29:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* win32/Makefile.sub (scriptbin.mk): no need to include twice.
|
* win32/Makefile.sub (scriptbin.mk): no need to include twice.
|
||||||
|
@ -91,7 +91,7 @@ module DL
|
|||||||
raise(RuntimeError, "block must be given.")
|
raise(RuntimeError, "block must be given.")
|
||||||
end
|
end
|
||||||
unless block.lambda?
|
unless block.lambda?
|
||||||
block = Class.new{define_method(:call, block)}.new.method(:call)
|
block = Class.new(self.class){define_method(:call, block); def initialize(obj); obj.instance_variables.each{|s| instance_variable_set(s, obj.instance_variable_get(s))}; end}.new(self).method(:call)
|
||||||
end
|
end
|
||||||
if( @cfunc.ptr == 0 )
|
if( @cfunc.ptr == 0 )
|
||||||
cb = Proc.new{|*args|
|
cb = Proc.new{|*args|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user