A new version of Tests was added to project The Inbox:
http://source.squeak.org/inbox/Tests-jar.462.mcz
==================== Summary ====================
Name: Tests-jar.462
Author: jar
Time: 3 May 2021, 12:03:40.642808 pm
UUID: b9dfb879-cfe4-ea46-96c4-fa620bd984c8
Ancestors: Tests-jar.461
Fix indentation of #doubleOuterResignalAsTest. I hope it's right this time :)
=============== Diff against Tests-jar.461 ===============
Item was changed:
----- Method: ExceptionTester>>doubleOuterResignalAsTest (in category 'tests') -----
doubleOuterResignalAsTest
"ExceptionTester new doubleOuterResignalAsTest"
[[self doSomething.
MyResumableTestError signal.
self doYetAnotherThing]
on: MyResumableTestError
+ do: [:ex | ex outer. self doSomethingExceptional].
+ self doSomethingElse]
+ on: MyResumableTestError
+ do: [:ex | ex resignalAs: MyTestNotification]
- do: [:ex | ex outer. self doSomethingExceptional]. self doSomethingElse]
- on: MyResumableTestError
- do: [:ex | ex resignalAs: MyTestNotification]
!
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1719.mcz
==================== Summary ====================
Name: Morphic-eem.1719
Author: eem
Time: 3 February 2021, 6:38:11.11355 pm
UUID: ffb981b1-7c53-4fbe-b6f4-4c8f27c79f5a
Ancestors: Morphic-mt.1718
Make SearchBar>>#smartSearch:in: search existing browsers for a class name being searched for, bringing the first such browser to the front and selecting the class. This allows one to find classes in browsers either when one has very many, or when one is using multi-window browsers containing many many classes.
=============== Diff against Morphic-mt.1718 ===============
Item was added:
+ ----- Method: Browser>>displayClass: (in category '*Morphic-Menus-DockingBar-accessing') -----
+ displayClass: aClass
+ "Assuming the receiver has answered true to isDisplayingClass:, come to the front and select the given class."
+ | index |
+ index := self multiWindowIndexForClassName: aClass.
+ index ~= 0 ifTrue:
+ [multiWindowState selectWindowIndex: index].
+ self selectClass: aClass!
Item was added:
+ ----- Method: Browser>>isDisplayingClass: (in category '*Morphic-Menus-DockingBar-accessing') -----
+ isDisplayingClass: aClass
+ | className |
+ className := aClass name.
+ (self multiWindowIndexForClassName: className) ~= 0 ifTrue: [^true].
+ ^selectedClassName = className!
Item was added:
+ ----- Method: Browser>>multiWindowIndexForClassName: (in category '*Morphic-Menus-DockingBar-accessing') -----
+ multiWindowIndexForClassName: className
+ "Answer the index of a browser displaying className in multiWindowState, if any.
+ Otherwise answer zero."
+ multiWindowState ifNil: [^0].
+ multiWindowState models withIndexDo:
+ [:browser :index|
+ browser selectedClassName = className ifTrue: [^index]].
+ ^0!
Item was changed:
----- Method: SearchBar>>smartSearch:in: (in category 'searching') -----
smartSearch: text in: morph
"Take the user input and perform an appropriate search"
| input newContents |
self removeResultsWidget.
input := text asString ifEmpty:[^self].
self class useSmartSearch ifFalse: [^ ToolSet default browseMessageNames: input].
+ (Symbol findInterned: input) ifNotNil:
+ [:symbol| input := symbol].
"If it is a global or a full class name, browse that class."
+ (Smalltalk bindingOf: input) ifNotNil:
+ [:assoc| | class |
+ class := (assoc value isBehavior ifTrue:[assoc value] ifFalse:[assoc value class]) theNonMetaClass.
+ Project current world submorphs do:
+ [:windowMorph|
+ (windowMorph isSystemWindow
+ and: [(windowMorph model isKindOf: Browser)
+ and: [windowMorph model isDisplayingClass: class]]) ifTrue:
+ [windowMorph beKeyWindow.
+ ^windowMorph model displayClass: class]].
+ ^ToolSet browse: class selector: nil].
- (Smalltalk bindingOf: input) ifNotNil:[:assoc| | global |
- global := assoc value.
- ^ToolSet browse: (global isBehavior ifTrue:[global] ifFalse:[global class]) selector: nil].
"If it is a symbol and there are implementors of it, browse those implementors."
Symbol hasInterned: input ifTrue: [:selector |
(SystemNavigation new allImplementorsOf: selector) ifNotEmpty:[:list|
^SystemNavigation new
browseMessageList: list
name: 'Implementors of ' , input]].
"If it starts uppercase, browse classes if any. Otherwise, just search for messages."
+ input first isUppercase ifTrue:
+ [(UIManager default classFromPattern: input withCaption: '')
+ ifNotNil:[:aClass| ^ToolSet browse: aClass selector: nil].
+ newContents := input, ' -- not found.'.
+ self searchTerm: newContents.
+ self selection: (input size+1 to: newContents size).
+ self currentHand newKeyboardFocus: morph textMorph.
+ ^ self].
+
+ "Default to browse message names..."
+ ToolSet default browseMessageNames: input!
- input first isUppercase
- ifTrue: [
- (UIManager default classFromPattern: input withCaption: '')
- ifNotNil:[:aClass| ^ToolSet browse: aClass selector: nil]
- ifNil: [
- newContents := input, ' -- not found.'.
- self searchTerm: newContents.
- self selection: (input size+1 to: newContents size).
- self currentHand newKeyboardFocus: morph textMorph.
- ^ self]]
- ifFalse: [
- ToolSet default browseMessageNames: input].!
Levente Uzonyi uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-ul.933.mcz
==================== Summary ====================
Name: Collections-ul.933
Author: ul
Time: 31 March 2021, 2:17:52.141067 am
UUID: b290ad2c-2ed0-4d46-b2fe-12545bf5f31c
Ancestors: Collections-ul.932
- use #ofSize: instead of #new: in SequenceableCollection class >> new:streamContents:, so that it creates a stream on a non-empty collection even if the receiver is OrderedCollection.
=============== Diff against Collections-ul.932 ===============
Item was changed:
----- Method: SequenceableCollection class>>new:streamContents: (in category 'stream creation') -----
new: newSize streamContents: blockWithArg
| stream originalContents |
+ stream := WriteStream on: (self ofSize: newSize).
- stream := WriteStream on: (self new: newSize).
blockWithArg value: stream.
originalContents := stream originalContents.
+ ^originalContents size = stream position
+ ifTrue: [ originalContents ]
+ ifFalse: [ stream contents ]!
- originalContents size = stream position
- ifTrue: [ ^originalContents ]
- ifFalse: [ ^stream contents ]!
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-jar.1398.mcz
==================== Summary ====================
Name: Kernel-jar.1398
Author: jar
Time: 2 May 2021, 2:56:26.972089 pm
UUID: 9398993d-726c-8747-bde6-506318c4f898
Ancestors: Kernel-nice.1397
Fix a bug in #resignalAs causing an incorrect evaluation of resignalAs in combination with #outer. Complemented with a test in Tests-jar.461 (Inbox)
To illustrate the bug try:
| x |
x:=''.
[
[1/0. x:=x,'1'] on: ZeroDivide do: [:ex | ex outer. x:=x,'2'].
x:=x,'3'
] on: ZeroDivide do: [:ex | ex resignalAs: Notification].
x
answers:
---> '2' currently - incorrect
---> '13' after the fix
=============== Diff against Kernel-nice.1397 ===============
Item was changed:
----- Method: Exception>>resignalAs: (in category 'handling') -----
resignalAs: replacementException
+ "Signal an alternative exception in place of the receiver.
+ Unwind to signalContext before signalling the replacement exception"
- "Signal an alternative exception in place of the receiver."
+ signalContext resumeEvaluating: [replacementException signal]!
- self resumeEvaluating: [replacementException signal]!