Contexts and exception handlers

David Shaffer cdshaffer at acm.org
Wed Aug 2 16:42:45 UTC 2006


When saving a context and using it in
Compiler>>evaluate:in:to:notifying:ifFail:logged: it doesn't appear that
exception handlers are active.  Here's a test case which demonstrates my
expectations (which are clearly flawed).  Can anyone help me understand
why this notification isn't caught?

BTW, I'm simply trying to figure out how to get the Inspector, Debugger,
ObjectExplorer etc to be able to access "dynamic variables" which
existed in the context in which the tool was activated.

David

-------------- next part --------------
'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 2 August 2006 at 12:34:47 pm'!
TestCase subclass: #SCContextTest
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'SCContextAwareInspector'!

!SCContextTest methodsFor: 'running' stamp: 'cds 8/2/2006 12:33'!
testNotificationCaught
	|ctxt notified|
	notified := false.
	[ctxt := thisContext] on: SCTestNotification do: [notified := true].
	self deny: notified.
	Compiler new evaluate: 'SCTestNotification signal' in: ctxt to: self notifying: nil ifFail: [^nil] logged: false.
	self assert: notified! !
-------------- next part --------------
'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 2 August 2006 at 12:34:49 pm'!
Notification subclass: #SCTestNotification
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'SCContextAwareInspector'!


More information about the Squeak-dev mailing list