2
0

Kernel-Methods.deploy.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366
  1. define("amber/Kernel-Methods", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber/Kernel-Objects"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Kernel-Methods');
  3. smalltalk.packages["Kernel-Methods"].transport = {"type":"amd","amdNamespace":"amber"};
  4. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "applyTo:arguments:",
  8. fn: function (anObject,aCollection){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. return self.apply(anObject, aCollection);
  12. return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},smalltalk.BlockClosure)})},
  13. messageSends: []}),
  14. smalltalk.BlockClosure);
  15. smalltalk.addMethod(
  16. smalltalk.method({
  17. selector: "asCompiledMethod:",
  18. fn: function (aString){
  19. var self=this;
  20. return smalltalk.withContext(function($ctx1) {
  21. return smalltalk.method({selector:aString, fn:self});;
  22. return self}, function($ctx1) {$ctx1.fill(self,"asCompiledMethod:",{aString:aString},smalltalk.BlockClosure)})},
  23. messageSends: []}),
  24. smalltalk.BlockClosure);
  25. smalltalk.addMethod(
  26. smalltalk.method({
  27. selector: "compiledSource",
  28. fn: function (){
  29. var self=this;
  30. return smalltalk.withContext(function($ctx1) {
  31. return self.toString();
  32. return self}, function($ctx1) {$ctx1.fill(self,"compiledSource",{},smalltalk.BlockClosure)})},
  33. messageSends: []}),
  34. smalltalk.BlockClosure);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "currySelf",
  38. fn: function (){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) {
  41. return function () {
  42. var args = [ this ];
  43. args.push.apply(args, arguments);
  44. return self.apply(null, args);
  45. }
  46. ;
  47. return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{},smalltalk.BlockClosure)})},
  48. messageSends: []}),
  49. smalltalk.BlockClosure);
  50. smalltalk.addMethod(
  51. smalltalk.method({
  52. selector: "ensure:",
  53. fn: function (aBlock){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) {
  56. try{return self._value()}finally{aBlock._value()};
  57. return self}, function($ctx1) {$ctx1.fill(self,"ensure:",{aBlock:aBlock},smalltalk.BlockClosure)})},
  58. messageSends: []}),
  59. smalltalk.BlockClosure);
  60. smalltalk.addMethod(
  61. smalltalk.method({
  62. selector: "fork",
  63. fn: function (){
  64. var self=this;
  65. function $ForkPool(){return smalltalk.ForkPool||(typeof ForkPool=="undefined"?nil:ForkPool)}
  66. return smalltalk.withContext(function($ctx1) {
  67. _st(_st($ForkPool())._default())._fork_(self);
  68. return self}, function($ctx1) {$ctx1.fill(self,"fork",{},smalltalk.BlockClosure)})},
  69. messageSends: ["fork:", "default"]}),
  70. smalltalk.BlockClosure);
  71. smalltalk.addMethod(
  72. smalltalk.method({
  73. selector: "new",
  74. fn: function (){
  75. var self=this;
  76. return smalltalk.withContext(function($ctx1) {
  77. return new self();
  78. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.BlockClosure)})},
  79. messageSends: []}),
  80. smalltalk.BlockClosure);
  81. smalltalk.addMethod(
  82. smalltalk.method({
  83. selector: "newValue:",
  84. fn: function (anObject){
  85. var self=this;
  86. return smalltalk.withContext(function($ctx1) {
  87. var $1;
  88. $1=self._newWithValues_([anObject]);
  89. return $1;
  90. }, function($ctx1) {$ctx1.fill(self,"newValue:",{anObject:anObject},smalltalk.BlockClosure)})},
  91. messageSends: ["newWithValues:"]}),
  92. smalltalk.BlockClosure);
  93. smalltalk.addMethod(
  94. smalltalk.method({
  95. selector: "newValue:value:",
  96. fn: function (anObject,anObject2){
  97. var self=this;
  98. return smalltalk.withContext(function($ctx1) {
  99. var $1;
  100. $1=self._newWithValues_([anObject,anObject2]);
  101. return $1;
  102. }, function($ctx1) {$ctx1.fill(self,"newValue:value:",{anObject:anObject,anObject2:anObject2},smalltalk.BlockClosure)})},
  103. messageSends: ["newWithValues:"]}),
  104. smalltalk.BlockClosure);
  105. smalltalk.addMethod(
  106. smalltalk.method({
  107. selector: "newValue:value:value:",
  108. fn: function (anObject,anObject2,anObject3){
  109. var self=this;
  110. return smalltalk.withContext(function($ctx1) {
  111. var $1;
  112. $1=self._newWithValues_([anObject,anObject2,anObject3]);
  113. return $1;
  114. }, function($ctx1) {$ctx1.fill(self,"newValue:value:value:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.BlockClosure)})},
  115. messageSends: ["newWithValues:"]}),
  116. smalltalk.BlockClosure);
  117. smalltalk.addMethod(
  118. smalltalk.method({
  119. selector: "newWithValues:",
  120. fn: function (aCollection){
  121. var self=this;
  122. return smalltalk.withContext(function($ctx1) {
  123. var constructor = function() {};
  124. constructor.prototype = self.prototype;
  125. var object = new constructor;
  126. var result = self.apply(object, aCollection);
  127. return typeof result === "object" ? result : object;;
  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)})}));
  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:", "value:", "resignal", "isKindOf:"]}),
  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)})}));
  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)})}));
  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:", "defaultCategory", "basicAt:"]}),
  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 $MethodMoved(){return smalltalk.MethodMoved||(typeof MethodMoved=="undefined"?nil:MethodMoved)}
  341. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  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)})})))._ifEmpty_((function(){
  360. return smalltalk.withContext(function($ctx2) {
  361. return _st(_st(self._methodClass())._organization())._removeElement_(oldProtocol);
  362. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  363. };
  364. return self}, function($ctx1) {$ctx1.fill(self,"category:",{aString:aString,oldProtocol:oldProtocol},smalltalk.CompiledMethod)})},
  365. messageSends: ["protocol", "basicAt:put:", "announce:", "method:", "new", "oldProtocol:", "yourself", "current", "ifNotNil:", "addElement:", "organization", "methodClass", "ifEmpty:", "removeElement:", "select:", "=", "methods"]}),
  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)})}));
  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:", "ifTrue:", "includesSelector:", "methodClass"]}),
  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: "source",
  536. fn: function (){
  537. var self=this;
  538. return smalltalk.withContext(function($ctx1) {
  539. var $2,$1;
  540. $2=self._basicAt_("source");
  541. if(($receiver = $2) == nil || $receiver == undefined){
  542. $1="";
  543. } else {
  544. $1=$2;
  545. };
  546. return $1;
  547. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.CompiledMethod)})},
  548. messageSends: ["ifNil:", "basicAt:"]}),
  549. smalltalk.CompiledMethod);
  550. smalltalk.addMethod(
  551. smalltalk.method({
  552. selector: "source:",
  553. fn: function (aString){
  554. var self=this;
  555. return smalltalk.withContext(function($ctx1) {
  556. self._basicAt_put_("source",aString);
  557. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.CompiledMethod)})},
  558. messageSends: ["basicAt:put:"]}),
  559. smalltalk.CompiledMethod);
  560. smalltalk.addClass('ForkPool', smalltalk.Object, ['poolSize', 'maxPoolSize', 'queue', 'worker'], 'Kernel-Methods');
  561. smalltalk.addMethod(
  562. smalltalk.method({
  563. selector: "addWorker",
  564. fn: function (){
  565. var self=this;
  566. return smalltalk.withContext(function($ctx1) {
  567. _st(self["@worker"])._valueWithTimeout_((0));
  568. self["@poolSize"]=_st(self["@poolSize"]).__plus((1));
  569. return self}, function($ctx1) {$ctx1.fill(self,"addWorker",{},smalltalk.ForkPool)})},
  570. messageSends: ["valueWithTimeout:", "+"]}),
  571. smalltalk.ForkPool);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "defaultMaxPoolSize",
  575. fn: function (){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) {
  578. var $1;
  579. $1=_st(self._class())._defaultMaxPoolSize();
  580. return $1;
  581. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool)})},
  582. messageSends: ["defaultMaxPoolSize", "class"]}),
  583. smalltalk.ForkPool);
  584. smalltalk.addMethod(
  585. smalltalk.method({
  586. selector: "fork:",
  587. fn: function (aBlock){
  588. var self=this;
  589. return smalltalk.withContext(function($ctx1) {
  590. var $1;
  591. $1=_st(self["@poolSize"]).__lt(self._maxPoolSize());
  592. if(smalltalk.assert($1)){
  593. self._addWorker();
  594. };
  595. _st(self["@queue"])._nextPut_(aBlock);
  596. return self}, function($ctx1) {$ctx1.fill(self,"fork:",{aBlock:aBlock},smalltalk.ForkPool)})},
  597. messageSends: ["ifTrue:", "addWorker", "<", "maxPoolSize", "nextPut:"]}),
  598. smalltalk.ForkPool);
  599. smalltalk.addMethod(
  600. smalltalk.method({
  601. selector: "initialize",
  602. fn: function (){
  603. var self=this;
  604. function $Queue(){return smalltalk.Queue||(typeof Queue=="undefined"?nil:Queue)}
  605. return smalltalk.withContext(function($ctx1) {
  606. smalltalk.ForkPool.superclass.fn.prototype._initialize.apply(_st(self), []);
  607. self["@poolSize"]=(0);
  608. self["@queue"]=_st($Queue())._new();
  609. self["@worker"]=self._makeWorker();
  610. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ForkPool)})},
  611. messageSends: ["initialize", "new", "makeWorker"]}),
  612. smalltalk.ForkPool);
  613. smalltalk.addMethod(
  614. smalltalk.method({
  615. selector: "makeWorker",
  616. fn: function (){
  617. var self=this;
  618. var sentinel;
  619. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  620. return smalltalk.withContext(function($ctx1) {
  621. var $2,$1;
  622. sentinel=_st($Object())._new();
  623. $1=(function(){
  624. var block;
  625. return smalltalk.withContext(function($ctx2) {
  626. self["@poolSize"]=_st(self["@poolSize"]).__minus((1));
  627. self["@poolSize"];
  628. block=_st(self["@queue"])._nextIfAbsent_((function(){
  629. return smalltalk.withContext(function($ctx3) {
  630. return sentinel;
  631. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  632. block;
  633. $2=_st(block).__eq_eq(sentinel);
  634. if(! smalltalk.assert($2)){
  635. return _st((function(){
  636. return smalltalk.withContext(function($ctx3) {
  637. return _st(block)._value();
  638. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._ensure_((function(){
  639. return smalltalk.withContext(function($ctx3) {
  640. return self._addWorker();
  641. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  642. };
  643. }, function($ctx2) {$ctx2.fillBlock({block:block},$ctx1)})});
  644. return $1;
  645. }, function($ctx1) {$ctx1.fill(self,"makeWorker",{sentinel:sentinel},smalltalk.ForkPool)})},
  646. messageSends: ["new", "-", "nextIfAbsent:", "ifFalse:", "ensure:", "addWorker", "value", "=="]}),
  647. smalltalk.ForkPool);
  648. smalltalk.addMethod(
  649. smalltalk.method({
  650. selector: "maxPoolSize",
  651. fn: function (){
  652. var self=this;
  653. return smalltalk.withContext(function($ctx1) {
  654. var $2,$1;
  655. $2=self["@maxPoolSize"];
  656. if(($receiver = $2) == nil || $receiver == undefined){
  657. $1=self._defaultMaxPoolSize();
  658. } else {
  659. $1=$2;
  660. };
  661. return $1;
  662. }, function($ctx1) {$ctx1.fill(self,"maxPoolSize",{},smalltalk.ForkPool)})},
  663. messageSends: ["ifNil:", "defaultMaxPoolSize"]}),
  664. smalltalk.ForkPool);
  665. smalltalk.addMethod(
  666. smalltalk.method({
  667. selector: "maxPoolSize:",
  668. fn: function (anInteger){
  669. var self=this;
  670. return smalltalk.withContext(function($ctx1) {
  671. self["@maxPoolSize"]=anInteger;
  672. return self}, function($ctx1) {$ctx1.fill(self,"maxPoolSize:",{anInteger:anInteger},smalltalk.ForkPool)})},
  673. messageSends: []}),
  674. smalltalk.ForkPool);
  675. smalltalk.ForkPool.klass.iVarNames = ['default'];
  676. smalltalk.addMethod(
  677. smalltalk.method({
  678. selector: "default",
  679. fn: function (){
  680. var self=this;
  681. return smalltalk.withContext(function($ctx1) {
  682. var $2,$1;
  683. $2=self["@default"];
  684. if(($receiver = $2) == nil || $receiver == undefined){
  685. self["@default"]=self._new();
  686. $1=self["@default"];
  687. } else {
  688. $1=$2;
  689. };
  690. return $1;
  691. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.ForkPool.klass)})},
  692. messageSends: ["ifNil:", "new"]}),
  693. smalltalk.ForkPool.klass);
  694. smalltalk.addMethod(
  695. smalltalk.method({
  696. selector: "defaultMaxPoolSize",
  697. fn: function (){
  698. var self=this;
  699. return smalltalk.withContext(function($ctx1) {
  700. return (100);
  701. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool.klass)})},
  702. messageSends: []}),
  703. smalltalk.ForkPool.klass);
  704. smalltalk.addMethod(
  705. smalltalk.method({
  706. selector: "resetDefault",
  707. fn: function (){
  708. var self=this;
  709. return smalltalk.withContext(function($ctx1) {
  710. self["@default"]=nil;
  711. return self}, function($ctx1) {$ctx1.fill(self,"resetDefault",{},smalltalk.ForkPool.klass)})},
  712. messageSends: []}),
  713. smalltalk.ForkPool.klass);
  714. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  715. smalltalk.addMethod(
  716. smalltalk.method({
  717. selector: "arguments",
  718. fn: function (){
  719. var self=this;
  720. return smalltalk.withContext(function($ctx1) {
  721. var $1;
  722. $1=self["@arguments"];
  723. return $1;
  724. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.Message)})},
  725. messageSends: []}),
  726. smalltalk.Message);
  727. smalltalk.addMethod(
  728. smalltalk.method({
  729. selector: "arguments:",
  730. fn: function (anArray){
  731. var self=this;
  732. return smalltalk.withContext(function($ctx1) {
  733. self["@arguments"]=anArray;
  734. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{anArray:anArray},smalltalk.Message)})},
  735. messageSends: []}),
  736. smalltalk.Message);
  737. smalltalk.addMethod(
  738. smalltalk.method({
  739. selector: "printOn:",
  740. fn: function (aStream){
  741. var self=this;
  742. return smalltalk.withContext(function($ctx1) {
  743. var $1,$2;
  744. smalltalk.Message.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  745. $1=aStream;
  746. _st($1)._nextPutAll_("(");
  747. _st($1)._nextPutAll_(self._selector());
  748. $2=_st($1)._nextPutAll_(")");
  749. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Message)})},
  750. messageSends: ["printOn:", "nextPutAll:", "selector"]}),
  751. smalltalk.Message);
  752. smalltalk.addMethod(
  753. smalltalk.method({
  754. selector: "selector",
  755. fn: function (){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx1) {
  758. var $1;
  759. $1=self["@selector"];
  760. return $1;
  761. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.Message)})},
  762. messageSends: []}),
  763. smalltalk.Message);
  764. smalltalk.addMethod(
  765. smalltalk.method({
  766. selector: "selector:",
  767. fn: function (aString){
  768. var self=this;
  769. return smalltalk.withContext(function($ctx1) {
  770. self["@selector"]=aString;
  771. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.Message)})},
  772. messageSends: []}),
  773. smalltalk.Message);
  774. smalltalk.addMethod(
  775. smalltalk.method({
  776. selector: "sendTo:",
  777. fn: function (anObject){
  778. var self=this;
  779. return smalltalk.withContext(function($ctx1) {
  780. var $1;
  781. $1=_st(anObject)._perform_withArguments_(self._selector(),self._arguments());
  782. return $1;
  783. }, function($ctx1) {$ctx1.fill(self,"sendTo:",{anObject:anObject},smalltalk.Message)})},
  784. messageSends: ["perform:withArguments:", "selector", "arguments"]}),
  785. smalltalk.Message);
  786. smalltalk.addMethod(
  787. smalltalk.method({
  788. selector: "selector:arguments:",
  789. fn: function (aString,anArray){
  790. var self=this;
  791. return smalltalk.withContext(function($ctx1) {
  792. var $2,$3,$1;
  793. $2=self._new();
  794. _st($2)._selector_(aString);
  795. _st($2)._arguments_(anArray);
  796. $3=_st($2)._yourself();
  797. $1=$3;
  798. return $1;
  799. }, function($ctx1) {$ctx1.fill(self,"selector:arguments:",{aString:aString,anArray:anArray},smalltalk.Message.klass)})},
  800. messageSends: ["selector:", "new", "arguments:", "yourself"]}),
  801. smalltalk.Message.klass);
  802. smalltalk.addClass('MessageSend', smalltalk.Object, ['receiver', 'message'], 'Kernel-Methods');
  803. smalltalk.addMethod(
  804. smalltalk.method({
  805. selector: "arguments",
  806. fn: function (){
  807. var self=this;
  808. return smalltalk.withContext(function($ctx1) {
  809. var $1;
  810. $1=_st(self["@message"])._arguments();
  811. return $1;
  812. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.MessageSend)})},
  813. messageSends: ["arguments"]}),
  814. smalltalk.MessageSend);
  815. smalltalk.addMethod(
  816. smalltalk.method({
  817. selector: "arguments:",
  818. fn: function (aCollection){
  819. var self=this;
  820. return smalltalk.withContext(function($ctx1) {
  821. _st(self["@message"])._arguments_(aCollection);
  822. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.MessageSend)})},
  823. messageSends: ["arguments:"]}),
  824. smalltalk.MessageSend);
  825. smalltalk.addMethod(
  826. smalltalk.method({
  827. selector: "initialize",
  828. fn: function (){
  829. var self=this;
  830. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  831. return smalltalk.withContext(function($ctx1) {
  832. smalltalk.MessageSend.superclass.fn.prototype._initialize.apply(_st(self), []);
  833. self["@message"]=_st($Message())._new();
  834. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.MessageSend)})},
  835. messageSends: ["initialize", "new"]}),
  836. smalltalk.MessageSend);
  837. smalltalk.addMethod(
  838. smalltalk.method({
  839. selector: "printOn:",
  840. fn: function (aStream){
  841. var self=this;
  842. return smalltalk.withContext(function($ctx1) {
  843. var $1,$2;
  844. smalltalk.MessageSend.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  845. $1=aStream;
  846. _st($1)._nextPutAll_("(");
  847. _st($1)._nextPutAll_(self._receiver());
  848. _st($1)._nextPutAll_(" >> ");
  849. _st($1)._nextPutAll_(self._selector());
  850. $2=_st($1)._nextPutAll_(")");
  851. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.MessageSend)})},
  852. messageSends: ["printOn:", "nextPutAll:", "receiver", "selector"]}),
  853. smalltalk.MessageSend);
  854. smalltalk.addMethod(
  855. smalltalk.method({
  856. selector: "receiver",
  857. fn: function (){
  858. var self=this;
  859. return smalltalk.withContext(function($ctx1) {
  860. var $1;
  861. $1=self["@receiver"];
  862. return $1;
  863. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MessageSend)})},
  864. messageSends: []}),
  865. smalltalk.MessageSend);
  866. smalltalk.addMethod(
  867. smalltalk.method({
  868. selector: "receiver:",
  869. fn: function (anObject){
  870. var self=this;
  871. return smalltalk.withContext(function($ctx1) {
  872. self["@receiver"]=anObject;
  873. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.MessageSend)})},
  874. messageSends: []}),
  875. smalltalk.MessageSend);
  876. smalltalk.addMethod(
  877. smalltalk.method({
  878. selector: "selector",
  879. fn: function (){
  880. var self=this;
  881. return smalltalk.withContext(function($ctx1) {
  882. var $1;
  883. $1=_st(self["@message"])._selector();
  884. return $1;
  885. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MessageSend)})},
  886. messageSends: ["selector"]}),
  887. smalltalk.MessageSend);
  888. smalltalk.addMethod(
  889. smalltalk.method({
  890. selector: "selector:",
  891. fn: function (aString){
  892. var self=this;
  893. return smalltalk.withContext(function($ctx1) {
  894. _st(self["@message"])._selector_(aString);
  895. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.MessageSend)})},
  896. messageSends: ["selector:"]}),
  897. smalltalk.MessageSend);
  898. smalltalk.addMethod(
  899. smalltalk.method({
  900. selector: "value",
  901. fn: function (){
  902. var self=this;
  903. return smalltalk.withContext(function($ctx1) {
  904. var $1;
  905. $1=_st(self["@message"])._sendTo_(self._receiver());
  906. return $1;
  907. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.MessageSend)})},
  908. messageSends: ["sendTo:", "receiver"]}),
  909. smalltalk.MessageSend);
  910. smalltalk.addMethod(
  911. smalltalk.method({
  912. selector: "value:",
  913. fn: function (anObject){
  914. var self=this;
  915. return smalltalk.withContext(function($ctx1) {
  916. var $2,$3,$1;
  917. $2=self["@message"];
  918. _st($2)._arguments_([anObject]);
  919. $3=_st($2)._sendTo_(self._receiver());
  920. $1=$3;
  921. return $1;
  922. }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},smalltalk.MessageSend)})},
  923. messageSends: ["arguments:", "sendTo:", "receiver"]}),
  924. smalltalk.MessageSend);
  925. smalltalk.addMethod(
  926. smalltalk.method({
  927. selector: "value:value:",
  928. fn: function (firstArgument,secondArgument){
  929. var self=this;
  930. return smalltalk.withContext(function($ctx1) {
  931. var $2,$3,$1;
  932. $2=self["@message"];
  933. _st($2)._arguments_([firstArgument,secondArgument]);
  934. $3=_st($2)._sendTo_(self._receiver());
  935. $1=$3;
  936. return $1;
  937. }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument},smalltalk.MessageSend)})},
  938. messageSends: ["arguments:", "sendTo:", "receiver"]}),
  939. smalltalk.MessageSend);
  940. smalltalk.addMethod(
  941. smalltalk.method({
  942. selector: "value:value:value:",
  943. fn: function (firstArgument,secondArgument,thirdArgument){
  944. var self=this;
  945. return smalltalk.withContext(function($ctx1) {
  946. var $2,$3,$1;
  947. $2=self["@message"];
  948. _st($2)._arguments_([firstArgument,secondArgument,thirdArgument]);
  949. $3=_st($2)._sendTo_(self._receiver());
  950. $1=$3;
  951. return $1;
  952. }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument},smalltalk.MessageSend)})},
  953. messageSends: ["arguments:", "sendTo:", "receiver"]}),
  954. smalltalk.MessageSend);
  955. smalltalk.addMethod(
  956. smalltalk.method({
  957. selector: "valueWithPossibleArguments:",
  958. fn: function (aCollection){
  959. var self=this;
  960. return smalltalk.withContext(function($ctx1) {
  961. var $1;
  962. self._arguments_(aCollection);
  963. $1=self._value();
  964. return $1;
  965. }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection},smalltalk.MessageSend)})},
  966. messageSends: ["arguments:", "value"]}),
  967. smalltalk.MessageSend);
  968. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  969. smalltalk.addMethod(
  970. smalltalk.method({
  971. selector: "asString",
  972. fn: function (){
  973. var self=this;
  974. return smalltalk.withContext(function($ctx1) {
  975. var $2,$1;
  976. $2=self._isBlockContext();
  977. if(smalltalk.assert($2)){
  978. $1=_st("a block (in ".__comma(_st(self._methodContext())._asString())).__comma(")");
  979. } else {
  980. $1=_st(_st(_st(_st(self._receiver())._class())._name()).__comma(" >> ")).__comma(self._selector());
  981. };
  982. return $1;
  983. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.MethodContext)})},
  984. messageSends: ["ifTrue:ifFalse:", ",", "asString", "methodContext", "selector", "name", "class", "receiver", "isBlockContext"]}),
  985. smalltalk.MethodContext);
  986. smalltalk.addMethod(
  987. smalltalk.method({
  988. selector: "home",
  989. fn: function (){
  990. var self=this;
  991. return smalltalk.withContext(function($ctx1) {
  992. return self.homeContext;
  993. return self}, function($ctx1) {$ctx1.fill(self,"home",{},smalltalk.MethodContext)})},
  994. messageSends: []}),
  995. smalltalk.MethodContext);
  996. smalltalk.addMethod(
  997. smalltalk.method({
  998. selector: "isBlockContext",
  999. fn: function (){
  1000. var self=this;
  1001. return smalltalk.withContext(function($ctx1) {
  1002. var $1;
  1003. $1=_st(self._selector())._isNil();
  1004. return $1;
  1005. }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},smalltalk.MethodContext)})},
  1006. messageSends: ["isNil", "selector"]}),
  1007. smalltalk.MethodContext);
  1008. smalltalk.addMethod(
  1009. smalltalk.method({
  1010. selector: "locals",
  1011. fn: function (){
  1012. var self=this;
  1013. return smalltalk.withContext(function($ctx1) {
  1014. return self.locals || {};
  1015. return self}, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.MethodContext)})},
  1016. messageSends: []}),
  1017. smalltalk.MethodContext);
  1018. smalltalk.addMethod(
  1019. smalltalk.method({
  1020. selector: "method",
  1021. fn: function (){
  1022. var self=this;
  1023. return smalltalk.withContext(function($ctx1) {
  1024. var $2,$1;
  1025. $2=self._methodContext();
  1026. if(($receiver = $2) == nil || $receiver == undefined){
  1027. $1=$2;
  1028. } else {
  1029. $1=_st(_st(_st(self._methodContext())._receiver())._class())._lookupSelector_(_st(self._methodContext())._selector());
  1030. };
  1031. return $1;
  1032. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodContext)})},
  1033. messageSends: ["ifNotNil:", "lookupSelector:", "selector", "methodContext", "class", "receiver"]}),
  1034. smalltalk.MethodContext);
  1035. smalltalk.addMethod(
  1036. smalltalk.method({
  1037. selector: "methodContext",
  1038. fn: function (){
  1039. var self=this;
  1040. return smalltalk.withContext(function($ctx1) {
  1041. var $1,$2,$4,$3;
  1042. $1=self._isBlockContext();
  1043. if(! smalltalk.assert($1)){
  1044. $2=self;
  1045. return $2;
  1046. };
  1047. $4=self._home();
  1048. if(($receiver = $4) == nil || $receiver == undefined){
  1049. $3=$4;
  1050. } else {
  1051. var home;
  1052. home=$receiver;
  1053. $3=_st(home)._methodContext();
  1054. };
  1055. return $3;
  1056. }, function($ctx1) {$ctx1.fill(self,"methodContext",{},smalltalk.MethodContext)})},
  1057. messageSends: ["ifFalse:", "isBlockContext", "ifNotNil:", "methodContext", "home"]}),
  1058. smalltalk.MethodContext);
  1059. smalltalk.addMethod(
  1060. smalltalk.method({
  1061. selector: "outerContext",
  1062. fn: function (){
  1063. var self=this;
  1064. return smalltalk.withContext(function($ctx1) {
  1065. return self.outerContext || self.homeContext;
  1066. return self}, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.MethodContext)})},
  1067. messageSends: []}),
  1068. smalltalk.MethodContext);
  1069. smalltalk.addMethod(
  1070. smalltalk.method({
  1071. selector: "pc",
  1072. fn: function (){
  1073. var self=this;
  1074. return smalltalk.withContext(function($ctx1) {
  1075. return self.pc;
  1076. return self}, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.MethodContext)})},
  1077. messageSends: []}),
  1078. smalltalk.MethodContext);
  1079. smalltalk.addMethod(
  1080. smalltalk.method({
  1081. selector: "printOn:",
  1082. fn: function (aStream){
  1083. var self=this;
  1084. return smalltalk.withContext(function($ctx1) {
  1085. var $1,$2;
  1086. smalltalk.MethodContext.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  1087. $1=aStream;
  1088. _st($1)._nextPutAll_("(");
  1089. _st($1)._nextPutAll_(self._asString());
  1090. $2=_st($1)._nextPutAll_(")");
  1091. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.MethodContext)})},
  1092. messageSends: ["printOn:", "nextPutAll:", "asString"]}),
  1093. smalltalk.MethodContext);
  1094. smalltalk.addMethod(
  1095. smalltalk.method({
  1096. selector: "receiver",
  1097. fn: function (){
  1098. var self=this;
  1099. return smalltalk.withContext(function($ctx1) {
  1100. return self.receiver;
  1101. return self}, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MethodContext)})},
  1102. messageSends: []}),
  1103. smalltalk.MethodContext);
  1104. smalltalk.addMethod(
  1105. smalltalk.method({
  1106. selector: "selector",
  1107. fn: function (){
  1108. var self=this;
  1109. return smalltalk.withContext(function($ctx1) {
  1110. if(self.selector) {
  1111. return smalltalk.convertSelector(self.selector);
  1112. } else {
  1113. return nil;
  1114. }
  1115. ;
  1116. return self}, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MethodContext)})},
  1117. messageSends: []}),
  1118. smalltalk.MethodContext);
  1119. smalltalk.addMethod(
  1120. smalltalk.method({
  1121. selector: "temps",
  1122. fn: function (){
  1123. var self=this;
  1124. return smalltalk.withContext(function($ctx1) {
  1125. var $1;
  1126. self._deprecatedAPI();
  1127. $1=self._locals();
  1128. return $1;
  1129. }, function($ctx1) {$ctx1.fill(self,"temps",{},smalltalk.MethodContext)})},
  1130. messageSends: ["deprecatedAPI", "locals"]}),
  1131. smalltalk.MethodContext);
  1132. smalltalk.addClass('NativeFunction', smalltalk.Object, [], 'Kernel-Methods');
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "constructor:",
  1136. fn: function (aString){
  1137. var self=this;
  1138. return smalltalk.withContext(function($ctx1) {
  1139. var native=eval(aString);
  1140. return new native();
  1141. ;
  1142. return self}, function($ctx1) {$ctx1.fill(self,"constructor:",{aString:aString},smalltalk.NativeFunction.klass)})},
  1143. messageSends: []}),
  1144. smalltalk.NativeFunction.klass);
  1145. smalltalk.addMethod(
  1146. smalltalk.method({
  1147. selector: "constructor:value:",
  1148. fn: function (aString,anObject){
  1149. var self=this;
  1150. return smalltalk.withContext(function($ctx1) {
  1151. var native=eval(aString);
  1152. return new native(anObject);
  1153. ;
  1154. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:",{aString:aString,anObject:anObject},smalltalk.NativeFunction.klass)})},
  1155. messageSends: []}),
  1156. smalltalk.NativeFunction.klass);
  1157. smalltalk.addMethod(
  1158. smalltalk.method({
  1159. selector: "constructor:value:value:",
  1160. fn: function (aString,anObject,anObject2){
  1161. var self=this;
  1162. return smalltalk.withContext(function($ctx1) {
  1163. var native=eval(aString);
  1164. return new native(anObject,anObject2);
  1165. ;
  1166. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2},smalltalk.NativeFunction.klass)})},
  1167. messageSends: []}),
  1168. smalltalk.NativeFunction.klass);
  1169. smalltalk.addMethod(
  1170. smalltalk.method({
  1171. selector: "constructor:value:value:value:",
  1172. fn: function (aString,anObject,anObject2,anObject3){
  1173. var self=this;
  1174. return smalltalk.withContext(function($ctx1) {
  1175. var native=eval(aString);
  1176. return new native(anObject,anObject2, anObject3);
  1177. ;
  1178. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3},smalltalk.NativeFunction.klass)})},
  1179. messageSends: []}),
  1180. smalltalk.NativeFunction.klass);
  1181. smalltalk.addMethod(
  1182. smalltalk.method({
  1183. selector: "exists:",
  1184. fn: function (aString){
  1185. var self=this;
  1186. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1187. return smalltalk.withContext(function($ctx1) {
  1188. var $1;
  1189. $1=_st($PlatformInterface())._existsGlobal_(aString);
  1190. return $1;
  1191. }, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString},smalltalk.NativeFunction.klass)})},
  1192. messageSends: ["existsGlobal:"]}),
  1193. smalltalk.NativeFunction.klass);
  1194. smalltalk.addClass('Timeout', smalltalk.Object, ['rawTimeout'], 'Kernel-Methods');
  1195. smalltalk.addMethod(
  1196. smalltalk.method({
  1197. selector: "clearInterval",
  1198. fn: function (){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx1) {
  1201. var interval = self["@rawTimeout"];
  1202. clearInterval(interval);
  1203. ;
  1204. return self}, function($ctx1) {$ctx1.fill(self,"clearInterval",{},smalltalk.Timeout)})},
  1205. messageSends: []}),
  1206. smalltalk.Timeout);
  1207. smalltalk.addMethod(
  1208. smalltalk.method({
  1209. selector: "clearTimeout",
  1210. fn: function (){
  1211. var self=this;
  1212. return smalltalk.withContext(function($ctx1) {
  1213. var timeout = self["@rawTimeout"];
  1214. clearTimeout(timeout);
  1215. ;
  1216. return self}, function($ctx1) {$ctx1.fill(self,"clearTimeout",{},smalltalk.Timeout)})},
  1217. messageSends: []}),
  1218. smalltalk.Timeout);
  1219. smalltalk.addMethod(
  1220. smalltalk.method({
  1221. selector: "rawTimeout:",
  1222. fn: function (anObject){
  1223. var self=this;
  1224. return smalltalk.withContext(function($ctx1) {
  1225. self["@rawTimeout"]=anObject;
  1226. return self}, function($ctx1) {$ctx1.fill(self,"rawTimeout:",{anObject:anObject},smalltalk.Timeout)})},
  1227. messageSends: []}),
  1228. smalltalk.Timeout);
  1229. smalltalk.addMethod(
  1230. smalltalk.method({
  1231. selector: "on:",
  1232. fn: function (anObject){
  1233. var self=this;
  1234. return smalltalk.withContext(function($ctx1) {
  1235. var $2,$3,$1;
  1236. $2=self._new();
  1237. _st($2)._rawTimeout_(anObject);
  1238. $3=_st($2)._yourself();
  1239. $1=$3;
  1240. return $1;
  1241. }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Timeout.klass)})},
  1242. messageSends: ["rawTimeout:", "new", "yourself"]}),
  1243. smalltalk.Timeout.klass);
  1244. });