1
0

Kernel-Methods.deploy.js 31 KB

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