[squeak-dev] The Trunk: Kernel-dtl.658.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Dec 12 00:51:31 UTC 2011


David T. Lewis uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-dtl.658.mcz

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

Name: Kernel-dtl.658
Author: dtl
Time: 11 December 2011, 7:50:47.904 pm
UUID: 8f8f6e77-b113-446b-b593-aa5aa0f8db4e
Ancestors: Kernel-ul.657

The primitive fallback code in object:perform:withArguments:inClass: should test 'selector isSymbol' rather than 'selector isMemberOf: Symbol' because #someSelector isMemberOf: Symbol ==> false

Observed when running testMirrorPerform on a VM with failing primitivePerformInSuperclass, resulting in a misleading error message.

=============== Diff against Kernel-ul.657 ===============

Item was changed:
  ----- Method: ContextPart>>object:perform:withArguments:inClass: (in category 'mirror primitives') -----
  object: anObject perform: selector withArguments: argArray inClass: lookupClass
  	"Send the selector, aSymbol, to anObject with arguments in argArray.
  	 Fail if the number of arguments expected by the selector 
  	 does not match the size of argArray, or if lookupClass
  	 cannot be found among the anObject's superclasses.
  	 Primitive. Essential for the debugger."
  
  	<primitive: 100 error: error>
+ 	(selector isSymbol) ifFalse:
- 	(selector isMemberOf: Symbol) ifFalse:
  		[^self error: 'selector argument must be a Symbol'].
  	(argArray isMemberOf: Array) ifFalse:
  		[^self error: 'argArray must be an Array'].
  	(selector numArgs = argArray size)
  		ifFalse: [^self error: 'incorrect number of arguments'].
  	((self objectClass: anObject) == lookupClass
  	 or: [(self objectClass: anObject) inheritsFrom: lookupClass]) ifFalse:
  		[^self error: 'lookupClass is not in anObject''s inheritance chain'].
  	self primitiveFailed!




More information about the Squeak-dev mailing list