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].! |
Just interested, what is the benefit of [Error signal: 'foo'] against [self error: 'foo']? :)
Christoph Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 15. Oktober 2019 13:58:28 An: [hidden email]; [hidden email] 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].!
Carpe Squeak!
|
Well ... I think "self error: ..." would be better here. #error: is a message that can be specified by the receiver. "Error" is a global class reference. Like a hard-coded value. "Magic number" Best, Marcel
|
Free forum by Nabble | Edit this page |