Kernel-Methods.deploy.js 32 KB

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