Ver Fonte

BlockClosure >> currySelf reformatting

Nicolas Petton há 11 anos atrás
pai
commit
8eaba366d1
3 ficheiros alterados com 23 adições e 16 exclusões
  1. 7 5
      js/Kernel-Methods.deploy.js
  2. 8 6
      js/Kernel-Methods.js
  3. 8 5
      st/Kernel-Methods.st

+ 7 - 5
js/Kernel-Methods.deploy.js

@@ -39,11 +39,13 @@ smalltalk.method({
 selector: "currySelf",
 selector: "currySelf",
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return function () {
-    	var args = [ this ];
-        args.push.apply(args, arguments);
-        return self.apply(null, args);
-    };
+return smalltalk.withContext(function($ctx1) { 
+    	return function () {
+    		var args = [ this ];
+        	args.push.apply(args, arguments);
+        	return self.apply(null, args);
+    	}
+	;
 return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{}, smalltalk.BlockClosure)})}
 return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{}, smalltalk.BlockClosure)})}
 }),
 }),
 smalltalk.BlockClosure);
 smalltalk.BlockClosure);

+ 8 - 6
js/Kernel-Methods.js

@@ -56,14 +56,16 @@ selector: "currySelf",
 category: 'converting',
 category: 'converting',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return function () {
-    	var args = [ this ];
-        args.push.apply(args, arguments);
-        return self.apply(null, args);
-    };
+return smalltalk.withContext(function($ctx1) { 
+    	return function () {
+    		var args = [ this ];
+        	args.push.apply(args, arguments);
+        	return self.apply(null, args);
+    	}
+	;
 return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{}, smalltalk.BlockClosure)})},
 return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{}, smalltalk.BlockClosure)})},
 args: [],
 args: [],
-source: "currySelf\x0a\x09\x22Transforms [ :selfarg :x :y | stcode ] block\x0a    which represents JS function (selfarg, x, y, ...) {jscode}\x0a    into function (x, y, ...) {jscode} that takes selfarg from 'this'.\x0a    IOW, it is usable as JS method and first arg takes the receiver.\x22\x0a    <return function () {\x0a    \x09var args = [ this ];\x0a        args.push.apply(args, arguments);\x0a        return self.apply(null, args);\x0a    }>",
+source: "currySelf\x0a\x09\x22Transforms [ :selfarg :x :y | stcode ] block\x0a    which represents JS function (selfarg, x, y, ...) {jscode}\x0a    into function (x, y, ...) {jscode} that takes selfarg from 'this'.\x0a    IOW, it is usable as JS method and first arg takes the receiver.\x22\x0a    \x0a    <\x0a    \x09return function () {\x0a    \x09\x09var args = [ this ];\x0a        \x09args.push.apply(args, arguments);\x0a        \x09return self.apply(null, args);\x0a    \x09}\x0a\x09>",
 messageSends: [],
 messageSends: [],
 referencedClasses: []
 referencedClasses: []
 }),
 }),

+ 8 - 5
st/Kernel-Methods.st

@@ -51,11 +51,14 @@ currySelf
     which represents JS function (selfarg, x, y, ...) {jscode}
     which represents JS function (selfarg, x, y, ...) {jscode}
     into function (x, y, ...) {jscode} that takes selfarg from 'this'.
     into function (x, y, ...) {jscode} that takes selfarg from 'this'.
     IOW, it is usable as JS method and first arg takes the receiver."
     IOW, it is usable as JS method and first arg takes the receiver."
-    <return function () {
-    	var args = [ this ];
-        args.push.apply(args, arguments);
-        return self.apply(null, args);
-    }>
+    
+    <
+    	return function () {
+    		var args = [ this ];
+        	args.push.apply(args, arguments);
+        	return self.apply(null, args);
+    	}
+	>
 ! !
 ! !
 
 
 !BlockClosure methodsFor: 'error handling'!
 !BlockClosure methodsFor: 'error handling'!