Kernel-Methods.deploy.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879
  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) { return self.apply(anObject, aCollection);
  10. return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:", [anObject,aCollection], {}, smalltalk.BlockClosure)})}
  11. }),
  12. smalltalk.BlockClosure);
  13. smalltalk.addMethod(
  14. "_compiledSource",
  15. smalltalk.method({
  16. selector: "compiledSource",
  17. fn: function (){
  18. var self=this;
  19. return smalltalk.withContext(function($ctx1) { return self.toString();
  20. return self}, function($ctx1) {$ctx1.fill(self,"compiledSource", [], {}, smalltalk.BlockClosure)})}
  21. }),
  22. smalltalk.BlockClosure);
  23. smalltalk.addMethod(
  24. "_ensure_",
  25. smalltalk.method({
  26. selector: "ensure:",
  27. fn: function (aBlock){
  28. var self=this;
  29. return smalltalk.withContext(function($ctx1) { try{return self()}finally{aBlock._value()};
  30. return self}, function($ctx1) {$ctx1.fill(self,"ensure:", [aBlock], {}, smalltalk.BlockClosure)})}
  31. }),
  32. smalltalk.BlockClosure);
  33. smalltalk.addMethod(
  34. "_fork",
  35. smalltalk.method({
  36. selector: "fork",
  37. fn: function (){
  38. var self=this;
  39. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.ForkPool || ForkPool))._default())._fork_(self);
  40. return self}, function($ctx1) {$ctx1.fill(self,"fork", [], {}, smalltalk.BlockClosure)})}
  41. }),
  42. smalltalk.BlockClosure);
  43. smalltalk.addMethod(
  44. "_new",
  45. smalltalk.method({
  46. selector: "new",
  47. fn: function (){
  48. var self=this;
  49. return smalltalk.withContext(function($ctx1) { return new self();
  50. return self}, function($ctx1) {$ctx1.fill(self,"new", [], {}, smalltalk.BlockClosure)})}
  51. }),
  52. smalltalk.BlockClosure);
  53. smalltalk.addMethod(
  54. "_newValue_",
  55. smalltalk.method({
  56. selector: "newValue:",
  57. fn: function (anObject){
  58. var self=this;
  59. return smalltalk.withContext(function($ctx1) { return new self(anObject);
  60. return self}, function($ctx1) {$ctx1.fill(self,"newValue:", [anObject], {}, smalltalk.BlockClosure)})}
  61. }),
  62. smalltalk.BlockClosure);
  63. smalltalk.addMethod(
  64. "_newValue_value_",
  65. smalltalk.method({
  66. selector: "newValue:value:",
  67. fn: function (anObject,anObject2){
  68. var self=this;
  69. return smalltalk.withContext(function($ctx1) { return new self(anObject, anObject2);
  70. return self}, function($ctx1) {$ctx1.fill(self,"newValue:value:", [anObject,anObject2], {}, smalltalk.BlockClosure)})}
  71. }),
  72. smalltalk.BlockClosure);
  73. smalltalk.addMethod(
  74. "_newValue_value_value_",
  75. smalltalk.method({
  76. selector: "newValue:value:value:",
  77. fn: function (anObject,anObject2,anObject3){
  78. var self=this;
  79. return smalltalk.withContext(function($ctx1) { return new self(anObject, anObject2);
  80. return self}, function($ctx1) {$ctx1.fill(self,"newValue:value:value:", [anObject,anObject2,anObject3], {}, smalltalk.BlockClosure)})}
  81. }),
  82. smalltalk.BlockClosure);
  83. smalltalk.addMethod(
  84. "_numArgs",
  85. smalltalk.method({
  86. selector: "numArgs",
  87. fn: function (){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) { return self.length;
  90. return self}, function($ctx1) {$ctx1.fill(self,"numArgs", [], {}, smalltalk.BlockClosure)})}
  91. }),
  92. smalltalk.BlockClosure);
  93. smalltalk.addMethod(
  94. "_on_do_",
  95. smalltalk.method({
  96. selector: "on:do:",
  97. fn: function (anErrorClass,aBlock){
  98. var self=this;
  99. return smalltalk.withContext(function($ctx1) { var $2,$3,$5,$4,$1;
  100. $2=self;
  101. $3=self;
  102. $4=(function(error){
  103. return smalltalk.withContext(function($ctx2) { $5=_st(error)._isKindOf_(anErrorClass);
  104. if(smalltalk.assert($5)){
  105. return _st(aBlock)._value_(error);
  106. } else {
  107. return _st(error)._signal();
  108. };
  109. }, function($ctx2) {$ctx2.fillBlock([error], {})})});
  110. $1=_st($2)._try_catch_($3,$4);
  111. return $1;
  112. }, function($ctx1) {$ctx1.fill(self,"on:do:", [anErrorClass,aBlock], {}, smalltalk.BlockClosure)})}
  113. }),
  114. smalltalk.BlockClosure);
  115. smalltalk.addMethod(
  116. "_timeToRun",
  117. smalltalk.method({
  118. selector: "timeToRun",
  119. fn: function (){
  120. var self=this;
  121. return smalltalk.withContext(function($ctx1) { var $1;
  122. $1=_st((smalltalk.Date || Date))._millisecondsToRun_(self);
  123. return $1;
  124. }, function($ctx1) {$ctx1.fill(self,"timeToRun", [], {}, smalltalk.BlockClosure)})}
  125. }),
  126. smalltalk.BlockClosure);
  127. smalltalk.addMethod(
  128. "_value",
  129. smalltalk.method({
  130. selector: "value",
  131. fn: function (){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) { return self();;
  134. return self}, function($ctx1) {$ctx1.fill(self,"value", [], {}, smalltalk.BlockClosure)})}
  135. }),
  136. smalltalk.BlockClosure);
  137. smalltalk.addMethod(
  138. "_value_",
  139. smalltalk.method({
  140. selector: "value:",
  141. fn: function (anArg){
  142. var self=this;
  143. return smalltalk.withContext(function($ctx1) { return self(anArg);;
  144. return self}, function($ctx1) {$ctx1.fill(self,"value:", [anArg], {}, smalltalk.BlockClosure)})}
  145. }),
  146. smalltalk.BlockClosure);
  147. smalltalk.addMethod(
  148. "_value_value_",
  149. smalltalk.method({
  150. selector: "value:value:",
  151. fn: function (firstArg,secondArg){
  152. var self=this;
  153. return smalltalk.withContext(function($ctx1) { return self(firstArg, secondArg);;
  154. return self}, function($ctx1) {$ctx1.fill(self,"value:value:", [firstArg,secondArg], {}, smalltalk.BlockClosure)})}
  155. }),
  156. smalltalk.BlockClosure);
  157. smalltalk.addMethod(
  158. "_value_value_value_",
  159. smalltalk.method({
  160. selector: "value:value:value:",
  161. fn: function (firstArg,secondArg,thirdArg){
  162. var self=this;
  163. return smalltalk.withContext(function($ctx1) { return self(firstArg, secondArg, thirdArg);;
  164. return self}, function($ctx1) {$ctx1.fill(self,"value:value:value:", [firstArg,secondArg,thirdArg], {}, smalltalk.BlockClosure)})}
  165. }),
  166. smalltalk.BlockClosure);
  167. smalltalk.addMethod(
  168. "_valueWithInterval_",
  169. smalltalk.method({
  170. selector: "valueWithInterval:",
  171. fn: function (aNumber){
  172. var self=this;
  173. return smalltalk.withContext(function($ctx1) {
  174. var interval = setInterval(self, aNumber);
  175. return smalltalk.Timeout._on_(interval);
  176. ;
  177. return self}, function($ctx1) {$ctx1.fill(self,"valueWithInterval:", [aNumber], {}, smalltalk.BlockClosure)})}
  178. }),
  179. smalltalk.BlockClosure);
  180. smalltalk.addMethod(
  181. "_valueWithPossibleArguments_",
  182. smalltalk.method({
  183. selector: "valueWithPossibleArguments:",
  184. fn: function (aCollection){
  185. var self=this;
  186. return smalltalk.withContext(function($ctx1) { return self.apply(null, aCollection);;
  187. return self}, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:", [aCollection], {}, smalltalk.BlockClosure)})}
  188. }),
  189. smalltalk.BlockClosure);
  190. smalltalk.addMethod(
  191. "_valueWithTimeout_",
  192. smalltalk.method({
  193. selector: "valueWithTimeout:",
  194. fn: function (aNumber){
  195. var self=this;
  196. return smalltalk.withContext(function($ctx1) {
  197. var timeout = setTimeout(self, aNumber);
  198. return smalltalk.Timeout._on_(timeout);
  199. ;
  200. return self}, function($ctx1) {$ctx1.fill(self,"valueWithTimeout:", [aNumber], {}, smalltalk.BlockClosure)})}
  201. }),
  202. smalltalk.BlockClosure);
  203. smalltalk.addMethod(
  204. "_whileFalse",
  205. smalltalk.method({
  206. selector: "whileFalse",
  207. fn: function (){
  208. var self=this;
  209. return smalltalk.withContext(function($ctx1) { _st(self)._whileFalse_((function(){
  210. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  211. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse", [], {}, smalltalk.BlockClosure)})}
  212. }),
  213. smalltalk.BlockClosure);
  214. smalltalk.addMethod(
  215. "_whileFalse_",
  216. smalltalk.method({
  217. selector: "whileFalse:",
  218. fn: function (aBlock){
  219. var self=this;
  220. return smalltalk.withContext(function($ctx1) { while(!self()) {aBlock()};
  221. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse:", [aBlock], {}, smalltalk.BlockClosure)})}
  222. }),
  223. smalltalk.BlockClosure);
  224. smalltalk.addMethod(
  225. "_whileTrue",
  226. smalltalk.method({
  227. selector: "whileTrue",
  228. fn: function (){
  229. var self=this;
  230. return smalltalk.withContext(function($ctx1) { _st(self)._whileTrue_((function(){
  231. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  232. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue", [], {}, smalltalk.BlockClosure)})}
  233. }),
  234. smalltalk.BlockClosure);
  235. smalltalk.addMethod(
  236. "_whileTrue_",
  237. smalltalk.method({
  238. selector: "whileTrue:",
  239. fn: function (aBlock){
  240. var self=this;
  241. return smalltalk.withContext(function($ctx1) { while(self()) {aBlock()};
  242. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue:", [aBlock], {}, smalltalk.BlockClosure)})}
  243. }),
  244. smalltalk.BlockClosure);
  245. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  246. smalltalk.addMethod(
  247. "_arguments",
  248. smalltalk.method({
  249. selector: "arguments",
  250. fn: function (){
  251. var self=this;
  252. return smalltalk.withContext(function($ctx1) { return self.args || [];
  253. return self}, function($ctx1) {$ctx1.fill(self,"arguments", [], {}, smalltalk.CompiledMethod)})}
  254. }),
  255. smalltalk.CompiledMethod);
  256. smalltalk.addMethod(
  257. "_category",
  258. smalltalk.method({
  259. selector: "category",
  260. fn: function (){
  261. var self=this;
  262. return smalltalk.withContext(function($ctx1) { var $2,$1;
  263. $2=_st(self)._basicAt_("category");
  264. if(($receiver = $2) == nil || $receiver == undefined){
  265. $1="";
  266. } else {
  267. $1=$2;
  268. };
  269. return $1;
  270. }, function($ctx1) {$ctx1.fill(self,"category", [], {}, smalltalk.CompiledMethod)})}
  271. }),
  272. smalltalk.CompiledMethod);
  273. smalltalk.addMethod(
  274. "_category_",
  275. smalltalk.method({
  276. selector: "category:",
  277. fn: function (aString){
  278. var self=this;
  279. var oldCategory;
  280. return smalltalk.withContext(function($ctx1) { var $1;
  281. oldCategory=_st(self)._category();
  282. _st(self)._basicAt_put_("category",aString);
  283. $1=_st(self)._methodClass();
  284. if(($receiver = $1) == nil || $receiver == undefined){
  285. $1;
  286. } else {
  287. _st(_st(_st(self)._methodClass())._organization())._addElement_(aString);
  288. _st(_st(_st(_st(self)._methodClass())._methods())._select_((function(each){
  289. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._category()).__eq(oldCategory);
  290. }, function($ctx2) {$ctx2.fillBlock([each], {})})})))._ifEmpty_((function(){
  291. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._methodClass())._organization())._removeElement_(oldCategory);
  292. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  293. };
  294. return self}, function($ctx1) {$ctx1.fill(self,"category:", [aString], {oldCategory:oldCategory}, smalltalk.CompiledMethod)})}
  295. }),
  296. smalltalk.CompiledMethod);
  297. smalltalk.addMethod(
  298. "_fn",
  299. smalltalk.method({
  300. selector: "fn",
  301. fn: function (){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx1) { var $1;
  304. $1=_st(self)._basicAt_("fn");
  305. return $1;
  306. }, function($ctx1) {$ctx1.fill(self,"fn", [], {}, smalltalk.CompiledMethod)})}
  307. }),
  308. smalltalk.CompiledMethod);
  309. smalltalk.addMethod(
  310. "_fn_",
  311. smalltalk.method({
  312. selector: "fn:",
  313. fn: function (aBlock){
  314. var self=this;
  315. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("fn",aBlock);
  316. return self}, function($ctx1) {$ctx1.fill(self,"fn:", [aBlock], {}, smalltalk.CompiledMethod)})}
  317. }),
  318. smalltalk.CompiledMethod);
  319. smalltalk.addMethod(
  320. "_messageSends",
  321. smalltalk.method({
  322. selector: "messageSends",
  323. fn: function (){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) { var $1;
  326. $1=_st(self)._basicAt_("messageSends");
  327. return $1;
  328. }, function($ctx1) {$ctx1.fill(self,"messageSends", [], {}, smalltalk.CompiledMethod)})}
  329. }),
  330. smalltalk.CompiledMethod);
  331. smalltalk.addMethod(
  332. "_methodClass",
  333. smalltalk.method({
  334. selector: "methodClass",
  335. fn: function (){
  336. var self=this;
  337. return smalltalk.withContext(function($ctx1) { var $1;
  338. $1=_st(self)._basicAt_("methodClass");
  339. return $1;
  340. }, function($ctx1) {$ctx1.fill(self,"methodClass", [], {}, smalltalk.CompiledMethod)})}
  341. }),
  342. smalltalk.CompiledMethod);
  343. smalltalk.addMethod(
  344. "_protocol",
  345. smalltalk.method({
  346. selector: "protocol",
  347. fn: function (){
  348. var self=this;
  349. return smalltalk.withContext(function($ctx1) { var $1;
  350. $1=_st(self)._category();
  351. return $1;
  352. }, function($ctx1) {$ctx1.fill(self,"protocol", [], {}, smalltalk.CompiledMethod)})}
  353. }),
  354. smalltalk.CompiledMethod);
  355. smalltalk.addMethod(
  356. "_referencedClasses",
  357. smalltalk.method({
  358. selector: "referencedClasses",
  359. fn: function (){
  360. var self=this;
  361. return smalltalk.withContext(function($ctx1) { var $1;
  362. $1=_st(self)._basicAt_("referencedClasses");
  363. return $1;
  364. }, function($ctx1) {$ctx1.fill(self,"referencedClasses", [], {}, smalltalk.CompiledMethod)})}
  365. }),
  366. smalltalk.CompiledMethod);
  367. smalltalk.addMethod(
  368. "_selector",
  369. smalltalk.method({
  370. selector: "selector",
  371. fn: function (){
  372. var self=this;
  373. return smalltalk.withContext(function($ctx1) { var $1;
  374. $1=_st(self)._basicAt_("selector");
  375. return $1;
  376. }, function($ctx1) {$ctx1.fill(self,"selector", [], {}, smalltalk.CompiledMethod)})}
  377. }),
  378. smalltalk.CompiledMethod);
  379. smalltalk.addMethod(
  380. "_selector_",
  381. smalltalk.method({
  382. selector: "selector:",
  383. fn: function (aString){
  384. var self=this;
  385. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("selector",aString);
  386. return self}, function($ctx1) {$ctx1.fill(self,"selector:", [aString], {}, smalltalk.CompiledMethod)})}
  387. }),
  388. smalltalk.CompiledMethod);
  389. smalltalk.addMethod(
  390. "_source",
  391. smalltalk.method({
  392. selector: "source",
  393. fn: function (){
  394. var self=this;
  395. return smalltalk.withContext(function($ctx1) { var $2,$1;
  396. $2=_st(self)._basicAt_("source");
  397. if(($receiver = $2) == nil || $receiver == undefined){
  398. $1="";
  399. } else {
  400. $1=$2;
  401. };
  402. return $1;
  403. }, function($ctx1) {$ctx1.fill(self,"source", [], {}, smalltalk.CompiledMethod)})}
  404. }),
  405. smalltalk.CompiledMethod);
  406. smalltalk.addMethod(
  407. "_source_",
  408. smalltalk.method({
  409. selector: "source:",
  410. fn: function (aString){
  411. var self=this;
  412. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("source",aString);
  413. return self}, function($ctx1) {$ctx1.fill(self,"source:", [aString], {}, smalltalk.CompiledMethod)})}
  414. }),
  415. smalltalk.CompiledMethod);
  416. smalltalk.addClass('ForkPool', smalltalk.Object, ['poolSize', 'maxPoolSize', 'queue', 'worker'], 'Kernel-Methods');
  417. smalltalk.addMethod(
  418. "_addWorker",
  419. smalltalk.method({
  420. selector: "addWorker",
  421. fn: function (){
  422. var self=this;
  423. return smalltalk.withContext(function($ctx1) { _st(self["@worker"])._valueWithTimeout_((0));
  424. self["@poolSize"]=_st(self["@poolSize"]).__plus((1));
  425. return self}, function($ctx1) {$ctx1.fill(self,"addWorker", [], {}, smalltalk.ForkPool)})}
  426. }),
  427. smalltalk.ForkPool);
  428. smalltalk.addMethod(
  429. "_defaultMaxPoolSize",
  430. smalltalk.method({
  431. selector: "defaultMaxPoolSize",
  432. fn: function (){
  433. var self=this;
  434. return smalltalk.withContext(function($ctx1) { var $1;
  435. $1=_st(_st(self)._class())._defaultMaxPoolSize();
  436. return $1;
  437. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize", [], {}, smalltalk.ForkPool)})}
  438. }),
  439. smalltalk.ForkPool);
  440. smalltalk.addMethod(
  441. "_fork_",
  442. smalltalk.method({
  443. selector: "fork:",
  444. fn: function (aBlock){
  445. var self=this;
  446. return smalltalk.withContext(function($ctx1) { var $1;
  447. $1=_st(self["@poolSize"]).__lt(_st(self)._maxPoolSize());
  448. if(smalltalk.assert($1)){
  449. _st(self)._addWorker();
  450. };
  451. _st(self["@queue"])._back_(aBlock);
  452. return self}, function($ctx1) {$ctx1.fill(self,"fork:", [aBlock], {}, smalltalk.ForkPool)})}
  453. }),
  454. smalltalk.ForkPool);
  455. smalltalk.addMethod(
  456. "_initialize",
  457. smalltalk.method({
  458. selector: "initialize",
  459. fn: function (){
  460. var self=this;
  461. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  462. self["@poolSize"]=(0);
  463. self["@queue"]=_st((smalltalk.Queue || Queue))._new();
  464. self["@worker"]=_st(self)._makeWorker();
  465. return self}, function($ctx1) {$ctx1.fill(self,"initialize", [], {}, smalltalk.ForkPool)})}
  466. }),
  467. smalltalk.ForkPool);
  468. smalltalk.addMethod(
  469. "_makeWorker",
  470. smalltalk.method({
  471. selector: "makeWorker",
  472. fn: function (){
  473. var self=this;
  474. var sentinel;
  475. return smalltalk.withContext(function($ctx1) { var $2,$1;
  476. sentinel=_st((smalltalk.Object || Object))._new();
  477. $1=(function(){
  478. var block;
  479. return smalltalk.withContext(function($ctx2) { self["@poolSize"]=_st(self["@poolSize"]).__minus((1));
  480. self["@poolSize"];
  481. block=_st(self["@queue"])._frontIfAbsent_((function(){
  482. return smalltalk.withContext(function($ctx3) { return sentinel;
  483. }, function($ctx3) {$ctx3.fillBlock([], {})})}));
  484. block;
  485. $2=_st(block).__eq_eq(sentinel);
  486. if(! smalltalk.assert($2)){
  487. return _st((function(){
  488. return smalltalk.withContext(function($ctx3) { return _st(block)._value();
  489. }, function($ctx3) {$ctx3.fillBlock([], {})})}))._ensure_((function(){
  490. return smalltalk.withContext(function($ctx3) { return _st(self)._addWorker();
  491. }, function($ctx3) {$ctx3.fillBlock([], {})})}));
  492. };
  493. }, function($ctx2) {$ctx2.fillBlock([], {block:block})})});
  494. return $1;
  495. }, function($ctx1) {$ctx1.fill(self,"makeWorker", [], {sentinel:sentinel}, smalltalk.ForkPool)})}
  496. }),
  497. smalltalk.ForkPool);
  498. smalltalk.addMethod(
  499. "_maxPoolSize",
  500. smalltalk.method({
  501. selector: "maxPoolSize",
  502. fn: function (){
  503. var self=this;
  504. return smalltalk.withContext(function($ctx1) { var $2,$1;
  505. $2=self["@maxPoolSize"];
  506. if(($receiver = $2) == nil || $receiver == undefined){
  507. $1=_st(self)._defaultMaxPoolSize();
  508. } else {
  509. $1=$2;
  510. };
  511. return $1;
  512. }, function($ctx1) {$ctx1.fill(self,"maxPoolSize", [], {}, smalltalk.ForkPool)})}
  513. }),
  514. smalltalk.ForkPool);
  515. smalltalk.addMethod(
  516. "_maxPoolSize_",
  517. smalltalk.method({
  518. selector: "maxPoolSize:",
  519. fn: function (anInteger){
  520. var self=this;
  521. return smalltalk.withContext(function($ctx1) { self["@maxPoolSize"]=anInteger;
  522. return self}, function($ctx1) {$ctx1.fill(self,"maxPoolSize:", [anInteger], {}, smalltalk.ForkPool)})}
  523. }),
  524. smalltalk.ForkPool);
  525. smalltalk.ForkPool.klass.iVarNames = ['default'];
  526. smalltalk.addMethod(
  527. "_default",
  528. smalltalk.method({
  529. selector: "default",
  530. fn: function (){
  531. var self=this;
  532. return smalltalk.withContext(function($ctx1) { var $2,$1;
  533. $2=self["@default"];
  534. if(($receiver = $2) == nil || $receiver == undefined){
  535. self["@default"]=_st(self)._new();
  536. $1=self["@default"];
  537. } else {
  538. $1=$2;
  539. };
  540. return $1;
  541. }, function($ctx1) {$ctx1.fill(self,"default", [], {}, smalltalk.ForkPool.klass)})}
  542. }),
  543. smalltalk.ForkPool.klass);
  544. smalltalk.addMethod(
  545. "_defaultMaxPoolSize",
  546. smalltalk.method({
  547. selector: "defaultMaxPoolSize",
  548. fn: function (){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) { return (100);
  551. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize", [], {}, smalltalk.ForkPool.klass)})}
  552. }),
  553. smalltalk.ForkPool.klass);
  554. smalltalk.addMethod(
  555. "_resetDefault",
  556. smalltalk.method({
  557. selector: "resetDefault",
  558. fn: function (){
  559. var self=this;
  560. return smalltalk.withContext(function($ctx1) { self["@default"]=nil;
  561. return self}, function($ctx1) {$ctx1.fill(self,"resetDefault", [], {}, smalltalk.ForkPool.klass)})}
  562. }),
  563. smalltalk.ForkPool.klass);
  564. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  565. smalltalk.addMethod(
  566. "_arguments",
  567. smalltalk.method({
  568. selector: "arguments",
  569. fn: function (){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) { var $1;
  572. $1=self["@arguments"];
  573. return $1;
  574. }, function($ctx1) {$ctx1.fill(self,"arguments", [], {}, smalltalk.Message)})}
  575. }),
  576. smalltalk.Message);
  577. smalltalk.addMethod(
  578. "_arguments_",
  579. smalltalk.method({
  580. selector: "arguments:",
  581. fn: function (anArray){
  582. var self=this;
  583. return smalltalk.withContext(function($ctx1) { self["@arguments"]=anArray;
  584. return self}, function($ctx1) {$ctx1.fill(self,"arguments:", [anArray], {}, smalltalk.Message)})}
  585. }),
  586. smalltalk.Message);
  587. smalltalk.addMethod(
  588. "_printString",
  589. smalltalk.method({
  590. selector: "printString",
  591. fn: function (){
  592. var self=this;
  593. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  594. $1=_st((smalltalk.String || String))._streamContents_((function(aStream){
  595. return smalltalk.withContext(function($ctx2) { $2=aStream;
  596. _st($2)._nextPutAll_(smalltalk.Object.fn.prototype._printString.apply(_st(self), []));
  597. _st($2)._nextPutAll_("(");
  598. _st($2)._nextPutAll_(self["@selector"]);
  599. $3=_st($2)._nextPutAll_(")");
  600. return $3;
  601. }, function($ctx2) {$ctx2.fillBlock([aStream], {})})}));
  602. return $1;
  603. }, function($ctx1) {$ctx1.fill(self,"printString", [], {}, smalltalk.Message)})}
  604. }),
  605. smalltalk.Message);
  606. smalltalk.addMethod(
  607. "_selector",
  608. smalltalk.method({
  609. selector: "selector",
  610. fn: function (){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) { var $1;
  613. $1=self["@selector"];
  614. return $1;
  615. }, function($ctx1) {$ctx1.fill(self,"selector", [], {}, smalltalk.Message)})}
  616. }),
  617. smalltalk.Message);
  618. smalltalk.addMethod(
  619. "_selector_",
  620. smalltalk.method({
  621. selector: "selector:",
  622. fn: function (aString){
  623. var self=this;
  624. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  625. return self}, function($ctx1) {$ctx1.fill(self,"selector:", [aString], {}, smalltalk.Message)})}
  626. }),
  627. smalltalk.Message);
  628. smalltalk.addMethod(
  629. "_sendTo_",
  630. smalltalk.method({
  631. selector: "sendTo:",
  632. fn: function (anObject){
  633. var self=this;
  634. return smalltalk.withContext(function($ctx1) { var $1;
  635. $1=_st(anObject)._perform_withArguments_(_st(self)._selector(),_st(self)._arguments());
  636. return $1;
  637. }, function($ctx1) {$ctx1.fill(self,"sendTo:", [anObject], {}, smalltalk.Message)})}
  638. }),
  639. smalltalk.Message);
  640. smalltalk.addMethod(
  641. "_selector_arguments_",
  642. smalltalk.method({
  643. selector: "selector:arguments:",
  644. fn: function (aString,anArray){
  645. var self=this;
  646. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  647. $2=_st(self)._new();
  648. _st($2)._selector_(aString);
  649. _st($2)._arguments_(anArray);
  650. $3=_st($2)._yourself();
  651. $1=$3;
  652. return $1;
  653. }, function($ctx1) {$ctx1.fill(self,"selector:arguments:", [aString,anArray], {}, smalltalk.Message.klass)})}
  654. }),
  655. smalltalk.Message.klass);
  656. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  657. smalltalk.addMethod(
  658. "_arguments",
  659. smalltalk.method({
  660. selector: "arguments",
  661. fn: function (){
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) { return self.args;
  664. return self}, function($ctx1) {$ctx1.fill(self,"arguments", [], {}, smalltalk.MethodContext)})}
  665. }),
  666. smalltalk.MethodContext);
  667. smalltalk.addMethod(
  668. "_asString",
  669. smalltalk.method({
  670. selector: "asString",
  671. fn: function (){
  672. var self=this;
  673. return smalltalk.withContext(function($ctx1) { var $2,$1;
  674. $2=_st(self)._isBlockContext();
  675. if(smalltalk.assert($2)){
  676. $1=_st(_st("a block (in ").__comma(_st(_st(self)._methodContext())._asString())).__comma(")");
  677. } else {
  678. $1=_st(_st(_st(_st(_st(self)._receiver())._class())._printString()).__comma(" >> ")).__comma(_st(self)._selector());
  679. };
  680. return $1;
  681. }, function($ctx1) {$ctx1.fill(self,"asString", [], {}, smalltalk.MethodContext)})}
  682. }),
  683. smalltalk.MethodContext);
  684. smalltalk.addMethod(
  685. "_home",
  686. smalltalk.method({
  687. selector: "home",
  688. fn: function (){
  689. var self=this;
  690. return smalltalk.withContext(function($ctx1) { return self.homeContext;
  691. return self}, function($ctx1) {$ctx1.fill(self,"home", [], {}, smalltalk.MethodContext)})}
  692. }),
  693. smalltalk.MethodContext);
  694. smalltalk.addMethod(
  695. "_isBlockContext",
  696. smalltalk.method({
  697. selector: "isBlockContext",
  698. fn: function (){
  699. var self=this;
  700. return smalltalk.withContext(function($ctx1) { var $1;
  701. $1=_st(_st(self)._selector())._isNil();
  702. return $1;
  703. }, function($ctx1) {$ctx1.fill(self,"isBlockContext", [], {}, smalltalk.MethodContext)})}
  704. }),
  705. smalltalk.MethodContext);
  706. smalltalk.addMethod(
  707. "_locals",
  708. smalltalk.method({
  709. selector: "locals",
  710. fn: function (){
  711. var self=this;
  712. return smalltalk.withContext(function($ctx1) { return self.locals;
  713. return self}, function($ctx1) {$ctx1.fill(self,"locals", [], {}, smalltalk.MethodContext)})}
  714. }),
  715. smalltalk.MethodContext);
  716. smalltalk.addMethod(
  717. "_methodContext",
  718. smalltalk.method({
  719. selector: "methodContext",
  720. fn: function (){
  721. var self=this;
  722. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  723. $1=_st(self)._isBlockContext();
  724. if(! smalltalk.assert($1)){
  725. $2=self;
  726. return $2;
  727. };
  728. $3=_st(self)._outerContext();
  729. return $3;
  730. }, function($ctx1) {$ctx1.fill(self,"methodContext", [], {}, smalltalk.MethodContext)})}
  731. }),
  732. smalltalk.MethodContext);
  733. smalltalk.addMethod(
  734. "_outerContext",
  735. smalltalk.method({
  736. selector: "outerContext",
  737. fn: function (){
  738. var self=this;
  739. return smalltalk.withContext(function($ctx1) { var $1;
  740. $1=_st(self)._home();
  741. return $1;
  742. }, function($ctx1) {$ctx1.fill(self,"outerContext", [], {}, smalltalk.MethodContext)})}
  743. }),
  744. smalltalk.MethodContext);
  745. smalltalk.addMethod(
  746. "_pc",
  747. smalltalk.method({
  748. selector: "pc",
  749. fn: function (){
  750. var self=this;
  751. return smalltalk.withContext(function($ctx1) { return self.pc;
  752. return self}, function($ctx1) {$ctx1.fill(self,"pc", [], {}, smalltalk.MethodContext)})}
  753. }),
  754. smalltalk.MethodContext);
  755. smalltalk.addMethod(
  756. "_printString",
  757. smalltalk.method({
  758. selector: "printString",
  759. fn: function (){
  760. var self=this;
  761. return smalltalk.withContext(function($ctx1) { var $1;
  762. $1=_st(_st(_st(smalltalk.Object.fn.prototype._printString.apply(_st(self), [])).__comma("(")).__comma(_st(self)._asString())).__comma(")");
  763. return $1;
  764. }, function($ctx1) {$ctx1.fill(self,"printString", [], {}, smalltalk.MethodContext)})}
  765. }),
  766. smalltalk.MethodContext);
  767. smalltalk.addMethod(
  768. "_receiver",
  769. smalltalk.method({
  770. selector: "receiver",
  771. fn: function (){
  772. var self=this;
  773. return smalltalk.withContext(function($ctx1) { return self.receiver;
  774. return self}, function($ctx1) {$ctx1.fill(self,"receiver", [], {}, smalltalk.MethodContext)})}
  775. }),
  776. smalltalk.MethodContext);
  777. smalltalk.addMethod(
  778. "_selector",
  779. smalltalk.method({
  780. selector: "selector",
  781. fn: function (){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) {
  784. if(self.selector) {
  785. return smalltalk.convertSelector(self.selector);
  786. } else {
  787. return nil;
  788. }
  789. ;
  790. return self}, function($ctx1) {$ctx1.fill(self,"selector", [], {}, smalltalk.MethodContext)})}
  791. }),
  792. smalltalk.MethodContext);
  793. smalltalk.addMethod(
  794. "_temps",
  795. smalltalk.method({
  796. selector: "temps",
  797. fn: function (){
  798. var self=this;
  799. return smalltalk.withContext(function($ctx1) { var $1;
  800. _st(self)._deprecatedAPI();
  801. $1=_st(self)._locals();
  802. return $1;
  803. }, function($ctx1) {$ctx1.fill(self,"temps", [], {}, smalltalk.MethodContext)})}
  804. }),
  805. smalltalk.MethodContext);