#REFACTORING by exept
class: ByteCodeCompiler
changed: #compile:forClass:inCategory:notifying:install:skipIfSame:silent:foldConstants:
--- a/ByteCodeCompiler.st Sun Sep 08 16:06:47 2019 +0200
+++ b/ByteCodeCompiler.st Sun Sep 08 16:08:12 2019 +0200
@@ -3025,51 +3025,51 @@
!
compile:aStringArg forClass:aClassArg inCategory:cat notifying:aRequestor
- install:install skipIfSame:skipIfSame silent:silent foldConstants:fold
+ install:install skipIfSame:skipIfSame silent:silent foldConstants:fold
aRequestor notNil ifTrue:[
- ^ self
- compile:aStringArg
- forClass:aClassArg
- inCategory:cat
- notifying:aRequestor
- install:install
- skipIfSame:skipIfSame
- silent:silent
- foldConstants:fold
- ifFail:nil
+ ^ self
+ compile:aStringArg
+ forClass:aClassArg
+ inCategory:cat
+ notifying:aRequestor
+ install:install
+ skipIfSame:skipIfSame
+ silent:silent
+ foldConstants:fold
+ ifFail:nil
].
^ self
- compile:aStringArg
- forClass:aClassArg
- inCategory:cat
- notifying:aRequestor
- install:install
- skipIfSame:skipIfSame
- silent:silent
- foldConstants:fold
- ifFail:[:exOrNil |
- exOrNil notNil ifTrue:[
- ParseError new
- errorMessage:(exOrNil errorMessage) startPosition:(exOrNil startPosition) endPosition:(exOrNil endPosition);
- parameter:exOrNil parameter;
- lineNumber:exOrNil lineNumber;
- raiseRequest.
- ] ifFalse:[
- ParseError raiseRequestErrorString:'compilation failed'. #Error
- ].
- (install and:[selector notNil]) ifTrue:[
- |newMethod|
-
- "/ if proceeded, install a trap method
- newMethod := (Method trapMethodForNumArgs:selector numArgs) copy.
- newMethod mclass:nil; setPackage:nil.
- newMethod makeInvalid.
- newMethod source:aStringArg.
- aClassArg basicAddSelector:selector withMethod:newMethod
- ].
- ]
+ compile:aStringArg
+ forClass:aClassArg
+ inCategory:cat
+ notifying:aRequestor
+ install:install
+ skipIfSame:skipIfSame
+ silent:silent
+ foldConstants:fold
+ ifFail:[:exOrNil |
+ exOrNil notNil ifTrue:[
+ ParseError new
+ errorMessage:(exOrNil errorMessage) startPosition:(exOrNil startPosition) endPosition:(exOrNil endPosition);
+ parameter:exOrNil parameter;
+ lineNumber:exOrNil lineNumber;
+ raiseRequest.
+ ] ifFalse:[
+ ParseError raiseRequestErrorString:'compilation failed'. "/ #Error
+ ].
+ (install and:[selector notNil]) ifTrue:[
+ |newMethod|
+
+ "/ if proceeded, install a trap method
+ newMethod := (Method trapMethodForNumArgs:selector argumentCount) copy.
+ newMethod mclass:nil; setPackage:nil.
+ newMethod makeInvalid.
+ newMethod source:aStringArg.
+ aClassArg basicAddSelector:selector withMethod:newMethod
+ ].
+ ]
"Modified: / 18-01-2011 / 11:35:21 / cg"
!