Obj-C Exceptions In Gecko: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
Line 4: Line 4:


= Possible solutions =
= Possible solutions =
== 1.8 branch ==
== Gecko 1.8 ==
Since there isn't a whole lot of code that's using Cocoa on 1.8, it might be best to to write macros to wrap any XPCOM entry point that calls cocoa, start to finish. NS_OBJC_EXCEPTION_CATCHER_START and _END, for example.
Since there isn't a whole lot of code that's using Cocoa in Gecko 1.8, it might be best to to write macros to wrap any XPCOM entry point that calls cocoa, start to finish. NS_OBJC_EXCEPTION_CATCHER_START and _END, for example.


Another, eviler approach is to override NSException's initWithName:reason:userInfo: method to instead call some sort of assertion, and then return nil. This of course bypasses the entire ObjC exception system, and will horribly, horribly break any code that depends upon actually handling ObjC exceptions. There might still some merit in the idea of posing as NSException, perhaps to override -raise?
Another, eviler approach is to override NSException's initWithName:reason:userInfo: method to instead call some sort of assertion, and then return nil. This of course bypasses the entire ObjC exception system, and will horribly, horribly break any code that depends upon actually handling ObjC exceptions. There might still some merit in the idea of posing as NSException, perhaps to override -raise?
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits

Navigation menu