1
0

Kernel-Methods.deploy.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. smalltalk.addPackage('Kernel-Methods', {});
  2. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
  3. smalltalk.addMethod(
  4. "_applyTo_arguments_",
  5. smalltalk.method({
  6. selector: "applyTo:arguments:",
  7. fn: function (anObject, aCollection){
  8. var self=this;
  9. return self.apply(anObject, aCollection);
  10. return self;}
  11. }),
  12. smalltalk.BlockClosure);
  13. smalltalk.addMethod(
  14. "_compiledSource",
  15. smalltalk.method({
  16. selector: "compiledSource",
  17. fn: function (){
  18. var self=this;
  19. return self.toString();
  20. return self;}
  21. }),
  22. smalltalk.BlockClosure);
  23. smalltalk.addMethod(
  24. "_ensure_",
  25. smalltalk.method({
  26. selector: "ensure:",
  27. fn: function (aBlock){
  28. var self=this;
  29. var success=nil;
  30. (success=false);
  31. return smalltalk.send((function(){smalltalk.send(self, "_value", []);(success=true);return smalltalk.send(aBlock, "_value", []);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){((($receiver = success).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value", []);})]));return smalltalk.send(ex, "_signal", []);})]);
  32. return self;}
  33. }),
  34. smalltalk.BlockClosure);
  35. smalltalk.addMethod(
  36. "_new",
  37. smalltalk.method({
  38. selector: "new",
  39. fn: function (){
  40. var self=this;
  41. return new self();
  42. return self;}
  43. }),
  44. smalltalk.BlockClosure);
  45. smalltalk.addMethod(
  46. "_newValue_",
  47. smalltalk.method({
  48. selector: "newValue:",
  49. fn: function (anObject){
  50. var self=this;
  51. return new self(anObject);
  52. return self;}
  53. }),
  54. smalltalk.BlockClosure);
  55. smalltalk.addMethod(
  56. "_newValue_value_",
  57. smalltalk.method({
  58. selector: "newValue:value:",
  59. fn: function (anObject, anObject2){
  60. var self=this;
  61. return new self(anObject, anObject2);
  62. return self;}
  63. }),
  64. smalltalk.BlockClosure);
  65. smalltalk.addMethod(
  66. "_newValue_value_value_",
  67. smalltalk.method({
  68. selector: "newValue:value:value:",
  69. fn: function (anObject, anObject2, anObject3){
  70. var self=this;
  71. return new self(anObject, anObject2);
  72. return self;}
  73. }),
  74. smalltalk.BlockClosure);
  75. smalltalk.addMethod(
  76. "_numArgs",
  77. smalltalk.method({
  78. selector: "numArgs",
  79. fn: function (){
  80. var self=this;
  81. return self.length;
  82. return self;}
  83. }),
  84. smalltalk.BlockClosure);
  85. smalltalk.addMethod(
  86. "_on_do_",
  87. smalltalk.method({
  88. selector: "on:do:",
  89. fn: function (anErrorClass, aBlock){
  90. var self=this;
  91. return smalltalk.send(self, "_try_catch_", [self, (function(error){return ((($receiver = smalltalk.send(error, "_isKindOf_", [anErrorClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value_", [error]);})() : (function(){return smalltalk.send(error, "_signal", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [error]);}), (function(){return smalltalk.send(error, "_signal", []);})]));})]);
  92. return self;}
  93. }),
  94. smalltalk.BlockClosure);
  95. smalltalk.addMethod(
  96. "_timeToRun",
  97. smalltalk.method({
  98. selector: "timeToRun",
  99. fn: function (){
  100. var self=this;
  101. return smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [self]);
  102. return self;}
  103. }),
  104. smalltalk.BlockClosure);
  105. smalltalk.addMethod(
  106. "_value",
  107. smalltalk.method({
  108. selector: "value",
  109. fn: function (){
  110. var self=this;
  111. return self();;
  112. return self;}
  113. }),
  114. smalltalk.BlockClosure);
  115. smalltalk.addMethod(
  116. "_value_",
  117. smalltalk.method({
  118. selector: "value:",
  119. fn: function (anArg){
  120. var self=this;
  121. return self(anArg);;
  122. return self;}
  123. }),
  124. smalltalk.BlockClosure);
  125. smalltalk.addMethod(
  126. "_value_value_",
  127. smalltalk.method({
  128. selector: "value:value:",
  129. fn: function (firstArg, secondArg){
  130. var self=this;
  131. return self(firstArg, secondArg);;
  132. return self;}
  133. }),
  134. smalltalk.BlockClosure);
  135. smalltalk.addMethod(
  136. "_value_value_value_",
  137. smalltalk.method({
  138. selector: "value:value:value:",
  139. fn: function (firstArg, secondArg, thirdArg){
  140. var self=this;
  141. return self(firstArg, secondArg, thirdArg);;
  142. return self;}
  143. }),
  144. smalltalk.BlockClosure);
  145. smalltalk.addMethod(
  146. "_valueWithInterval_",
  147. smalltalk.method({
  148. selector: "valueWithInterval:",
  149. fn: function (aNumber){
  150. var self=this;
  151. return setInterval(self, aNumber);
  152. return self;}
  153. }),
  154. smalltalk.BlockClosure);
  155. smalltalk.addMethod(
  156. "_valueWithPossibleArguments_",
  157. smalltalk.method({
  158. selector: "valueWithPossibleArguments:",
  159. fn: function (aCollection){
  160. var self=this;
  161. return self.apply(null, aCollection);;
  162. return self;}
  163. }),
  164. smalltalk.BlockClosure);
  165. smalltalk.addMethod(
  166. "_valueWithTimeout_",
  167. smalltalk.method({
  168. selector: "valueWithTimeout:",
  169. fn: function (aNumber){
  170. var self=this;
  171. return setTimeout(self, aNumber);
  172. return self;}
  173. }),
  174. smalltalk.BlockClosure);
  175. smalltalk.addMethod(
  176. "_whileFalse",
  177. smalltalk.method({
  178. selector: "whileFalse",
  179. fn: function (){
  180. var self=this;
  181. smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
  182. return self;}
  183. }),
  184. smalltalk.BlockClosure);
  185. smalltalk.addMethod(
  186. "_whileFalse_",
  187. smalltalk.method({
  188. selector: "whileFalse:",
  189. fn: function (aBlock){
  190. var self=this;
  191. while(!self()) {aBlock()};
  192. return self;}
  193. }),
  194. smalltalk.BlockClosure);
  195. smalltalk.addMethod(
  196. "_whileTrue",
  197. smalltalk.method({
  198. selector: "whileTrue",
  199. fn: function (){
  200. var self=this;
  201. smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
  202. return self;}
  203. }),
  204. smalltalk.BlockClosure);
  205. smalltalk.addMethod(
  206. "_whileTrue_",
  207. smalltalk.method({
  208. selector: "whileTrue:",
  209. fn: function (aBlock){
  210. var self=this;
  211. while(self()) {aBlock()};
  212. return self;}
  213. }),
  214. smalltalk.BlockClosure);
  215. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  216. smalltalk.addMethod(
  217. "_arguments",
  218. smalltalk.method({
  219. selector: "arguments",
  220. fn: function (){
  221. var self=this;
  222. return self.args || [];
  223. return self;}
  224. }),
  225. smalltalk.CompiledMethod);
  226. smalltalk.addMethod(
  227. "_category",
  228. smalltalk.method({
  229. selector: "category",
  230. fn: function (){
  231. var self=this;
  232. return (($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  233. return self;}
  234. }),
  235. smalltalk.CompiledMethod);
  236. smalltalk.addMethod(
  237. "_category_",
  238. smalltalk.method({
  239. selector: "category:",
  240. fn: function (aString){
  241. var self=this;
  242. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  243. return self;}
  244. }),
  245. smalltalk.CompiledMethod);
  246. smalltalk.addMethod(
  247. "_fn",
  248. smalltalk.method({
  249. selector: "fn",
  250. fn: function (){
  251. var self=this;
  252. return smalltalk.send(self, "_basicAt_", ["fn"]);
  253. return self;}
  254. }),
  255. smalltalk.CompiledMethod);
  256. smalltalk.addMethod(
  257. "_fn_",
  258. smalltalk.method({
  259. selector: "fn:",
  260. fn: function (aBlock){
  261. var self=this;
  262. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  263. return self;}
  264. }),
  265. smalltalk.CompiledMethod);
  266. smalltalk.addMethod(
  267. "_messageSends",
  268. smalltalk.method({
  269. selector: "messageSends",
  270. fn: function (){
  271. var self=this;
  272. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  273. return self;}
  274. }),
  275. smalltalk.CompiledMethod);
  276. smalltalk.addMethod(
  277. "_methodClass",
  278. smalltalk.method({
  279. selector: "methodClass",
  280. fn: function (){
  281. var self=this;
  282. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  283. return self;}
  284. }),
  285. smalltalk.CompiledMethod);
  286. smalltalk.addMethod(
  287. "_referencedClasses",
  288. smalltalk.method({
  289. selector: "referencedClasses",
  290. fn: function (){
  291. var self=this;
  292. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  293. return self;}
  294. }),
  295. smalltalk.CompiledMethod);
  296. smalltalk.addMethod(
  297. "_selector",
  298. smalltalk.method({
  299. selector: "selector",
  300. fn: function (){
  301. var self=this;
  302. return smalltalk.send(self, "_basicAt_", ["selector"]);
  303. return self;}
  304. }),
  305. smalltalk.CompiledMethod);
  306. smalltalk.addMethod(
  307. "_selector_",
  308. smalltalk.method({
  309. selector: "selector:",
  310. fn: function (aString){
  311. var self=this;
  312. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  313. return self;}
  314. }),
  315. smalltalk.CompiledMethod);
  316. smalltalk.addMethod(
  317. "_source",
  318. smalltalk.method({
  319. selector: "source",
  320. fn: function (){
  321. var self=this;
  322. return (($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  323. return self;}
  324. }),
  325. smalltalk.CompiledMethod);
  326. smalltalk.addMethod(
  327. "_source_",
  328. smalltalk.method({
  329. selector: "source:",
  330. fn: function (aString){
  331. var self=this;
  332. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  333. return self;}
  334. }),
  335. smalltalk.CompiledMethod);
  336. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  337. smalltalk.addMethod(
  338. "_arguments",
  339. smalltalk.method({
  340. selector: "arguments",
  341. fn: function (){
  342. var self=this;
  343. return self['@arguments'];
  344. return self;}
  345. }),
  346. smalltalk.Message);
  347. smalltalk.addMethod(
  348. "_arguments_",
  349. smalltalk.method({
  350. selector: "arguments:",
  351. fn: function (anArray){
  352. var self=this;
  353. (self['@arguments']=anArray);
  354. return self;}
  355. }),
  356. smalltalk.Message);
  357. smalltalk.addMethod(
  358. "_printString",
  359. smalltalk.method({
  360. selector: "printString",
  361. fn: function (){
  362. var self=this;
  363. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Message.superclass || nil)]);smalltalk.send($rec, "_nextPutAll_", ["("]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [")"]);})(aStream);})]);
  364. return self;}
  365. }),
  366. smalltalk.Message);
  367. smalltalk.addMethod(
  368. "_selector",
  369. smalltalk.method({
  370. selector: "selector",
  371. fn: function (){
  372. var self=this;
  373. return self['@selector'];
  374. return self;}
  375. }),
  376. smalltalk.Message);
  377. smalltalk.addMethod(
  378. "_selector_",
  379. smalltalk.method({
  380. selector: "selector:",
  381. fn: function (aString){
  382. var self=this;
  383. (self['@selector']=aString);
  384. return self;}
  385. }),
  386. smalltalk.Message);
  387. smalltalk.addMethod(
  388. "_sendTo_",
  389. smalltalk.method({
  390. selector: "sendTo:",
  391. fn: function (anObject){
  392. var self=this;
  393. smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_send_to_arguments_", [smalltalk.send(self, "_selector", []), anObject, smalltalk.send(self, "_arguments", [])]);
  394. return self;}
  395. }),
  396. smalltalk.Message);
  397. smalltalk.addMethod(
  398. "_selector_arguments_",
  399. smalltalk.method({
  400. selector: "selector:arguments:",
  401. fn: function (aString, anArray){
  402. var self=this;
  403. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  404. return self;}
  405. }),
  406. smalltalk.Message.klass);
  407. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  408. smalltalk.addMethod(
  409. "_asString",
  410. smalltalk.method({
  411. selector: "asString",
  412. fn: function (){
  413. var self=this;
  414. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [" >> "]), "__comma", [smalltalk.send(self, "_selector", [])]);
  415. return self;}
  416. }),
  417. smalltalk.MethodContext);
  418. smalltalk.addMethod(
  419. "_home",
  420. smalltalk.method({
  421. selector: "home",
  422. fn: function (){
  423. var self=this;
  424. return self.homeContext;
  425. return self;}
  426. }),
  427. smalltalk.MethodContext);
  428. smalltalk.addMethod(
  429. "_printString",
  430. smalltalk.method({
  431. selector: "printString",
  432. fn: function (){
  433. var self=this;
  434. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.MethodContext.superclass || nil), "__comma", ["("]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [")"]);
  435. return self;}
  436. }),
  437. smalltalk.MethodContext);
  438. smalltalk.addMethod(
  439. "_receiver",
  440. smalltalk.method({
  441. selector: "receiver",
  442. fn: function (){
  443. var self=this;
  444. return self.receiver;
  445. return self;}
  446. }),
  447. smalltalk.MethodContext);
  448. smalltalk.addMethod(
  449. "_selector",
  450. smalltalk.method({
  451. selector: "selector",
  452. fn: function (){
  453. var self=this;
  454. return smalltalk.convertSelector(self.selector);
  455. return self;}
  456. }),
  457. smalltalk.MethodContext);
  458. smalltalk.addMethod(
  459. "_temps",
  460. smalltalk.method({
  461. selector: "temps",
  462. fn: function (){
  463. var self=this;
  464. return self.temps;
  465. return self;}
  466. }),
  467. smalltalk.MethodContext);