From 838aba470d91a6eec7b852951e278049d9531378 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 31 Dec 2016 14:54:34 +0200 Subject: [PATCH] move fix_types in order of usage --- lib/register/boot.rb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/register/boot.rb b/lib/register/boot.rb index 21ead5b9..b1547beb 100644 --- a/lib/register/boot.rb +++ b/lib/register/boot.rb @@ -50,6 +50,7 @@ module Register # - flesh out the types , create the real space # - and finally load the methods def boot_parfait! + Parfait.set_object_space( nil ) types = boot_types boot_boot_space( types ) classes = boot_classes( types ) @@ -89,17 +90,6 @@ module Register Parfait.set_object_space( boot_space ) end - # Types are hollow shells before this, so we need to set the object_class - # and initialize the list variables (which we now can with .new) - def fix_types(types , classes) - type_names.each do |name , ivars | - type = types[name] - clazz = classes[name] - type.set_object_class( clazz ) - type.init_lists({:type => :Type }.merge(ivars)) - end - end - # when running code instantiates a class, a type is created automatically # but even to get our space up, we have already instantiated all types # so we have to continue and allocate classes and fill the data by hand @@ -113,6 +103,17 @@ module Register classes end + # Types are hollow shells before this, so we need to set the object_class + # and initialize the list variables (which we now can with .new) + def fix_types(types , classes) + type_names.each do |name , ivars | + type = types[name] + clazz = classes[name] + type.set_object_class( clazz ) + type.init_lists({:type => :Type }.merge(ivars)) + end + end + # superclasses other than default object def super_class_names { :Object => :Kernel , :Kernel => :Value , :Integer => :Value , :BinaryCode => :Word }