instantiations / tonel-vast

Tonel file format writer and reader implementation for VA Smalltalk
MIT License
9 stars 3 forks source link

#loaded is wrongly implemented #91

Closed marianopeck closed 3 years ago

marianopeck commented 3 years ago

The current implementation is:

loaded
    "Send #initializeOnLoad to every class defined in this subapplication that implements it."

    defined do: [ :aClass |
        (aClass class includesSelector: #initializeOnLoad) ifTrue: [ aClass perform: #initializeOnLoad ] ]

That was copied from MetacelloImporter I imagine. This was OK in Monticello importer because it replaced #initializeOnLoad with #initialize. We don't do that with Tonel, so no class implements #initializeOnLoad but actually #initialize.

So...I think the implementation should be:

loaded
    "Send #initializeOnLoad to every class defined in this subapplication that implements it."

    defined do: [ :aClass |
        (aClass class includesSelector: #initialize) ifTrue: [ aClass perform: #initialize ] ]