Kernel-Methods.js 24 KB

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