Kernel-Methods.deploy.js 11 KB

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