forked from hpi-swa/RSqueak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel changes.1.cs
51 lines (40 loc) · 1.65 KB
/
kernel changes.1.cs
1
'From Squeak4.4 of 31 December 2012 [latest update: #12332] on 21 May 2013 at 4:15:40 pm'!!Object methodsFor: 'error handling' stamp: 'lw 5/21/2013 11:55'!doesNotUnderstand: aMessage "Handle the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message (typically sent from the machine when a message is sent to the receiver and no method is defined for that selector)." "Testing: (3 activeProcess)" | exception resumeValue | SPyVM halt. (exception := MessageNotUnderstood new) message: aMessage; receiver: self. resumeValue := exception signal. ^exception reachedDefaultHandler ifTrue: [aMessage sentTo: self] ifFalse: [resumeValue]! !!Object methodsFor: 'error handling' stamp: 'lw 5/21/2013 16:14'!error: aString "Throw a generic Error exception." SPyVM halt. ^Error new signal: aString! !!ContextPart class methodsFor: 'special context creation' stamp: 'lw 5/17/2013 18:36'!contextEnsure: block "Create an #ensure: context that is ready to return from executing its receiver" | ctxt chain | ctxt := thisContext. [chain := thisContext sender cut: ctxt. ctxt push: nil. ctxt jump] ensure: block. "jump above will resume here without unwinding chain" ^ chain! !!ContextPart class methodsFor: 'special context creation' stamp: 'lw 5/17/2013 14:37'!contextOn: exceptionClass do: block "Create an #on:do: context that is ready to return from executing its receiver" | ctxt chain | ctxt := thisContext. [chain := thisContext sender cut: ctxt. ctxt push: nil. ctxt jump] on: exceptionClass do: block. "jump above will resume here without unwinding chain" ^ chain! !