[Pharo-project] #getSource is broken for temp names
| trailer materializedCompiledMethod method | trailer := CompiledMethodTrailer new tempNames: 'param1 param2 temp1 temp2'. self assert: trailer kind = #TempsNamesQCompress. self assert: trailer kindAsByte = 8. method := (self class >> #fooWith:and:) copyWithTrailerBytes: trailer. self assert: (method getSource includesSubString: 'param1'). this last assert fails. Problem is that #getSource is broken and somehow it looks like if the part of tempNames was removed. I propose to put back its original verison or just add at the beginning: trailer tempNames ifNotNil: [:namesString | "Magic sources -- decompile with temp names" ^ ((class decompilerClass new withTempNames: namesString) decompile: selector in: class method: self) decompileString]. agree? if true I open an issue. -- Mariano http://marianopeck.wordpress.com
participants (1)
-
Mariano Martinez Peck