问题
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