[squeak-dev] The Inbox: Kernel-tonyg.1212.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jan 29 17:48:33 UTC 2019


A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-tonyg.1212.mcz

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

Name: Kernel-tonyg.1212
Author: tonyg
Time: 29 January 2019, 5:20:15.285274 pm
UUID: b291eae8-dfde-4ee1-b5dd-a351cb270ec9
Ancestors: Kernel-mt.1211, Kernel-tonyg.1153

Merge "Improve promise resolution error handling via #fulfillWith:."

=============== Diff against Kernel-mt.1211 ===============

Item was added:
+ ----- Method: Promise>>fulfillWith: (in category 'resolving') -----
+ fulfillWith: aBlock
+ 	self fulfillWith: aBlock passErrors: rejecters isEmpty!

Item was added:
+ ----- Method: Promise>>fulfillWith:passErrors: (in category 'resolving') -----
+ fulfillWith: aBlock passErrors: aBoolean
+ 	"Evaluate aBlock. If it signals an exception, reject this promise with the exception
+ 	as the argument; if it returns a value [or another Promise], resolve this promise
+ 	with the result.
+ 	
+ 	If aBoolean is true, and an exception is signaled, it is passed out to the caller.
+ 	If aBoolean is false, signaled exceptions are considered handled after the promise
+ 	has been rejected."
+ 	[ self resolveWith: aBlock value ]
+ 		on: Exception
+ 		do: [ :ex |
+ 			(ex isKindOf: Halt)
+ 				ifTrue: [ex pass]
+ 				ifFalse: [
+ 					self rejectWith: ex.
+ 					aBoolean ifTrue: [ ex pass ] ]]!



More information about the Squeak-dev mailing list