The Trunk: Kernel-ct.1298.mcz

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

The Trunk: Kernel-ct.1298.mcz

commits-2
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ct.1298.mcz

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

Name: Kernel-ct.1298
Author: ct
Time: 17 February 2020, 4:48:43.681432 pm
UUID: d57152c7-359a-054c-9dd7-c6353a6f700f
Ancestors: Kernel-tonyg.1293

Fixes a simulation bug regarding #doesNotUnderstand:. Don't forget to indicate the correct lookup class.

Steps to reproduce this bug:
1. Debug "42 foo"
2. Step over
The debugger label was: 'MessageNotUnderstood: nil>>foo'.

=============== Diff against Kernel-tonyg.1293 ===============

Item was changed:
  ----- Method: Context>>send:to:with:lookupIn: (in category 'controlling') -----
  send: selector to: rcvr with: arguments lookupIn: lookupClass
  "Simulate the action of sending a message with selector and arguments
  to rcvr. The argument, lookupClass, is the class in which to lookup the
  message.  This is the receiver's class for normal messages, but for super
  messages it will be some specific class related to the source method."
 
  | meth primIndex val ctxt |
  (meth := lookupClass lookupSelector: selector) ifNil:
  [^self send: #doesNotUnderstand:
  to: rcvr
+ with: {(Message selector: selector arguments: arguments) lookupClass: lookupClass}
- with: {Message selector: selector arguments: arguments}
  lookupIn: lookupClass].
  meth numArgs ~= arguments size ifTrue:
  [^self error: 'Wrong number of arguments in simulated message ', selector printString].
  (primIndex := meth primitive) > 0 ifTrue:
  [val := self doPrimitive: primIndex method: meth receiver: rcvr args: arguments.
  (self isPrimFailToken: val) ifFalse:
  [^val]].
  (selector == #doesNotUnderstand: and: [lookupClass == ProtoObject]) ifTrue:
  [^self error: 'Simulated message ', arguments first selector, ' not understood'].
  ctxt := Context sender: self receiver: rcvr method: meth arguments: arguments.
  primIndex > 0 ifTrue:
  [ctxt failPrimitiveWith: val].
  ^ctxt!