A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-cbc.1054.mcz==================== Summary ====================
Name: Kernel-cbc.1054
Author: cbc
Time: 27 January 2017, 9:06:02.080673 am
UUID: 4707f619-341d-7241-918f-6c3215f93fce
Ancestors: Kernel-eem.1053
Fixes Behaviour>>basicNew: to recognize and invalid arugment and raise an appropriate error (not an 'out of memory' error).
=============== Diff against Kernel-eem.1053 ===============
Item was changed:
----- Method: Behavior>>basicNew: (in category 'instance creation') -----
basicNew: sizeRequested
"Primitive. Answer an instance of this class with the number of indexable
variables specified by the argument, sizeRequested. Fail if this class is not
indexable or if the argument is not a positive Integer, or if there is not
enough memory available. Essential. See Object documentation whatIsAPrimitive.
If the primitive fails because space is low then the scavenger will run before the
method is activated. Check args and retry via handleFailingBasicNew: if they're OK."
<primitive: 71 error: ec>
+ (ec == #'insufficient object memory') ifTrue:
- (ec == #'insufficient object memory' or: [ec == #'bad argument']) ifTrue:
[^self handleFailingBasicNew: sizeRequested].
+ (ec == #'bad argument') ifTrue:
+ [self error: self printString, ' called #basicNew: with invalid arugment ', sizeRequested].
self isVariable ifFalse:
[self error: self printString, ' cannot have variable sized instances'].
self primitiveFailed!