This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Static analysis of all the ensure: calls that are present in Pharo 14. | |
We analyze how many of the block that the ensure: method receives as an argument are clean blocks" | |
| allEnsureUsers allEnsureMessages allEnsureBlockNodes ensureCleanBlock ensureFullBlocks totalEnsureCleanBlocks totalEnsureFullBlocks| | |
allEnsureUsers := #ensure: senders collect: [ :compiledMethod | compiledMethod parseTree]. | |
allEnsureMessages := allEnsureUsers flatCollect: [ :ast | | |
ast sendNodes select: [ :node | node selector = #ensure: ] ]. | |
allEnsureBlockNodes := allEnsureMessages | |
collect: [ :msgNode | msgNode arguments first ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
block := [ | |
toolsToOpen := 10. | |
renderingTimes := 100. | |
"Icerberg" | |
toolsToOpen timesRepeat: [ | |
IceTipRepositoriesBrowser new open. | |
1 to: renderingTimes do: [ :e | WorldMorph doOneCycle ] ]. | |
"Playground" | |
toolsToOpen timesRepeat: [ | |
Smalltalk tools workspace open. |