2
0

Kernel-Methods.deploy.js 32 KB

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