Browse Source

Adds BlokClosure >> receiver

Nicolas Petton 11 years ago
parent
commit
9cea75a118
3 changed files with 31 additions and 0 deletions
  1. 11 0
      js/Kernel-Methods.deploy.js
  2. 16 0
      js/Kernel-Methods.js
  3. 4 0
      st/Kernel-Methods.st

+ 11 - 0
js/Kernel-Methods.deploy.js

@@ -153,6 +153,17 @@ return $1;
 messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:"]}),
 smalltalk.BlockClosure);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "receiver",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return nil;
+}, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.BlockClosure)})},
+messageSends: []}),
+smalltalk.BlockClosure);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "timeToRun",

+ 16 - 0
js/Kernel-Methods.js

@@ -214,6 +214,22 @@ referencedClasses: ["Smalltalk"]
 }),
 smalltalk.BlockClosure);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "receiver",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return nil;
+}, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.BlockClosure)})},
+args: [],
+source: "receiver\x0a\x09^ nil",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.BlockClosure);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "timeToRun",

+ 4 - 0
st/Kernel-Methods.st

@@ -16,6 +16,10 @@ compiledSource
 
 numArgs
 	<return self.length>
+!
+
+receiver
+	^ nil
 ! !
 
 !BlockClosure methodsFor: 'controlling'!