[squeak-dev] The Trunk: Kernel-tonyg.1330.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jun 4 20:01:04 UTC 2020

Tony Garnock-Jones uploaded a new version of Kernel to project The Trunk:

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

Name: Kernel-tonyg.1330
Author: tonyg
Time: 4 June 2020, 4:44:15.894747 pm
UUID: 76ade342-1acf-4780-8cda-610dba22bbec
Ancestors: Kernel-eem.1329

Repair a discrepancy between current Promise implementation and the Promises/A+ spec. (Bug reported by Jakob Reschke on squeak-dev, 5 April 2020)

=============== Diff against Kernel-eem.1329 ===============

Item was changed:
  ----- Method: Promise>>then:ifRejected: (in category 'monad') -----
  then: resolvedBlock ifRejected: errBlock
  	"Return a Promise that, if it resolves, runs the resolvedBlock. If resolution throws an Exception, it runs the errBlock."
  	| p |
  	p := Promise new.
  	self whenResolved: [:v |
  		[p resolveWith: (resolvedBlock value: v)]
  			on: Error do: [:e | p rejectWith: e]].
+ 	self whenRejected: [:e |
+ 		[p resolveWith: (errBlock value: e)]
+ 			on: Error do: [:e2 | p rejectWith: e2]].
- 	self whenRejected: [:e | p rejectWith: (errBlock value: e)].
  	^ p.!

More information about the Squeak-dev mailing list