[squeak-dev] The Inbox: Kernel-ct.1442.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 3 20:25:03 UTC 2022


A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1442.mcz

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

Name: Kernel-ct.1442
Author: ct
Time: 3 January 2022, 9:25:00.293397 pm
UUID: 1c8eb404-f420-9f48-99fa-32c965fb5491
Ancestors: Kernel-mt.1441

Improves multilingual support in common error messages on Object.

Uploaded to the inbox because I am not sure whether any of these places should NOT invoke Get-Text to avoid infinite recursions. I already excluded the error selectors in the private category and #primitiveFailed: for this reason. How far do we want to go with multilingual support in low-level Kernel?

=============== Diff against Kernel-mt.1441 ===============

Item was changed:
  ----- Method: AdditionalMethodState>>copyWith: (in category 'copying') -----
  copyWith: aPropertyOrPragma "<Association|Pragma>"
  	"Answer a copy of the receiver which includes aPropertyOrPragma"
  	| bs copy |
  	(Association == aPropertyOrPragma class
  	 or: [Pragma == aPropertyOrPragma class]) ifFalse:
+ 		[self error: ('{1} instances should hold only Associations or Pragmas.' translated format: {self class name})].
- 		[self error: self class name, ' instances should hold only Associations or Pragmas.'].
  	"no need to initialize here; we're copying all inst vars"
  	copy := self class basicNew: (bs := self basicSize) + 1.
  	1 to: bs do:
  		[:i|
  		copy basicAt: i put: (self basicAt: i) shallowCopy].
  	copy basicAt: bs + 1 put: aPropertyOrPragma.
  	1 to: self class instSize do:
  		[:i| copy instVarAt: i put: (self instVarAt: i)].
  	^copy!

Item was changed:
  ----- Method: Object>>assert: (in category 'error handling') -----
  assert: aBlock
  	"Throw an assertion error if aBlock does not evaluates to true."
  
+ 	aBlock value ifFalse: [AssertionFailure signal: 'Assertion failed' translated]!
- 	aBlock value ifFalse: [AssertionFailure signal: 'Assertion failed']!

Item was changed:
  ----- Method: Object>>backwardCompatibilityOnly: (in category 'error handling') -----
  backwardCompatibilityOnly: explanationString
  	"Warn that the sending method has been deprecated. Methods that are tagt with #backwardCompatibility:
  	 are kept for compatibility."
  
  	Deprecation
  		signalForContext: thisContext sender
+ 		message: ' (but will be kept for compatibility)' translated
- 		message: ' (but will be kept for compatibility)'
  		explanation: explanationString!

Item was changed:
  ----- Method: Object>>caseError (in category 'error handling') -----
  caseError
  	"Report an error from an in-line or explicit case statement."
  
+ 	self error: ('Case not found ({1}), and no otherwise clause' translated format: {self printString})!
- 	self error: ('Case not found ({1}), and no otherwise clause' format: {self printString})!

Item was changed:
  ----- Method: Object>>doesNotUnderstand: (in category 'error handling') -----
  doesNotUnderstand: aMessage 
  	 "Handle the fact that there was an attempt to send the given
  	  message to the receiver but the receiver does not understand
  	  this message (typically sent from the machine when a message
  	  is sent to the receiver and no method is defined for that selector).
  
  	 Raise the MessageNotUnderstood signal.  If it is caught, answer
  	 the result supplied by the exception handler.  If it is not caught,
  	 answer the result of resending the message within a guard for
  	 infinite recursion. This allows, for example, the programmer to
  	 implement the method and continue."
  
  	"Testing: (3 activeProcess)"
  
  	| exception resumeValue |
  	(exception := MessageNotUnderstood new)
  		message: aMessage;
  		receiver: self.
  	resumeValue := exception signal.
  	^exception reachedDefaultHandler "i.e. exception was not caught..."
  		ifTrue:
  			[[aMessage sentTo: self]
  				on: MessageNotUnderstood
  				do: [:ex|
  					(self == ex receiver
  					and: [aMessage hasIdenticalContentsAs: ex message]) ifFalse:
  						[ex pass].
+ 					self error: 'infinite recursion in doesNotUnderstand:' translated]]
- 					self error: 'infinite recursion in doesNotUnderstand:']]
  		ifFalse: [resumeValue]!

Item was changed:
  ----- Method: Object>>error (in category 'error handling') -----
  error
  	"Throw a generic Error exception."
  
+ 	^self error: 'Error!!' translated.!
- 	^self error: 'Error!!'.!

Item was changed:
  ----- Method: Object>>shouldBeImplemented (in category 'error handling') -----
  shouldBeImplemented
  	"Announce that this message should be implemented"
  
+ 	^ NotImplemented signal: ('{1} or a superclass should implement {2}' translated format: {self className. thisContext sender selector})!
- 	^ NotImplemented signal: ('{1} or a superclass should implement {2}' format: {self className. thisContext sender selector})!

Item was changed:
  ----- Method: Object>>shouldNotImplement (in category 'error handling') -----
  shouldNotImplement
  	"Announce that, although the receiver inherits this message, it should 
  	not implement it."
  
+ 	NotImplemented signal: ('{1} is not a message appropriate for a {2}' translated format: {thisContext sender selector. self className}).!
- 	NotImplemented signal: ('{1} is not a message appropriate for a {2}' format: {thisContext sender selector. self className}).!

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."
  	^ SubclassResponsibility
  		signal: ('My {1} subclass should have overridden {2}'
+ 			translated format: {self className. thisContext sender selector}).!
- 			format: {self className. thisContext sender selector}).!

Item was changed:
  ----- Method: Object>>traitConflict (in category 'error handling') -----
  traitConflict
+ 	self error: 'A class or trait does not properly resolve a conflict between multiple traits it uses.' translated!
- 	self error: 'A class or trait does not properly resolve a conflict between multiple traits it uses.'!



More information about the Squeak-dev mailing list