Browse Source

!= null tests where more appropriate

Herbert Vojčík 9 years ago
parent
commit
35bab0e2ae

+ 2 - 2
src/Kernel-Collections.js

@@ -8152,7 +8152,7 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return anObject.klass && anObject.klass.className;
+return anObject.klass != null && anObject.klass.className;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"classNameOf:",{anObject:anObject},$globals.Set)});
@@ -8160,7 +8160,7 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anObject"],
-source: "classNameOf: anObject\x0a\x09\x22Answer the class name of `anObject`, or `undefined` \x0a\x09if `anObject` is not an Smalltalk object\x22\x0a\x09\x0a\x09<return anObject.klass && anObject.klass.className>",
+source: "classNameOf: anObject\x0a\x09\x22Answer the class name of `anObject`, or `undefined` \x0a\x09if `anObject` is not an Smalltalk object\x22\x0a\x09\x0a\x09<return anObject.klass != null && anObject.klass.className>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 1 - 1
src/Kernel-Collections.st

@@ -2012,7 +2012,7 @@ classNameOf: anObject
 	"Answer the class name of `anObject`, or `undefined` 
 	if `anObject` is not an Smalltalk object"
 	
-	<return anObject.klass && anObject.klass.className>
+	<return anObject.klass !!= null && anObject.klass.className>
 !
 
 includes: anObject in: anotherObject

+ 2 - 2
src/Kernel-Infrastructure.js

@@ -2991,7 +2991,7 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return typeof anObject.klass !== 'undefined';
+return anObject.klass != null;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},$globals.SmalltalkImage)});
@@ -2999,7 +2999,7 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anObject"],
-source: "isSmalltalkObject: anObject\x0a\x09\x22Consider anObject a Smalltalk object if it has a 'klass' property.\x0a\x09Note that this may be unaccurate\x22\x0a\x09\x0a\x09<return typeof anObject.klass !== 'undefined'>",
+source: "isSmalltalkObject: anObject\x0a\x09\x22Consider anObject a Smalltalk object if it has a 'klass' property.\x0a\x09Note that this may be unaccurate\x22\x0a\x09\x0a\x09<return anObject.klass != null>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 1 - 1
src/Kernel-Infrastructure.st

@@ -913,7 +913,7 @@ isSmalltalkObject: anObject
 	"Consider anObject a Smalltalk object if it has a 'klass' property.
 	Note that this may be unaccurate"
 	
-	<return typeof anObject.klass !!== 'undefined'>
+	<return anObject.klass !!= null>
 ! !
 
 SmalltalkImage class instanceVariableNames: 'current'!