Kernel-Methods.js 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182
  1. smalltalk.addPackage('Kernel-Methods', {});
  2. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
  3. smalltalk.BlockClosure.comment="A BlockClosure is a lexical closure.\x0aThe JavaScript representation is a function.\x0a\x0aA BlockClosure is evaluated with the `#value*` methods in the 'evaluating' protocol."
  4. smalltalk.addMethod(
  5. "_applyTo_arguments_",
  6. smalltalk.method({
  7. selector: "applyTo:arguments:",
  8. category: 'evaluating',
  9. fn: function (anObject,aCollection){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) { return self.apply(anObject, aCollection);
  12. return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:", [anObject,aCollection], smalltalk.BlockClosure)})},
  13. args: ["anObject", "aCollection"],
  14. source: "applyTo: anObject arguments: aCollection\x0a\x09<return self.apply(anObject, aCollection)>",
  15. messageSends: [],
  16. referencedClasses: []
  17. }),
  18. smalltalk.BlockClosure);
  19. smalltalk.addMethod(
  20. "_compiledSource",
  21. smalltalk.method({
  22. selector: "compiledSource",
  23. category: 'accessing',
  24. fn: function (){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx1) { return self.toString();
  27. return self}, function($ctx1) {$ctx1.fill(self,"compiledSource", [], smalltalk.BlockClosure)})},
  28. args: [],
  29. source: "compiledSource\x0a\x09<return self.toString()>",
  30. messageSends: [],
  31. referencedClasses: []
  32. }),
  33. smalltalk.BlockClosure);
  34. smalltalk.addMethod(
  35. "_ensure_",
  36. smalltalk.method({
  37. selector: "ensure:",
  38. category: 'evaluating',
  39. fn: function (aBlock){
  40. var self=this;
  41. return smalltalk.withContext(function($ctx1) { try{return self()}finally{aBlock._value()};
  42. return self}, function($ctx1) {$ctx1.fill(self,"ensure:", [aBlock], smalltalk.BlockClosure)})},
  43. args: ["aBlock"],
  44. source: "ensure: aBlock\x0a\x09<try{return self()}finally{aBlock._value()}>",
  45. messageSends: [],
  46. referencedClasses: []
  47. }),
  48. smalltalk.BlockClosure);
  49. smalltalk.addMethod(
  50. "_fork",
  51. smalltalk.method({
  52. selector: "fork",
  53. category: 'timeout/interval',
  54. fn: function (){
  55. var self=this;
  56. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.ForkPool || ForkPool))._default())._fork_(self);
  57. return self}, function($ctx1) {$ctx1.fill(self,"fork", [], smalltalk.BlockClosure)})},
  58. args: [],
  59. source: "fork\x0a\x09ForkPool default fork: self",
  60. messageSends: ["fork:", "default"],
  61. referencedClasses: ["ForkPool"]
  62. }),
  63. smalltalk.BlockClosure);
  64. smalltalk.addMethod(
  65. "_new",
  66. smalltalk.method({
  67. selector: "new",
  68. category: 'evaluating',
  69. fn: function (){
  70. var self=this;
  71. return smalltalk.withContext(function($ctx1) { return new self();
  72. return self}, function($ctx1) {$ctx1.fill(self,"new", [], smalltalk.BlockClosure)})},
  73. args: [],
  74. source: "new\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self()>",
  75. messageSends: [],
  76. referencedClasses: []
  77. }),
  78. smalltalk.BlockClosure);
  79. smalltalk.addMethod(
  80. "_newValue_",
  81. smalltalk.method({
  82. selector: "newValue:",
  83. category: 'evaluating',
  84. fn: function (anObject){
  85. var self=this;
  86. return smalltalk.withContext(function($ctx1) { return new self(anObject);
  87. return self}, function($ctx1) {$ctx1.fill(self,"newValue:", [anObject], smalltalk.BlockClosure)})},
  88. args: ["anObject"],
  89. source: "newValue: anObject\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject)>",
  90. messageSends: [],
  91. referencedClasses: []
  92. }),
  93. smalltalk.BlockClosure);
  94. smalltalk.addMethod(
  95. "_newValue_value_",
  96. smalltalk.method({
  97. selector: "newValue:value:",
  98. category: 'evaluating',
  99. fn: function (anObject,anObject2){
  100. var self=this;
  101. return smalltalk.withContext(function($ctx1) { return new self(anObject, anObject2);
  102. return self}, function($ctx1) {$ctx1.fill(self,"newValue:value:", [anObject,anObject2], smalltalk.BlockClosure)})},
  103. args: ["anObject", "anObject2"],
  104. source: "newValue: anObject value: anObject2\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject, anObject2)>",
  105. messageSends: [],
  106. referencedClasses: []
  107. }),
  108. smalltalk.BlockClosure);
  109. smalltalk.addMethod(
  110. "_newValue_value_value_",
  111. smalltalk.method({
  112. selector: "newValue:value:value:",
  113. category: 'evaluating',
  114. fn: function (anObject,anObject2,anObject3){
  115. var self=this;
  116. return smalltalk.withContext(function($ctx1) { return new self(anObject, anObject2);
  117. return self}, function($ctx1) {$ctx1.fill(self,"newValue:value:value:", [anObject,anObject2,anObject3], smalltalk.BlockClosure)})},
  118. args: ["anObject", "anObject2", "anObject3"],
  119. source: "newValue: anObject value: anObject2 value: anObject3\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject, anObject2)>",
  120. messageSends: [],
  121. referencedClasses: []
  122. }),
  123. smalltalk.BlockClosure);
  124. smalltalk.addMethod(
  125. "_numArgs",
  126. smalltalk.method({
  127. selector: "numArgs",
  128. category: 'accessing',
  129. fn: function (){
  130. var self=this;
  131. return smalltalk.withContext(function($ctx1) { return self.length;
  132. return self}, function($ctx1) {$ctx1.fill(self,"numArgs", [], smalltalk.BlockClosure)})},
  133. args: [],
  134. source: "numArgs\x0a\x09<return self.length>",
  135. messageSends: [],
  136. referencedClasses: []
  137. }),
  138. smalltalk.BlockClosure);
  139. smalltalk.addMethod(
  140. "_on_do_",
  141. smalltalk.method({
  142. selector: "on:do:",
  143. category: 'error handling',
  144. fn: function (anErrorClass,aBlock){
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) { var $2,$3,$5,$4,$1;
  147. $2=self;
  148. $3=self;
  149. $4=(function(error){
  150. return smalltalk.withContext(function($ctx2) { $5=_st(error)._isKindOf_(anErrorClass);
  151. if(smalltalk.assert($5)){
  152. return _st(aBlock)._value_(error);
  153. } else {
  154. return _st(error)._signal();
  155. };
  156. }, function($ctx2) {$ctx2.fill(null, null, {})})});
  157. $1=_st($2)._try_catch_($3,$4);
  158. return $1;
  159. }, function($ctx1) {$ctx1.fill(self,"on:do:", [anErrorClass,aBlock], smalltalk.BlockClosure)})},
  160. args: ["anErrorClass", "aBlock"],
  161. source: "on: anErrorClass do: aBlock\x0a\x09^self try: self catch: [:error |\x0a\x09 (error isKindOf: anErrorClass) \x0a\x09 ifTrue: [aBlock value: error]\x0a\x09 ifFalse: [error signal]]",
  162. messageSends: ["try:catch:", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:"],
  163. referencedClasses: []
  164. }),
  165. smalltalk.BlockClosure);
  166. smalltalk.addMethod(
  167. "_timeToRun",
  168. smalltalk.method({
  169. selector: "timeToRun",
  170. category: 'evaluating',
  171. fn: function (){
  172. var self=this;
  173. return smalltalk.withContext(function($ctx1) { var $1;
  174. $1=_st((smalltalk.Date || Date))._millisecondsToRun_(self);
  175. return $1;
  176. }, function($ctx1) {$ctx1.fill(self,"timeToRun", [], smalltalk.BlockClosure)})},
  177. args: [],
  178. source: "timeToRun\x0a\x09\x22Answer the number of milliseconds taken to execute this block.\x22\x0a\x0a\x09^ Date millisecondsToRun: self",
  179. messageSends: ["millisecondsToRun:"],
  180. referencedClasses: ["Date"]
  181. }),
  182. smalltalk.BlockClosure);
  183. smalltalk.addMethod(
  184. "_value",
  185. smalltalk.method({
  186. selector: "value",
  187. category: 'evaluating',
  188. fn: function (){
  189. var self=this;
  190. return smalltalk.withContext(function($ctx1) { return self();;
  191. return self}, function($ctx1) {$ctx1.fill(self,"value", [], smalltalk.BlockClosure)})},
  192. args: [],
  193. source: "value\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self();>",
  194. messageSends: [],
  195. referencedClasses: []
  196. }),
  197. smalltalk.BlockClosure);
  198. smalltalk.addMethod(
  199. "_value_",
  200. smalltalk.method({
  201. selector: "value:",
  202. category: 'evaluating',
  203. fn: function (anArg){
  204. var self=this;
  205. return smalltalk.withContext(function($ctx1) { return self(anArg);;
  206. return self}, function($ctx1) {$ctx1.fill(self,"value:", [anArg], smalltalk.BlockClosure)})},
  207. args: ["anArg"],
  208. source: "value: anArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(anArg);>",
  209. messageSends: [],
  210. referencedClasses: []
  211. }),
  212. smalltalk.BlockClosure);
  213. smalltalk.addMethod(
  214. "_value_value_",
  215. smalltalk.method({
  216. selector: "value:value:",
  217. category: 'evaluating',
  218. fn: function (firstArg,secondArg){
  219. var self=this;
  220. return smalltalk.withContext(function($ctx1) { return self(firstArg, secondArg);;
  221. return self}, function($ctx1) {$ctx1.fill(self,"value:value:", [firstArg,secondArg], smalltalk.BlockClosure)})},
  222. args: ["firstArg", "secondArg"],
  223. source: "value: firstArg value: secondArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(firstArg, secondArg);>",
  224. messageSends: [],
  225. referencedClasses: []
  226. }),
  227. smalltalk.BlockClosure);
  228. smalltalk.addMethod(
  229. "_value_value_value_",
  230. smalltalk.method({
  231. selector: "value:value:value:",
  232. category: 'evaluating',
  233. fn: function (firstArg,secondArg,thirdArg){
  234. var self=this;
  235. return smalltalk.withContext(function($ctx1) { return self(firstArg, secondArg, thirdArg);;
  236. return self}, function($ctx1) {$ctx1.fill(self,"value:value:value:", [firstArg,secondArg,thirdArg], smalltalk.BlockClosure)})},
  237. args: ["firstArg", "secondArg", "thirdArg"],
  238. source: "value: firstArg value: secondArg value: thirdArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(firstArg, secondArg, thirdArg);>",
  239. messageSends: [],
  240. referencedClasses: []
  241. }),
  242. smalltalk.BlockClosure);
  243. smalltalk.addMethod(
  244. "_valueWithInterval_",
  245. smalltalk.method({
  246. selector: "valueWithInterval:",
  247. category: 'timeout/interval',
  248. fn: function (aNumber){
  249. var self=this;
  250. return smalltalk.withContext(function($ctx1) {
  251. var interval = setInterval(self, aNumber);
  252. return smalltalk.Timeout._on_(interval);
  253. ;
  254. return self}, function($ctx1) {$ctx1.fill(self,"valueWithInterval:", [aNumber], smalltalk.BlockClosure)})},
  255. args: ["aNumber"],
  256. source: "valueWithInterval: aNumber\x0a\x09<\x0a \x09var interval = setInterval(self, aNumber);\x0a \x09return smalltalk.Timeout._on_(interval);\x0a >",
  257. messageSends: [],
  258. referencedClasses: []
  259. }),
  260. smalltalk.BlockClosure);
  261. smalltalk.addMethod(
  262. "_valueWithPossibleArguments_",
  263. smalltalk.method({
  264. selector: "valueWithPossibleArguments:",
  265. category: 'evaluating',
  266. fn: function (aCollection){
  267. var self=this;
  268. return smalltalk.withContext(function($ctx1) { return self.apply(null, aCollection);;
  269. return self}, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:", [aCollection], smalltalk.BlockClosure)})},
  270. args: ["aCollection"],
  271. source: "valueWithPossibleArguments: aCollection\x0a\x09<return self.apply(null, aCollection);>",
  272. messageSends: [],
  273. referencedClasses: []
  274. }),
  275. smalltalk.BlockClosure);
  276. smalltalk.addMethod(
  277. "_valueWithTimeout_",
  278. smalltalk.method({
  279. selector: "valueWithTimeout:",
  280. category: 'timeout/interval',
  281. fn: function (aNumber){
  282. var self=this;
  283. return smalltalk.withContext(function($ctx1) {
  284. var timeout = setTimeout(self, aNumber);
  285. return smalltalk.Timeout._on_(timeout);
  286. ;
  287. return self}, function($ctx1) {$ctx1.fill(self,"valueWithTimeout:", [aNumber], smalltalk.BlockClosure)})},
  288. args: ["aNumber"],
  289. source: "valueWithTimeout: aNumber\x0a\x09<\x0a \x09var timeout = setTimeout(self, aNumber);\x0a \x09return smalltalk.Timeout._on_(timeout);\x0a >",
  290. messageSends: [],
  291. referencedClasses: []
  292. }),
  293. smalltalk.BlockClosure);
  294. smalltalk.addMethod(
  295. "_whileFalse",
  296. smalltalk.method({
  297. selector: "whileFalse",
  298. category: 'controlling',
  299. fn: function (){
  300. var self=this;
  301. return smalltalk.withContext(function($ctx1) { _st(self)._whileFalse_((function(){
  302. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fill(null, null, {})})}));
  303. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse", [], smalltalk.BlockClosure)})},
  304. args: [],
  305. source: "whileFalse\x0a\x09\x22inlined in the Compiler\x22\x0a\x09self whileFalse: []",
  306. messageSends: ["whileFalse:"],
  307. referencedClasses: []
  308. }),
  309. smalltalk.BlockClosure);
  310. smalltalk.addMethod(
  311. "_whileFalse_",
  312. smalltalk.method({
  313. selector: "whileFalse:",
  314. category: 'controlling',
  315. fn: function (aBlock){
  316. var self=this;
  317. return smalltalk.withContext(function($ctx1) { while(!self()) {aBlock()};
  318. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse:", [aBlock], smalltalk.BlockClosure)})},
  319. args: ["aBlock"],
  320. source: "whileFalse: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<while(!self()) {aBlock()}>",
  321. messageSends: [],
  322. referencedClasses: []
  323. }),
  324. smalltalk.BlockClosure);
  325. smalltalk.addMethod(
  326. "_whileTrue",
  327. smalltalk.method({
  328. selector: "whileTrue",
  329. category: 'controlling',
  330. fn: function (){
  331. var self=this;
  332. return smalltalk.withContext(function($ctx1) { _st(self)._whileTrue_((function(){
  333. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fill(null, null, {})})}));
  334. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue", [], smalltalk.BlockClosure)})},
  335. args: [],
  336. source: "whileTrue\x0a\x09\x22inlined in the Compiler\x22\x0a\x09self whileTrue: []",
  337. messageSends: ["whileTrue:"],
  338. referencedClasses: []
  339. }),
  340. smalltalk.BlockClosure);
  341. smalltalk.addMethod(
  342. "_whileTrue_",
  343. smalltalk.method({
  344. selector: "whileTrue:",
  345. category: 'controlling',
  346. fn: function (aBlock){
  347. var self=this;
  348. return smalltalk.withContext(function($ctx1) { while(self()) {aBlock()};
  349. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue:", [aBlock], smalltalk.BlockClosure)})},
  350. args: ["aBlock"],
  351. source: "whileTrue: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<while(self()) {aBlock()}>",
  352. messageSends: [],
  353. referencedClasses: []
  354. }),
  355. smalltalk.BlockClosure);
  356. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  357. smalltalk.CompiledMethod.comment="CompiledMethod hold the source and compiled code of a class method.\x0a\x0aYou can get a CompiledMethod using `Behavior>>methodAt:`\x0a\x0a\x09String methodAt: 'lines'\x0a\x0aand read the source code\x0a\x0a\x09(String methodAt: 'lines') source\x0a\x0aSee referenced classes:\x0a\x0a\x09(String methodAt: 'lines') referencedClasses\x0a\x0aor messages sent from this method:\x0a\x09\x0a\x09(String methodAt: 'lines') messageSends"
  358. smalltalk.addMethod(
  359. "_arguments",
  360. smalltalk.method({
  361. selector: "arguments",
  362. category: 'accessing',
  363. fn: function (){
  364. var self=this;
  365. return smalltalk.withContext(function($ctx1) { return self.args || [];
  366. return self}, function($ctx1) {$ctx1.fill(self,"arguments", [], smalltalk.CompiledMethod)})},
  367. args: [],
  368. source: "arguments\x0a\x09<return self.args || []>",
  369. messageSends: [],
  370. referencedClasses: []
  371. }),
  372. smalltalk.CompiledMethod);
  373. smalltalk.addMethod(
  374. "_category",
  375. smalltalk.method({
  376. selector: "category",
  377. category: 'accessing',
  378. fn: function (){
  379. var self=this;
  380. return smalltalk.withContext(function($ctx1) { var $2,$1;
  381. $2=_st(self)._basicAt_("category");
  382. if(($receiver = $2) == nil || $receiver == undefined){
  383. $1="";
  384. } else {
  385. $1=$2;
  386. };
  387. return $1;
  388. }, function($ctx1) {$ctx1.fill(self,"category", [], smalltalk.CompiledMethod)})},
  389. args: [],
  390. source: "category\x0a\x09^(self basicAt: 'category') ifNil: ['']",
  391. messageSends: ["ifNil:", "basicAt:"],
  392. referencedClasses: []
  393. }),
  394. smalltalk.CompiledMethod);
  395. smalltalk.addMethod(
  396. "_category_",
  397. smalltalk.method({
  398. selector: "category:",
  399. category: 'accessing',
  400. fn: function (aString){
  401. var self=this;
  402. var oldCategory;
  403. return smalltalk.withContext(function($ctx1) { var $1;
  404. oldCategory=_st(self)._category();
  405. _st(self)._basicAt_put_("category",aString);
  406. $1=_st(self)._methodClass();
  407. if(($receiver = $1) == nil || $receiver == undefined){
  408. $1;
  409. } else {
  410. _st(_st(_st(self)._methodClass())._organization())._addElement_(aString);
  411. _st(_st(_st(_st(self)._methodClass())._methods())._select_((function(each){
  412. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._category()).__eq(oldCategory);
  413. }, function($ctx2) {$ctx2.fill(null, null, {})})})))._ifEmpty_((function(){
  414. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._methodClass())._organization())._removeElement_(oldCategory);
  415. }, function($ctx2) {$ctx2.fill(null, null, {})})}));
  416. };
  417. return self}, function($ctx1) {$ctx1.fill(self,"category:", [aString], smalltalk.CompiledMethod)})},
  418. args: ["aString"],
  419. source: "category: aString\x0a\x09| oldCategory |\x0a oldCategory := self category.\x0a\x09self basicAt: 'category' put: aString.\x0a \x0a self methodClass ifNotNil: [\x0a \x09self methodClass organization addElement: aString.\x0a \x0a\x09\x09(self methodClass methods \x0a \x09\x09select: [ :each | each category = oldCategory ])\x0a \x09ifEmpty: [ self methodClass organization removeElement: oldCategory ] ]",
  420. messageSends: ["category", "basicAt:put:", "ifNotNil:", "addElement:", "organization", "methodClass", "ifEmpty:", "removeElement:", "select:", "=", "methods"],
  421. referencedClasses: []
  422. }),
  423. smalltalk.CompiledMethod);
  424. smalltalk.addMethod(
  425. "_fn",
  426. smalltalk.method({
  427. selector: "fn",
  428. category: 'accessing',
  429. fn: function (){
  430. var self=this;
  431. return smalltalk.withContext(function($ctx1) { var $1;
  432. $1=_st(self)._basicAt_("fn");
  433. return $1;
  434. }, function($ctx1) {$ctx1.fill(self,"fn", [], smalltalk.CompiledMethod)})},
  435. args: [],
  436. source: "fn\x0a\x09^self basicAt: 'fn'",
  437. messageSends: ["basicAt:"],
  438. referencedClasses: []
  439. }),
  440. smalltalk.CompiledMethod);
  441. smalltalk.addMethod(
  442. "_fn_",
  443. smalltalk.method({
  444. selector: "fn:",
  445. category: 'accessing',
  446. fn: function (aBlock){
  447. var self=this;
  448. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("fn",aBlock);
  449. return self}, function($ctx1) {$ctx1.fill(self,"fn:", [aBlock], smalltalk.CompiledMethod)})},
  450. args: ["aBlock"],
  451. source: "fn: aBlock\x0a\x09self basicAt: 'fn' put: aBlock",
  452. messageSends: ["basicAt:put:"],
  453. referencedClasses: []
  454. }),
  455. smalltalk.CompiledMethod);
  456. smalltalk.addMethod(
  457. "_messageSends",
  458. smalltalk.method({
  459. selector: "messageSends",
  460. category: 'accessing',
  461. fn: function (){
  462. var self=this;
  463. return smalltalk.withContext(function($ctx1) { var $1;
  464. $1=_st(self)._basicAt_("messageSends");
  465. return $1;
  466. }, function($ctx1) {$ctx1.fill(self,"messageSends", [], smalltalk.CompiledMethod)})},
  467. args: [],
  468. source: "messageSends\x0a\x09^self basicAt: 'messageSends'",
  469. messageSends: ["basicAt:"],
  470. referencedClasses: []
  471. }),
  472. smalltalk.CompiledMethod);
  473. smalltalk.addMethod(
  474. "_methodClass",
  475. smalltalk.method({
  476. selector: "methodClass",
  477. category: 'accessing',
  478. fn: function (){
  479. var self=this;
  480. return smalltalk.withContext(function($ctx1) { var $1;
  481. $1=_st(self)._basicAt_("methodClass");
  482. return $1;
  483. }, function($ctx1) {$ctx1.fill(self,"methodClass", [], smalltalk.CompiledMethod)})},
  484. args: [],
  485. source: "methodClass\x0a\x09^self basicAt: 'methodClass'",
  486. messageSends: ["basicAt:"],
  487. referencedClasses: []
  488. }),
  489. smalltalk.CompiledMethod);
  490. smalltalk.addMethod(
  491. "_protocol",
  492. smalltalk.method({
  493. selector: "protocol",
  494. category: 'accessing',
  495. fn: function (){
  496. var self=this;
  497. return smalltalk.withContext(function($ctx1) { var $1;
  498. $1=_st(self)._category();
  499. return $1;
  500. }, function($ctx1) {$ctx1.fill(self,"protocol", [], smalltalk.CompiledMethod)})},
  501. args: [],
  502. source: "protocol\x0a\x09^ self category",
  503. messageSends: ["category"],
  504. referencedClasses: []
  505. }),
  506. smalltalk.CompiledMethod);
  507. smalltalk.addMethod(
  508. "_referencedClasses",
  509. smalltalk.method({
  510. selector: "referencedClasses",
  511. category: 'accessing',
  512. fn: function (){
  513. var self=this;
  514. return smalltalk.withContext(function($ctx1) { var $1;
  515. $1=_st(self)._basicAt_("referencedClasses");
  516. return $1;
  517. }, function($ctx1) {$ctx1.fill(self,"referencedClasses", [], smalltalk.CompiledMethod)})},
  518. args: [],
  519. source: "referencedClasses\x0a\x09^self basicAt: 'referencedClasses'",
  520. messageSends: ["basicAt:"],
  521. referencedClasses: []
  522. }),
  523. smalltalk.CompiledMethod);
  524. smalltalk.addMethod(
  525. "_selector",
  526. smalltalk.method({
  527. selector: "selector",
  528. category: 'accessing',
  529. fn: function (){
  530. var self=this;
  531. return smalltalk.withContext(function($ctx1) { var $1;
  532. $1=_st(self)._basicAt_("selector");
  533. return $1;
  534. }, function($ctx1) {$ctx1.fill(self,"selector", [], smalltalk.CompiledMethod)})},
  535. args: [],
  536. source: "selector\x0a\x09^self basicAt: 'selector'",
  537. messageSends: ["basicAt:"],
  538. referencedClasses: []
  539. }),
  540. smalltalk.CompiledMethod);
  541. smalltalk.addMethod(
  542. "_selector_",
  543. smalltalk.method({
  544. selector: "selector:",
  545. category: 'accessing',
  546. fn: function (aString){
  547. var self=this;
  548. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("selector",aString);
  549. return self}, function($ctx1) {$ctx1.fill(self,"selector:", [aString], smalltalk.CompiledMethod)})},
  550. args: ["aString"],
  551. source: "selector: aString\x0a\x09self basicAt: 'selector' put: aString",
  552. messageSends: ["basicAt:put:"],
  553. referencedClasses: []
  554. }),
  555. smalltalk.CompiledMethod);
  556. smalltalk.addMethod(
  557. "_source",
  558. smalltalk.method({
  559. selector: "source",
  560. category: 'accessing',
  561. fn: function (){
  562. var self=this;
  563. return smalltalk.withContext(function($ctx1) { var $2,$1;
  564. $2=_st(self)._basicAt_("source");
  565. if(($receiver = $2) == nil || $receiver == undefined){
  566. $1="";
  567. } else {
  568. $1=$2;
  569. };
  570. return $1;
  571. }, function($ctx1) {$ctx1.fill(self,"source", [], smalltalk.CompiledMethod)})},
  572. args: [],
  573. source: "source\x0a\x09^(self basicAt: 'source') ifNil: ['']",
  574. messageSends: ["ifNil:", "basicAt:"],
  575. referencedClasses: []
  576. }),
  577. smalltalk.CompiledMethod);
  578. smalltalk.addMethod(
  579. "_source_",
  580. smalltalk.method({
  581. selector: "source:",
  582. category: 'accessing',
  583. fn: function (aString){
  584. var self=this;
  585. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("source",aString);
  586. return self}, function($ctx1) {$ctx1.fill(self,"source:", [aString], smalltalk.CompiledMethod)})},
  587. args: ["aString"],
  588. source: "source: aString\x0a\x09self basicAt: 'source' put: aString",
  589. messageSends: ["basicAt:put:"],
  590. referencedClasses: []
  591. }),
  592. smalltalk.CompiledMethod);
  593. smalltalk.addClass('ForkPool', smalltalk.Object, ['poolSize', 'maxPoolSize', 'queue', 'worker'], 'Kernel-Methods');
  594. smalltalk.ForkPool.comment="A ForkPool is responsible for handling forked blocks.\x0aThe pool size sets the maximum concurrent forked blocks.\x0a\x0aThe default instance is accessed with `ForkPool default`"
  595. smalltalk.addMethod(
  596. "_addWorker",
  597. smalltalk.method({
  598. selector: "addWorker",
  599. category: 'action',
  600. fn: function (){
  601. var self=this;
  602. return smalltalk.withContext(function($ctx1) { _st(self["@worker"])._valueWithTimeout_((0));
  603. self["@poolSize"]=_st(self["@poolSize"]).__plus((1));
  604. return self}, function($ctx1) {$ctx1.fill(self,"addWorker", [], smalltalk.ForkPool)})},
  605. args: [],
  606. source: "addWorker\x0a\x09worker valueWithTimeout: 0.\x0a poolSize := poolSize + 1",
  607. messageSends: ["valueWithTimeout:", "+"],
  608. referencedClasses: []
  609. }),
  610. smalltalk.ForkPool);
  611. smalltalk.addMethod(
  612. "_defaultMaxPoolSize",
  613. smalltalk.method({
  614. selector: "defaultMaxPoolSize",
  615. category: 'defaults',
  616. fn: function (){
  617. var self=this;
  618. return smalltalk.withContext(function($ctx1) { var $1;
  619. $1=_st(_st(self)._class())._defaultMaxPoolSize();
  620. return $1;
  621. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize", [], smalltalk.ForkPool)})},
  622. args: [],
  623. source: "defaultMaxPoolSize\x0a\x09^ self class defaultMaxPoolSize",
  624. messageSends: ["defaultMaxPoolSize", "class"],
  625. referencedClasses: []
  626. }),
  627. smalltalk.ForkPool);
  628. smalltalk.addMethod(
  629. "_fork_",
  630. smalltalk.method({
  631. selector: "fork:",
  632. category: 'action',
  633. fn: function (aBlock){
  634. var self=this;
  635. return smalltalk.withContext(function($ctx1) { var $1;
  636. $1=_st(self["@poolSize"]).__lt(_st(self)._maxPoolSize());
  637. if(smalltalk.assert($1)){
  638. _st(self)._addWorker();
  639. };
  640. _st(self["@queue"])._back_(aBlock);
  641. return self}, function($ctx1) {$ctx1.fill(self,"fork:", [aBlock], smalltalk.ForkPool)})},
  642. args: ["aBlock"],
  643. source: "fork: aBlock\x0a\x09poolSize < self maxPoolSize ifTrue: [ self addWorker ].\x0a\x09queue back: aBlock",
  644. messageSends: ["ifTrue:", "addWorker", "<", "maxPoolSize", "back:"],
  645. referencedClasses: []
  646. }),
  647. smalltalk.ForkPool);
  648. smalltalk.addMethod(
  649. "_initialize",
  650. smalltalk.method({
  651. selector: "initialize",
  652. category: 'initialization',
  653. fn: function (){
  654. var self=this;
  655. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  656. self["@poolSize"]=(0);
  657. self["@queue"]=_st((smalltalk.Queue || Queue))._new();
  658. self["@worker"]=_st(self)._makeWorker();
  659. return self}, function($ctx1) {$ctx1.fill(self,"initialize", [], smalltalk.ForkPool)})},
  660. args: [],
  661. source: "initialize\x0a super initialize.\x0a \x0a\x09poolSize := 0.\x0a queue := Queue new.\x0a worker := self makeWorker",
  662. messageSends: ["initialize", "new", "makeWorker"],
  663. referencedClasses: ["Queue"]
  664. }),
  665. smalltalk.ForkPool);
  666. smalltalk.addMethod(
  667. "_makeWorker",
  668. smalltalk.method({
  669. selector: "makeWorker",
  670. category: 'initialization',
  671. fn: function (){
  672. var self=this;
  673. var sentinel;
  674. return smalltalk.withContext(function($ctx1) { var $2,$1;
  675. sentinel=_st((smalltalk.Object || Object))._new();
  676. $1=(function(){
  677. return smalltalk.withContext(function($ctx2) { self["@poolSize"]=_st(self["@poolSize"]).__minus((1));
  678. self["@poolSize"];
  679. block=_st(self["@queue"])._frontIfAbsent_((function(){
  680. return smalltalk.withContext(function($ctx3) { return sentinel;
  681. }, function($ctx3) {$ctx3.fill(null, null, {})})}));
  682. block;
  683. $2=_st(block).__eq_eq(sentinel);
  684. if(! smalltalk.assert($2)){
  685. return _st((function(){
  686. return smalltalk.withContext(function($ctx3) { return _st(block)._value();
  687. }, function($ctx3) {$ctx3.fill(null, null, {})})}))._ensure_((function(){
  688. return smalltalk.withContext(function($ctx3) { return _st(self)._addWorker();
  689. }, function($ctx3) {$ctx3.fill(null, null, {})})}));
  690. };
  691. }, function($ctx2) {$ctx2.fill(null, null, {})})});
  692. return $1;
  693. }, function($ctx1) {$ctx1.fill(self,"makeWorker", [], smalltalk.ForkPool)})},
  694. args: [],
  695. source: "makeWorker\x0a\x09| sentinel |\x0a sentinel := Object new.\x0a ^[ | block |\x0a poolSize := poolSize - 1.\x0a\x09\x09block := queue frontIfAbsent: [ sentinel ].\x0a block == sentinel ifFalse: [\x0a \x09[ block value ] ensure: [ self addWorker ]]]",
  696. messageSends: ["new", "-", "frontIfAbsent:", "ifFalse:", "ensure:", "addWorker", "value", "=="],
  697. referencedClasses: ["Object"]
  698. }),
  699. smalltalk.ForkPool);
  700. smalltalk.addMethod(
  701. "_maxPoolSize",
  702. smalltalk.method({
  703. selector: "maxPoolSize",
  704. category: 'accessing',
  705. fn: function (){
  706. var self=this;
  707. return smalltalk.withContext(function($ctx1) { var $2,$1;
  708. $2=self["@maxPoolSize"];
  709. if(($receiver = $2) == nil || $receiver == undefined){
  710. $1=_st(self)._defaultMaxPoolSize();
  711. } else {
  712. $1=$2;
  713. };
  714. return $1;
  715. }, function($ctx1) {$ctx1.fill(self,"maxPoolSize", [], smalltalk.ForkPool)})},
  716. args: [],
  717. source: "maxPoolSize\x0a\x09^ maxPoolSize ifNil: [ self defaultMaxPoolSize ]",
  718. messageSends: ["ifNil:", "defaultMaxPoolSize"],
  719. referencedClasses: []
  720. }),
  721. smalltalk.ForkPool);
  722. smalltalk.addMethod(
  723. "_maxPoolSize_",
  724. smalltalk.method({
  725. selector: "maxPoolSize:",
  726. category: 'accessing',
  727. fn: function (anInteger){
  728. var self=this;
  729. return smalltalk.withContext(function($ctx1) { self["@maxPoolSize"]=anInteger;
  730. return self}, function($ctx1) {$ctx1.fill(self,"maxPoolSize:", [anInteger], smalltalk.ForkPool)})},
  731. args: ["anInteger"],
  732. source: "maxPoolSize: anInteger\x0a\x09maxPoolSize := anInteger",
  733. messageSends: [],
  734. referencedClasses: []
  735. }),
  736. smalltalk.ForkPool);
  737. smalltalk.ForkPool.klass.iVarNames = ['default'];
  738. smalltalk.addMethod(
  739. "_default",
  740. smalltalk.method({
  741. selector: "default",
  742. category: 'accessing',
  743. fn: function (){
  744. var self=this;
  745. return smalltalk.withContext(function($ctx1) { var $2,$1;
  746. $2=self["@default"];
  747. if(($receiver = $2) == nil || $receiver == undefined){
  748. self["@default"]=_st(self)._new();
  749. $1=self["@default"];
  750. } else {
  751. $1=$2;
  752. };
  753. return $1;
  754. }, function($ctx1) {$ctx1.fill(self,"default", [], smalltalk.ForkPool.klass)})},
  755. args: [],
  756. source: "default\x0a\x09^default ifNil: [ default := self new ]",
  757. messageSends: ["ifNil:", "new"],
  758. referencedClasses: []
  759. }),
  760. smalltalk.ForkPool.klass);
  761. smalltalk.addMethod(
  762. "_defaultMaxPoolSize",
  763. smalltalk.method({
  764. selector: "defaultMaxPoolSize",
  765. category: 'accessing',
  766. fn: function (){
  767. var self=this;
  768. return smalltalk.withContext(function($ctx1) { return (100);
  769. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize", [], smalltalk.ForkPool.klass)})},
  770. args: [],
  771. source: "defaultMaxPoolSize\x0a\x09^100",
  772. messageSends: [],
  773. referencedClasses: []
  774. }),
  775. smalltalk.ForkPool.klass);
  776. smalltalk.addMethod(
  777. "_resetDefault",
  778. smalltalk.method({
  779. selector: "resetDefault",
  780. category: 'accessing',
  781. fn: function (){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) { self["@default"]=nil;
  784. return self}, function($ctx1) {$ctx1.fill(self,"resetDefault", [], smalltalk.ForkPool.klass)})},
  785. args: [],
  786. source: "resetDefault\x0a\x09default := nil",
  787. messageSends: [],
  788. referencedClasses: []
  789. }),
  790. smalltalk.ForkPool.klass);
  791. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  792. smalltalk.Message.comment="Generally, the system does not use instances of Message for efficiency reasons.\x0aHowever, when a message is not understood by its receiver, the interpreter will make up an instance of it in order to capture the information involved in an actual message transmission. \x0aThis instance is sent it as an argument with the message `doesNotUnderstand:` to the receiver.\x0a\x0aSee boot.js, `messageNotUnderstood` and its counterpart `Object>>doesNotUnderstand:`"
  793. smalltalk.addMethod(
  794. "_arguments",
  795. smalltalk.method({
  796. selector: "arguments",
  797. category: 'accessing',
  798. fn: function (){
  799. var self=this;
  800. return smalltalk.withContext(function($ctx1) { var $1;
  801. $1=self["@arguments"];
  802. return $1;
  803. }, function($ctx1) {$ctx1.fill(self,"arguments", [], smalltalk.Message)})},
  804. args: [],
  805. source: "arguments\x0a\x09^arguments",
  806. messageSends: [],
  807. referencedClasses: []
  808. }),
  809. smalltalk.Message);
  810. smalltalk.addMethod(
  811. "_arguments_",
  812. smalltalk.method({
  813. selector: "arguments:",
  814. category: 'accessing',
  815. fn: function (anArray){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx1) { self["@arguments"]=anArray;
  818. return self}, function($ctx1) {$ctx1.fill(self,"arguments:", [anArray], smalltalk.Message)})},
  819. args: ["anArray"],
  820. source: "arguments: anArray\x0a\x09arguments := anArray",
  821. messageSends: [],
  822. referencedClasses: []
  823. }),
  824. smalltalk.Message);
  825. smalltalk.addMethod(
  826. "_printString",
  827. smalltalk.method({
  828. selector: "printString",
  829. category: 'printing',
  830. fn: function (){
  831. var self=this;
  832. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  833. $1=_st((smalltalk.String || String))._streamContents_((function(aStream){
  834. return smalltalk.withContext(function($ctx2) { $2=aStream;
  835. _st($2)._nextPutAll_(smalltalk.Object.fn.prototype._printString.apply(_st(self), []));
  836. _st($2)._nextPutAll_("(");
  837. _st($2)._nextPutAll_(self["@selector"]);
  838. $3=_st($2)._nextPutAll_(")");
  839. return $3;
  840. }, function($ctx2) {$ctx2.fill(null, null, {})})}));
  841. return $1;
  842. }, function($ctx1) {$ctx1.fill(self,"printString", [], smalltalk.Message)})},
  843. args: [],
  844. source: "printString\x0a\x09^ String streamContents: [:aStream| \x0a \x09\x09\x09\x09aStream \x0a \x09\x09\x09\x09\x09nextPutAll: super printString;\x0a \x09\x09\x09\x09\x09nextPutAll: '(';\x0a \x09\x09\x09\x09\x09nextPutAll: selector;\x0a \x09\x09\x09\x09\x09nextPutAll: ')' \x09\x09\x09\x09]",
  845. messageSends: ["streamContents:", "nextPutAll:", "printString"],
  846. referencedClasses: ["String"]
  847. }),
  848. smalltalk.Message);
  849. smalltalk.addMethod(
  850. "_selector",
  851. smalltalk.method({
  852. selector: "selector",
  853. category: 'accessing',
  854. fn: function (){
  855. var self=this;
  856. return smalltalk.withContext(function($ctx1) { var $1;
  857. $1=self["@selector"];
  858. return $1;
  859. }, function($ctx1) {$ctx1.fill(self,"selector", [], smalltalk.Message)})},
  860. args: [],
  861. source: "selector\x0a\x09^selector",
  862. messageSends: [],
  863. referencedClasses: []
  864. }),
  865. smalltalk.Message);
  866. smalltalk.addMethod(
  867. "_selector_",
  868. smalltalk.method({
  869. selector: "selector:",
  870. category: 'accessing',
  871. fn: function (aString){
  872. var self=this;
  873. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  874. return self}, function($ctx1) {$ctx1.fill(self,"selector:", [aString], smalltalk.Message)})},
  875. args: ["aString"],
  876. source: "selector: aString\x0a\x09selector := aString",
  877. messageSends: [],
  878. referencedClasses: []
  879. }),
  880. smalltalk.Message);
  881. smalltalk.addMethod(
  882. "_sendTo_",
  883. smalltalk.method({
  884. selector: "sendTo:",
  885. category: 'printing',
  886. fn: function (anObject){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) { var $1;
  889. $1=_st(anObject)._perform_withArguments_(_st(self)._selector(),_st(self)._arguments());
  890. return $1;
  891. }, function($ctx1) {$ctx1.fill(self,"sendTo:", [anObject], smalltalk.Message)})},
  892. args: ["anObject"],
  893. source: "sendTo: anObject\x0a\x09^ anObject perform: self selector withArguments: self arguments",
  894. messageSends: ["perform:withArguments:", "selector", "arguments"],
  895. referencedClasses: []
  896. }),
  897. smalltalk.Message);
  898. smalltalk.addMethod(
  899. "_selector_arguments_",
  900. smalltalk.method({
  901. selector: "selector:arguments:",
  902. category: 'instance creation',
  903. fn: function (aString,anArray){
  904. var self=this;
  905. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  906. $2=_st(self)._new();
  907. _st($2)._selector_(aString);
  908. _st($2)._arguments_(anArray);
  909. $3=_st($2)._yourself();
  910. $1=$3;
  911. return $1;
  912. }, function($ctx1) {$ctx1.fill(self,"selector:arguments:", [aString,anArray], smalltalk.Message.klass)})},
  913. args: ["aString", "anArray"],
  914. source: "selector: aString arguments: anArray\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09arguments: anArray;\x0a\x09\x09yourself",
  915. messageSends: ["selector:", "new", "arguments:", "yourself"],
  916. referencedClasses: []
  917. }),
  918. smalltalk.Message.klass);
  919. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  920. smalltalk.MethodContext.comment="MethodContext holds all the dynamic state associated with the execution of either a method activation resulting from a message send. That is used to build the call stack while debugging.\x0a \x0aMethodContext instances are JavaScript `SmalltalkMethodContext` objects defined in boot.js \x0a\x0aCurrent limitation: MethodContext instances are not created on Block evaluation. That means it's actually impossible to debug inside a Block."
  921. smalltalk.addMethod(
  922. "_asString",
  923. smalltalk.method({
  924. selector: "asString",
  925. category: 'accessing',
  926. fn: function (){
  927. var self=this;
  928. return smalltalk.withContext(function($ctx1) { var $1;
  929. $1=_st(_st(_st(_st(_st(self)._receiver())._class())._printString()).__comma(" >> ")).__comma(_st(self)._selector());
  930. return $1;
  931. }, function($ctx1) {$ctx1.fill(self,"asString", [], smalltalk.MethodContext)})},
  932. args: [],
  933. source: "asString\x0a\x09^self receiver class printString, ' >> ', self selector",
  934. messageSends: [",", "selector", "printString", "class", "receiver"],
  935. referencedClasses: []
  936. }),
  937. smalltalk.MethodContext);
  938. smalltalk.addMethod(
  939. "_home",
  940. smalltalk.method({
  941. selector: "home",
  942. category: 'accessing',
  943. fn: function (){
  944. var self=this;
  945. return smalltalk.withContext(function($ctx1) { return self.homeContext;
  946. return self}, function($ctx1) {$ctx1.fill(self,"home", [], smalltalk.MethodContext)})},
  947. args: [],
  948. source: "home\x0a\x09<return self.homeContext>",
  949. messageSends: [],
  950. referencedClasses: []
  951. }),
  952. smalltalk.MethodContext);
  953. smalltalk.addMethod(
  954. "_isBlockContext",
  955. smalltalk.method({
  956. selector: "isBlockContext",
  957. category: 'testing',
  958. fn: function (){
  959. var self=this;
  960. return smalltalk.withContext(function($ctx1) { var $1;
  961. $1=_st(_st(self)._selector())._isNil();
  962. return $1;
  963. }, function($ctx1) {$ctx1.fill(self,"isBlockContext", [], smalltalk.MethodContext)})},
  964. args: [],
  965. source: "isBlockContext\x0a\x09\x22Block context do not have selectors.\x22\x0a \x0a\x09^ self selector isNil",
  966. messageSends: ["isNil", "selector"],
  967. referencedClasses: []
  968. }),
  969. smalltalk.MethodContext);
  970. smalltalk.addMethod(
  971. "_locals",
  972. smalltalk.method({
  973. selector: "locals",
  974. category: 'accessing',
  975. fn: function (){
  976. var self=this;
  977. return smalltalk.withContext(function($ctx1) { return self.locals;
  978. return self}, function($ctx1) {$ctx1.fill(self,"locals", [], smalltalk.MethodContext)})},
  979. args: [],
  980. source: "locals\x0a\x09<return self.locals>",
  981. messageSends: [],
  982. referencedClasses: []
  983. }),
  984. smalltalk.MethodContext);
  985. smalltalk.addMethod(
  986. "_methodContext",
  987. smalltalk.method({
  988. selector: "methodContext",
  989. category: 'accessing',
  990. fn: function (){
  991. var self=this;
  992. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  993. $1=_st(self)._isBlockContext();
  994. if(! smalltalk.assert($1)){
  995. $2=self;
  996. return $2;
  997. };
  998. $3=_st(self)._outerContext();
  999. return $3;
  1000. }, function($ctx1) {$ctx1.fill(self,"methodContext", [], smalltalk.MethodContext)})},
  1001. args: [],
  1002. source: "methodContext\x0a\x09self isBlockContext ifFalse: [ ^ self ].\x0a \x0a ^ self outerContext",
  1003. messageSends: ["ifFalse:", "isBlockContext", "outerContext"],
  1004. referencedClasses: []
  1005. }),
  1006. smalltalk.MethodContext);
  1007. smalltalk.addMethod(
  1008. "_outerContext",
  1009. smalltalk.method({
  1010. selector: "outerContext",
  1011. category: 'accessing',
  1012. fn: function (){
  1013. var self=this;
  1014. return smalltalk.withContext(function($ctx1) { var $1;
  1015. $1=_st(self)._home();
  1016. return $1;
  1017. }, function($ctx1) {$ctx1.fill(self,"outerContext", [], smalltalk.MethodContext)})},
  1018. args: [],
  1019. source: "outerContext\x0a\x09^ self home",
  1020. messageSends: ["home"],
  1021. referencedClasses: []
  1022. }),
  1023. smalltalk.MethodContext);
  1024. smalltalk.addMethod(
  1025. "_pc",
  1026. smalltalk.method({
  1027. selector: "pc",
  1028. category: 'accessing',
  1029. fn: function (){
  1030. var self=this;
  1031. return smalltalk.withContext(function($ctx1) { return self.pc;
  1032. return self}, function($ctx1) {$ctx1.fill(self,"pc", [], smalltalk.MethodContext)})},
  1033. args: [],
  1034. source: "pc\x0a\x09<return self.pc>",
  1035. messageSends: [],
  1036. referencedClasses: []
  1037. }),
  1038. smalltalk.MethodContext);
  1039. smalltalk.addMethod(
  1040. "_printString",
  1041. smalltalk.method({
  1042. selector: "printString",
  1043. category: 'accessing',
  1044. fn: function (){
  1045. var self=this;
  1046. return smalltalk.withContext(function($ctx1) { var $1;
  1047. $1=_st(_st(_st(smalltalk.Object.fn.prototype._printString.apply(_st(self), [])).__comma("(")).__comma(_st(self)._asString())).__comma(")");
  1048. return $1;
  1049. }, function($ctx1) {$ctx1.fill(self,"printString", [], smalltalk.MethodContext)})},
  1050. args: [],
  1051. source: "printString\x0a\x09^super printString, '(', self asString, ')'",
  1052. messageSends: [",", "asString", "printString"],
  1053. referencedClasses: []
  1054. }),
  1055. smalltalk.MethodContext);
  1056. smalltalk.addMethod(
  1057. "_receiver",
  1058. smalltalk.method({
  1059. selector: "receiver",
  1060. category: 'accessing',
  1061. fn: function (){
  1062. var self=this;
  1063. return smalltalk.withContext(function($ctx1) { return self.receiver;
  1064. return self}, function($ctx1) {$ctx1.fill(self,"receiver", [], smalltalk.MethodContext)})},
  1065. args: [],
  1066. source: "receiver\x0a\x09<return self.receiver>",
  1067. messageSends: [],
  1068. referencedClasses: []
  1069. }),
  1070. smalltalk.MethodContext);
  1071. smalltalk.addMethod(
  1072. "_selector",
  1073. smalltalk.method({
  1074. selector: "selector",
  1075. category: 'accessing',
  1076. fn: function (){
  1077. var self=this;
  1078. return smalltalk.withContext(function($ctx1) {
  1079. if(self.selector) {
  1080. return smalltalk.convertSelector(self.selector);
  1081. } else {
  1082. return nil;
  1083. }
  1084. ;
  1085. return self}, function($ctx1) {$ctx1.fill(self,"selector", [], smalltalk.MethodContext)})},
  1086. args: [],
  1087. source: "selector\x0a\x09<\x0a \x09if(self.selector) {\x0a \x09return smalltalk.convertSelector(self.selector);\x0a } else {\x0a \x09return nil;\x0a }\x0a >",
  1088. messageSends: [],
  1089. referencedClasses: []
  1090. }),
  1091. smalltalk.MethodContext);
  1092. smalltalk.addMethod(
  1093. "_temps",
  1094. smalltalk.method({
  1095. selector: "temps",
  1096. category: 'accessing',
  1097. fn: function (){
  1098. var self=this;
  1099. return smalltalk.withContext(function($ctx1) { var $1;
  1100. _st(self)._deprecatedAPI();
  1101. $1=_st(self)._locals();
  1102. return $1;
  1103. }, function($ctx1) {$ctx1.fill(self,"temps", [], smalltalk.MethodContext)})},
  1104. args: [],
  1105. source: "temps\x0a\x09self deprecatedAPI.\x0a \x0a\x09^ self locals",
  1106. messageSends: ["deprecatedAPI", "locals"],
  1107. referencedClasses: []
  1108. }),
  1109. smalltalk.MethodContext);