2
0

Kernel-Methods.deploy.js 33 KB

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