1
0

Kernel-Methods.deploy.js 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  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 smalltalk.withContext(function($ctx1) {
  10. return self.apply(anObject, aCollection);
  11. return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},smalltalk.BlockClosure)})},
  12. messageSends: []}),
  13. smalltalk.BlockClosure);
  14. smalltalk.addMethod(
  15. "_asCompiledMethod_",
  16. smalltalk.method({
  17. selector: "asCompiledMethod:",
  18. fn: function (aString){
  19. var self=this;
  20. return smalltalk.withContext(function($ctx1) {
  21. return smalltalk.method({selector:aString, fn:self});;
  22. return self}, function($ctx1) {$ctx1.fill(self,"asCompiledMethod:",{aString:aString},smalltalk.BlockClosure)})},
  23. messageSends: []}),
  24. smalltalk.BlockClosure);
  25. smalltalk.addMethod(
  26. "_compiledSource",
  27. smalltalk.method({
  28. selector: "compiledSource",
  29. fn: function (){
  30. var self=this;
  31. return smalltalk.withContext(function($ctx1) {
  32. return self.toString();
  33. return self}, function($ctx1) {$ctx1.fill(self,"compiledSource",{},smalltalk.BlockClosure)})},
  34. messageSends: []}),
  35. smalltalk.BlockClosure);
  36. smalltalk.addMethod(
  37. "_currySelf",
  38. smalltalk.method({
  39. selector: "currySelf",
  40. fn: function (){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. return function () {
  44. var args = [ this ];
  45. args.push.apply(args, arguments);
  46. return self.apply(null, args);
  47. }
  48. ;
  49. return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{},smalltalk.BlockClosure)})},
  50. messageSends: []}),
  51. smalltalk.BlockClosure);
  52. smalltalk.addMethod(
  53. "_ensure_",
  54. smalltalk.method({
  55. selector: "ensure:",
  56. fn: function (aBlock){
  57. var self=this;
  58. return smalltalk.withContext(function($ctx1) {
  59. try{return self()}finally{aBlock._value()};
  60. return self}, function($ctx1) {$ctx1.fill(self,"ensure:",{aBlock:aBlock},smalltalk.BlockClosure)})},
  61. messageSends: []}),
  62. smalltalk.BlockClosure);
  63. smalltalk.addMethod(
  64. "_fork",
  65. smalltalk.method({
  66. selector: "fork",
  67. fn: function (){
  68. var self=this;
  69. function $ForkPool(){return smalltalk.ForkPool||(typeof ForkPool=="undefined"?nil:ForkPool)}
  70. return smalltalk.withContext(function($ctx1) {
  71. _st(_st($ForkPool())._default())._fork_(self);
  72. return self}, function($ctx1) {$ctx1.fill(self,"fork",{},smalltalk.BlockClosure)})},
  73. messageSends: ["fork:", "default"]}),
  74. smalltalk.BlockClosure);
  75. smalltalk.addMethod(
  76. "_new",
  77. smalltalk.method({
  78. selector: "new",
  79. fn: function (){
  80. var self=this;
  81. return smalltalk.withContext(function($ctx1) {
  82. return new self();
  83. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.BlockClosure)})},
  84. messageSends: []}),
  85. smalltalk.BlockClosure);
  86. smalltalk.addMethod(
  87. "_newValue_",
  88. smalltalk.method({
  89. selector: "newValue:",
  90. fn: function (anObject){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) {
  93. return new self(anObject);
  94. return self}, function($ctx1) {$ctx1.fill(self,"newValue:",{anObject:anObject},smalltalk.BlockClosure)})},
  95. messageSends: []}),
  96. smalltalk.BlockClosure);
  97. smalltalk.addMethod(
  98. "_newValue_value_",
  99. smalltalk.method({
  100. selector: "newValue:value:",
  101. fn: function (anObject,anObject2){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. return new self(anObject, anObject2);
  105. return self}, function($ctx1) {$ctx1.fill(self,"newValue:value:",{anObject:anObject,anObject2:anObject2},smalltalk.BlockClosure)})},
  106. messageSends: []}),
  107. smalltalk.BlockClosure);
  108. smalltalk.addMethod(
  109. "_newValue_value_value_",
  110. smalltalk.method({
  111. selector: "newValue:value:value:",
  112. fn: function (anObject,anObject2,anObject3){
  113. var self=this;
  114. return smalltalk.withContext(function($ctx1) {
  115. return new self(anObject, anObject2,anObject3);
  116. return self}, function($ctx1) {$ctx1.fill(self,"newValue:value:value:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.BlockClosure)})},
  117. messageSends: []}),
  118. smalltalk.BlockClosure);
  119. smalltalk.addMethod(
  120. "_numArgs",
  121. smalltalk.method({
  122. selector: "numArgs",
  123. fn: function (){
  124. var self=this;
  125. return smalltalk.withContext(function($ctx1) {
  126. return self.length;
  127. return self}, function($ctx1) {$ctx1.fill(self,"numArgs",{},smalltalk.BlockClosure)})},
  128. messageSends: []}),
  129. smalltalk.BlockClosure);
  130. smalltalk.addMethod(
  131. "_on_do_",
  132. smalltalk.method({
  133. selector: "on:do:",
  134. fn: function (anErrorClass,aBlock){
  135. var self=this;
  136. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  137. return smalltalk.withContext(function($ctx1) {
  138. var $2,$1;
  139. $1=_st(self)._try_catch_(self,(function(error){
  140. var smalltalkError;
  141. return smalltalk.withContext(function($ctx2) {
  142. smalltalkError=_st(_st($Smalltalk())._current())._asSmalltalkException_(error);
  143. smalltalkError;
  144. $2=_st(smalltalkError)._isKindOf_(anErrorClass);
  145. if(smalltalk.assert($2)){
  146. return _st(aBlock)._value_(smalltalkError);
  147. } else {
  148. return _st(smalltalkError)._signal();
  149. };
  150. }, function($ctx2) {$ctx2.fillBlock({error:error,smalltalkError:smalltalkError},$ctx1)})}));
  151. return $1;
  152. }, function($ctx1) {$ctx1.fill(self,"on:do:",{anErrorClass:anErrorClass,aBlock:aBlock},smalltalk.BlockClosure)})},
  153. messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:"]}),
  154. smalltalk.BlockClosure);
  155. smalltalk.addMethod(
  156. "_timeToRun",
  157. smalltalk.method({
  158. selector: "timeToRun",
  159. fn: function (){
  160. var self=this;
  161. function $Date(){return smalltalk.Date||(typeof Date=="undefined"?nil:Date)}
  162. return smalltalk.withContext(function($ctx1) {
  163. var $1;
  164. $1=_st($Date())._millisecondsToRun_(self);
  165. return $1;
  166. }, function($ctx1) {$ctx1.fill(self,"timeToRun",{},smalltalk.BlockClosure)})},
  167. messageSends: ["millisecondsToRun:"]}),
  168. smalltalk.BlockClosure);
  169. smalltalk.addMethod(
  170. "_value",
  171. smalltalk.method({
  172. selector: "value",
  173. fn: function (){
  174. var self=this;
  175. return smalltalk.withContext(function($ctx1) {
  176. return self();;
  177. return self}, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.BlockClosure)})},
  178. messageSends: []}),
  179. smalltalk.BlockClosure);
  180. smalltalk.addMethod(
  181. "_value_",
  182. smalltalk.method({
  183. selector: "value:",
  184. fn: function (anArg){
  185. var self=this;
  186. return smalltalk.withContext(function($ctx1) {
  187. return self(anArg);;
  188. return self}, function($ctx1) {$ctx1.fill(self,"value:",{anArg:anArg},smalltalk.BlockClosure)})},
  189. messageSends: []}),
  190. smalltalk.BlockClosure);
  191. smalltalk.addMethod(
  192. "_value_value_",
  193. smalltalk.method({
  194. selector: "value:value:",
  195. fn: function (firstArg,secondArg){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. return self(firstArg, secondArg);;
  199. return self}, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArg:firstArg,secondArg:secondArg},smalltalk.BlockClosure)})},
  200. messageSends: []}),
  201. smalltalk.BlockClosure);
  202. smalltalk.addMethod(
  203. "_value_value_value_",
  204. smalltalk.method({
  205. selector: "value:value:value:",
  206. fn: function (firstArg,secondArg,thirdArg){
  207. var self=this;
  208. return smalltalk.withContext(function($ctx1) {
  209. return self(firstArg, secondArg, thirdArg);;
  210. return self}, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArg:firstArg,secondArg:secondArg,thirdArg:thirdArg},smalltalk.BlockClosure)})},
  211. messageSends: []}),
  212. smalltalk.BlockClosure);
  213. smalltalk.addMethod(
  214. "_valueWithInterval_",
  215. smalltalk.method({
  216. selector: "valueWithInterval:",
  217. fn: function (aNumber){
  218. var self=this;
  219. return smalltalk.withContext(function($ctx1) {
  220. var interval = setInterval(self, aNumber);
  221. return smalltalk.Timeout._on_(interval);
  222. ;
  223. return self}, function($ctx1) {$ctx1.fill(self,"valueWithInterval:",{aNumber:aNumber},smalltalk.BlockClosure)})},
  224. messageSends: []}),
  225. smalltalk.BlockClosure);
  226. smalltalk.addMethod(
  227. "_valueWithPossibleArguments_",
  228. smalltalk.method({
  229. selector: "valueWithPossibleArguments:",
  230. fn: function (aCollection){
  231. var self=this;
  232. return smalltalk.withContext(function($ctx1) {
  233. return self.apply(null, aCollection);;
  234. return self}, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection},smalltalk.BlockClosure)})},
  235. messageSends: []}),
  236. smalltalk.BlockClosure);
  237. smalltalk.addMethod(
  238. "_valueWithTimeout_",
  239. smalltalk.method({
  240. selector: "valueWithTimeout:",
  241. fn: function (aNumber){
  242. var self=this;
  243. return smalltalk.withContext(function($ctx1) {
  244. var timeout = setTimeout(self, aNumber);
  245. return smalltalk.Timeout._on_(timeout);
  246. ;
  247. return self}, function($ctx1) {$ctx1.fill(self,"valueWithTimeout:",{aNumber:aNumber},smalltalk.BlockClosure)})},
  248. messageSends: []}),
  249. smalltalk.BlockClosure);
  250. smalltalk.addMethod(
  251. "_whileFalse",
  252. smalltalk.method({
  253. selector: "whileFalse",
  254. fn: function (){
  255. var self=this;
  256. return smalltalk.withContext(function($ctx1) {
  257. _st(self)._whileFalse_((function(){
  258. return smalltalk.withContext(function($ctx2) {
  259. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  260. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse",{},smalltalk.BlockClosure)})},
  261. messageSends: ["whileFalse:"]}),
  262. smalltalk.BlockClosure);
  263. smalltalk.addMethod(
  264. "_whileFalse_",
  265. smalltalk.method({
  266. selector: "whileFalse:",
  267. fn: function (aBlock){
  268. var self=this;
  269. return smalltalk.withContext(function($ctx1) {
  270. while(!self()) {aBlock()};
  271. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse:",{aBlock:aBlock},smalltalk.BlockClosure)})},
  272. messageSends: []}),
  273. smalltalk.BlockClosure);
  274. smalltalk.addMethod(
  275. "_whileTrue",
  276. smalltalk.method({
  277. selector: "whileTrue",
  278. fn: function (){
  279. var self=this;
  280. return smalltalk.withContext(function($ctx1) {
  281. _st(self)._whileTrue_((function(){
  282. return smalltalk.withContext(function($ctx2) {
  283. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  284. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue",{},smalltalk.BlockClosure)})},
  285. messageSends: ["whileTrue:"]}),
  286. smalltalk.BlockClosure);
  287. smalltalk.addMethod(
  288. "_whileTrue_",
  289. smalltalk.method({
  290. selector: "whileTrue:",
  291. fn: function (aBlock){
  292. var self=this;
  293. return smalltalk.withContext(function($ctx1) {
  294. while(self()) {aBlock()};
  295. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue:",{aBlock:aBlock},smalltalk.BlockClosure)})},
  296. messageSends: []}),
  297. smalltalk.BlockClosure);
  298. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  299. smalltalk.addMethod(
  300. "_arguments",
  301. smalltalk.method({
  302. selector: "arguments",
  303. fn: function (){
  304. var self=this;
  305. return smalltalk.withContext(function($ctx1) {
  306. return self.args || [];
  307. return self}, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.CompiledMethod)})},
  308. messageSends: []}),
  309. smalltalk.CompiledMethod);
  310. smalltalk.addMethod(
  311. "_category",
  312. smalltalk.method({
  313. selector: "category",
  314. fn: function (){
  315. var self=this;
  316. return smalltalk.withContext(function($ctx1) {
  317. var $2,$1;
  318. $2=_st(self)._basicAt_("category");
  319. if(($receiver = $2) == nil || $receiver == undefined){
  320. $1=_st(self)._defaultCategory();
  321. } else {
  322. $1=$2;
  323. };
  324. return $1;
  325. }, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.CompiledMethod)})},
  326. messageSends: ["ifNil:", "defaultCategory", "basicAt:"]}),
  327. smalltalk.CompiledMethod);
  328. smalltalk.addMethod(
  329. "_category_",
  330. smalltalk.method({
  331. selector: "category:",
  332. fn: function (aString){
  333. var self=this;
  334. var oldCategory;
  335. return smalltalk.withContext(function($ctx1) {
  336. var $1;
  337. oldCategory=_st(self)._category();
  338. _st(self)._basicAt_put_("category",aString);
  339. $1=_st(self)._methodClass();
  340. if(($receiver = $1) == nil || $receiver == undefined){
  341. $1;
  342. } else {
  343. _st(_st(_st(self)._methodClass())._organization())._addElement_(aString);
  344. _st(_st(_st(_st(self)._methodClass())._methods())._select_((function(each){
  345. return smalltalk.withContext(function($ctx2) {
  346. return _st(_st(each)._category()).__eq(oldCategory);
  347. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._ifEmpty_((function(){
  348. return smalltalk.withContext(function($ctx2) {
  349. return _st(_st(_st(self)._methodClass())._organization())._removeElement_(oldCategory);
  350. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  351. };
  352. return self}, function($ctx1) {$ctx1.fill(self,"category:",{aString:aString,oldCategory:oldCategory},smalltalk.CompiledMethod)})},
  353. messageSends: ["category", "basicAt:put:", "ifNotNil:", "addElement:", "organization", "methodClass", "ifEmpty:", "removeElement:", "select:", "=", "methods"]}),
  354. smalltalk.CompiledMethod);
  355. smalltalk.addMethod(
  356. "_defaultCategory",
  357. smalltalk.method({
  358. selector: "defaultCategory",
  359. fn: function (){
  360. var self=this;
  361. return smalltalk.withContext(function($ctx1) {
  362. return "as yet unclassified";
  363. }, function($ctx1) {$ctx1.fill(self,"defaultCategory",{},smalltalk.CompiledMethod)})},
  364. messageSends: []}),
  365. smalltalk.CompiledMethod);
  366. smalltalk.addMethod(
  367. "_fn",
  368. smalltalk.method({
  369. selector: "fn",
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) {
  373. var $1;
  374. $1=_st(self)._basicAt_("fn");
  375. return $1;
  376. }, function($ctx1) {$ctx1.fill(self,"fn",{},smalltalk.CompiledMethod)})},
  377. messageSends: ["basicAt:"]}),
  378. smalltalk.CompiledMethod);
  379. smalltalk.addMethod(
  380. "_fn_",
  381. smalltalk.method({
  382. selector: "fn:",
  383. fn: function (aBlock){
  384. var self=this;
  385. return smalltalk.withContext(function($ctx1) {
  386. _st(self)._basicAt_put_("fn",aBlock);
  387. return self}, function($ctx1) {$ctx1.fill(self,"fn:",{aBlock:aBlock},smalltalk.CompiledMethod)})},
  388. messageSends: ["basicAt:put:"]}),
  389. smalltalk.CompiledMethod);
  390. smalltalk.addMethod(
  391. "_isCompiledMethod",
  392. smalltalk.method({
  393. selector: "isCompiledMethod",
  394. fn: function (){
  395. var self=this;
  396. return smalltalk.withContext(function($ctx1) {
  397. return true;
  398. }, function($ctx1) {$ctx1.fill(self,"isCompiledMethod",{},smalltalk.CompiledMethod)})},
  399. messageSends: []}),
  400. smalltalk.CompiledMethod);
  401. smalltalk.addMethod(
  402. "_messageSends",
  403. smalltalk.method({
  404. selector: "messageSends",
  405. fn: function (){
  406. var self=this;
  407. return smalltalk.withContext(function($ctx1) {
  408. var $1;
  409. $1=_st(self)._basicAt_("messageSends");
  410. return $1;
  411. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.CompiledMethod)})},
  412. messageSends: ["basicAt:"]}),
  413. smalltalk.CompiledMethod);
  414. smalltalk.addMethod(
  415. "_methodClass",
  416. smalltalk.method({
  417. selector: "methodClass",
  418. fn: function (){
  419. var self=this;
  420. return smalltalk.withContext(function($ctx1) {
  421. var $1;
  422. $1=_st(self)._basicAt_("methodClass");
  423. return $1;
  424. }, function($ctx1) {$ctx1.fill(self,"methodClass",{},smalltalk.CompiledMethod)})},
  425. messageSends: ["basicAt:"]}),
  426. smalltalk.CompiledMethod);
  427. smalltalk.addMethod(
  428. "_protocol",
  429. smalltalk.method({
  430. selector: "protocol",
  431. fn: function (){
  432. var self=this;
  433. return smalltalk.withContext(function($ctx1) {
  434. var $1;
  435. $1=_st(self)._category();
  436. return $1;
  437. }, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.CompiledMethod)})},
  438. messageSends: ["category"]}),
  439. smalltalk.CompiledMethod);
  440. smalltalk.addMethod(
  441. "_referencedClasses",
  442. smalltalk.method({
  443. selector: "referencedClasses",
  444. fn: function (){
  445. var self=this;
  446. return smalltalk.withContext(function($ctx1) {
  447. var $1;
  448. $1=_st(self)._basicAt_("referencedClasses");
  449. return $1;
  450. }, function($ctx1) {$ctx1.fill(self,"referencedClasses",{},smalltalk.CompiledMethod)})},
  451. messageSends: ["basicAt:"]}),
  452. smalltalk.CompiledMethod);
  453. smalltalk.addMethod(
  454. "_selector",
  455. smalltalk.method({
  456. selector: "selector",
  457. fn: function (){
  458. var self=this;
  459. return smalltalk.withContext(function($ctx1) {
  460. var $1;
  461. $1=_st(self)._basicAt_("selector");
  462. return $1;
  463. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.CompiledMethod)})},
  464. messageSends: ["basicAt:"]}),
  465. smalltalk.CompiledMethod);
  466. smalltalk.addMethod(
  467. "_selector_",
  468. smalltalk.method({
  469. selector: "selector:",
  470. fn: function (aString){
  471. var self=this;
  472. return smalltalk.withContext(function($ctx1) {
  473. _st(self)._basicAt_put_("selector",aString);
  474. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.CompiledMethod)})},
  475. messageSends: ["basicAt:put:"]}),
  476. smalltalk.CompiledMethod);
  477. smalltalk.addMethod(
  478. "_source",
  479. smalltalk.method({
  480. selector: "source",
  481. fn: function (){
  482. var self=this;
  483. return smalltalk.withContext(function($ctx1) {
  484. var $2,$1;
  485. $2=_st(self)._basicAt_("source");
  486. if(($receiver = $2) == nil || $receiver == undefined){
  487. $1="";
  488. } else {
  489. $1=$2;
  490. };
  491. return $1;
  492. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.CompiledMethod)})},
  493. messageSends: ["ifNil:", "basicAt:"]}),
  494. smalltalk.CompiledMethod);
  495. smalltalk.addMethod(
  496. "_source_",
  497. smalltalk.method({
  498. selector: "source:",
  499. fn: function (aString){
  500. var self=this;
  501. return smalltalk.withContext(function($ctx1) {
  502. _st(self)._basicAt_put_("source",aString);
  503. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.CompiledMethod)})},
  504. messageSends: ["basicAt:put:"]}),
  505. smalltalk.CompiledMethod);
  506. smalltalk.addClass('ForkPool', smalltalk.Object, ['poolSize', 'maxPoolSize', 'queue', 'worker'], 'Kernel-Methods');
  507. smalltalk.addMethod(
  508. "_addWorker",
  509. smalltalk.method({
  510. selector: "addWorker",
  511. fn: function (){
  512. var self=this;
  513. return smalltalk.withContext(function($ctx1) {
  514. _st(self["@worker"])._valueWithTimeout_((0));
  515. self["@poolSize"]=_st(self["@poolSize"]).__plus((1));
  516. return self}, function($ctx1) {$ctx1.fill(self,"addWorker",{},smalltalk.ForkPool)})},
  517. messageSends: ["valueWithTimeout:", "+"]}),
  518. smalltalk.ForkPool);
  519. smalltalk.addMethod(
  520. "_defaultMaxPoolSize",
  521. smalltalk.method({
  522. selector: "defaultMaxPoolSize",
  523. fn: function (){
  524. var self=this;
  525. return smalltalk.withContext(function($ctx1) {
  526. var $1;
  527. $1=_st(_st(self)._class())._defaultMaxPoolSize();
  528. return $1;
  529. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool)})},
  530. messageSends: ["defaultMaxPoolSize", "class"]}),
  531. smalltalk.ForkPool);
  532. smalltalk.addMethod(
  533. "_fork_",
  534. smalltalk.method({
  535. selector: "fork:",
  536. fn: function (aBlock){
  537. var self=this;
  538. return smalltalk.withContext(function($ctx1) {
  539. var $1;
  540. $1=_st(self["@poolSize"]).__lt(_st(self)._maxPoolSize());
  541. if(smalltalk.assert($1)){
  542. _st(self)._addWorker();
  543. };
  544. _st(self["@queue"])._nextPut_(aBlock);
  545. return self}, function($ctx1) {$ctx1.fill(self,"fork:",{aBlock:aBlock},smalltalk.ForkPool)})},
  546. messageSends: ["ifTrue:", "addWorker", "<", "maxPoolSize", "nextPut:"]}),
  547. smalltalk.ForkPool);
  548. smalltalk.addMethod(
  549. "_initialize",
  550. smalltalk.method({
  551. selector: "initialize",
  552. fn: function (){
  553. var self=this;
  554. function $Queue(){return smalltalk.Queue||(typeof Queue=="undefined"?nil:Queue)}
  555. return smalltalk.withContext(function($ctx1) {
  556. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  557. self["@poolSize"]=(0);
  558. self["@queue"]=_st($Queue())._new();
  559. self["@worker"]=_st(self)._makeWorker();
  560. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ForkPool)})},
  561. messageSends: ["initialize", "new", "makeWorker"]}),
  562. smalltalk.ForkPool);
  563. smalltalk.addMethod(
  564. "_makeWorker",
  565. smalltalk.method({
  566. selector: "makeWorker",
  567. fn: function (){
  568. var self=this;
  569. var sentinel;
  570. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  571. return smalltalk.withContext(function($ctx1) {
  572. var $2,$1;
  573. sentinel=_st($Object())._new();
  574. $1=(function(){
  575. var block;
  576. return smalltalk.withContext(function($ctx2) {
  577. self["@poolSize"]=_st(self["@poolSize"]).__minus((1));
  578. self["@poolSize"];
  579. block=_st(self["@queue"])._nextIfAbsent_((function(){
  580. return smalltalk.withContext(function($ctx3) {
  581. return sentinel;
  582. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  583. block;
  584. $2=_st(block).__eq_eq(sentinel);
  585. if(! smalltalk.assert($2)){
  586. return _st((function(){
  587. return smalltalk.withContext(function($ctx3) {
  588. return _st(block)._value();
  589. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
  590. return smalltalk.withContext(function($ctx3) {
  591. return _st(self)._addWorker();
  592. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  593. };
  594. }, function($ctx2) {$ctx2.fillBlock({block:block},$ctx1)})});
  595. return $1;
  596. }, function($ctx1) {$ctx1.fill(self,"makeWorker",{sentinel:sentinel},smalltalk.ForkPool)})},
  597. messageSends: ["new", "-", "nextIfAbsent:", "ifFalse:", "ensure:", "addWorker", "value", "=="]}),
  598. smalltalk.ForkPool);
  599. smalltalk.addMethod(
  600. "_maxPoolSize",
  601. smalltalk.method({
  602. selector: "maxPoolSize",
  603. fn: function (){
  604. var self=this;
  605. return smalltalk.withContext(function($ctx1) {
  606. var $2,$1;
  607. $2=self["@maxPoolSize"];
  608. if(($receiver = $2) == nil || $receiver == undefined){
  609. $1=_st(self)._defaultMaxPoolSize();
  610. } else {
  611. $1=$2;
  612. };
  613. return $1;
  614. }, function($ctx1) {$ctx1.fill(self,"maxPoolSize",{},smalltalk.ForkPool)})},
  615. messageSends: ["ifNil:", "defaultMaxPoolSize"]}),
  616. smalltalk.ForkPool);
  617. smalltalk.addMethod(
  618. "_maxPoolSize_",
  619. smalltalk.method({
  620. selector: "maxPoolSize:",
  621. fn: function (anInteger){
  622. var self=this;
  623. return smalltalk.withContext(function($ctx1) {
  624. self["@maxPoolSize"]=anInteger;
  625. return self}, function($ctx1) {$ctx1.fill(self,"maxPoolSize:",{anInteger:anInteger},smalltalk.ForkPool)})},
  626. messageSends: []}),
  627. smalltalk.ForkPool);
  628. smalltalk.ForkPool.klass.iVarNames = ['default'];
  629. smalltalk.addMethod(
  630. "_default",
  631. smalltalk.method({
  632. selector: "default",
  633. fn: function (){
  634. var self=this;
  635. return smalltalk.withContext(function($ctx1) {
  636. var $2,$1;
  637. $2=self["@default"];
  638. if(($receiver = $2) == nil || $receiver == undefined){
  639. self["@default"]=_st(self)._new();
  640. $1=self["@default"];
  641. } else {
  642. $1=$2;
  643. };
  644. return $1;
  645. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.ForkPool.klass)})},
  646. messageSends: ["ifNil:", "new"]}),
  647. smalltalk.ForkPool.klass);
  648. smalltalk.addMethod(
  649. "_defaultMaxPoolSize",
  650. smalltalk.method({
  651. selector: "defaultMaxPoolSize",
  652. fn: function (){
  653. var self=this;
  654. return smalltalk.withContext(function($ctx1) {
  655. var $1;
  656. $1=(100);
  657. return $1;
  658. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool.klass)})},
  659. messageSends: []}),
  660. smalltalk.ForkPool.klass);
  661. smalltalk.addMethod(
  662. "_resetDefault",
  663. smalltalk.method({
  664. selector: "resetDefault",
  665. fn: function (){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) {
  668. self["@default"]=nil;
  669. return self}, function($ctx1) {$ctx1.fill(self,"resetDefault",{},smalltalk.ForkPool.klass)})},
  670. messageSends: []}),
  671. smalltalk.ForkPool.klass);
  672. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  673. smalltalk.addMethod(
  674. "_arguments",
  675. smalltalk.method({
  676. selector: "arguments",
  677. fn: function (){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx1) {
  680. var $1;
  681. $1=self["@arguments"];
  682. return $1;
  683. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.Message)})},
  684. messageSends: []}),
  685. smalltalk.Message);
  686. smalltalk.addMethod(
  687. "_arguments_",
  688. smalltalk.method({
  689. selector: "arguments:",
  690. fn: function (anArray){
  691. var self=this;
  692. return smalltalk.withContext(function($ctx1) {
  693. self["@arguments"]=anArray;
  694. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{anArray:anArray},smalltalk.Message)})},
  695. messageSends: []}),
  696. smalltalk.Message);
  697. smalltalk.addMethod(
  698. "_printOn_",
  699. smalltalk.method({
  700. selector: "printOn:",
  701. fn: function (aStream){
  702. var self=this;
  703. return smalltalk.withContext(function($ctx1) {
  704. var $1,$2;
  705. smalltalk.Object.fn.prototype._printOn_.apply(_st(self), [aStream]);
  706. $1=aStream;
  707. _st($1)._nextPutAll_("(");
  708. _st($1)._nextPutAll_(_st(self)._selector());
  709. $2=_st($1)._nextPutAll_(")");
  710. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Message)})},
  711. messageSends: ["printOn:", "nextPutAll:", "selector"]}),
  712. smalltalk.Message);
  713. smalltalk.addMethod(
  714. "_selector",
  715. smalltalk.method({
  716. selector: "selector",
  717. fn: function (){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) {
  720. var $1;
  721. $1=self["@selector"];
  722. return $1;
  723. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.Message)})},
  724. messageSends: []}),
  725. smalltalk.Message);
  726. smalltalk.addMethod(
  727. "_selector_",
  728. smalltalk.method({
  729. selector: "selector:",
  730. fn: function (aString){
  731. var self=this;
  732. return smalltalk.withContext(function($ctx1) {
  733. self["@selector"]=aString;
  734. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.Message)})},
  735. messageSends: []}),
  736. smalltalk.Message);
  737. smalltalk.addMethod(
  738. "_sendTo_",
  739. smalltalk.method({
  740. selector: "sendTo:",
  741. fn: function (anObject){
  742. var self=this;
  743. return smalltalk.withContext(function($ctx1) {
  744. var $1;
  745. $1=_st(anObject)._perform_withArguments_(_st(self)._selector(),_st(self)._arguments());
  746. return $1;
  747. }, function($ctx1) {$ctx1.fill(self,"sendTo:",{anObject:anObject},smalltalk.Message)})},
  748. messageSends: ["perform:withArguments:", "selector", "arguments"]}),
  749. smalltalk.Message);
  750. smalltalk.addMethod(
  751. "_selector_arguments_",
  752. smalltalk.method({
  753. selector: "selector:arguments:",
  754. fn: function (aString,anArray){
  755. var self=this;
  756. return smalltalk.withContext(function($ctx1) {
  757. var $2,$3,$1;
  758. $2=_st(self)._new();
  759. _st($2)._selector_(aString);
  760. _st($2)._arguments_(anArray);
  761. $3=_st($2)._yourself();
  762. $1=$3;
  763. return $1;
  764. }, function($ctx1) {$ctx1.fill(self,"selector:arguments:",{aString:aString,anArray:anArray},smalltalk.Message.klass)})},
  765. messageSends: ["selector:", "new", "arguments:", "yourself"]}),
  766. smalltalk.Message.klass);
  767. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  768. smalltalk.addMethod(
  769. "_asString",
  770. smalltalk.method({
  771. selector: "asString",
  772. fn: function (){
  773. var self=this;
  774. return smalltalk.withContext(function($ctx1) {
  775. var $2,$1;
  776. $2=_st(self)._isBlockContext();
  777. if(smalltalk.assert($2)){
  778. $1=_st(_st("a block (in ").__comma(_st(_st(_st(_st(self)._methodContext())._receiver())._class())._printString())).__comma(")");
  779. } else {
  780. $1=_st(_st(_st(_st(_st(self)._receiver())._class())._printString()).__comma(" >> ")).__comma(_st(self)._selector());
  781. };
  782. return $1;
  783. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.MethodContext)})},
  784. messageSends: ["ifTrue:ifFalse:", ",", "printString", "class", "receiver", "methodContext", "selector", "isBlockContext"]}),
  785. smalltalk.MethodContext);
  786. smalltalk.addMethod(
  787. "_home",
  788. smalltalk.method({
  789. selector: "home",
  790. fn: function (){
  791. var self=this;
  792. return smalltalk.withContext(function($ctx1) {
  793. return self.methodContext || self.homeContext;
  794. return self}, function($ctx1) {$ctx1.fill(self,"home",{},smalltalk.MethodContext)})},
  795. messageSends: []}),
  796. smalltalk.MethodContext);
  797. smalltalk.addMethod(
  798. "_isBlockContext",
  799. smalltalk.method({
  800. selector: "isBlockContext",
  801. fn: function (){
  802. var self=this;
  803. return smalltalk.withContext(function($ctx1) {
  804. var $1;
  805. $1=_st(_st(self)._selector())._isNil();
  806. return $1;
  807. }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},smalltalk.MethodContext)})},
  808. messageSends: ["isNil", "selector"]}),
  809. smalltalk.MethodContext);
  810. smalltalk.addMethod(
  811. "_locals",
  812. smalltalk.method({
  813. selector: "locals",
  814. fn: function (){
  815. var self=this;
  816. return smalltalk.withContext(function($ctx1) {
  817. return self.locals;
  818. return self}, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.MethodContext)})},
  819. messageSends: []}),
  820. smalltalk.MethodContext);
  821. smalltalk.addMethod(
  822. "_method",
  823. smalltalk.method({
  824. selector: "method",
  825. fn: function (){
  826. var self=this;
  827. return smalltalk.withContext(function($ctx1) {
  828. var $1;
  829. $1=_st(_st(_st(_st(self)._methodContext())._receiver())._class())._lookupSelector_(_st(_st(self)._methodContext())._selector());
  830. return $1;
  831. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodContext)})},
  832. messageSends: ["lookupSelector:", "selector", "methodContext", "class", "receiver"]}),
  833. smalltalk.MethodContext);
  834. smalltalk.addMethod(
  835. "_methodContext",
  836. smalltalk.method({
  837. selector: "methodContext",
  838. fn: function (){
  839. var self=this;
  840. return smalltalk.withContext(function($ctx1) {
  841. var $1,$2,$3;
  842. $1=_st(self)._isBlockContext();
  843. if(! smalltalk.assert($1)){
  844. $2=self;
  845. return $2;
  846. };
  847. $3=_st(self)._home();
  848. return $3;
  849. }, function($ctx1) {$ctx1.fill(self,"methodContext",{},smalltalk.MethodContext)})},
  850. messageSends: ["ifFalse:", "isBlockContext", "home"]}),
  851. smalltalk.MethodContext);
  852. smalltalk.addMethod(
  853. "_outerContext",
  854. smalltalk.method({
  855. selector: "outerContext",
  856. fn: function (){
  857. var self=this;
  858. return smalltalk.withContext(function($ctx1) {
  859. return self.homeContext;
  860. return self}, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.MethodContext)})},
  861. messageSends: []}),
  862. smalltalk.MethodContext);
  863. smalltalk.addMethod(
  864. "_pc",
  865. smalltalk.method({
  866. selector: "pc",
  867. fn: function (){
  868. var self=this;
  869. return smalltalk.withContext(function($ctx1) {
  870. return self.pc;
  871. return self}, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.MethodContext)})},
  872. messageSends: []}),
  873. smalltalk.MethodContext);
  874. smalltalk.addMethod(
  875. "_printOn_",
  876. smalltalk.method({
  877. selector: "printOn:",
  878. fn: function (aStream){
  879. var self=this;
  880. return smalltalk.withContext(function($ctx1) {
  881. var $1,$2;
  882. smalltalk.Object.fn.prototype._printOn_.apply(_st(self), [aStream]);
  883. $1=aStream;
  884. _st($1)._nextPutAll_("(");
  885. _st($1)._nextPutAll_(_st(self)._asString());
  886. $2=_st($1)._nextPutAll_(")");
  887. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.MethodContext)})},
  888. messageSends: ["printOn:", "nextPutAll:", "asString"]}),
  889. smalltalk.MethodContext);
  890. smalltalk.addMethod(
  891. "_receiver",
  892. smalltalk.method({
  893. selector: "receiver",
  894. fn: function (){
  895. var self=this;
  896. return smalltalk.withContext(function($ctx1) {
  897. return self.receiver;
  898. return self}, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MethodContext)})},
  899. messageSends: []}),
  900. smalltalk.MethodContext);
  901. smalltalk.addMethod(
  902. "_selector",
  903. smalltalk.method({
  904. selector: "selector",
  905. fn: function (){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) {
  908. if(self.selector) {
  909. return smalltalk.convertSelector(self.selector);
  910. } else {
  911. return nil;
  912. }
  913. ;
  914. return self}, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MethodContext)})},
  915. messageSends: []}),
  916. smalltalk.MethodContext);
  917. smalltalk.addMethod(
  918. "_temps",
  919. smalltalk.method({
  920. selector: "temps",
  921. fn: function (){
  922. var self=this;
  923. return smalltalk.withContext(function($ctx1) {
  924. var $1;
  925. _st(self)._deprecatedAPI();
  926. $1=_st(self)._locals();
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"temps",{},smalltalk.MethodContext)})},
  929. messageSends: ["deprecatedAPI", "locals"]}),
  930. smalltalk.MethodContext);
  931. smalltalk.addClass('NativeFunction', smalltalk.Object, [], 'Kernel-Methods');
  932. smalltalk.addMethod(
  933. "_constructor_",
  934. smalltalk.method({
  935. selector: "constructor:",
  936. fn: function (aString){
  937. var self=this;
  938. return smalltalk.withContext(function($ctx1) {
  939. var native=eval(aString);
  940. return new native();
  941. ;
  942. return self}, function($ctx1) {$ctx1.fill(self,"constructor:",{aString:aString},smalltalk.NativeFunction.klass)})},
  943. messageSends: []}),
  944. smalltalk.NativeFunction.klass);
  945. smalltalk.addMethod(
  946. "_constructor_value_",
  947. smalltalk.method({
  948. selector: "constructor:value:",
  949. fn: function (aString,anObject){
  950. var self=this;
  951. return smalltalk.withContext(function($ctx1) {
  952. var native=eval(aString);
  953. return new native(anObject);
  954. ;
  955. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:",{aString:aString,anObject:anObject},smalltalk.NativeFunction.klass)})},
  956. messageSends: []}),
  957. smalltalk.NativeFunction.klass);
  958. smalltalk.addMethod(
  959. "_constructor_value_value_",
  960. smalltalk.method({
  961. selector: "constructor:value:value:",
  962. fn: function (aString,anObject,anObject2){
  963. var self=this;
  964. return smalltalk.withContext(function($ctx1) {
  965. var native=eval(aString);
  966. return new native(anObject,anObject2);
  967. ;
  968. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2},smalltalk.NativeFunction.klass)})},
  969. messageSends: []}),
  970. smalltalk.NativeFunction.klass);
  971. smalltalk.addMethod(
  972. "_constructor_value_value_value_",
  973. smalltalk.method({
  974. selector: "constructor:value:value:value:",
  975. fn: function (aString,anObject,anObject2,anObject3){
  976. var self=this;
  977. return smalltalk.withContext(function($ctx1) {
  978. var native=eval(aString);
  979. return new native(anObject,anObject2, anObject3);
  980. ;
  981. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.NativeFunction.klass)})},
  982. messageSends: []}),
  983. smalltalk.NativeFunction.klass);
  984. smalltalk.addMethod(
  985. "_exists_",
  986. smalltalk.method({
  987. selector: "exists:",
  988. fn: function (aString){
  989. var self=this;
  990. return smalltalk.withContext(function($ctx1) {
  991. if(aString in window) {
  992. return true
  993. } else {
  994. return false
  995. }
  996. ;
  997. return self}, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString},smalltalk.NativeFunction.klass)})},
  998. messageSends: []}),
  999. smalltalk.NativeFunction.klass);