How does the implementation of #doesNotUnderstand in the Object class result in opening a debugger in Squeak smalltalk?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 06:42:53

问题


I know that the implementation signals a MessageNotUnderstood exception, but how does that end up opening a debugger?


回答1:


When an Exception remains unhandled after it has been signalled, its #defaultAction is invoked. MessageNotUnderstood>>defaultAction delegates to Error>>defaultAction, which signals an UnhandledError (another Exception). This exception, in turn, has a defaultAction whose code reads like this:

^ ToolSet debugError: self exception

...which opens the debugger if you use the StandardToolSet (which is the default in regular Squeak images).



来源:https://stackoverflow.com/questions/51363300/how-does-the-implementation-of-doesnotunderstand-in-the-object-class-result-in

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!