[View] [Edit] [Lock] [References] [Attachments] [History] [Home] [Changes] [Search] [Help]
test[S8ObjC] super
SwikiCodeRobot @> #testS8ObjCSuper |
"super send"
| counter cls object result |
counter := 0.
cls := (ObjCClass named: #NSObject) extend: #SuperSendTest.
cls addMethod: #description
type: (#retval -> $@ ,(#args -> #($@ $:))) json
function: [:my :cmd|
self print: '//executing #' ,cmd.
counter := counter + 1.
my#super value: #description
].
cls register.
object := cls newInstanceHandle.
counter = 0 ifFalse: [ self error: 'Must be zero' ].
self error: 'Needs work - will crash if run from this point".
result := object value: #description.
counter = 1 ifFalse: [ self error: 'Must be one' ].
#ok