Kernel-Methods.deploy.js 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081
  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. "_messageSends",
  392. smalltalk.method({
  393. selector: "messageSends",
  394. fn: function (){
  395. var self=this;
  396. return smalltalk.withContext(function($ctx1) {
  397. var $1;
  398. $1=_st(self)._basicAt_("messageSends");
  399. return $1;
  400. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.CompiledMethod)})},
  401. messageSends: ["basicAt:"]}),
  402. smalltalk.CompiledMethod);
  403. smalltalk.addMethod(
  404. "_methodClass",
  405. smalltalk.method({
  406. selector: "methodClass",
  407. fn: function (){
  408. var self=this;
  409. return smalltalk.withContext(function($ctx1) {
  410. var $1;
  411. $1=_st(self)._basicAt_("methodClass");
  412. return $1;
  413. }, function($ctx1) {$ctx1.fill(self,"methodClass",{},smalltalk.CompiledMethod)})},
  414. messageSends: ["basicAt:"]}),
  415. smalltalk.CompiledMethod);
  416. smalltalk.addMethod(
  417. "_protocol",
  418. smalltalk.method({
  419. selector: "protocol",
  420. fn: function (){
  421. var self=this;
  422. return smalltalk.withContext(function($ctx1) {
  423. var $1;
  424. $1=_st(self)._category();
  425. return $1;
  426. }, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.CompiledMethod)})},
  427. messageSends: ["category"]}),
  428. smalltalk.CompiledMethod);
  429. smalltalk.addMethod(
  430. "_referencedClasses",
  431. smalltalk.method({
  432. selector: "referencedClasses",
  433. fn: function (){
  434. var self=this;
  435. return smalltalk.withContext(function($ctx1) {
  436. var $1;
  437. $1=_st(self)._basicAt_("referencedClasses");
  438. return $1;
  439. }, function($ctx1) {$ctx1.fill(self,"referencedClasses",{},smalltalk.CompiledMethod)})},
  440. messageSends: ["basicAt:"]}),
  441. smalltalk.CompiledMethod);
  442. smalltalk.addMethod(
  443. "_selector",
  444. smalltalk.method({
  445. selector: "selector",
  446. fn: function (){
  447. var self=this;
  448. return smalltalk.withContext(function($ctx1) {
  449. var $1;
  450. $1=_st(self)._basicAt_("selector");
  451. return $1;
  452. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.CompiledMethod)})},
  453. messageSends: ["basicAt:"]}),
  454. smalltalk.CompiledMethod);
  455. smalltalk.addMethod(
  456. "_selector_",
  457. smalltalk.method({
  458. selector: "selector:",
  459. fn: function (aString){
  460. var self=this;
  461. return smalltalk.withContext(function($ctx1) {
  462. _st(self)._basicAt_put_("selector",aString);
  463. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.CompiledMethod)})},
  464. messageSends: ["basicAt:put:"]}),
  465. smalltalk.CompiledMethod);
  466. smalltalk.addMethod(
  467. "_source",
  468. smalltalk.method({
  469. selector: "source",
  470. fn: function (){
  471. var self=this;
  472. return smalltalk.withContext(function($ctx1) {
  473. var $2,$1;
  474. $2=_st(self)._basicAt_("source");
  475. if(($receiver = $2) == nil || $receiver == undefined){
  476. $1="";
  477. } else {
  478. $1=$2;
  479. };
  480. return $1;
  481. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.CompiledMethod)})},
  482. messageSends: ["ifNil:", "basicAt:"]}),
  483. smalltalk.CompiledMethod);
  484. smalltalk.addMethod(
  485. "_source_",
  486. smalltalk.method({
  487. selector: "source:",
  488. fn: function (aString){
  489. var self=this;
  490. return smalltalk.withContext(function($ctx1) {
  491. _st(self)._basicAt_put_("source",aString);
  492. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.CompiledMethod)})},
  493. messageSends: ["basicAt:put:"]}),
  494. smalltalk.CompiledMethod);
  495. smalltalk.addClass('ForkPool', smalltalk.Object, ['poolSize', 'maxPoolSize', 'queue', 'worker'], 'Kernel-Methods');
  496. smalltalk.addMethod(
  497. "_addWorker",
  498. smalltalk.method({
  499. selector: "addWorker",
  500. fn: function (){
  501. var self=this;
  502. return smalltalk.withContext(function($ctx1) {
  503. _st(self["@worker"])._valueWithTimeout_((0));
  504. self["@poolSize"]=_st(self["@poolSize"]).__plus((1));
  505. return self}, function($ctx1) {$ctx1.fill(self,"addWorker",{},smalltalk.ForkPool)})},
  506. messageSends: ["valueWithTimeout:", "+"]}),
  507. smalltalk.ForkPool);
  508. smalltalk.addMethod(
  509. "_defaultMaxPoolSize",
  510. smalltalk.method({
  511. selector: "defaultMaxPoolSize",
  512. fn: function (){
  513. var self=this;
  514. return smalltalk.withContext(function($ctx1) {
  515. var $1;
  516. $1=_st(_st(self)._class())._defaultMaxPoolSize();
  517. return $1;
  518. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool)})},
  519. messageSends: ["defaultMaxPoolSize", "class"]}),
  520. smalltalk.ForkPool);
  521. smalltalk.addMethod(
  522. "_fork_",
  523. smalltalk.method({
  524. selector: "fork:",
  525. fn: function (aBlock){
  526. var self=this;
  527. return smalltalk.withContext(function($ctx1) {
  528. var $1;
  529. $1=_st(self["@poolSize"]).__lt(_st(self)._maxPoolSize());
  530. if(smalltalk.assert($1)){
  531. _st(self)._addWorker();
  532. };
  533. _st(self["@queue"])._back_(aBlock);
  534. return self}, function($ctx1) {$ctx1.fill(self,"fork:",{aBlock:aBlock},smalltalk.ForkPool)})},
  535. messageSends: ["ifTrue:", "addWorker", "<", "maxPoolSize", "back:"]}),
  536. smalltalk.ForkPool);
  537. smalltalk.addMethod(
  538. "_initialize",
  539. smalltalk.method({
  540. selector: "initialize",
  541. fn: function (){
  542. var self=this;
  543. function $Queue(){return smalltalk.Queue||(typeof Queue=="undefined"?nil:Queue)}
  544. return smalltalk.withContext(function($ctx1) {
  545. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  546. self["@poolSize"]=(0);
  547. self["@queue"]=_st($Queue())._new();
  548. self["@worker"]=_st(self)._makeWorker();
  549. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ForkPool)})},
  550. messageSends: ["initialize", "new", "makeWorker"]}),
  551. smalltalk.ForkPool);
  552. smalltalk.addMethod(
  553. "_makeWorker",
  554. smalltalk.method({
  555. selector: "makeWorker",
  556. fn: function (){
  557. var self=this;
  558. var sentinel;
  559. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  560. return smalltalk.withContext(function($ctx1) {
  561. var $2,$1;
  562. sentinel=_st($Object())._new();
  563. $1=(function(){
  564. var block;
  565. return smalltalk.withContext(function($ctx2) {
  566. self["@poolSize"]=_st(self["@poolSize"]).__minus((1));
  567. self["@poolSize"];
  568. block=_st(self["@queue"])._frontIfAbsent_((function(){
  569. return smalltalk.withContext(function($ctx3) {
  570. return sentinel;
  571. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  572. block;
  573. $2=_st(block).__eq_eq(sentinel);
  574. if(! smalltalk.assert($2)){
  575. return _st((function(){
  576. return smalltalk.withContext(function($ctx3) {
  577. return _st(block)._value();
  578. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
  579. return smalltalk.withContext(function($ctx3) {
  580. return _st(self)._addWorker();
  581. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  582. };
  583. }, function($ctx2) {$ctx2.fillBlock({block:block},$ctx1)})});
  584. return $1;
  585. }, function($ctx1) {$ctx1.fill(self,"makeWorker",{sentinel:sentinel},smalltalk.ForkPool)})},
  586. messageSends: ["new", "-", "frontIfAbsent:", "ifFalse:", "ensure:", "addWorker", "value", "=="]}),
  587. smalltalk.ForkPool);
  588. smalltalk.addMethod(
  589. "_maxPoolSize",
  590. smalltalk.method({
  591. selector: "maxPoolSize",
  592. fn: function (){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx1) {
  595. var $2,$1;
  596. $2=self["@maxPoolSize"];
  597. if(($receiver = $2) == nil || $receiver == undefined){
  598. $1=_st(self)._defaultMaxPoolSize();
  599. } else {
  600. $1=$2;
  601. };
  602. return $1;
  603. }, function($ctx1) {$ctx1.fill(self,"maxPoolSize",{},smalltalk.ForkPool)})},
  604. messageSends: ["ifNil:", "defaultMaxPoolSize"]}),
  605. smalltalk.ForkPool);
  606. smalltalk.addMethod(
  607. "_maxPoolSize_",
  608. smalltalk.method({
  609. selector: "maxPoolSize:",
  610. fn: function (anInteger){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) {
  613. self["@maxPoolSize"]=anInteger;
  614. return self}, function($ctx1) {$ctx1.fill(self,"maxPoolSize:",{anInteger:anInteger},smalltalk.ForkPool)})},
  615. messageSends: []}),
  616. smalltalk.ForkPool);
  617. smalltalk.ForkPool.klass.iVarNames = ['default'];
  618. smalltalk.addMethod(
  619. "_default",
  620. smalltalk.method({
  621. selector: "default",
  622. fn: function (){
  623. var self=this;
  624. return smalltalk.withContext(function($ctx1) {
  625. var $2,$1;
  626. $2=self["@default"];
  627. if(($receiver = $2) == nil || $receiver == undefined){
  628. self["@default"]=_st(self)._new();
  629. $1=self["@default"];
  630. } else {
  631. $1=$2;
  632. };
  633. return $1;
  634. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.ForkPool.klass)})},
  635. messageSends: ["ifNil:", "new"]}),
  636. smalltalk.ForkPool.klass);
  637. smalltalk.addMethod(
  638. "_defaultMaxPoolSize",
  639. smalltalk.method({
  640. selector: "defaultMaxPoolSize",
  641. fn: function (){
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) {
  644. var $1;
  645. $1=(100);
  646. return $1;
  647. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool.klass)})},
  648. messageSends: []}),
  649. smalltalk.ForkPool.klass);
  650. smalltalk.addMethod(
  651. "_resetDefault",
  652. smalltalk.method({
  653. selector: "resetDefault",
  654. fn: function (){
  655. var self=this;
  656. return smalltalk.withContext(function($ctx1) {
  657. self["@default"]=nil;
  658. return self}, function($ctx1) {$ctx1.fill(self,"resetDefault",{},smalltalk.ForkPool.klass)})},
  659. messageSends: []}),
  660. smalltalk.ForkPool.klass);
  661. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  662. smalltalk.addMethod(
  663. "_arguments",
  664. smalltalk.method({
  665. selector: "arguments",
  666. fn: function (){
  667. var self=this;
  668. return smalltalk.withContext(function($ctx1) {
  669. var $1;
  670. $1=self["@arguments"];
  671. return $1;
  672. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.Message)})},
  673. messageSends: []}),
  674. smalltalk.Message);
  675. smalltalk.addMethod(
  676. "_arguments_",
  677. smalltalk.method({
  678. selector: "arguments:",
  679. fn: function (anArray){
  680. var self=this;
  681. return smalltalk.withContext(function($ctx1) {
  682. self["@arguments"]=anArray;
  683. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{anArray:anArray},smalltalk.Message)})},
  684. messageSends: []}),
  685. smalltalk.Message);
  686. smalltalk.addMethod(
  687. "_printOn_",
  688. smalltalk.method({
  689. selector: "printOn:",
  690. fn: function (aStream){
  691. var self=this;
  692. return smalltalk.withContext(function($ctx1) {
  693. var $1,$2;
  694. smalltalk.Object.fn.prototype._printOn_.apply(_st(self), [aStream]);
  695. $1=aStream;
  696. _st($1)._nextPutAll_("(");
  697. _st($1)._nextPutAll_(_st(self)._selector());
  698. $2=_st($1)._nextPutAll_(")");
  699. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Message)})},
  700. messageSends: ["printOn:", "nextPutAll:", "selector"]}),
  701. smalltalk.Message);
  702. smalltalk.addMethod(
  703. "_selector",
  704. smalltalk.method({
  705. selector: "selector",
  706. fn: function (){
  707. var self=this;
  708. return smalltalk.withContext(function($ctx1) {
  709. var $1;
  710. $1=self["@selector"];
  711. return $1;
  712. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.Message)})},
  713. messageSends: []}),
  714. smalltalk.Message);
  715. smalltalk.addMethod(
  716. "_selector_",
  717. smalltalk.method({
  718. selector: "selector:",
  719. fn: function (aString){
  720. var self=this;
  721. return smalltalk.withContext(function($ctx1) {
  722. self["@selector"]=aString;
  723. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.Message)})},
  724. messageSends: []}),
  725. smalltalk.Message);
  726. smalltalk.addMethod(
  727. "_sendTo_",
  728. smalltalk.method({
  729. selector: "sendTo:",
  730. fn: function (anObject){
  731. var self=this;
  732. return smalltalk.withContext(function($ctx1) {
  733. var $1;
  734. $1=_st(anObject)._perform_withArguments_(_st(self)._selector(),_st(self)._arguments());
  735. return $1;
  736. }, function($ctx1) {$ctx1.fill(self,"sendTo:",{anObject:anObject},smalltalk.Message)})},
  737. messageSends: ["perform:withArguments:", "selector", "arguments"]}),
  738. smalltalk.Message);
  739. smalltalk.addMethod(
  740. "_selector_arguments_",
  741. smalltalk.method({
  742. selector: "selector:arguments:",
  743. fn: function (aString,anArray){
  744. var self=this;
  745. return smalltalk.withContext(function($ctx1) {
  746. var $2,$3,$1;
  747. $2=_st(self)._new();
  748. _st($2)._selector_(aString);
  749. _st($2)._arguments_(anArray);
  750. $3=_st($2)._yourself();
  751. $1=$3;
  752. return $1;
  753. }, function($ctx1) {$ctx1.fill(self,"selector:arguments:",{aString:aString,anArray:anArray},smalltalk.Message.klass)})},
  754. messageSends: ["selector:", "new", "arguments:", "yourself"]}),
  755. smalltalk.Message.klass);
  756. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  757. smalltalk.addMethod(
  758. "_asString",
  759. smalltalk.method({
  760. selector: "asString",
  761. fn: function (){
  762. var self=this;
  763. return smalltalk.withContext(function($ctx1) {
  764. var $2,$1;
  765. $2=_st(self)._isBlockContext();
  766. if(smalltalk.assert($2)){
  767. $1=_st(_st("a block (in ").__comma(_st(_st(_st(_st(self)._methodContext())._receiver())._class())._printString())).__comma(")");
  768. } else {
  769. $1=_st(_st(_st(_st(_st(self)._receiver())._class())._printString()).__comma(" >> ")).__comma(_st(self)._selector());
  770. };
  771. return $1;
  772. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.MethodContext)})},
  773. messageSends: ["ifTrue:ifFalse:", ",", "printString", "class", "receiver", "methodContext", "selector", "isBlockContext"]}),
  774. smalltalk.MethodContext);
  775. smalltalk.addMethod(
  776. "_home",
  777. smalltalk.method({
  778. selector: "home",
  779. fn: function (){
  780. var self=this;
  781. return smalltalk.withContext(function($ctx1) {
  782. return self.methodContext || self.homeContext;
  783. return self}, function($ctx1) {$ctx1.fill(self,"home",{},smalltalk.MethodContext)})},
  784. messageSends: []}),
  785. smalltalk.MethodContext);
  786. smalltalk.addMethod(
  787. "_isBlockContext",
  788. smalltalk.method({
  789. selector: "isBlockContext",
  790. fn: function (){
  791. var self=this;
  792. return smalltalk.withContext(function($ctx1) {
  793. var $1;
  794. $1=_st(_st(self)._selector())._isNil();
  795. return $1;
  796. }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},smalltalk.MethodContext)})},
  797. messageSends: ["isNil", "selector"]}),
  798. smalltalk.MethodContext);
  799. smalltalk.addMethod(
  800. "_locals",
  801. smalltalk.method({
  802. selector: "locals",
  803. fn: function (){
  804. var self=this;
  805. return smalltalk.withContext(function($ctx1) {
  806. return self.locals;
  807. return self}, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.MethodContext)})},
  808. messageSends: []}),
  809. smalltalk.MethodContext);
  810. smalltalk.addMethod(
  811. "_method",
  812. smalltalk.method({
  813. selector: "method",
  814. fn: function (){
  815. var self=this;
  816. return smalltalk.withContext(function($ctx1) {
  817. var $1;
  818. $1=_st(_st(_st(_st(self)._methodContext())._receiver())._class())._lookupSelector_(_st(_st(self)._methodContext())._selector());
  819. return $1;
  820. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodContext)})},
  821. messageSends: ["lookupSelector:", "selector", "methodContext", "class", "receiver"]}),
  822. smalltalk.MethodContext);
  823. smalltalk.addMethod(
  824. "_methodContext",
  825. smalltalk.method({
  826. selector: "methodContext",
  827. fn: function (){
  828. var self=this;
  829. return smalltalk.withContext(function($ctx1) {
  830. var $1,$2,$3;
  831. $1=_st(self)._isBlockContext();
  832. if(! smalltalk.assert($1)){
  833. $2=self;
  834. return $2;
  835. };
  836. $3=_st(self)._home();
  837. return $3;
  838. }, function($ctx1) {$ctx1.fill(self,"methodContext",{},smalltalk.MethodContext)})},
  839. messageSends: ["ifFalse:", "isBlockContext", "home"]}),
  840. smalltalk.MethodContext);
  841. smalltalk.addMethod(
  842. "_outerContext",
  843. smalltalk.method({
  844. selector: "outerContext",
  845. fn: function (){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx1) {
  848. return self.homeContext;
  849. return self}, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.MethodContext)})},
  850. messageSends: []}),
  851. smalltalk.MethodContext);
  852. smalltalk.addMethod(
  853. "_pc",
  854. smalltalk.method({
  855. selector: "pc",
  856. fn: function (){
  857. var self=this;
  858. return smalltalk.withContext(function($ctx1) {
  859. return self.pc;
  860. return self}, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.MethodContext)})},
  861. messageSends: []}),
  862. smalltalk.MethodContext);
  863. smalltalk.addMethod(
  864. "_printOn_",
  865. smalltalk.method({
  866. selector: "printOn:",
  867. fn: function (aStream){
  868. var self=this;
  869. return smalltalk.withContext(function($ctx1) {
  870. var $1,$2;
  871. smalltalk.Object.fn.prototype._printOn_.apply(_st(self), [aStream]);
  872. $1=aStream;
  873. _st($1)._nextPutAll_("(");
  874. _st($1)._nextPutAll_(_st(self)._asString());
  875. $2=_st($1)._nextPutAll_(")");
  876. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.MethodContext)})},
  877. messageSends: ["printOn:", "nextPutAll:", "asString"]}),
  878. smalltalk.MethodContext);
  879. smalltalk.addMethod(
  880. "_receiver",
  881. smalltalk.method({
  882. selector: "receiver",
  883. fn: function (){
  884. var self=this;
  885. return smalltalk.withContext(function($ctx1) {
  886. return self.receiver;
  887. return self}, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MethodContext)})},
  888. messageSends: []}),
  889. smalltalk.MethodContext);
  890. smalltalk.addMethod(
  891. "_selector",
  892. smalltalk.method({
  893. selector: "selector",
  894. fn: function (){
  895. var self=this;
  896. return smalltalk.withContext(function($ctx1) {
  897. if(self.selector) {
  898. return smalltalk.convertSelector(self.selector);
  899. } else {
  900. return nil;
  901. }
  902. ;
  903. return self}, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MethodContext)})},
  904. messageSends: []}),
  905. smalltalk.MethodContext);
  906. smalltalk.addMethod(
  907. "_temps",
  908. smalltalk.method({
  909. selector: "temps",
  910. fn: function (){
  911. var self=this;
  912. return smalltalk.withContext(function($ctx1) {
  913. var $1;
  914. _st(self)._deprecatedAPI();
  915. $1=_st(self)._locals();
  916. return $1;
  917. }, function($ctx1) {$ctx1.fill(self,"temps",{},smalltalk.MethodContext)})},
  918. messageSends: ["deprecatedAPI", "locals"]}),
  919. smalltalk.MethodContext);
  920. smalltalk.addClass('NativeFunction', smalltalk.Object, [], 'Kernel-Methods');
  921. smalltalk.addMethod(
  922. "_constructor_",
  923. smalltalk.method({
  924. selector: "constructor:",
  925. fn: function (aString){
  926. var self=this;
  927. return smalltalk.withContext(function($ctx1) {
  928. var native=eval(aString);
  929. return new native();
  930. ;
  931. return self}, function($ctx1) {$ctx1.fill(self,"constructor:",{aString:aString},smalltalk.NativeFunction.klass)})},
  932. messageSends: []}),
  933. smalltalk.NativeFunction.klass);
  934. smalltalk.addMethod(
  935. "_constructor_value_",
  936. smalltalk.method({
  937. selector: "constructor:value:",
  938. fn: function (aString,anObject){
  939. var self=this;
  940. return smalltalk.withContext(function($ctx1) {
  941. var native=eval(aString);
  942. return new native(anObject);
  943. ;
  944. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:",{aString:aString,anObject:anObject},smalltalk.NativeFunction.klass)})},
  945. messageSends: []}),
  946. smalltalk.NativeFunction.klass);
  947. smalltalk.addMethod(
  948. "_constructor_value_value_",
  949. smalltalk.method({
  950. selector: "constructor:value:value:",
  951. fn: function (aString,anObject,anObject2){
  952. var self=this;
  953. return smalltalk.withContext(function($ctx1) {
  954. var native=eval(aString);
  955. return new native(anObject,anObject2);
  956. ;
  957. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2},smalltalk.NativeFunction.klass)})},
  958. messageSends: []}),
  959. smalltalk.NativeFunction.klass);
  960. smalltalk.addMethod(
  961. "_constructor_value_value_value_",
  962. smalltalk.method({
  963. selector: "constructor:value:value:value:",
  964. fn: function (aString,anObject,anObject2,anObject3){
  965. var self=this;
  966. return smalltalk.withContext(function($ctx1) {
  967. var native=eval(aString);
  968. return new native(anObject,anObject2, anObject3);
  969. ;
  970. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.NativeFunction.klass)})},
  971. messageSends: []}),
  972. smalltalk.NativeFunction.klass);
  973. smalltalk.addMethod(
  974. "_exists_",
  975. smalltalk.method({
  976. selector: "exists:",
  977. fn: function (aString){
  978. var self=this;
  979. return smalltalk.withContext(function($ctx1) {
  980. if(aString in window) {
  981. return true
  982. } else {
  983. return false
  984. }
  985. ;
  986. return self}, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString},smalltalk.NativeFunction.klass)})},
  987. messageSends: []}),
  988. smalltalk.NativeFunction.klass);