Browse Source

Merge branch 'master' of https://github.com/bromagosa/amber

Nicolas Petton 13 years ago
parent
commit
72dc6cebf4
3 changed files with 31 additions and 0 deletions
  1. 11 0
      js/Kernel.deploy.js
  2. 16 0
      js/Kernel.js
  3. 4 0
      st/Kernel.st

+ 11 - 0
js/Kernel.deploy.js

@@ -5620,6 +5620,17 @@ return self;}
 }),
 smalltalk.Point);
 
+smalltalk.addMethod(
+'__eq',
+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 self;}
+}),
+smalltalk.Point);
+
 
 smalltalk.addMethod(
 '_x_y_',

+ 16 - 0
js/Kernel.js

@@ -8007,6 +8007,22 @@ referencedClasses: []
 }),
 smalltalk.Point);
 
+smalltalk.addMethod(
+unescape('__eq'),
+smalltalk.method({
+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 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"],
+referencedClasses: []
+}),
+smalltalk.Point);
+
 
 smalltalk.addMethod(
 unescape('_x_y_'),

+ 4 - 0
st/Kernel.st

@@ -2783,6 +2783,10 @@ x: aNumber
 
 / aPoint
 	^Point x: self x / aPoint asPoint x y: self y / aPoint asPoint y
+!
+
+= aPoint
+	^ (aPoint x = self x) & (aPoint y = self y)
 ! !
 
 !Point methodsFor: 'converting'!