The Inbox: Morphic-nice.1269.mcz

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

The Inbox: Morphic-nice.1269.mcz

commits-2
Nicolas Cellier uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-nice.1269.mcz

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

Name: Morphic-nice.1269
Author: nice
Time: 12 August 2016, 7:43:38.846146 pm
UUID: 0fe08891-e1d1-49c3-9aa6-a06a768461a5
Ancestors: Morphic-mt.1268

BUGFIX: tallySelection (tally it) might need a context

=============== Diff against Morphic-mt.1268 ===============

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.
  !