fix the plus method that sneaked into arm
This commit is contained in:
parent
9ebe6eb5b7
commit
4afd7f78ca
@ -48,8 +48,14 @@ module Parfait
|
|||||||
method
|
method
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_instance_method method
|
def remove_instance_method method_name
|
||||||
self.instance_methods.delete method
|
found = get_instance_method( method_name )
|
||||||
|
if found
|
||||||
|
self.instance_methods.delete(found)
|
||||||
|
else
|
||||||
|
raise "No such method #{method_name} in #{self.name}"
|
||||||
|
end
|
||||||
|
self.instance_methods.delete found
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_instance_method method_name , arg_names
|
def create_instance_method method_name , arg_names
|
||||||
|
@ -38,7 +38,7 @@ module Virtual
|
|||||||
def remove_remaining
|
def remove_remaining
|
||||||
@gonners.each do |method|
|
@gonners.each do |method|
|
||||||
next if(method.name == :plus)
|
next if(method.name == :plus)
|
||||||
method.for_class.remove_instance_method method
|
method.for_class.remove_instance_method method.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,6 +4,8 @@ class HelloTest < MiniTest::Test
|
|||||||
|
|
||||||
def check
|
def check
|
||||||
machine = Virtual.machine.boot
|
machine = Virtual.machine.boot
|
||||||
|
Parfait::Space.object_space.get_class_by_name(:Integer).remove_instance_method :plus
|
||||||
|
#TODO remove this hack: write proper aliases
|
||||||
expressions = machine.compile_main @string_input
|
expressions = machine.compile_main @string_input
|
||||||
output_at = "Register::CallImplementation"
|
output_at = "Register::CallImplementation"
|
||||||
#{}"Register::CallImplementation"
|
#{}"Register::CallImplementation"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user