Browse Source

Fixed Point >> =

Nicolas Petton 12 years ago
parent
commit
a4fff54b98
3 changed files with 6 additions and 5 deletions
  1. 1 1
      js/Kernel.deploy.js
  2. 3 3
      js/Kernel.js
  3. 2 1
      st/Kernel.st

+ 1 - 1
js/Kernel.deploy.js

@@ -5626,7 +5626,7 @@ smalltalk.method({
 selector: '=',
 fn: function (aPoint){
 var self=this;
-return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);
+return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);})]);
 return self;}
 }),
 smalltalk.Point);

+ 3 - 3
js/Kernel.js

@@ -8014,11 +8014,11 @@ selector: unescape('%3D'),
 category: 'arithmetic',
 fn: function (aPoint){
 var self=this;
-return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);
+return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);})]);
 return self;},
 args: ["aPoint"],
-source: unescape('%3D%20aPoint%0A%09%5E%20%28aPoint%20x%20%3D%20self%20x%29%20%26%20%28aPoint%20y%20%3D%20self%20y%29'),
-messageSends: [unescape("%26"), unescape("%3D"), "x", "y"],
+source: unescape('%3D%20aPoint%0A%09%5EaPoint%20class%20%3D%20self%20class%20and%3A%20%5B%0A%09%09%28aPoint%20x%20%3D%20self%20x%29%20%26%20%28aPoint%20y%20%3D%20self%20y%29%5D'),
+messageSends: ["and:", unescape("%3D"), "class", unescape("%26"), "x", "y"],
 referencedClasses: []
 }),
 smalltalk.Point);

+ 2 - 1
st/Kernel.st

@@ -2786,7 +2786,8 @@ x: aNumber
 !
 
 = aPoint
-	^ (aPoint x = self x) & (aPoint y = self y)
+	^aPoint class = self class and: [
+		(aPoint x = self x) & (aPoint y = self y)]
 ! !
 
 !Point methodsFor: 'converting'!