The Trunk: Exceptions-nice.17.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Exceptions-nice.17.mcz

commits-2
Nicolas Cellier uploaded a new version of Exceptions to project The Trunk:
http://source.squeak.org/trunk/Exceptions-nice.17.mcz

==================== Summary ====================

Name: Exceptions-nice.17
Author: nice
Time: 27 December 2009, 9:09:19 am
UUID: e82085dd-d10b-4ea4-b0cc-0e49f423dcfa
Ancestors: Exceptions-ar.16

Cosmetic: move or remove a few temps inside closures


=============== Diff against Exceptions-ar.16 ===============

Item was changed:
  ----- Method: ExceptionTester>>simpleResumeTest (in category 'signaledException tests') -----
  simpleResumeTest
-
  "see if we can resume twice"
+
+ [ | it |
+ self doSomething.
-
- | it |
- [self doSomething.
  it := MyResumableTestError signal.
  it = 3 ifTrue: [self doSomethingElse].
  it := MyResumableTestError signal.
  it = 3 ifTrue: [self doSomethingElse].
  ]
  on: MyResumableTestError
  do:
  [:ex |
  self doYetAnotherThing.
  ex resume: 3]!

Item was changed:
  ----- Method: ProgressInitiationException>>defaultMVCAction (in category 'as yet unclassified') -----
  defaultMVCAction
 
+ | delta savedArea captionText textFrame barFrame outerFrame result range lastW |
- | delta savedArea captionText textFrame barFrame outerFrame result range lastW w |
  barFrame := aPoint - (75@10) corner: aPoint + (75@10).
  captionText := DisplayText text: progressTitle asText allBold.
  captionText
  foregroundColor: Color black
  backgroundColor: Color white.
  textFrame := captionText boundingBox insetBy: -4.
  textFrame := textFrame align: textFrame bottomCenter
  with: barFrame topCenter + (0@2).
  outerFrame := barFrame merge: textFrame.
  delta := outerFrame amountToTranslateWithin: Display boundingBox.
  barFrame := barFrame translateBy: delta.
  textFrame := textFrame translateBy: delta.
  outerFrame := outerFrame translateBy: delta.
  savedArea := Form fromDisplay: outerFrame.
  Display fillBlack: barFrame; fillWhite: (barFrame insetBy: 2).
  Display fillBlack: textFrame; fillWhite: (textFrame insetBy: 2).
  captionText displayOn: Display at: textFrame topLeft + (4@4).
  range := maxVal = minVal ifTrue: [1] ifFalse: [maxVal - minVal].  "Avoid div by 0"
  lastW := 0.
  [result := workBlock value:  "Supply the bar-update block for evaluation in the work block"
  [:barVal |
+ | w |
  w := ((barFrame width-4) asFloat * ((barVal-minVal) asFloat / range min: 1.0)) asInteger.
  w ~= lastW ifTrue: [
  Display fillGray: (barFrame topLeft + (2@2) extent: w@16).
  lastW := w]]]
  ensure: [savedArea displayOn: Display at: outerFrame topLeft].
  self resume: result!