2
0

Kernel-Methods.deploy.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  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. "_referencedClasses",
  343. smalltalk.method({
  344. selector: "referencedClasses",
  345. fn: function (){
  346. var self=this;
  347. var $1;
  348. $1=smalltalk.send(self,"_basicAt_",["referencedClasses"]);
  349. return $1;
  350. }
  351. }),
  352. smalltalk.CompiledMethod);
  353. smalltalk.addMethod(
  354. "_selector",
  355. smalltalk.method({
  356. selector: "selector",
  357. fn: function (){
  358. var self=this;
  359. var $1;
  360. $1=smalltalk.send(self,"_basicAt_",["selector"]);
  361. return $1;
  362. }
  363. }),
  364. smalltalk.CompiledMethod);
  365. smalltalk.addMethod(
  366. "_selector_",
  367. smalltalk.method({
  368. selector: "selector:",
  369. fn: function (aString){
  370. var self=this;
  371. smalltalk.send(self,"_basicAt_put_",["selector",aString]);
  372. return self}
  373. }),
  374. smalltalk.CompiledMethod);
  375. smalltalk.addMethod(
  376. "_source",
  377. smalltalk.method({
  378. selector: "source",
  379. fn: function (){
  380. var self=this;
  381. var $2,$1;
  382. $2=smalltalk.send(self,"_basicAt_",["source"]);
  383. if(($receiver = $2) == nil || $receiver == undefined){
  384. $1="";
  385. } else {
  386. $1=$2;
  387. };
  388. return $1;
  389. }
  390. }),
  391. smalltalk.CompiledMethod);
  392. smalltalk.addMethod(
  393. "_source_",
  394. smalltalk.method({
  395. selector: "source:",
  396. fn: function (aString){
  397. var self=this;
  398. smalltalk.send(self,"_basicAt_put_",["source",aString]);
  399. return self}
  400. }),
  401. smalltalk.CompiledMethod);
  402. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  403. smalltalk.addMethod(
  404. "_arguments",
  405. smalltalk.method({
  406. selector: "arguments",
  407. fn: function (){
  408. var self=this;
  409. return self["@arguments"];
  410. }
  411. }),
  412. smalltalk.Message);
  413. smalltalk.addMethod(
  414. "_arguments_",
  415. smalltalk.method({
  416. selector: "arguments:",
  417. fn: function (anArray){
  418. var self=this;
  419. self["@arguments"]=anArray;
  420. return self}
  421. }),
  422. smalltalk.Message);
  423. smalltalk.addMethod(
  424. "_printString",
  425. smalltalk.method({
  426. selector: "printString",
  427. fn: function (){
  428. var self=this;
  429. var $2,$1;
  430. $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(aStream){
  431. smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_printString",[],smalltalk.Object)]);
  432. smalltalk.send(aStream,"_nextPutAll_",["("]);
  433. smalltalk.send(aStream,"_nextPutAll_",[self["@selector"]]);
  434. $2=smalltalk.send(aStream,"_nextPutAll_",[")"]);
  435. return $2;
  436. })]);
  437. return $1;
  438. }
  439. }),
  440. smalltalk.Message);
  441. smalltalk.addMethod(
  442. "_selector",
  443. smalltalk.method({
  444. selector: "selector",
  445. fn: function (){
  446. var self=this;
  447. return self["@selector"];
  448. }
  449. }),
  450. smalltalk.Message);
  451. smalltalk.addMethod(
  452. "_selector_",
  453. smalltalk.method({
  454. selector: "selector:",
  455. fn: function (aString){
  456. var self=this;
  457. self["@selector"]=aString;
  458. return self}
  459. }),
  460. smalltalk.Message);
  461. smalltalk.addMethod(
  462. "_sendTo_",
  463. smalltalk.method({
  464. selector: "sendTo:",
  465. fn: function (anObject){
  466. var self=this;
  467. var $1;
  468. $1=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_send_to_arguments_",[smalltalk.send(self,"_selector",[]),anObject,smalltalk.send(self,"_arguments",[])]);
  469. return $1;
  470. }
  471. }),
  472. smalltalk.Message);
  473. smalltalk.addMethod(
  474. "_selector_arguments_",
  475. smalltalk.method({
  476. selector: "selector:arguments:",
  477. fn: function (aString,anArray){
  478. var self=this;
  479. var $2,$3,$1;
  480. $2=smalltalk.send(self,"_new",[]);
  481. smalltalk.send($2,"_selector_",[aString]);
  482. smalltalk.send($2,"_arguments_",[anArray]);
  483. $3=smalltalk.send($2,"_yourself",[]);
  484. $1=$3;
  485. return $1;
  486. }
  487. }),
  488. smalltalk.Message.klass);
  489. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  490. smalltalk.addMethod(
  491. "_asString",
  492. smalltalk.method({
  493. selector: "asString",
  494. fn: function (){
  495. var self=this;
  496. var $1;
  497. $1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_receiver",[]),"_class",[]),"_printString",[]),"__comma",[" >> "]),"__comma",[smalltalk.send(self,"_selector",[])]);
  498. return $1;
  499. }
  500. }),
  501. smalltalk.MethodContext);
  502. smalltalk.addMethod(
  503. "_home",
  504. smalltalk.method({
  505. selector: "home",
  506. fn: function (){
  507. var self=this;
  508. return self.homeContext;
  509. ;
  510. return self}
  511. }),
  512. smalltalk.MethodContext);
  513. smalltalk.addMethod(
  514. "_pc",
  515. smalltalk.method({
  516. selector: "pc",
  517. fn: function (){
  518. var self=this;
  519. return self.pc;
  520. ;
  521. return self}
  522. }),
  523. smalltalk.MethodContext);
  524. smalltalk.addMethod(
  525. "_printString",
  526. smalltalk.method({
  527. selector: "printString",
  528. fn: function (){
  529. var self=this;
  530. var $1;
  531. $1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_printString",[],smalltalk.Object),"__comma",["("]),"__comma",[smalltalk.send(self,"_asString",[])]),"__comma",[")"]);
  532. return $1;
  533. }
  534. }),
  535. smalltalk.MethodContext);
  536. smalltalk.addMethod(
  537. "_receiver",
  538. smalltalk.method({
  539. selector: "receiver",
  540. fn: function (){
  541. var self=this;
  542. return self.receiver;
  543. ;
  544. return self}
  545. }),
  546. smalltalk.MethodContext);
  547. smalltalk.addMethod(
  548. "_selector",
  549. smalltalk.method({
  550. selector: "selector",
  551. fn: function (){
  552. var self=this;
  553. return smalltalk.convertSelector(self.selector);
  554. ;
  555. return self}
  556. }),
  557. smalltalk.MethodContext);
  558. smalltalk.addMethod(
  559. "_temps",
  560. smalltalk.method({
  561. selector: "temps",
  562. fn: function (){
  563. var self=this;
  564. return self.temps;
  565. ;
  566. return self}
  567. }),
  568. smalltalk.MethodContext);