The Trunk: Morphic-nice.1271.mcz

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

The Trunk: Morphic-nice.1271.mcz

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

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

Name: Morphic-nice.1271
Author: nice
Time: 13 August 2016, 9:36:14.224536 am
UUID: 81bd8809-f130-4f38-b153-c427d78ccbac
Ancestors: Morphic-mt.1270, Morphic-nice.1269

merge

Morphic-mt.1270:
        Preference help text updates. Thanks Tim R.!

Morphic-nice.1269:
        BUGFIX: tallySelection (tally it) might need a context

=============== Diff against Morphic-mt.1270 ===============

Item was changed:
  ----- Method: SmalltalkEditor>>tallySelection (in category 'do-its') -----
  tallySelection
  "Treat the current selection as an expression; evaluate it and return the time took for this evaluation"
  | result rcvr ctxt valueAsString v |
  self lineSelectAndEmptyCheck: [^ self].
 
  (model respondsTo: #doItReceiver)
  ifTrue: [ rcvr := model doItReceiver.
  ctxt := model doItContext]
  ifFalse: [rcvr := ctxt := nil].
  result := [ | cm |
  cm := rcvr class evaluatorClass new
  compiledMethodFor: self selectionAsStream
  in: ctxt
  to: rcvr
  notifying: self
  ifFail: [morph flash. ^ self].
  Time millisecondsToRun:
+ [v := cm valueWithReceiver: rcvr arguments: (ctxt ifNil: [#()] ifNotNil: [{ctxt}]) ].
- [v := cm valueWithReceiver: rcvr arguments: #() ].
  ]
  on: OutOfScopeNotification
  do: [ :ex | ex resume: true].
 
  "We do not want to have large result displayed"
  valueAsString := v printString.
  (valueAsString size > 30) ifTrue: [valueAsString := (valueAsString copyFrom: 1 to: 30), '...'].
  PopUpMenu
  inform: 'Time to compile and execute: ', result printString, 'ms res: ', valueAsString.
  !