Explorar el Código

BlockClosure >> currySelf reformatting

Nicolas Petton hace 11 años
padre
commit
8eaba366d1
Se han modificado 3 ficheros con 23 adiciones y 16 borrados
  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",
 fn: function (){
 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)})}
 }),
 smalltalk.BlockClosure);

+ 8 - 6
js/Kernel-Methods.js

@@ -56,14 +56,16 @@ selector: "currySelf",
 category: 'converting',
 fn: function (){
 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)})},
 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: [],
 referencedClasses: []
 }),

+ 8 - 5
st/Kernel-Methods.st

@@ -51,11 +51,14 @@ currySelf
     which represents JS function (selfarg, x, y, ...) {jscode}
     into function (x, y, ...) {jscode} that takes selfarg from 'this'.
     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'!