Skip to content

Commit

Permalink
use class factory in all pharo versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrichau committed Dec 27, 2023
1 parent 5b89188 commit bcb000b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
accessing-code
defineClass: aClassSymbol superclass: aSuperSymbol
| class |

SystemVersion current major >= 12
ifTrue:[
class := factory silentlyMake: [ :aBuilder |
aBuilder
superclass: (Smalltalk at: aSuperSymbol);
package: self category ] ]
ifFalse:[
model defineClass: aSuperSymbol , ' subclass: #' , aClassSymbol , '
instanceVariableNames: ''''
classVariableNames: ''''
poolDictionaries: ''''
category: ''' , self category , ''''.
class := model classNamed: aClassSymbol ].
| class |
class := factory silentlyMake: [ :aBuilder |
aBuilder
superclass: (Smalltalk at: aSuperSymbol);
package: self category ].
environment
addClass: class;
addClass: class theMetaClass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ running
tearDown

super tearDown.
factory cleanUp.
SystemVersion current major >= 12 ifFalse:[
(Smalltalk organization listAtCategoryNamed: self category) do:[ :e | SmalltalkImage current removeClassNamed: e ].
Smalltalk organization removeCategory: self category ]
factory cleanUp

0 comments on commit bcb000b

Please sign in to comment.