Browse Source

Merge pull request #312 from herby/yourself-toprimitive

yourself return primitive (unboxed) value of self.
Nicolas Petton 12 years ago
parent
commit
d3edbd8102
3 changed files with 12 additions and 10 deletions
  1. 5 4
      js/Kernel-Objects.deploy.js
  2. 6 5
      js/Kernel-Objects.js
  3. 1 1
      st/Kernel-Objects.st

+ 5 - 4
js/Kernel-Objects.deploy.js

@@ -684,10 +684,11 @@ smalltalk.addMethod(
 "_yourself",
 smalltalk.method({
 selector: "yourself",
-fn: function () {
-    var self = this;
-    return self;
-}
+fn: function (){
+var self=this;
+return self.valueOf();
+;
+return self}
 }),
 smalltalk.Object);
 

+ 6 - 5
js/Kernel-Objects.js

@@ -951,12 +951,13 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "yourself",
 category: 'accessing',
-fn: function () {
-    var self = this;
-    return self;
-},
+fn: function (){
+var self=this;
+return self.valueOf();
+;
+return self},
 args: [],
-source: "yourself\x0a\x09^self",
+source: "yourself\x0a\x09<return self.valueOf()>",
 messageSends: [],
 referencedClasses: []
 }),

+ 1 - 1
st/Kernel-Objects.st

@@ -88,7 +88,7 @@ value
 !
 
 yourself
-	^self
+	<return self.valueOf()>
 ! !
 
 !Object methodsFor: 'comparing'!