Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1401.mcz ==================== Summary ==================== Name: Kernel-nice.1401 Author: nice Time: 6 May 2021, 11:24:25.403176 pm UUID: 2fbbe628-b187-4e75-ab6f-a6d16df14ce7 Ancestors: Kernel-jar.1400, Kernel-nice.1399 Merge exception handling fixes Kernel-jar.1400, Kernel-nice.1399 =============== Diff against Kernel-jar.1400 =============== Item was changed: ----- Method: Context>>resumeEvaluating: (in category 'controlling') ----- resumeEvaluating: aBlock "Unwind thisContext to self and resume with value as result of last send. Execute unwind blocks when unwinding. ASSUMES self is a sender of thisContext" | ctxt unwindBlock | self isDead ifTrue: [self cannotReturn: aBlock value to: self]. ctxt := thisContext. [ ctxt := ctxt findNextUnwindContextUpTo: self. ctxt isNil ] whileFalse: [ (ctxt tempAt: 2) ifNil:[ + "(tempAt: 2) refers to complete temporary in ensure: and ifCurtailed: + or any other method marked with <primitive: 198>" ctxt tempAt: 2 put: true. unwindBlock := ctxt tempAt: 1. thisContext terminateTo: ctxt. unwindBlock value]. ]. thisContext terminateTo: self. ^ aBlock value ! 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]! Item was changed: ----- Method: Exception>>resumeEvaluating: (in category 'handling') ----- resumeEvaluating: aBlock "Return result of evaluating aBlock as the value of #signal, unless this was called after an #outer message, then return resumptionValue as the value of #outer. The block is only evaluated after unwinding the stack." | ctxt | outerContext ifNil: [ signalContext returnEvaluating: aBlock ] ifNotNil: [ ctxt := outerContext. outerContext := ctxt tempAt: 1. "prevOuterContext in #outer" + handlerContext := ctxt tempAt: 2. "currHandlerContext in #outer" ctxt returnEvaluating: aBlock ]. ! Item was changed: ----- Method: Exception>>resumeUnchecked: (in category 'handling') ----- resumeUnchecked: resumptionValue "Return resumptionValue as the value of #signal, unless this was called after an #outer message, then return resumptionValue as the value of #outer." + ^self resumeEvaluating: [resumptionValue]! - | ctxt | - outerContext ifNil: [ - signalContext return: resumptionValue - ] ifNotNil: [ - ctxt := outerContext. - outerContext := ctxt tempAt: 1. "prevOuterContext in #outer" - handlerContext := ctxt tempAt: 2. "currHandlerContext in #outer" - ctxt return: resumptionValue - ]. - ! |
Free forum by Nabble | Edit this page |