The Trunk: ST80-nice.216.mcz

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

The Trunk: ST80-nice.216.mcz

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

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

Name: ST80-nice.216
Author: nice
Time: 12 August 2016, 7:46:54.418146 pm
UUID: 1355ad92-746c-4ba6-8255-90bbdc07e4b9
Ancestors: ST80-mt.215

BUGFIX: tallySelection (tally it) might need a context

=============== Diff against ST80-mt.215 ===============

Item was changed:
  ----- Method: ParagraphEditor>>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: [self 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.
  !