fix super class with name mixup

This commit is contained in:
Torsten Ruger 2015-11-07 19:37:38 +02:00
parent 37928b8591
commit 1d07c1fb95
2 changed files with 4 additions and 7 deletions

View File

@ -58,10 +58,12 @@ module Parfait
# instantiated. By that logic it should maybe be part of vm rather.
# On the other hand vague plans to load the hierachy from sof exist, so for now...
def set_super_class_name sup
raise "super_class_name must be a name, not #{sup}" unless sup.is_a?(Symbol)
self.super_class_name = sup
end
def super_class
puts "Superclass #{super_class_name}"
Parfait::Space.object_space.get_class_by_name(self.super_class_name)
end

View File

@ -75,18 +75,13 @@ module Register
cl.name = name
classes[name] = cl
end
object_class = classes[:Object]
# superclasses other than default object
supers = { :Object => :Kernel , :Kernel => :Value, :Integer => :Value }
layout_names.each do |classname , ivar|
next if classname == :Value # has no superclass
clazz = classes[classname]
super_name = supers[classname]
if super_name
clazz.set_super_class_name classes[super_name]
else
clazz.set_super_class_name object_class
end
super_name = supers[classname] || :Object
clazz.set_super_class_name super_name
end
end