[squeak-dev] The Trunk: Morphic-mt.1577.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Oct 15 12:44:45 UTC 2019


Just interested, what is the benefit of [Error signal: 'foo'] against [self error: 'foo']? :)


Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Dienstag, 15. Oktober 2019 13:58:28
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Morphic-mt.1577.mcz

Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1577.mcz

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

Name: Morphic-mt.1577
Author: mt
Time: 15 October 2019, 1:58:16.523992 pm
UUID: 1d4a5d6b-aeee-5242-b9ef-d2c81fedd846
Ancestors: Morphic-mt.1576

Better error message in pluggable lists for misbehaving models. :-)

=============== Diff against Morphic-mt.1576 ===============

Item was changed:
  ----- Method: PluggableListMorph>>getFullList (in category 'model access - cached') -----
  getFullList
         "The full, unfiltered list. Cached result, see #updateList. Prefer getListSelector over getListElementSelector if both a set."

         ^ fullList ifNil: [
                 fullList := getListSelector
                         ifNotNil: [:sel | model perform: sel]
                         ifNil: [(getListSizeSelector notNil and: [getListElementSelector notNil])
                                 ifTrue: [       (1 to: self getListSize) collect: [:index | self getListItem: index]]
+                                ifFalse: [#() "We cannot get the full list."]].
+                fullList ifNil: [Error signal: 'The model must never provide ''nil'' as a list but only a collection.'].
+                fullList]!
-                                ifFalse: [#() "We cannot get the full list."]]]!

Item was changed:
  ----- Method: PluggableListMorph>>updateListFilter (in category 'updating') -----
  updateListFilter

         | selection |
+        selection := self selectionIndex = 0 "Avoid fetching #getList here."
+                ifTrue: [nil]
+                ifFalse: [self selection].
-        selection := self selection.

         list := nil.
         modelToView := nil.
         viewToModel := nil.

         self getList.

         "Try to restore the last selection."
         selection ifNotNil: [self selection: selection].!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191015/fc9468d2/attachment.html>


More information about the Squeak-dev mailing list