Kernel-Methods.deploy.js 39 KB

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