1
0

Kernel-Methods.deploy.js 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335
  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. return smalltalk.withContext(function($ctx1) {
  1209. if(aString in window) {
  1210. return true
  1211. } else {
  1212. return false
  1213. }
  1214. ;
  1215. return self}, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString},smalltalk.NativeFunction.klass)})},
  1216. messageSends: []}),
  1217. smalltalk.NativeFunction.klass);
  1218. })(global_smalltalk,global_nil,global__st);