Kernel-Methods.deploy.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390
  1. (function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Kernel-Methods');
  3. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "applyTo:arguments:",
  7. fn: function (anObject,aCollection){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) {
  10. return self.apply(anObject, aCollection);
  11. return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},smalltalk.BlockClosure)})},
  12. messageSends: []}),
  13. smalltalk.BlockClosure);
  14. smalltalk.addMethod(
  15. smalltalk.method({
  16. selector: "asCompiledMethod:",
  17. fn: function (aString){
  18. var self=this;
  19. return smalltalk.withContext(function($ctx1) {
  20. return smalltalk.method({selector:aString, fn:self});;
  21. return self}, function($ctx1) {$ctx1.fill(self,"asCompiledMethod:",{aString:aString},smalltalk.BlockClosure)})},
  22. messageSends: []}),
  23. smalltalk.BlockClosure);
  24. smalltalk.addMethod(
  25. smalltalk.method({
  26. selector: "compiledSource",
  27. fn: function (){
  28. var self=this;
  29. return smalltalk.withContext(function($ctx1) {
  30. return self.toString();
  31. return self}, function($ctx1) {$ctx1.fill(self,"compiledSource",{},smalltalk.BlockClosure)})},
  32. messageSends: []}),
  33. smalltalk.BlockClosure);
  34. smalltalk.addMethod(
  35. smalltalk.method({
  36. selector: "currySelf",
  37. fn: function (){
  38. var self=this;
  39. return smalltalk.withContext(function($ctx1) {
  40. return function () {
  41. var args = [ this ];
  42. args.push.apply(args, arguments);
  43. return self.apply(null, args);
  44. }
  45. ;
  46. return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{},smalltalk.BlockClosure)})},
  47. messageSends: []}),
  48. smalltalk.BlockClosure);
  49. smalltalk.addMethod(
  50. smalltalk.method({
  51. selector: "ensure:",
  52. fn: function (aBlock){
  53. var self=this;
  54. return smalltalk.withContext(function($ctx1) {
  55. try{return self._value()}finally{aBlock._value()};
  56. return self}, function($ctx1) {$ctx1.fill(self,"ensure:",{aBlock:aBlock},smalltalk.BlockClosure)})},
  57. messageSends: []}),
  58. smalltalk.BlockClosure);
  59. smalltalk.addMethod(
  60. smalltalk.method({
  61. selector: "fork",
  62. fn: function (){
  63. var self=this;
  64. function $ForkPool(){return smalltalk.ForkPool||(typeof ForkPool=="undefined"?nil:ForkPool)}
  65. return smalltalk.withContext(function($ctx1) {
  66. _st(_st($ForkPool())._default())._fork_(self);
  67. return self}, function($ctx1) {$ctx1.fill(self,"fork",{},smalltalk.BlockClosure)})},
  68. messageSends: ["fork:", "default"]}),
  69. smalltalk.BlockClosure);
  70. smalltalk.addMethod(
  71. smalltalk.method({
  72. selector: "new",
  73. fn: function (){
  74. var self=this;
  75. return smalltalk.withContext(function($ctx1) {
  76. return new self();
  77. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.BlockClosure)})},
  78. messageSends: []}),
  79. smalltalk.BlockClosure);
  80. smalltalk.addMethod(
  81. smalltalk.method({
  82. selector: "newValue:",
  83. fn: function (anObject){
  84. var self=this;
  85. return smalltalk.withContext(function($ctx1) {
  86. var $1;
  87. $1=self._newWithValues_([anObject]);
  88. return $1;
  89. }, function($ctx1) {$ctx1.fill(self,"newValue:",{anObject:anObject},smalltalk.BlockClosure)})},
  90. messageSends: ["newWithValues:"]}),
  91. smalltalk.BlockClosure);
  92. smalltalk.addMethod(
  93. smalltalk.method({
  94. selector: "newValue:value:",
  95. fn: function (anObject,anObject2){
  96. var self=this;
  97. return smalltalk.withContext(function($ctx1) {
  98. var $1;
  99. $1=self._newWithValues_([anObject,anObject2]);
  100. return $1;
  101. }, function($ctx1) {$ctx1.fill(self,"newValue:value:",{anObject:anObject,anObject2:anObject2},smalltalk.BlockClosure)})},
  102. messageSends: ["newWithValues:"]}),
  103. smalltalk.BlockClosure);
  104. smalltalk.addMethod(
  105. smalltalk.method({
  106. selector: "newValue:value:value:",
  107. fn: function (anObject,anObject2,anObject3){
  108. var self=this;
  109. return smalltalk.withContext(function($ctx1) {
  110. var $1;
  111. $1=self._newWithValues_([anObject,anObject2,anObject3]);
  112. return $1;
  113. }, function($ctx1) {$ctx1.fill(self,"newValue:value:value:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.BlockClosure)})},
  114. messageSends: ["newWithValues:"]}),
  115. smalltalk.BlockClosure);
  116. smalltalk.addMethod(
  117. smalltalk.method({
  118. selector: "newWithValues:",
  119. fn: function (aCollection){
  120. var self=this;
  121. return smalltalk.withContext(function($ctx1) {
  122. var constructor = function() {};
  123. constructor.prototype = self.prototype;
  124. var object = new constructor;
  125. var result = self.apply(object, aCollection);
  126. return typeof result === "object" ? result : object;
  127. ;
  128. return self}, function($ctx1) {$ctx1.fill(self,"newWithValues:",{aCollection:aCollection},smalltalk.BlockClosure)})},
  129. messageSends: []}),
  130. smalltalk.BlockClosure);
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "numArgs",
  134. fn: function (){
  135. var self=this;
  136. return smalltalk.withContext(function($ctx1) {
  137. return self.length;
  138. return self}, function($ctx1) {$ctx1.fill(self,"numArgs",{},smalltalk.BlockClosure)})},
  139. messageSends: []}),
  140. smalltalk.BlockClosure);
  141. smalltalk.addMethod(
  142. smalltalk.method({
  143. selector: "on:do:",
  144. fn: function (anErrorClass,aBlock){
  145. var self=this;
  146. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  147. return smalltalk.withContext(function($ctx1) {
  148. var $2,$1;
  149. $1=self._try_catch_(self,(function(error){
  150. var smalltalkError;
  151. return smalltalk.withContext(function($ctx2) {
  152. smalltalkError=_st(_st($Smalltalk())._current())._asSmalltalkException_(error);
  153. smalltalkError;
  154. $2=_st(smalltalkError)._isKindOf_(anErrorClass);
  155. if(smalltalk.assert($2)){
  156. return _st(aBlock)._value_(smalltalkError);
  157. } else {
  158. return _st(smalltalkError)._resignal();
  159. };
  160. }, function($ctx2) {$ctx2.fillBlock({error:error,smalltalkError:smalltalkError},$ctx1,1)})}));
  161. return $1;
  162. }, function($ctx1) {$ctx1.fill(self,"on:do:",{anErrorClass:anErrorClass,aBlock:aBlock},smalltalk.BlockClosure)})},
  163. messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "isKindOf:", "value:", "resignal"]}),
  164. smalltalk.BlockClosure);
  165. smalltalk.addMethod(
  166. smalltalk.method({
  167. selector: "receiver",
  168. fn: function (){
  169. var self=this;
  170. return smalltalk.withContext(function($ctx1) {
  171. return nil;
  172. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.BlockClosure)})},
  173. messageSends: []}),
  174. smalltalk.BlockClosure);
  175. smalltalk.addMethod(
  176. smalltalk.method({
  177. selector: "timeToRun",
  178. fn: function (){
  179. var self=this;
  180. function $Date(){return smalltalk.Date||(typeof Date=="undefined"?nil:Date)}
  181. return smalltalk.withContext(function($ctx1) {
  182. var $1;
  183. $1=_st($Date())._millisecondsToRun_(self);
  184. return $1;
  185. }, function($ctx1) {$ctx1.fill(self,"timeToRun",{},smalltalk.BlockClosure)})},
  186. messageSends: ["millisecondsToRun:"]}),
  187. smalltalk.BlockClosure);
  188. smalltalk.addMethod(
  189. smalltalk.method({
  190. selector: "value",
  191. fn: function (){
  192. var self=this;
  193. return smalltalk.withContext(function($ctx1) {
  194. return self();;
  195. return self}, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.BlockClosure)})},
  196. messageSends: []}),
  197. smalltalk.BlockClosure);
  198. smalltalk.addMethod(
  199. smalltalk.method({
  200. selector: "value:",
  201. fn: function (anArg){
  202. var self=this;
  203. return smalltalk.withContext(function($ctx1) {
  204. return self(anArg);;
  205. return self}, function($ctx1) {$ctx1.fill(self,"value:",{anArg:anArg},smalltalk.BlockClosure)})},
  206. messageSends: []}),
  207. smalltalk.BlockClosure);
  208. smalltalk.addMethod(
  209. smalltalk.method({
  210. selector: "value:value:",
  211. fn: function (firstArg,secondArg){
  212. var self=this;
  213. return smalltalk.withContext(function($ctx1) {
  214. return self(firstArg, secondArg);;
  215. return self}, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArg:firstArg,secondArg:secondArg},smalltalk.BlockClosure)})},
  216. messageSends: []}),
  217. smalltalk.BlockClosure);
  218. smalltalk.addMethod(
  219. smalltalk.method({
  220. selector: "value:value:value:",
  221. fn: function (firstArg,secondArg,thirdArg){
  222. var self=this;
  223. return smalltalk.withContext(function($ctx1) {
  224. return self(firstArg, secondArg, thirdArg);;
  225. return self}, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArg:firstArg,secondArg:secondArg,thirdArg:thirdArg},smalltalk.BlockClosure)})},
  226. messageSends: []}),
  227. smalltalk.BlockClosure);
  228. smalltalk.addMethod(
  229. smalltalk.method({
  230. selector: "valueWithInterval:",
  231. fn: function (aNumber){
  232. var self=this;
  233. return smalltalk.withContext(function($ctx1) {
  234. var interval = setInterval(self, aNumber);
  235. return smalltalk.Timeout._on_(interval);
  236. ;
  237. return self}, function($ctx1) {$ctx1.fill(self,"valueWithInterval:",{aNumber:aNumber},smalltalk.BlockClosure)})},
  238. messageSends: []}),
  239. smalltalk.BlockClosure);
  240. smalltalk.addMethod(
  241. smalltalk.method({
  242. selector: "valueWithPossibleArguments:",
  243. fn: function (aCollection){
  244. var self=this;
  245. return smalltalk.withContext(function($ctx1) {
  246. return self.apply(null, aCollection);;
  247. return self}, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection},smalltalk.BlockClosure)})},
  248. messageSends: []}),
  249. smalltalk.BlockClosure);
  250. smalltalk.addMethod(
  251. smalltalk.method({
  252. selector: "valueWithTimeout:",
  253. fn: function (aNumber){
  254. var self=this;
  255. return smalltalk.withContext(function($ctx1) {
  256. var timeout = setTimeout(self, aNumber);
  257. return smalltalk.Timeout._on_(timeout);
  258. ;
  259. return self}, function($ctx1) {$ctx1.fill(self,"valueWithTimeout:",{aNumber:aNumber},smalltalk.BlockClosure)})},
  260. messageSends: []}),
  261. smalltalk.BlockClosure);
  262. smalltalk.addMethod(
  263. smalltalk.method({
  264. selector: "whileFalse",
  265. fn: function (){
  266. var self=this;
  267. return smalltalk.withContext(function($ctx1) {
  268. self._whileFalse_((function(){
  269. return smalltalk.withContext(function($ctx2) {
  270. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  271. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse",{},smalltalk.BlockClosure)})},
  272. messageSends: ["whileFalse:"]}),
  273. smalltalk.BlockClosure);
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "whileFalse:",
  277. fn: function (aBlock){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) {
  280. while(!smalltalk.assert(self._value())) {aBlock._value()};
  281. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse:",{aBlock:aBlock},smalltalk.BlockClosure)})},
  282. messageSends: []}),
  283. smalltalk.BlockClosure);
  284. smalltalk.addMethod(
  285. smalltalk.method({
  286. selector: "whileTrue",
  287. fn: function (){
  288. var self=this;
  289. return smalltalk.withContext(function($ctx1) {
  290. self._whileTrue_((function(){
  291. return smalltalk.withContext(function($ctx2) {
  292. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  293. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue",{},smalltalk.BlockClosure)})},
  294. messageSends: ["whileTrue:"]}),
  295. smalltalk.BlockClosure);
  296. smalltalk.addMethod(
  297. smalltalk.method({
  298. selector: "whileTrue:",
  299. fn: function (aBlock){
  300. var self=this;
  301. return smalltalk.withContext(function($ctx1) {
  302. while(smalltalk.assert(self._value())) {aBlock._value()};
  303. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue:",{aBlock:aBlock},smalltalk.BlockClosure)})},
  304. messageSends: []}),
  305. smalltalk.BlockClosure);
  306. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "arguments",
  310. fn: function (){
  311. var self=this;
  312. return smalltalk.withContext(function($ctx1) {
  313. return self.args || [];
  314. return self}, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.CompiledMethod)})},
  315. messageSends: []}),
  316. smalltalk.CompiledMethod);
  317. smalltalk.addMethod(
  318. smalltalk.method({
  319. selector: "category",
  320. fn: function (){
  321. var self=this;
  322. return smalltalk.withContext(function($ctx1) {
  323. var $2,$1;
  324. $2=self._basicAt_("category");
  325. if(($receiver = $2) == nil || $receiver == undefined){
  326. $1=self._defaultCategory();
  327. } else {
  328. $1=$2;
  329. };
  330. return $1;
  331. }, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.CompiledMethod)})},
  332. messageSends: ["ifNil:", "basicAt:", "defaultCategory"]}),
  333. smalltalk.CompiledMethod);
  334. smalltalk.addMethod(
  335. smalltalk.method({
  336. selector: "category:",
  337. fn: function (aString){
  338. var self=this;
  339. var oldProtocol;
  340. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  341. function $MethodMoved(){return smalltalk.MethodMoved||(typeof MethodMoved=="undefined"?nil:MethodMoved)}
  342. return smalltalk.withContext(function($ctx1) {
  343. var $1,$2,$3;
  344. oldProtocol=self._protocol();
  345. self._basicAt_put_("category",aString);
  346. $1=_st($MethodMoved())._new();
  347. _st($1)._method_(self);
  348. _st($1)._oldProtocol_(oldProtocol);
  349. $2=_st($1)._yourself();
  350. _st(_st($SystemAnnouncer())._current())._announce_($2);
  351. $3=self._methodClass();
  352. if(($receiver = $3) == nil || $receiver == undefined){
  353. $3;
  354. } else {
  355. _st(_st(self._methodClass())._organization())._addElement_(aString);
  356. _st(_st(_st(self._methodClass())._methods())._select_((function(each){
  357. return smalltalk.withContext(function($ctx2) {
  358. return _st(_st(each)._protocol()).__eq(oldProtocol);
  359. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})})))._ifEmpty_((function(){
  360. return smalltalk.withContext(function($ctx2) {
  361. return _st(_st(self._methodClass())._organization())._removeElement_(oldProtocol);
  362. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  363. };
  364. return self}, function($ctx1) {$ctx1.fill(self,"category:",{aString:aString,oldProtocol:oldProtocol},smalltalk.CompiledMethod)})},
  365. messageSends: ["protocol", "basicAt:put:", "announce:", "current", "method:", "new", "oldProtocol:", "yourself", "ifNotNil:", "methodClass", "addElement:", "organization", "ifEmpty:", "select:", "methods", "=", "removeElement:"]}),
  366. smalltalk.CompiledMethod);
  367. smalltalk.addMethod(
  368. smalltalk.method({
  369. selector: "defaultCategory",
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) {
  373. return "as yet unclassified";
  374. }, function($ctx1) {$ctx1.fill(self,"defaultCategory",{},smalltalk.CompiledMethod)})},
  375. messageSends: []}),
  376. smalltalk.CompiledMethod);
  377. smalltalk.addMethod(
  378. smalltalk.method({
  379. selector: "fn",
  380. fn: function (){
  381. var self=this;
  382. return smalltalk.withContext(function($ctx1) {
  383. var $1;
  384. $1=self._basicAt_("fn");
  385. return $1;
  386. }, function($ctx1) {$ctx1.fill(self,"fn",{},smalltalk.CompiledMethod)})},
  387. messageSends: ["basicAt:"]}),
  388. smalltalk.CompiledMethod);
  389. smalltalk.addMethod(
  390. smalltalk.method({
  391. selector: "fn:",
  392. fn: function (aBlock){
  393. var self=this;
  394. return smalltalk.withContext(function($ctx1) {
  395. self._basicAt_put_("fn",aBlock);
  396. return self}, function($ctx1) {$ctx1.fill(self,"fn:",{aBlock:aBlock},smalltalk.CompiledMethod)})},
  397. messageSends: ["basicAt:put:"]}),
  398. smalltalk.CompiledMethod);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "isCompiledMethod",
  402. fn: function (){
  403. var self=this;
  404. return smalltalk.withContext(function($ctx1) {
  405. return true;
  406. }, function($ctx1) {$ctx1.fill(self,"isCompiledMethod",{},smalltalk.CompiledMethod)})},
  407. messageSends: []}),
  408. smalltalk.CompiledMethod);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "isOverridden",
  412. fn: function (){
  413. var self=this;
  414. var selector;
  415. return smalltalk.withContext(function($ctx1) {
  416. var $1;
  417. var $early={};
  418. try {
  419. selector=self._selector();
  420. _st(self._methodClass())._allSubclassesDo_((function(each){
  421. return smalltalk.withContext(function($ctx2) {
  422. $1=_st(each)._includesSelector_(selector);
  423. if(smalltalk.assert($1)){
  424. throw $early=[true];
  425. };
  426. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  427. return false;
  428. }
  429. catch(e) {if(e===$early)return e[0]; throw e}
  430. }, function($ctx1) {$ctx1.fill(self,"isOverridden",{selector:selector},smalltalk.CompiledMethod)})},
  431. messageSends: ["selector", "allSubclassesDo:", "methodClass", "ifTrue:", "includesSelector:"]}),
  432. smalltalk.CompiledMethod);
  433. smalltalk.addMethod(
  434. smalltalk.method({
  435. selector: "isOverride",
  436. fn: function (){
  437. var self=this;
  438. var superclass;
  439. return smalltalk.withContext(function($ctx1) {
  440. var $1,$2;
  441. superclass=_st(self._methodClass())._superclass();
  442. $1=superclass;
  443. if(($receiver = $1) == nil || $receiver == undefined){
  444. return false;
  445. } else {
  446. $1;
  447. };
  448. $2=_st(_st(_st(self._methodClass())._superclass())._lookupSelector_(self._selector()))._notNil();
  449. return $2;
  450. }, function($ctx1) {$ctx1.fill(self,"isOverride",{superclass:superclass},smalltalk.CompiledMethod)})},
  451. messageSends: ["superclass", "methodClass", "ifNil:", "notNil", "lookupSelector:", "selector"]}),
  452. smalltalk.CompiledMethod);
  453. smalltalk.addMethod(
  454. smalltalk.method({
  455. selector: "messageSends",
  456. fn: function (){
  457. var self=this;
  458. return smalltalk.withContext(function($ctx1) {
  459. var $1;
  460. $1=self._basicAt_("messageSends");
  461. return $1;
  462. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.CompiledMethod)})},
  463. messageSends: ["basicAt:"]}),
  464. smalltalk.CompiledMethod);
  465. smalltalk.addMethod(
  466. smalltalk.method({
  467. selector: "methodClass",
  468. fn: function (){
  469. var self=this;
  470. return smalltalk.withContext(function($ctx1) {
  471. var $1;
  472. $1=self._basicAt_("methodClass");
  473. return $1;
  474. }, function($ctx1) {$ctx1.fill(self,"methodClass",{},smalltalk.CompiledMethod)})},
  475. messageSends: ["basicAt:"]}),
  476. smalltalk.CompiledMethod);
  477. smalltalk.addMethod(
  478. smalltalk.method({
  479. selector: "protocol",
  480. fn: function (){
  481. var self=this;
  482. return smalltalk.withContext(function($ctx1) {
  483. var $1;
  484. $1=self._category();
  485. return $1;
  486. }, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.CompiledMethod)})},
  487. messageSends: ["category"]}),
  488. smalltalk.CompiledMethod);
  489. smalltalk.addMethod(
  490. smalltalk.method({
  491. selector: "protocol:",
  492. fn: function (aString){
  493. var self=this;
  494. return smalltalk.withContext(function($ctx1) {
  495. self._category_(aString);
  496. return self}, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString},smalltalk.CompiledMethod)})},
  497. messageSends: ["category:"]}),
  498. smalltalk.CompiledMethod);
  499. smalltalk.addMethod(
  500. smalltalk.method({
  501. selector: "referencedClasses",
  502. fn: function (){
  503. var self=this;
  504. return smalltalk.withContext(function($ctx1) {
  505. var $1;
  506. $1=self._basicAt_("referencedClasses");
  507. return $1;
  508. }, function($ctx1) {$ctx1.fill(self,"referencedClasses",{},smalltalk.CompiledMethod)})},
  509. messageSends: ["basicAt:"]}),
  510. smalltalk.CompiledMethod);
  511. smalltalk.addMethod(
  512. smalltalk.method({
  513. selector: "selector",
  514. fn: function (){
  515. var self=this;
  516. return smalltalk.withContext(function($ctx1) {
  517. var $1;
  518. $1=self._basicAt_("selector");
  519. return $1;
  520. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.CompiledMethod)})},
  521. messageSends: ["basicAt:"]}),
  522. smalltalk.CompiledMethod);
  523. smalltalk.addMethod(
  524. smalltalk.method({
  525. selector: "selector:",
  526. fn: function (aString){
  527. var self=this;
  528. return smalltalk.withContext(function($ctx1) {
  529. self._basicAt_put_("selector",aString);
  530. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.CompiledMethod)})},
  531. messageSends: ["basicAt:put:"]}),
  532. smalltalk.CompiledMethod);
  533. smalltalk.addMethod(
  534. smalltalk.method({
  535. selector: "sendTo:arguments:",
  536. fn: function (anObject,aCollection){
  537. var self=this;
  538. return smalltalk.withContext(function($ctx1) {
  539. var $1;
  540. $1=_st(self._fn())._applyTo_arguments_(anObject,aCollection);
  541. return $1;
  542. }, function($ctx1) {$ctx1.fill(self,"sendTo:arguments:",{anObject:anObject,aCollection:aCollection},smalltalk.CompiledMethod)})},
  543. messageSends: ["applyTo:arguments:", "fn"]}),
  544. smalltalk.CompiledMethod);
  545. smalltalk.addMethod(
  546. smalltalk.method({
  547. selector: "source",
  548. fn: function (){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) {
  551. var $2,$1;
  552. $2=self._basicAt_("source");
  553. if(($receiver = $2) == nil || $receiver == undefined){
  554. $1="";
  555. } else {
  556. $1=$2;
  557. };
  558. return $1;
  559. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.CompiledMethod)})},
  560. messageSends: ["ifNil:", "basicAt:"]}),
  561. smalltalk.CompiledMethod);
  562. smalltalk.addMethod(
  563. smalltalk.method({
  564. selector: "source:",
  565. fn: function (aString){
  566. var self=this;
  567. return smalltalk.withContext(function($ctx1) {
  568. self._basicAt_put_("source",aString);
  569. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.CompiledMethod)})},
  570. messageSends: ["basicAt:put:"]}),
  571. smalltalk.CompiledMethod);
  572. smalltalk.addClass('ForkPool', smalltalk.Object, ['poolSize', 'maxPoolSize', 'queue', 'worker'], 'Kernel-Methods');
  573. smalltalk.addMethod(
  574. smalltalk.method({
  575. selector: "addWorker",
  576. fn: function (){
  577. var self=this;
  578. return smalltalk.withContext(function($ctx1) {
  579. _st(self["@worker"])._valueWithTimeout_((0));
  580. self["@poolSize"]=_st(self["@poolSize"]).__plus((1));
  581. return self}, function($ctx1) {$ctx1.fill(self,"addWorker",{},smalltalk.ForkPool)})},
  582. messageSends: ["valueWithTimeout:", "+"]}),
  583. smalltalk.ForkPool);
  584. smalltalk.addMethod(
  585. smalltalk.method({
  586. selector: "defaultMaxPoolSize",
  587. fn: function (){
  588. var self=this;
  589. return smalltalk.withContext(function($ctx1) {
  590. var $1;
  591. $1=_st(self._class())._defaultMaxPoolSize();
  592. return $1;
  593. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool)})},
  594. messageSends: ["defaultMaxPoolSize", "class"]}),
  595. smalltalk.ForkPool);
  596. smalltalk.addMethod(
  597. smalltalk.method({
  598. selector: "fork:",
  599. fn: function (aBlock){
  600. var self=this;
  601. return smalltalk.withContext(function($ctx1) {
  602. var $1;
  603. $1=_st(self["@poolSize"]).__lt(self._maxPoolSize());
  604. if(smalltalk.assert($1)){
  605. self._addWorker();
  606. };
  607. _st(self["@queue"])._nextPut_(aBlock);
  608. return self}, function($ctx1) {$ctx1.fill(self,"fork:",{aBlock:aBlock},smalltalk.ForkPool)})},
  609. messageSends: ["ifTrue:", "<", "maxPoolSize", "addWorker", "nextPut:"]}),
  610. smalltalk.ForkPool);
  611. smalltalk.addMethod(
  612. smalltalk.method({
  613. selector: "initialize",
  614. fn: function (){
  615. var self=this;
  616. function $Queue(){return smalltalk.Queue||(typeof Queue=="undefined"?nil:Queue)}
  617. return smalltalk.withContext(function($ctx1) {
  618. smalltalk.ForkPool.superclass.fn.prototype._initialize.apply(_st(self), []);
  619. self["@poolSize"]=(0);
  620. self["@queue"]=_st($Queue())._new();
  621. self["@worker"]=self._makeWorker();
  622. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ForkPool)})},
  623. messageSends: ["initialize", "new", "makeWorker"]}),
  624. smalltalk.ForkPool);
  625. smalltalk.addMethod(
  626. smalltalk.method({
  627. selector: "makeWorker",
  628. fn: function (){
  629. var self=this;
  630. var sentinel;
  631. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  632. return smalltalk.withContext(function($ctx1) {
  633. var $2,$1;
  634. sentinel=_st($Object())._new();
  635. $1=(function(){
  636. var block;
  637. return smalltalk.withContext(function($ctx2) {
  638. self["@poolSize"]=_st(self["@poolSize"]).__minus((1));
  639. self["@poolSize"];
  640. block=_st(self["@queue"])._nextIfAbsent_((function(){
  641. return smalltalk.withContext(function($ctx3) {
  642. return sentinel;
  643. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  644. block;
  645. $2=_st(block).__eq_eq(sentinel);
  646. if(! smalltalk.assert($2)){
  647. return _st((function(){
  648. return smalltalk.withContext(function($ctx3) {
  649. return _st(block)._value();
  650. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}))._ensure_((function(){
  651. return smalltalk.withContext(function($ctx3) {
  652. return self._addWorker();
  653. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
  654. };
  655. }, function($ctx2) {$ctx2.fillBlock({block:block},$ctx1,1)})});
  656. return $1;
  657. }, function($ctx1) {$ctx1.fill(self,"makeWorker",{sentinel:sentinel},smalltalk.ForkPool)})},
  658. messageSends: ["new", "-", "nextIfAbsent:", "ifFalse:", "==", "ensure:", "value", "addWorker"]}),
  659. smalltalk.ForkPool);
  660. smalltalk.addMethod(
  661. smalltalk.method({
  662. selector: "maxPoolSize",
  663. fn: function (){
  664. var self=this;
  665. return smalltalk.withContext(function($ctx1) {
  666. var $2,$1;
  667. $2=self["@maxPoolSize"];
  668. if(($receiver = $2) == nil || $receiver == undefined){
  669. $1=self._defaultMaxPoolSize();
  670. } else {
  671. $1=$2;
  672. };
  673. return $1;
  674. }, function($ctx1) {$ctx1.fill(self,"maxPoolSize",{},smalltalk.ForkPool)})},
  675. messageSends: ["ifNil:", "defaultMaxPoolSize"]}),
  676. smalltalk.ForkPool);
  677. smalltalk.addMethod(
  678. smalltalk.method({
  679. selector: "maxPoolSize:",
  680. fn: function (anInteger){
  681. var self=this;
  682. return smalltalk.withContext(function($ctx1) {
  683. self["@maxPoolSize"]=anInteger;
  684. return self}, function($ctx1) {$ctx1.fill(self,"maxPoolSize:",{anInteger:anInteger},smalltalk.ForkPool)})},
  685. messageSends: []}),
  686. smalltalk.ForkPool);
  687. smalltalk.ForkPool.klass.iVarNames = ['default'];
  688. smalltalk.addMethod(
  689. smalltalk.method({
  690. selector: "default",
  691. fn: function (){
  692. var self=this;
  693. return smalltalk.withContext(function($ctx1) {
  694. var $2,$1;
  695. $2=self["@default"];
  696. if(($receiver = $2) == nil || $receiver == undefined){
  697. self["@default"]=self._new();
  698. $1=self["@default"];
  699. } else {
  700. $1=$2;
  701. };
  702. return $1;
  703. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.ForkPool.klass)})},
  704. messageSends: ["ifNil:", "new"]}),
  705. smalltalk.ForkPool.klass);
  706. smalltalk.addMethod(
  707. smalltalk.method({
  708. selector: "defaultMaxPoolSize",
  709. fn: function (){
  710. var self=this;
  711. return smalltalk.withContext(function($ctx1) {
  712. return (100);
  713. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool.klass)})},
  714. messageSends: []}),
  715. smalltalk.ForkPool.klass);
  716. smalltalk.addMethod(
  717. smalltalk.method({
  718. selector: "resetDefault",
  719. fn: function (){
  720. var self=this;
  721. return smalltalk.withContext(function($ctx1) {
  722. self["@default"]=nil;
  723. return self}, function($ctx1) {$ctx1.fill(self,"resetDefault",{},smalltalk.ForkPool.klass)})},
  724. messageSends: []}),
  725. smalltalk.ForkPool.klass);
  726. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  727. smalltalk.addMethod(
  728. smalltalk.method({
  729. selector: "arguments",
  730. fn: function (){
  731. var self=this;
  732. return smalltalk.withContext(function($ctx1) {
  733. var $1;
  734. $1=self["@arguments"];
  735. return $1;
  736. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.Message)})},
  737. messageSends: []}),
  738. smalltalk.Message);
  739. smalltalk.addMethod(
  740. smalltalk.method({
  741. selector: "arguments:",
  742. fn: function (anArray){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) {
  745. self["@arguments"]=anArray;
  746. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{anArray:anArray},smalltalk.Message)})},
  747. messageSends: []}),
  748. smalltalk.Message);
  749. smalltalk.addMethod(
  750. smalltalk.method({
  751. selector: "printOn:",
  752. fn: function (aStream){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. var $1,$2;
  756. smalltalk.Message.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  757. $1=aStream;
  758. _st($1)._nextPutAll_("(");
  759. _st($1)._nextPutAll_(self._selector());
  760. $2=_st($1)._nextPutAll_(")");
  761. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Message)})},
  762. messageSends: ["printOn:", "nextPutAll:", "selector"]}),
  763. smalltalk.Message);
  764. smalltalk.addMethod(
  765. smalltalk.method({
  766. selector: "selector",
  767. fn: function (){
  768. var self=this;
  769. return smalltalk.withContext(function($ctx1) {
  770. var $1;
  771. $1=self["@selector"];
  772. return $1;
  773. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.Message)})},
  774. messageSends: []}),
  775. smalltalk.Message);
  776. smalltalk.addMethod(
  777. smalltalk.method({
  778. selector: "selector:",
  779. fn: function (aString){
  780. var self=this;
  781. return smalltalk.withContext(function($ctx1) {
  782. self["@selector"]=aString;
  783. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.Message)})},
  784. messageSends: []}),
  785. smalltalk.Message);
  786. smalltalk.addMethod(
  787. smalltalk.method({
  788. selector: "sendTo:",
  789. fn: function (anObject){
  790. var self=this;
  791. return smalltalk.withContext(function($ctx1) {
  792. var $1;
  793. $1=_st(anObject)._perform_withArguments_(self._selector(),self._arguments());
  794. return $1;
  795. }, function($ctx1) {$ctx1.fill(self,"sendTo:",{anObject:anObject},smalltalk.Message)})},
  796. messageSends: ["perform:withArguments:", "selector", "arguments"]}),
  797. smalltalk.Message);
  798. smalltalk.addMethod(
  799. smalltalk.method({
  800. selector: "selector:arguments:",
  801. fn: function (aString,anArray){
  802. var self=this;
  803. return smalltalk.withContext(function($ctx1) {
  804. var $2,$3,$1;
  805. $2=self._new();
  806. _st($2)._selector_(aString);
  807. _st($2)._arguments_(anArray);
  808. $3=_st($2)._yourself();
  809. $1=$3;
  810. return $1;
  811. }, function($ctx1) {$ctx1.fill(self,"selector:arguments:",{aString:aString,anArray:anArray},smalltalk.Message.klass)})},
  812. messageSends: ["selector:", "new", "arguments:", "yourself"]}),
  813. smalltalk.Message.klass);
  814. smalltalk.addClass('MessageSend', smalltalk.Object, ['receiver', 'message'], 'Kernel-Methods');
  815. smalltalk.addMethod(
  816. smalltalk.method({
  817. selector: "arguments",
  818. fn: function (){
  819. var self=this;
  820. return smalltalk.withContext(function($ctx1) {
  821. var $1;
  822. $1=_st(self["@message"])._arguments();
  823. return $1;
  824. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.MessageSend)})},
  825. messageSends: ["arguments"]}),
  826. smalltalk.MessageSend);
  827. smalltalk.addMethod(
  828. smalltalk.method({
  829. selector: "arguments:",
  830. fn: function (aCollection){
  831. var self=this;
  832. return smalltalk.withContext(function($ctx1) {
  833. _st(self["@message"])._arguments_(aCollection);
  834. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.MessageSend)})},
  835. messageSends: ["arguments:"]}),
  836. smalltalk.MessageSend);
  837. smalltalk.addMethod(
  838. smalltalk.method({
  839. selector: "initialize",
  840. fn: function (){
  841. var self=this;
  842. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  843. return smalltalk.withContext(function($ctx1) {
  844. smalltalk.MessageSend.superclass.fn.prototype._initialize.apply(_st(self), []);
  845. self["@message"]=_st($Message())._new();
  846. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.MessageSend)})},
  847. messageSends: ["initialize", "new"]}),
  848. smalltalk.MessageSend);
  849. smalltalk.addMethod(
  850. smalltalk.method({
  851. selector: "printOn:",
  852. fn: function (aStream){
  853. var self=this;
  854. return smalltalk.withContext(function($ctx1) {
  855. var $1,$2;
  856. smalltalk.MessageSend.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  857. $1=aStream;
  858. _st($1)._nextPutAll_("(");
  859. _st($1)._nextPutAll_(self._receiver());
  860. _st($1)._nextPutAll_(" >> ");
  861. _st($1)._nextPutAll_(self._selector());
  862. $2=_st($1)._nextPutAll_(")");
  863. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.MessageSend)})},
  864. messageSends: ["printOn:", "nextPutAll:", "receiver", "selector"]}),
  865. smalltalk.MessageSend);
  866. smalltalk.addMethod(
  867. smalltalk.method({
  868. selector: "receiver",
  869. fn: function (){
  870. var self=this;
  871. return smalltalk.withContext(function($ctx1) {
  872. var $1;
  873. $1=self["@receiver"];
  874. return $1;
  875. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MessageSend)})},
  876. messageSends: []}),
  877. smalltalk.MessageSend);
  878. smalltalk.addMethod(
  879. smalltalk.method({
  880. selector: "receiver:",
  881. fn: function (anObject){
  882. var self=this;
  883. return smalltalk.withContext(function($ctx1) {
  884. self["@receiver"]=anObject;
  885. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.MessageSend)})},
  886. messageSends: []}),
  887. smalltalk.MessageSend);
  888. smalltalk.addMethod(
  889. smalltalk.method({
  890. selector: "selector",
  891. fn: function (){
  892. var self=this;
  893. return smalltalk.withContext(function($ctx1) {
  894. var $1;
  895. $1=_st(self["@message"])._selector();
  896. return $1;
  897. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MessageSend)})},
  898. messageSends: ["selector"]}),
  899. smalltalk.MessageSend);
  900. smalltalk.addMethod(
  901. smalltalk.method({
  902. selector: "selector:",
  903. fn: function (aString){
  904. var self=this;
  905. return smalltalk.withContext(function($ctx1) {
  906. _st(self["@message"])._selector_(aString);
  907. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.MessageSend)})},
  908. messageSends: ["selector:"]}),
  909. smalltalk.MessageSend);
  910. smalltalk.addMethod(
  911. smalltalk.method({
  912. selector: "value",
  913. fn: function (){
  914. var self=this;
  915. return smalltalk.withContext(function($ctx1) {
  916. var $1;
  917. $1=_st(self["@message"])._sendTo_(self._receiver());
  918. return $1;
  919. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.MessageSend)})},
  920. messageSends: ["sendTo:", "receiver"]}),
  921. smalltalk.MessageSend);
  922. smalltalk.addMethod(
  923. smalltalk.method({
  924. selector: "value:",
  925. fn: function (anObject){
  926. var self=this;
  927. return smalltalk.withContext(function($ctx1) {
  928. var $2,$3,$1;
  929. $2=self["@message"];
  930. _st($2)._arguments_([anObject]);
  931. $3=_st($2)._sendTo_(self._receiver());
  932. $1=$3;
  933. return $1;
  934. }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},smalltalk.MessageSend)})},
  935. messageSends: ["arguments:", "sendTo:", "receiver"]}),
  936. smalltalk.MessageSend);
  937. smalltalk.addMethod(
  938. smalltalk.method({
  939. selector: "value:value:",
  940. fn: function (firstArgument,secondArgument){
  941. var self=this;
  942. return smalltalk.withContext(function($ctx1) {
  943. var $2,$3,$1;
  944. $2=self["@message"];
  945. _st($2)._arguments_([firstArgument,secondArgument]);
  946. $3=_st($2)._sendTo_(self._receiver());
  947. $1=$3;
  948. return $1;
  949. }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument},smalltalk.MessageSend)})},
  950. messageSends: ["arguments:", "sendTo:", "receiver"]}),
  951. smalltalk.MessageSend);
  952. smalltalk.addMethod(
  953. smalltalk.method({
  954. selector: "value:value:value:",
  955. fn: function (firstArgument,secondArgument,thirdArgument){
  956. var self=this;
  957. return smalltalk.withContext(function($ctx1) {
  958. var $2,$3,$1;
  959. $2=self["@message"];
  960. _st($2)._arguments_([firstArgument,secondArgument,thirdArgument]);
  961. $3=_st($2)._sendTo_(self._receiver());
  962. $1=$3;
  963. return $1;
  964. }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument},smalltalk.MessageSend)})},
  965. messageSends: ["arguments:", "sendTo:", "receiver"]}),
  966. smalltalk.MessageSend);
  967. smalltalk.addMethod(
  968. smalltalk.method({
  969. selector: "valueWithPossibleArguments:",
  970. fn: function (aCollection){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) {
  973. var $1;
  974. self._arguments_(aCollection);
  975. $1=self._value();
  976. return $1;
  977. }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection},smalltalk.MessageSend)})},
  978. messageSends: ["arguments:", "value"]}),
  979. smalltalk.MessageSend);
  980. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  981. smalltalk.addMethod(
  982. smalltalk.method({
  983. selector: "asString",
  984. fn: function (){
  985. var self=this;
  986. return smalltalk.withContext(function($ctx1) {
  987. var $2,$1;
  988. $2=self._isBlockContext();
  989. if(smalltalk.assert($2)){
  990. $1=_st("a block (in ".__comma(_st(self._methodContext())._asString())).__comma(")");
  991. } else {
  992. $1=_st(_st(_st(_st(self._receiver())._class())._name()).__comma(" >> ")).__comma(self._selector());
  993. };
  994. return $1;
  995. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.MethodContext)})},
  996. messageSends: ["ifTrue:ifFalse:", "isBlockContext", ",", "asString", "methodContext", "name", "class", "receiver", "selector"]}),
  997. smalltalk.MethodContext);
  998. smalltalk.addMethod(
  999. smalltalk.method({
  1000. selector: "home",
  1001. fn: function (){
  1002. var self=this;
  1003. return smalltalk.withContext(function($ctx1) {
  1004. return self.homeContext;
  1005. return self}, function($ctx1) {$ctx1.fill(self,"home",{},smalltalk.MethodContext)})},
  1006. messageSends: []}),
  1007. smalltalk.MethodContext);
  1008. smalltalk.addMethod(
  1009. smalltalk.method({
  1010. selector: "index",
  1011. fn: function (){
  1012. var self=this;
  1013. return smalltalk.withContext(function($ctx1) {
  1014. return self.index || 0;
  1015. return self}, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.MethodContext)})},
  1016. messageSends: []}),
  1017. smalltalk.MethodContext);
  1018. smalltalk.addMethod(
  1019. smalltalk.method({
  1020. selector: "isBlockContext",
  1021. fn: function (){
  1022. var self=this;
  1023. return smalltalk.withContext(function($ctx1) {
  1024. var $1;
  1025. $1=_st(self._selector())._isNil();
  1026. return $1;
  1027. }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},smalltalk.MethodContext)})},
  1028. messageSends: ["isNil", "selector"]}),
  1029. smalltalk.MethodContext);
  1030. smalltalk.addMethod(
  1031. smalltalk.method({
  1032. selector: "locals",
  1033. fn: function (){
  1034. var self=this;
  1035. return smalltalk.withContext(function($ctx1) {
  1036. return self.locals || {};
  1037. return self}, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.MethodContext)})},
  1038. messageSends: []}),
  1039. smalltalk.MethodContext);
  1040. smalltalk.addMethod(
  1041. smalltalk.method({
  1042. selector: "method",
  1043. fn: function (){
  1044. var self=this;
  1045. return smalltalk.withContext(function($ctx1) {
  1046. var $2,$1;
  1047. $2=self._methodContext();
  1048. if(($receiver = $2) == nil || $receiver == undefined){
  1049. $1=$2;
  1050. } else {
  1051. $1=_st(_st(_st(self._methodContext())._receiver())._class())._lookupSelector_(_st(self._methodContext())._selector());
  1052. };
  1053. return $1;
  1054. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodContext)})},
  1055. messageSends: ["ifNotNil:", "methodContext", "lookupSelector:", "class", "receiver", "selector"]}),
  1056. smalltalk.MethodContext);
  1057. smalltalk.addMethod(
  1058. smalltalk.method({
  1059. selector: "methodContext",
  1060. fn: function (){
  1061. var self=this;
  1062. return smalltalk.withContext(function($ctx1) {
  1063. var $1,$2,$4,$3;
  1064. $1=self._isBlockContext();
  1065. if(! smalltalk.assert($1)){
  1066. $2=self;
  1067. return $2;
  1068. };
  1069. $4=self._outerContext();
  1070. if(($receiver = $4) == nil || $receiver == undefined){
  1071. $3=$4;
  1072. } else {
  1073. var outer;
  1074. outer=$receiver;
  1075. $3=_st(outer)._methodContext();
  1076. };
  1077. return $3;
  1078. }, function($ctx1) {$ctx1.fill(self,"methodContext",{},smalltalk.MethodContext)})},
  1079. messageSends: ["ifFalse:", "isBlockContext", "ifNotNil:", "outerContext", "methodContext"]}),
  1080. smalltalk.MethodContext);
  1081. smalltalk.addMethod(
  1082. smalltalk.method({
  1083. selector: "outerContext",
  1084. fn: function (){
  1085. var self=this;
  1086. return smalltalk.withContext(function($ctx1) {
  1087. return self.outerContext || self.homeContext;
  1088. return self}, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.MethodContext)})},
  1089. messageSends: []}),
  1090. smalltalk.MethodContext);
  1091. smalltalk.addMethod(
  1092. smalltalk.method({
  1093. selector: "pc",
  1094. fn: function (){
  1095. var self=this;
  1096. return smalltalk.withContext(function($ctx1) {
  1097. return self.pc;
  1098. return self}, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.MethodContext)})},
  1099. messageSends: []}),
  1100. smalltalk.MethodContext);
  1101. smalltalk.addMethod(
  1102. smalltalk.method({
  1103. selector: "printOn:",
  1104. fn: function (aStream){
  1105. var self=this;
  1106. return smalltalk.withContext(function($ctx1) {
  1107. var $1,$2;
  1108. smalltalk.MethodContext.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  1109. $1=aStream;
  1110. _st($1)._nextPutAll_("(");
  1111. _st($1)._nextPutAll_(self._asString());
  1112. $2=_st($1)._nextPutAll_(")");
  1113. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.MethodContext)})},
  1114. messageSends: ["printOn:", "nextPutAll:", "asString"]}),
  1115. smalltalk.MethodContext);
  1116. smalltalk.addMethod(
  1117. smalltalk.method({
  1118. selector: "receiver",
  1119. fn: function (){
  1120. var self=this;
  1121. return smalltalk.withContext(function($ctx1) {
  1122. return self.receiver;
  1123. return self}, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MethodContext)})},
  1124. messageSends: []}),
  1125. smalltalk.MethodContext);
  1126. smalltalk.addMethod(
  1127. smalltalk.method({
  1128. selector: "selector",
  1129. fn: function (){
  1130. var self=this;
  1131. return smalltalk.withContext(function($ctx1) {
  1132. if(self.selector) {
  1133. return smalltalk.convertSelector(self.selector);
  1134. } else {
  1135. return nil;
  1136. }
  1137. ;
  1138. return self}, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MethodContext)})},
  1139. messageSends: []}),
  1140. smalltalk.MethodContext);
  1141. smalltalk.addMethod(
  1142. smalltalk.method({
  1143. selector: "temps",
  1144. fn: function (){
  1145. var self=this;
  1146. return smalltalk.withContext(function($ctx1) {
  1147. var $1;
  1148. self._deprecatedAPI();
  1149. $1=self._locals();
  1150. return $1;
  1151. }, function($ctx1) {$ctx1.fill(self,"temps",{},smalltalk.MethodContext)})},
  1152. messageSends: ["deprecatedAPI", "locals"]}),
  1153. smalltalk.MethodContext);
  1154. smalltalk.addClass('NativeFunction', smalltalk.Object, [], 'Kernel-Methods');
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "constructor:",
  1158. fn: function (aString){
  1159. var self=this;
  1160. return smalltalk.withContext(function($ctx1) {
  1161. var native=eval(aString);
  1162. return new native();
  1163. ;
  1164. return self}, function($ctx1) {$ctx1.fill(self,"constructor:",{aString:aString},smalltalk.NativeFunction.klass)})},
  1165. messageSends: []}),
  1166. smalltalk.NativeFunction.klass);
  1167. smalltalk.addMethod(
  1168. smalltalk.method({
  1169. selector: "constructor:value:",
  1170. fn: function (aString,anObject){
  1171. var self=this;
  1172. return smalltalk.withContext(function($ctx1) {
  1173. var native=eval(aString);
  1174. return new native(anObject);
  1175. ;
  1176. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:",{aString:aString,anObject:anObject},smalltalk.NativeFunction.klass)})},
  1177. messageSends: []}),
  1178. smalltalk.NativeFunction.klass);
  1179. smalltalk.addMethod(
  1180. smalltalk.method({
  1181. selector: "constructor:value:value:",
  1182. fn: function (aString,anObject,anObject2){
  1183. var self=this;
  1184. return smalltalk.withContext(function($ctx1) {
  1185. var native=eval(aString);
  1186. return new native(anObject,anObject2);
  1187. ;
  1188. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2},smalltalk.NativeFunction.klass)})},
  1189. messageSends: []}),
  1190. smalltalk.NativeFunction.klass);
  1191. smalltalk.addMethod(
  1192. smalltalk.method({
  1193. selector: "constructor:value:value:value:",
  1194. fn: function (aString,anObject,anObject2,anObject3){
  1195. var self=this;
  1196. return smalltalk.withContext(function($ctx1) {
  1197. var native=eval(aString);
  1198. return new native(anObject,anObject2, anObject3);
  1199. ;
  1200. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.NativeFunction.klass)})},
  1201. messageSends: []}),
  1202. smalltalk.NativeFunction.klass);
  1203. smalltalk.addMethod(
  1204. smalltalk.method({
  1205. selector: "exists:",
  1206. fn: function (aString){
  1207. var self=this;
  1208. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1209. return smalltalk.withContext(function($ctx1) {
  1210. var $1;
  1211. $1=_st($PlatformInterface())._existsGlobal_(aString);
  1212. return $1;
  1213. }, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString},smalltalk.NativeFunction.klass)})},
  1214. messageSends: ["existsGlobal:"]}),
  1215. smalltalk.NativeFunction.klass);
  1216. smalltalk.addClass('Timeout', smalltalk.Object, ['rawTimeout'], 'Kernel-Methods');
  1217. smalltalk.addMethod(
  1218. smalltalk.method({
  1219. selector: "clearInterval",
  1220. fn: function (){
  1221. var self=this;
  1222. return smalltalk.withContext(function($ctx1) {
  1223. var interval = self["@rawTimeout"];
  1224. clearInterval(interval);
  1225. ;
  1226. return self}, function($ctx1) {$ctx1.fill(self,"clearInterval",{},smalltalk.Timeout)})},
  1227. messageSends: []}),
  1228. smalltalk.Timeout);
  1229. smalltalk.addMethod(
  1230. smalltalk.method({
  1231. selector: "clearTimeout",
  1232. fn: function (){
  1233. var self=this;
  1234. return smalltalk.withContext(function($ctx1) {
  1235. var timeout = self["@rawTimeout"];
  1236. clearTimeout(timeout);
  1237. ;
  1238. return self}, function($ctx1) {$ctx1.fill(self,"clearTimeout",{},smalltalk.Timeout)})},
  1239. messageSends: []}),
  1240. smalltalk.Timeout);
  1241. smalltalk.addMethod(
  1242. smalltalk.method({
  1243. selector: "rawTimeout:",
  1244. fn: function (anObject){
  1245. var self=this;
  1246. return smalltalk.withContext(function($ctx1) {
  1247. self["@rawTimeout"]=anObject;
  1248. return self}, function($ctx1) {$ctx1.fill(self,"rawTimeout:",{anObject:anObject},smalltalk.Timeout)})},
  1249. messageSends: []}),
  1250. smalltalk.Timeout);
  1251. smalltalk.addMethod(
  1252. smalltalk.method({
  1253. selector: "on:",
  1254. fn: function (anObject){
  1255. var self=this;
  1256. return smalltalk.withContext(function($ctx1) {
  1257. var $2,$3,$1;
  1258. $2=self._new();
  1259. _st($2)._rawTimeout_(anObject);
  1260. $3=_st($2)._yourself();
  1261. $1=$3;
  1262. return $1;
  1263. }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Timeout.klass)})},
  1264. messageSends: ["rawTimeout:", "new", "yourself"]}),
  1265. smalltalk.Timeout.klass);
  1266. })(global_smalltalk,global_nil,global__st);