2
0

Kernel-Methods.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. smalltalk.addPackage('Kernel-Methods', {});
  2. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
  3. smalltalk.BlockClosure.comment=unescape('A%20BlockClosure%20is%20a%20lexical%20closure.%0AThe%20JavaScript%20representation%20is%20a%20function.%0A%0AA%20BlockClosure%20is%20evaluated%20with%20the%20%60%23value*%60%20methods%20in%20the%20%27evaluating%27%20protocol.')
  4. smalltalk.addMethod(
  5. unescape('_applyTo_arguments_'),
  6. smalltalk.method({
  7. selector: unescape('applyTo%3Aarguments%3A'),
  8. category: 'evaluating',
  9. fn: function (anObject, aCollection) {
  10. var self = this;
  11. return self.apply(anObject, aCollection);
  12. return self;
  13. },
  14. args: ["anObject", "aCollection"],
  15. source: unescape('applyTo%3A%20anObject%20arguments%3A%20aCollection%0A%09%3Creturn%20self.apply%28anObject%2C%20aCollection%29%3E'),
  16. messageSends: [],
  17. referencedClasses: []
  18. }),
  19. smalltalk.BlockClosure);
  20. smalltalk.addMethod(
  21. unescape('_compiledSource'),
  22. smalltalk.method({
  23. selector: unescape('compiledSource'),
  24. category: 'accessing',
  25. fn: function () {
  26. var self = this;
  27. return self.toString();
  28. return self;
  29. },
  30. args: [],
  31. source: unescape('compiledSource%0A%09%3Creturn%20self.toString%28%29%3E'),
  32. messageSends: [],
  33. referencedClasses: []
  34. }),
  35. smalltalk.BlockClosure);
  36. smalltalk.addMethod(
  37. unescape('_ensure_'),
  38. smalltalk.method({
  39. selector: unescape('ensure%3A'),
  40. category: 'evaluating',
  41. fn: function (aBlock) {
  42. var self = this;
  43. var success = nil;
  44. success = false;
  45. return smalltalk.send(function () {smalltalk.send(self, "_value", []);success = true;return smalltalk.send(aBlock, "_value", []);}, "_on_do_", [smalltalk.Error || Error, function (ex) {($receiver = success).klass === smalltalk.Boolean ? !$receiver ? function () {return smalltalk.send(aBlock, "_value", []);}() : nil : smalltalk.send($receiver, "_ifFalse_", [function () {return smalltalk.send(aBlock, "_value", []);}]);return smalltalk.send(ex, "_signal", []);}]);
  46. return self;
  47. },
  48. args: ["aBlock"],
  49. source: unescape('ensure%3A%20aBlock%0A%09%7C%20success%20%7C%0A%09success%20%3A%3D%20false.%0A%09%5E%5Bself%20value.%20success%20%3A%3D%20true.%20aBlock%20value%5D%0A%09%09on%3A%20Error%0A%09%09do%3A%20%5B%3Aex%20%7C%0A%09%09%09success%20ifFalse%3A%20%5BaBlock%20value%5D.%0A%09%09%09ex%20signal%5D'),
  50. messageSends: ["on:do:", "value", "ifFalse:", "signal"],
  51. referencedClasses: ["Error"]
  52. }),
  53. smalltalk.BlockClosure);
  54. smalltalk.addMethod(
  55. unescape('_new'),
  56. smalltalk.method({
  57. selector: unescape('new'),
  58. category: 'evaluating',
  59. fn: function () {
  60. var self = this;
  61. return new self;
  62. return self;
  63. },
  64. args: [],
  65. source: unescape('new%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28%29%3E'),
  66. messageSends: [],
  67. referencedClasses: []
  68. }),
  69. smalltalk.BlockClosure);
  70. smalltalk.addMethod(
  71. unescape('_newValue_'),
  72. smalltalk.method({
  73. selector: unescape('newValue%3A'),
  74. category: 'evaluating',
  75. fn: function (anObject) {
  76. var self = this;
  77. return new self(anObject);
  78. return self;
  79. },
  80. args: ["anObject"],
  81. source: unescape('newValue%3A%20anObject%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%29%3E'),
  82. messageSends: [],
  83. referencedClasses: []
  84. }),
  85. smalltalk.BlockClosure);
  86. smalltalk.addMethod(
  87. unescape('_newValue_value_'),
  88. smalltalk.method({
  89. selector: unescape('newValue%3Avalue%3A'),
  90. category: 'evaluating',
  91. fn: function (anObject, anObject2) {
  92. var self = this;
  93. return new self(anObject, anObject2);
  94. return self;
  95. },
  96. args: ["anObject", "anObject2"],
  97. source: unescape('newValue%3A%20%20anObject%20value%3A%20anObject2%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%2C%20anObject2%29%3E'),
  98. messageSends: [],
  99. referencedClasses: []
  100. }),
  101. smalltalk.BlockClosure);
  102. smalltalk.addMethod(
  103. unescape('_newValue_value_value_'),
  104. smalltalk.method({
  105. selector: unescape('newValue%3Avalue%3Avalue%3A'),
  106. category: 'evaluating',
  107. fn: function (anObject, anObject2, anObject3) {
  108. var self = this;
  109. return new self(anObject, anObject2);
  110. return self;
  111. },
  112. args: ["anObject", "anObject2", "anObject3"],
  113. source: unescape('newValue%3A%20%20anObject%20value%3A%20anObject2%20value%3A%20anObject3%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%2C%20anObject2%29%3E'),
  114. messageSends: [],
  115. referencedClasses: []
  116. }),
  117. smalltalk.BlockClosure);
  118. smalltalk.addMethod(
  119. unescape('_numArgs'),
  120. smalltalk.method({
  121. selector: unescape('numArgs'),
  122. category: 'accessing',
  123. fn: function () {
  124. var self = this;
  125. return self.length;
  126. return self;
  127. },
  128. args: [],
  129. source: unescape('numArgs%0A%09%3Creturn%20self.length%3E'),
  130. messageSends: [],
  131. referencedClasses: []
  132. }),
  133. smalltalk.BlockClosure);
  134. smalltalk.addMethod(
  135. unescape('_on_do_'),
  136. smalltalk.method({
  137. selector: unescape('on%3Ado%3A'),
  138. category: 'error handling',
  139. fn: function (anErrorClass, aBlock) {
  140. var self = this;
  141. return smalltalk.send(self, "_try_catch_", [self, function (error) {return ($receiver = smalltalk.send(error, "_isKindOf_", [anErrorClass])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(aBlock, "_value_", [error]);}() : function () {return smalltalk.send(error, "_signal", []);}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return smalltalk.send(aBlock, "_value_", [error]);}, function () {return smalltalk.send(error, "_signal", []);}]);}]);
  142. return self;
  143. },
  144. args: ["anErrorClass", "aBlock"],
  145. source: unescape('on%3A%20anErrorClass%20do%3A%20aBlock%0A%09%5Eself%20try%3A%20self%20catch%3A%20%5B%3Aerror%20%7C%0A%09%20%20%20%20%28error%20isKindOf%3A%20anErrorClass%29%20%0A%09%20%20%20%20%20ifTrue%3A%20%5BaBlock%20value%3A%20error%5D%0A%09%20%20%20%20%20ifFalse%3A%20%5Berror%20signal%5D%5D'),
  146. messageSends: ["try:catch:", "ifTrue:ifFalse:", "isKindOf:", "value:", "signal"],
  147. referencedClasses: []
  148. }),
  149. smalltalk.BlockClosure);
  150. smalltalk.addMethod(
  151. unescape('_timeToRun'),
  152. smalltalk.method({
  153. selector: unescape('timeToRun'),
  154. category: 'evaluating',
  155. fn: function () {
  156. var self = this;
  157. return smalltalk.send(smalltalk.Date || Date, "_millisecondsToRun_", [self]);
  158. return self;
  159. },
  160. args: [],
  161. source: unescape('timeToRun%0A%09%22Answer%20the%20number%20of%20milliseconds%20taken%20to%20execute%20this%20block.%22%0A%0A%09%5E%20Date%20millisecondsToRun%3A%20self'),
  162. messageSends: ["millisecondsToRun:"],
  163. referencedClasses: ["Date"]
  164. }),
  165. smalltalk.BlockClosure);
  166. smalltalk.addMethod(
  167. unescape('_value'),
  168. smalltalk.method({
  169. selector: unescape('value'),
  170. category: 'evaluating',
  171. fn: function () {
  172. var self = this;
  173. return self();
  174. return self;
  175. },
  176. args: [],
  177. source: unescape('value%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28%29%3B%3E'),
  178. messageSends: [],
  179. referencedClasses: []
  180. }),
  181. smalltalk.BlockClosure);
  182. smalltalk.addMethod(
  183. unescape('_value_'),
  184. smalltalk.method({
  185. selector: unescape('value%3A'),
  186. category: 'evaluating',
  187. fn: function (anArg) {
  188. var self = this;
  189. return self(anArg);
  190. return self;
  191. },
  192. args: ["anArg"],
  193. source: unescape('value%3A%20anArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28anArg%29%3B%3E'),
  194. messageSends: [],
  195. referencedClasses: []
  196. }),
  197. smalltalk.BlockClosure);
  198. smalltalk.addMethod(
  199. unescape('_value_value_'),
  200. smalltalk.method({
  201. selector: unescape('value%3Avalue%3A'),
  202. category: 'evaluating',
  203. fn: function (firstArg, secondArg) {
  204. var self = this;
  205. return self(firstArg, secondArg);
  206. return self;
  207. },
  208. args: ["firstArg", "secondArg"],
  209. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%29%3B%3E'),
  210. messageSends: [],
  211. referencedClasses: []
  212. }),
  213. smalltalk.BlockClosure);
  214. smalltalk.addMethod(
  215. unescape('_value_value_value_'),
  216. smalltalk.method({
  217. selector: unescape('value%3Avalue%3Avalue%3A'),
  218. category: 'evaluating',
  219. fn: function (firstArg, secondArg, thirdArg) {
  220. var self = this;
  221. return self(firstArg, secondArg, thirdArg);
  222. return self;
  223. },
  224. args: ["firstArg", "secondArg", "thirdArg"],
  225. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%3E'),
  226. messageSends: [],
  227. referencedClasses: []
  228. }),
  229. smalltalk.BlockClosure);
  230. smalltalk.addMethod(
  231. unescape('_valueWithInterval_'),
  232. smalltalk.method({
  233. selector: unescape('valueWithInterval%3A'),
  234. category: 'timeout/interval',
  235. fn: function (aNumber) {
  236. var self = this;
  237. return setInterval(self, aNumber);
  238. return self;
  239. },
  240. args: ["aNumber"],
  241. source: unescape('valueWithInterval%3A%20aNumber%0A%09%3Creturn%20setInterval%28self%2C%20aNumber%29%3E'),
  242. messageSends: [],
  243. referencedClasses: []
  244. }),
  245. smalltalk.BlockClosure);
  246. smalltalk.addMethod(
  247. unescape('_valueWithPossibleArguments_'),
  248. smalltalk.method({
  249. selector: unescape('valueWithPossibleArguments%3A'),
  250. category: 'evaluating',
  251. fn: function (aCollection) {
  252. var self = this;
  253. return self.apply(null, aCollection);
  254. return self;
  255. },
  256. args: ["aCollection"],
  257. source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%3Creturn%20self.apply%28null%2C%20aCollection%29%3B%3E'),
  258. messageSends: [],
  259. referencedClasses: []
  260. }),
  261. smalltalk.BlockClosure);
  262. smalltalk.addMethod(
  263. unescape('_valueWithTimeout_'),
  264. smalltalk.method({
  265. selector: unescape('valueWithTimeout%3A'),
  266. category: 'timeout/interval',
  267. fn: function (aNumber) {
  268. var self = this;
  269. return setTimeout(self, aNumber);
  270. return self;
  271. },
  272. args: ["aNumber"],
  273. source: unescape('valueWithTimeout%3A%20aNumber%0A%09%3Creturn%20setTimeout%28self%2C%20aNumber%29%3E'),
  274. messageSends: [],
  275. referencedClasses: []
  276. }),
  277. smalltalk.BlockClosure);
  278. smalltalk.addMethod(
  279. unescape('_whileFalse'),
  280. smalltalk.method({
  281. selector: unescape('whileFalse'),
  282. category: 'controlling',
  283. fn: function () {
  284. var self = this;
  285. smalltalk.send(self, "_whileFalse_", [function () {return nil;}]);
  286. return self;
  287. },
  288. args: [],
  289. source: unescape('whileFalse%0A%09%22inlined%20in%20the%20Compiler%22%0A%09self%20whileFalse%3A%20%5B%5D'),
  290. messageSends: ["whileFalse:"],
  291. referencedClasses: []
  292. }),
  293. smalltalk.BlockClosure);
  294. smalltalk.addMethod(
  295. unescape('_whileFalse_'),
  296. smalltalk.method({
  297. selector: unescape('whileFalse%3A'),
  298. category: 'controlling',
  299. fn: function (aBlock) {
  300. var self = this;
  301. while (!self()) {
  302. aBlock();
  303. }
  304. return self;
  305. },
  306. args: ["aBlock"],
  307. source: unescape('whileFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28%21self%28%29%29%20%7BaBlock%28%29%7D%3E'),
  308. messageSends: [],
  309. referencedClasses: []
  310. }),
  311. smalltalk.BlockClosure);
  312. smalltalk.addMethod(
  313. unescape('_whileTrue'),
  314. smalltalk.method({
  315. selector: unescape('whileTrue'),
  316. category: 'controlling',
  317. fn: function () {
  318. var self = this;
  319. smalltalk.send(self, "_whileTrue_", [function () {return nil;}]);
  320. return self;
  321. },
  322. args: [],
  323. source: unescape('whileTrue%0A%09%22inlined%20in%20the%20Compiler%22%0A%09self%20whileTrue%3A%20%5B%5D'),
  324. messageSends: ["whileTrue:"],
  325. referencedClasses: []
  326. }),
  327. smalltalk.BlockClosure);
  328. smalltalk.addMethod(
  329. unescape('_whileTrue_'),
  330. smalltalk.method({
  331. selector: unescape('whileTrue%3A'),
  332. category: 'controlling',
  333. fn: function (aBlock) {
  334. var self = this;
  335. while (self()) {
  336. aBlock();
  337. }
  338. return self;
  339. },
  340. args: ["aBlock"],
  341. source: unescape('whileTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28self%28%29%29%20%7BaBlock%28%29%7D%3E'),
  342. messageSends: [],
  343. referencedClasses: []
  344. }),
  345. smalltalk.BlockClosure);
  346. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  347. smalltalk.CompiledMethod.comment=unescape('CompiledMethod%20hold%20the%20source%20and%20compiled%20code%20of%20a%20class%20method.%0A%0AYou%20can%20get%20a%20CompiledMethod%20using%20%60Behavior%3E%3EmethodAt%3A%60%0A%0A%09String%20methodAt%3A%20%27lines%27%0A%0Aand%20read%20the%20source%20code%0A%0A%09%28String%20methodAt%3A%20%27lines%27%29%20source%0A%0ASee%20referenced%20classes%3A%0A%0A%09%28String%20methodAt%3A%20%27lines%27%29%20referencedClasses%0A%0Aor%20messages%20sent%20from%20this%20method%3A%0A%09%0A%09%28String%20methodAt%3A%20%27lines%27%29%20%20messageSends')
  348. smalltalk.addMethod(
  349. unescape('_arguments'),
  350. smalltalk.method({
  351. selector: unescape('arguments'),
  352. category: 'accessing',
  353. fn: function () {
  354. var self = this;
  355. return self.args || [];
  356. return self;
  357. },
  358. args: [],
  359. source: unescape('arguments%0A%09%3Creturn%20self.args%20%7C%7C%20%5B%5D%3E'),
  360. messageSends: [],
  361. referencedClasses: []
  362. }),
  363. smalltalk.CompiledMethod);
  364. smalltalk.addMethod(
  365. unescape('_category'),
  366. smalltalk.method({
  367. selector: unescape('category'),
  368. category: 'accessing',
  369. fn: function () {
  370. var self = this;
  371. return ($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil ||
  372. $receiver == undefined ? function () {return "";}() : $receiver;
  373. return self;
  374. },
  375. args: [],
  376. source: unescape('category%0A%09%5E%28self%20basicAt%3A%20%27category%27%29%20ifNil%3A%20%5B%27%27%5D'),
  377. messageSends: ["ifNil:", "basicAt:"],
  378. referencedClasses: []
  379. }),
  380. smalltalk.CompiledMethod);
  381. smalltalk.addMethod(
  382. unescape('_category_'),
  383. smalltalk.method({
  384. selector: unescape('category%3A'),
  385. category: 'accessing',
  386. fn: function (aString) {
  387. var self = this;
  388. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  389. return self;
  390. },
  391. args: ["aString"],
  392. source: unescape('category%3A%20aString%0A%09self%20basicAt%3A%20%27category%27%20put%3A%20aString'),
  393. messageSends: ["basicAt:put:"],
  394. referencedClasses: []
  395. }),
  396. smalltalk.CompiledMethod);
  397. smalltalk.addMethod(
  398. unescape('_fn'),
  399. smalltalk.method({
  400. selector: unescape('fn'),
  401. category: 'accessing',
  402. fn: function () {
  403. var self = this;
  404. return smalltalk.send(self, "_basicAt_", ["fn"]);
  405. return self;
  406. },
  407. args: [],
  408. source: unescape('fn%0A%09%5Eself%20basicAt%3A%20%27fn%27'),
  409. messageSends: ["basicAt:"],
  410. referencedClasses: []
  411. }),
  412. smalltalk.CompiledMethod);
  413. smalltalk.addMethod(
  414. unescape('_fn_'),
  415. smalltalk.method({
  416. selector: unescape('fn%3A'),
  417. category: 'accessing',
  418. fn: function (aBlock) {
  419. var self = this;
  420. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  421. return self;
  422. },
  423. args: ["aBlock"],
  424. source: unescape('fn%3A%20aBlock%0A%09self%20basicAt%3A%20%27fn%27%20put%3A%20aBlock'),
  425. messageSends: ["basicAt:put:"],
  426. referencedClasses: []
  427. }),
  428. smalltalk.CompiledMethod);
  429. smalltalk.addMethod(
  430. unescape('_messageSends'),
  431. smalltalk.method({
  432. selector: unescape('messageSends'),
  433. category: 'accessing',
  434. fn: function () {
  435. var self = this;
  436. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  437. return self;
  438. },
  439. args: [],
  440. source: unescape('messageSends%0A%09%5Eself%20basicAt%3A%20%27messageSends%27'),
  441. messageSends: ["basicAt:"],
  442. referencedClasses: []
  443. }),
  444. smalltalk.CompiledMethod);
  445. smalltalk.addMethod(
  446. unescape('_methodClass'),
  447. smalltalk.method({
  448. selector: unescape('methodClass'),
  449. category: 'accessing',
  450. fn: function () {
  451. var self = this;
  452. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  453. return self;
  454. },
  455. args: [],
  456. source: unescape('methodClass%0A%09%5Eself%20basicAt%3A%20%27methodClass%27'),
  457. messageSends: ["basicAt:"],
  458. referencedClasses: []
  459. }),
  460. smalltalk.CompiledMethod);
  461. smalltalk.addMethod(
  462. unescape('_referencedClasses'),
  463. smalltalk.method({
  464. selector: unescape('referencedClasses'),
  465. category: 'accessing',
  466. fn: function () {
  467. var self = this;
  468. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  469. return self;
  470. },
  471. args: [],
  472. source: unescape('referencedClasses%0A%09%5Eself%20basicAt%3A%20%27referencedClasses%27'),
  473. messageSends: ["basicAt:"],
  474. referencedClasses: []
  475. }),
  476. smalltalk.CompiledMethod);
  477. smalltalk.addMethod(
  478. unescape('_selector'),
  479. smalltalk.method({
  480. selector: unescape('selector'),
  481. category: 'accessing',
  482. fn: function () {
  483. var self = this;
  484. return smalltalk.send(self, "_basicAt_", ["selector"]);
  485. return self;
  486. },
  487. args: [],
  488. source: unescape('selector%0A%09%5Eself%20basicAt%3A%20%27selector%27'),
  489. messageSends: ["basicAt:"],
  490. referencedClasses: []
  491. }),
  492. smalltalk.CompiledMethod);
  493. smalltalk.addMethod(
  494. unescape('_selector_'),
  495. smalltalk.method({
  496. selector: unescape('selector%3A'),
  497. category: 'accessing',
  498. fn: function (aString) {
  499. var self = this;
  500. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  501. return self;
  502. },
  503. args: ["aString"],
  504. source: unescape('selector%3A%20aString%0A%09self%20basicAt%3A%20%27selector%27%20put%3A%20aString'),
  505. messageSends: ["basicAt:put:"],
  506. referencedClasses: []
  507. }),
  508. smalltalk.CompiledMethod);
  509. smalltalk.addMethod(
  510. unescape('_source'),
  511. smalltalk.method({
  512. selector: unescape('source'),
  513. category: 'accessing',
  514. fn: function () {
  515. var self = this;
  516. return ($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil ||
  517. $receiver == undefined ? function () {return "";}() : $receiver;
  518. return self;
  519. },
  520. args: [],
  521. source: unescape('source%0A%09%5E%28self%20basicAt%3A%20%27source%27%29%20ifNil%3A%20%5B%27%27%5D'),
  522. messageSends: ["ifNil:", "basicAt:"],
  523. referencedClasses: []
  524. }),
  525. smalltalk.CompiledMethod);
  526. smalltalk.addMethod(
  527. unescape('_source_'),
  528. smalltalk.method({
  529. selector: unescape('source%3A'),
  530. category: 'accessing',
  531. fn: function (aString) {
  532. var self = this;
  533. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  534. return self;
  535. },
  536. args: ["aString"],
  537. source: unescape('source%3A%20aString%0A%09self%20basicAt%3A%20%27source%27%20put%3A%20aString'),
  538. messageSends: ["basicAt:put:"],
  539. referencedClasses: []
  540. }),
  541. smalltalk.CompiledMethod);
  542. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  543. smalltalk.Message.comment=unescape('Generally%2C%20the%20system%20does%20not%20use%20instances%20of%20Message%20for%20efficiency%20reasons.%0AHowever%2C%20when%20a%20message%20is%20not%20understood%20by%20its%20receiver%2C%20the%20interpreter%20will%20make%20up%20an%20instance%20of%20it%20in%20order%20to%20capture%20the%20information%20involved%20in%20an%20actual%20message%20transmission.%20%0AThis%20instance%20is%20sent%20it%20as%20an%20argument%20with%20the%20message%20%60doesNotUnderstand%3A%60%20to%20the%20receiver.%0A%0ASee%20boot.js%2C%20%60messageNotUnderstood%60%20%20and%20its%20counterpart%20%60Object%3E%3EdoesNotUnderstand%3A%60')
  544. smalltalk.addMethod(
  545. unescape('_arguments'),
  546. smalltalk.method({
  547. selector: unescape('arguments'),
  548. category: 'accessing',
  549. fn: function () {
  550. var self = this;
  551. return self['@arguments'];
  552. return self;
  553. },
  554. args: [],
  555. source: unescape('arguments%0A%09%5Earguments'),
  556. messageSends: [],
  557. referencedClasses: []
  558. }),
  559. smalltalk.Message);
  560. smalltalk.addMethod(
  561. unescape('_arguments_'),
  562. smalltalk.method({
  563. selector: unescape('arguments%3A'),
  564. category: 'accessing',
  565. fn: function (anArray) {
  566. var self = this;
  567. self['@arguments'] = anArray;
  568. return self;
  569. },
  570. args: ["anArray"],
  571. source: unescape('arguments%3A%20anArray%0A%09arguments%20%3A%3D%20anArray'),
  572. messageSends: [],
  573. referencedClasses: []
  574. }),
  575. smalltalk.Message);
  576. smalltalk.addMethod(
  577. unescape('_printString'),
  578. smalltalk.method({
  579. selector: unescape('printString'),
  580. category: 'printing',
  581. fn: function () {
  582. var self = this;
  583. return smalltalk.send(smalltalk.String || String, "_streamContents_", [function (aStream) {return function ($rec) {smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);}(aStream);}]);
  584. return self;
  585. },
  586. args: [],
  587. source: unescape('printString%0A%09%5E%20String%20streamContents%3A%20%5B%3AaStream%7C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20super%20printString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27%28%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20selector%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27%29%27%20%09%09%09%09%5D'),
  588. messageSends: ["streamContents:", "nextPutAll:", "printString"],
  589. referencedClasses: ["String"]
  590. }),
  591. smalltalk.Message);
  592. smalltalk.addMethod(
  593. unescape('_selector'),
  594. smalltalk.method({
  595. selector: unescape('selector'),
  596. category: 'accessing',
  597. fn: function () {
  598. var self = this;
  599. return self['@selector'];
  600. return self;
  601. },
  602. args: [],
  603. source: unescape('selector%0A%09%5Eselector'),
  604. messageSends: [],
  605. referencedClasses: []
  606. }),
  607. smalltalk.Message);
  608. smalltalk.addMethod(
  609. unescape('_selector_'),
  610. smalltalk.method({
  611. selector: unescape('selector%3A'),
  612. category: 'accessing',
  613. fn: function (aString) {
  614. var self = this;
  615. self['@selector'] = aString;
  616. return self;
  617. },
  618. args: ["aString"],
  619. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString'),
  620. messageSends: [],
  621. referencedClasses: []
  622. }),
  623. smalltalk.Message);
  624. smalltalk.addMethod(
  625. unescape('_sendTo_'),
  626. smalltalk.method({
  627. selector: unescape('sendTo%3A'),
  628. category: 'printing',
  629. fn: function (anObject) {
  630. var self = this;
  631. smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_send_to_arguments_", [smalltalk.send(self, "_selector", []), anObject, smalltalk.send(self, "_arguments", [])]);
  632. return self;
  633. },
  634. args: ["anObject"],
  635. source: unescape('sendTo%3A%20anObject%0A%09Smalltalk%20current%20send%3A%20self%20selector%20to%3A%20anObject%20arguments%3A%20self%20arguments'),
  636. messageSends: ["send:to:arguments:", "current", "selector", "arguments"],
  637. referencedClasses: ["Smalltalk"]
  638. }),
  639. smalltalk.Message);
  640. smalltalk.addMethod(
  641. unescape('_selector_arguments_'),
  642. smalltalk.method({
  643. selector: unescape('selector%3Aarguments%3A'),
  644. category: 'instance creation',
  645. fn: function (aString, anArray) {
  646. var self = this;
  647. return function ($rec) {smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  648. return self;
  649. },
  650. args: ["aString", "anArray"],
  651. source: unescape('selector%3A%20aString%20arguments%3A%20anArray%0A%09%5Eself%20new%0A%09%09selector%3A%20aString%3B%0A%09%09arguments%3A%20anArray%3B%0A%09%09yourself'),
  652. messageSends: ["selector:", "arguments:", "yourself", "new"],
  653. referencedClasses: []
  654. }),
  655. smalltalk.Message.klass);
  656. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  657. smalltalk.MethodContext.comment=unescape('MethodContext%20holds%20all%20the%20dynamic%20state%20associated%20with%20the%20execution%20of%20either%20a%20method%20activation%20resulting%20from%20a%20message%20send.%20That%20is%20used%20to%20build%20the%20call%20stack%20while%20debugging.%0A%20%20%0AMethodContext%20instances%20are%20JavaScript%20%60SmalltalkMethodContext%60%20objects%20defined%20in%20boot.js%20%0A%0ACurrent%20limitation%3A%20MethodContext%20instances%20are%20not%20created%20on%20Block%20evaluation.%20That%20means%20it%27s%20actually%20impossible%20to%20debug%20inside%20a%20Block.')
  658. smalltalk.addMethod(
  659. unescape('_asString'),
  660. smalltalk.method({
  661. selector: unescape('asString'),
  662. category: 'accessing',
  663. fn: function () {
  664. var self = this;
  665. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [unescape("%20%3E%3E%20")]), "__comma", [smalltalk.send(self, "_selector", [])]);
  666. return self;
  667. },
  668. args: [],
  669. source: unescape('asString%0A%09%5Eself%20receiver%20class%20printString%2C%20%27%20%3E%3E%20%27%2C%20self%20selector'),
  670. messageSends: [unescape("%2C"), "printString", "class", "receiver", "selector"],
  671. referencedClasses: []
  672. }),
  673. smalltalk.MethodContext);
  674. smalltalk.addMethod(
  675. unescape('_home'),
  676. smalltalk.method({
  677. selector: unescape('home'),
  678. category: 'accessing',
  679. fn: function () {
  680. var self = this;
  681. return self.homeContext;
  682. return self;
  683. },
  684. args: [],
  685. source: unescape('home%0A%09%3Creturn%20self.homeContext%3E'),
  686. messageSends: [],
  687. referencedClasses: []
  688. }),
  689. smalltalk.MethodContext);
  690. smalltalk.addMethod(
  691. unescape('_printString'),
  692. smalltalk.method({
  693. selector: unescape('printString'),
  694. category: 'accessing',
  695. fn: function () {
  696. var self = this;
  697. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  698. return self;
  699. },
  700. args: [],
  701. source: unescape('printString%0A%09%5Esuper%20printString%2C%20%27%28%27%2C%20self%20asString%2C%20%27%29%27'),
  702. messageSends: [unescape("%2C"), "printString", "asString"],
  703. referencedClasses: []
  704. }),
  705. smalltalk.MethodContext);
  706. smalltalk.addMethod(
  707. unescape('_receiver'),
  708. smalltalk.method({
  709. selector: unescape('receiver'),
  710. category: 'accessing',
  711. fn: function () {
  712. var self = this;
  713. return self.receiver;
  714. return self;
  715. },
  716. args: [],
  717. source: unescape('receiver%0A%09%3Creturn%20self.receiver%3E'),
  718. messageSends: [],
  719. referencedClasses: []
  720. }),
  721. smalltalk.MethodContext);
  722. smalltalk.addMethod(
  723. unescape('_selector'),
  724. smalltalk.method({
  725. selector: unescape('selector'),
  726. category: 'accessing',
  727. fn: function () {
  728. var self = this;
  729. return smalltalk.convertSelector(self.selector);
  730. return self;
  731. },
  732. args: [],
  733. source: unescape('selector%0A%09%3Creturn%20smalltalk.convertSelector%28self.selector%29%3E'),
  734. messageSends: [],
  735. referencedClasses: []
  736. }),
  737. smalltalk.MethodContext);
  738. smalltalk.addMethod(
  739. unescape('_temps'),
  740. smalltalk.method({
  741. selector: unescape('temps'),
  742. category: 'accessing',
  743. fn: function () {
  744. var self = this;
  745. return self.temps;
  746. return self;
  747. },
  748. args: [],
  749. source: unescape('temps%0A%09%3Creturn%20self.temps%3E'),
  750. messageSends: [],
  751. referencedClasses: []
  752. }),
  753. smalltalk.MethodContext);