The Inbox: Kernel-fbs.733.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Kernel-fbs.733.mcz

commits-2
Frank Shearar uploaded a new version of Kernel to project The Inbox:
http://source.squeak.org/inbox/Kernel-fbs.733.mcz

==================== Summary ====================

Name: Kernel-fbs.733
Author: fbs
Time: 29 January 2013, 4:38:23.85 pm
UUID: 473959a5-97ca-425d-a84b-7440244c893b
Ancestors: Kernel-fbs.732

Move the Debugger's introspection of a context into ContextPart. Use the new SubclassResponsibilityError API.

=============== Diff against Kernel-fbs.732 ===============

Item was added:
+ ----- Method: ContextPart>>invocationMessage (in category 'accessing') -----
+ invocationMessage
+ "Upon sending messages like #doesNotUnderstand: or #subclassResponsibility - methods that will pop up a Debugger - return the Message that prompted the Debugger."
+ | sender selector args |
+ (self method selector == #doesNotUnderstand:) ifTrue: [^ self tempAt: 1].
+ sender := self sender.
+ selector := sender method selector.
+ args := Array new: selector numArgs.
+ 1 to: selector numArgs do: [ :i | args at: i put: (sender tempAt: i)].
+ ^ MessageSend receiver: self receiver selector: selector arguments: args.!

Item was added:
+ ----- Method: MessageSend>>asMessage (in category 'converting') -----
+ asMessage
+ ^ Message selector: selector arguments: arguments.!

Item was added:
+ ----- Method: MessageSend>>selectorCategory (in category 'accessing') -----
+ selectorCategory
+ "Return the category to which this message belongs (relative to the receiver). If no superclass categorises this message, use the default."
+ | organizers |
+ organizers := receiver class withAllSuperclasses collect: [:ea | ea organization].
+ organizers addFirst: receiver class organization.
+ ^ (organizers collect: [ :org | org categoryOfElement: selector])
+ detect: [:ea | ea ~= ClassOrganizer default and: [ ea ~= nil]]
+ ifNone: [ClassOrganizer default]!

Item was changed:
  ----- Method: Object>>subclassResponsibility (in category 'error handling') -----
  subclassResponsibility
  "This message sets up a framework for the behavior of the class' subclasses.
  Announce that the subclass should have implemented this message."
+ SubclassResponsibilityError
+ signal: ('My {1} subclass should have overridden {2}'
+ format: {self className. thisContext sender selector}).!
- | exception args senderCtxt |
- "We must assign to a local variable so that the Debugger can access the exception through thisParticularContext tempAt: 1. This also means that the exception local must be the first local declared."
- senderCtxt := thisContext sender.
- "Copy the temps out of senderCtxt"
- args := OrderedCollection new.
- 1 to: senderCtxt selector numArgs do:
- [:idx | args addLast: (senderCtxt tempAt: idx)].
- exception := SubclassResponsibilityError
- class: self class
- selector: senderCtxt selector
- arguments: args.
- exception signal.!