opal only bug, deleting while iterating over array

This commit is contained in:
Torsten Ruger 2015-07-23 17:15:07 +03:00
parent 2f409ea4e1
commit fa552bf751

View File

@ -11,7 +11,7 @@ module Virtual
@gonners << f @gonners << f
end end
end end
init= Parfait::Space.object_space.get_class_by_name(:Kernel).get_instance_method :__init__ init = Parfait::Space.object_space.get_class_by_name(:Kernel).get_instance_method :__init__
remove init remove init
dump_remaining dump_remaining
end end
@ -19,7 +19,7 @@ module Virtual
def remove function def remove function
index = @gonners.index function index = @gonners.index function
unless index unless index
puts "function was already removed #{ function.name}" puts "function was already removed #{function.name}"
return return
end end
#puts "stayer #{function.name}" #puts "stayer #{function.name}"
@ -27,7 +27,7 @@ module Virtual
function.source.blocks.each do |block| function.source.blocks.each do |block|
block.codes.each do |code| block.codes.each do |code|
if code.is_a? Virtual::MessageSend if code.is_a? Virtual::MessageSend
@gonners.each do |stay| @gonners.dup.each do |stay|
remove stay if(stay.name == code.name) remove stay if(stay.name == code.name)
end end
end end