--- a/MessageTracer.st Wed Feb 01 23:17:12 2006 +0100
+++ b/MessageTracer.st Wed Feb 08 16:16:20 2006 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1994 by Claus Gittinger
All Rights Reserved
@@ -322,7 +320,7 @@
ExitBlock will be called, when the method is left, and get context and the methods return value as arguments.
"
- |myMetaclass trapMethod s spec implClass newClass save dict|
+ |myMetaclass trapMethod s spec implClass newClass dict|
WrappedMethod autoload. "/ just to make sure ...
@@ -346,21 +344,19 @@
].
s nextPutAll:'^ retVal'; cr.
- save := Compiler stcCompilation.
- Compiler stcCompilation:#never.
- [
- Class withoutUpdatingChangesDo:[
- trapMethod := Compiler compile:s contents
- forClass:orgClass
- inCategory:'trapping'
- notifying:nil
- install:false
- skipIfSame:false
- silent:true.
- ]
- ] ensure:[
- Compiler stcCompilation:save
- ].
+ ParserFlags
+ withSTCCompilation:#never
+ do:[
+ Class withoutUpdatingChangesDo:[
+ trapMethod := Compiler compile:s contents
+ forClass:orgClass
+ inCategory:'trapping'
+ notifying:nil
+ install:false
+ skipIfSame:false
+ silent:true.
+ ]
+ ].
implClass := orgClass whichClassIncludesSelector:aSelector.
implClass isNil ifTrue:[
@@ -1551,7 +1547,7 @@
because allocating the unwindBlock uses memory and some users want to count allocated memory.
"
- |selector class trapMethod s spec src dict sel save save2 xselector|
+ |selector class trapMethod s spec src dict sel saveUS xselector|
CallingLevel := 0.
@@ -1617,24 +1613,25 @@
s nextPutAll:'^ retVal'; cr.
src := s contents.
- save := Compiler stcCompilation.
- save2 := Compiler allowUnderscoreInIdentifier.
- Compiler stcCompilation:#never.
- Compiler allowUnderscoreInIdentifier:true.
- [
- Class withoutUpdatingChangesDo:[
- trapMethod := Compiler compile:src
- forClass:UndefinedObject
- inCategory:aMethod category
- notifying:nil
- install:false
- skipIfSame:false
- silent:false. "/ true.
- ]
- ] ensure:[
- Compiler stcCompilation:save.
- Compiler allowUnderscoreInIdentifier:save2.
- ].
+ saveUS := Compiler allowUnderscoreInIdentifier.
+ ParserFlags
+ withSTCCompilation:#never
+ do:[
+ [
+ Compiler allowUnderscoreInIdentifier:true.
+ Class withoutUpdatingChangesDo:[
+ trapMethod := Compiler compile:src
+ forClass:UndefinedObject
+ inCategory:aMethod category
+ notifying:nil
+ install:false
+ skipIfSame:false
+ silent:false. "/ true.
+ ]
+ ] ensure:[
+ Compiler allowUnderscoreInIdentifier:saveUS.
+ ].
+ ].
trapMethod setPackage:aMethod package.
trapMethod changeClassTo:WrappedMethod.
@@ -2470,7 +2467,7 @@
before the wrapped method will be called.
NOTICE: The current implementation does not allow integers or nil to be wrapped."
- |newClass orgClass myMetaclass trapMethod s spec implClass save dict
+ |newClass orgClass myMetaclass trapMethod s spec implClass dict
originalMethod|
"
@@ -2539,21 +2536,19 @@
].
s nextPutAll:'^ retVal'; cr.
- save := Compiler stcCompilation.
- Compiler stcCompilation:#never.
- [
- Class withoutUpdatingChangesDo:[
- trapMethod := Compiler compile:s contents
- forClass:newClass
- inCategory:'breakpointed'
- notifying:nil
- install:false
- skipIfSame:false
- silent:true.
- ]
- ] ensure:[
- Compiler stcCompilation:save
- ].
+ ParserFlags
+ withSTCCompilation:#never
+ do:[
+ Class withoutUpdatingChangesDo:[
+ trapMethod := Compiler compile:s contents
+ forClass:newClass
+ inCategory:'breakpointed'
+ notifying:nil
+ install:false
+ skipIfSame:false
+ silent:true.
+ ]
+ ].
trapMethod == #Error ifTrue:[
Transcript showCR:('cannot place trap on method: ' , aSelector).
@@ -3159,7 +3154,7 @@
!MessageTracer class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/MessageTracer.st,v 1.101 2004-03-05 16:34:17 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/MessageTracer.st,v 1.102 2006-02-08 15:16:20 cg Exp $'
! !
MessageTracer initialize!