/interpreter/tags/at2dist041108/test/edu/vub/at/objects/natives/ExceptionHandlingTest-snippet1
http://ambienttalk.googlecode.com/ · #! · 23 lines · 21 code · 2 blank · 0 comment · 0 complexity · 2e045baf7771cb293555db23c0d15dd1 MD5 · raw file
- def removableFieldsMirror :=
- mirror: {
- // vectors are not loaded with these unit tests
- // we therefore assume only a single field is removed
- def removedField := nil;
- def removeField( symbol ) {
- removedField := symbol;
- };
- def invokeField( receiver, symbol ) {
- if: (symbol == removedField) then: {
- raise: doesNotUnderstandX.new(symbol , self);
- } else: {
- super.invokeField( receiver, symbol );
- }
- }
- };
-
- def test := object: {
- def visible := nil
- } mirroredBy: removableFieldsMirror;
- (reflect: test).removeField(`visible);
- (test.visible == nil).ifTrue: { fail(); };