Kernel-Methods.deploy.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. smalltalk.addPackage('Kernel-Methods', {});
  2. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
  3. smalltalk.addMethod(
  4. unescape('_applyTo_arguments_'),
  5. smalltalk.method({
  6. selector: unescape('applyTo%3Aarguments%3A'),
  7. fn: function (anObject, aCollection) {
  8. var self = this;
  9. return self.apply(anObject, aCollection);
  10. return self;
  11. }
  12. }),
  13. smalltalk.BlockClosure);
  14. smalltalk.addMethod(
  15. unescape('_compiledSource'),
  16. smalltalk.method({
  17. selector: unescape('compiledSource'),
  18. fn: function () {
  19. var self = this;
  20. return self.toString();
  21. return self;
  22. }
  23. }),
  24. smalltalk.BlockClosure);
  25. smalltalk.addMethod(
  26. unescape('_ensure_'),
  27. smalltalk.method({
  28. selector: unescape('ensure%3A'),
  29. fn: function (aBlock) {
  30. var self = this;
  31. var success = nil;
  32. success = false;
  33. 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", []);}]);
  34. return self;
  35. }
  36. }),
  37. smalltalk.BlockClosure);
  38. smalltalk.addMethod(
  39. unescape('_new'),
  40. smalltalk.method({
  41. selector: unescape('new'),
  42. fn: function () {
  43. var self = this;
  44. return new self;
  45. return self;
  46. }
  47. }),
  48. smalltalk.BlockClosure);
  49. smalltalk.addMethod(
  50. unescape('_newValue_'),
  51. smalltalk.method({
  52. selector: unescape('newValue%3A'),
  53. fn: function (anObject) {
  54. var self = this;
  55. return new self(anObject);
  56. return self;
  57. }
  58. }),
  59. smalltalk.BlockClosure);
  60. smalltalk.addMethod(
  61. unescape('_newValue_value_'),
  62. smalltalk.method({
  63. selector: unescape('newValue%3Avalue%3A'),
  64. fn: function (anObject, anObject2) {
  65. var self = this;
  66. return new self(anObject, anObject2);
  67. return self;
  68. }
  69. }),
  70. smalltalk.BlockClosure);
  71. smalltalk.addMethod(
  72. unescape('_newValue_value_value_'),
  73. smalltalk.method({
  74. selector: unescape('newValue%3Avalue%3Avalue%3A'),
  75. fn: function (anObject, anObject2, anObject3) {
  76. var self = this;
  77. return new self(anObject, anObject2);
  78. return self;
  79. }
  80. }),
  81. smalltalk.BlockClosure);
  82. smalltalk.addMethod(
  83. unescape('_numArgs'),
  84. smalltalk.method({
  85. selector: unescape('numArgs'),
  86. fn: function () {
  87. var self = this;
  88. return self.length;
  89. return self;
  90. }
  91. }),
  92. smalltalk.BlockClosure);
  93. smalltalk.addMethod(
  94. unescape('_on_do_'),
  95. smalltalk.method({
  96. selector: unescape('on%3Ado%3A'),
  97. fn: function (anErrorClass, aBlock) {
  98. var self = this;
  99. 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", []);}]);}]);
  100. return self;
  101. }
  102. }),
  103. smalltalk.BlockClosure);
  104. smalltalk.addMethod(
  105. unescape('_timeToRun'),
  106. smalltalk.method({
  107. selector: unescape('timeToRun'),
  108. fn: function () {
  109. var self = this;
  110. return smalltalk.send(smalltalk.Date || Date, "_millisecondsToRun_", [self]);
  111. return self;
  112. }
  113. }),
  114. smalltalk.BlockClosure);
  115. smalltalk.addMethod(
  116. unescape('_value'),
  117. smalltalk.method({
  118. selector: unescape('value'),
  119. fn: function () {
  120. var self = this;
  121. return self();
  122. return self;
  123. }
  124. }),
  125. smalltalk.BlockClosure);
  126. smalltalk.addMethod(
  127. unescape('_value_'),
  128. smalltalk.method({
  129. selector: unescape('value%3A'),
  130. fn: function (anArg) {
  131. var self = this;
  132. return self(anArg);
  133. return self;
  134. }
  135. }),
  136. smalltalk.BlockClosure);
  137. smalltalk.addMethod(
  138. unescape('_value_value_'),
  139. smalltalk.method({
  140. selector: unescape('value%3Avalue%3A'),
  141. fn: function (firstArg, secondArg) {
  142. var self = this;
  143. return self(firstArg, secondArg);
  144. return self;
  145. }
  146. }),
  147. smalltalk.BlockClosure);
  148. smalltalk.addMethod(
  149. unescape('_value_value_value_'),
  150. smalltalk.method({
  151. selector: unescape('value%3Avalue%3Avalue%3A'),
  152. fn: function (firstArg, secondArg, thirdArg) {
  153. var self = this;
  154. return self(firstArg, secondArg, thirdArg);
  155. return self;
  156. }
  157. }),
  158. smalltalk.BlockClosure);
  159. smalltalk.addMethod(
  160. unescape('_valueWithInterval_'),
  161. smalltalk.method({
  162. selector: unescape('valueWithInterval%3A'),
  163. fn: function (aNumber) {
  164. var self = this;
  165. return setInterval(self, aNumber);
  166. return self;
  167. }
  168. }),
  169. smalltalk.BlockClosure);
  170. smalltalk.addMethod(
  171. unescape('_valueWithPossibleArguments_'),
  172. smalltalk.method({
  173. selector: unescape('valueWithPossibleArguments%3A'),
  174. fn: function (aCollection) {
  175. var self = this;
  176. return self.apply(null, aCollection);
  177. return self;
  178. }
  179. }),
  180. smalltalk.BlockClosure);
  181. smalltalk.addMethod(
  182. unescape('_valueWithTimeout_'),
  183. smalltalk.method({
  184. selector: unescape('valueWithTimeout%3A'),
  185. fn: function (aNumber) {
  186. var self = this;
  187. return setTimeout(self, aNumber);
  188. return self;
  189. }
  190. }),
  191. smalltalk.BlockClosure);
  192. smalltalk.addMethod(
  193. unescape('_whileFalse'),
  194. smalltalk.method({
  195. selector: unescape('whileFalse'),
  196. fn: function () {
  197. var self = this;
  198. smalltalk.send(self, "_whileFalse_", [function () {return nil;}]);
  199. return self;
  200. }
  201. }),
  202. smalltalk.BlockClosure);
  203. smalltalk.addMethod(
  204. unescape('_whileFalse_'),
  205. smalltalk.method({
  206. selector: unescape('whileFalse%3A'),
  207. fn: function (aBlock) {
  208. var self = this;
  209. while (!self()) {
  210. aBlock();
  211. }
  212. return self;
  213. }
  214. }),
  215. smalltalk.BlockClosure);
  216. smalltalk.addMethod(
  217. unescape('_whileTrue'),
  218. smalltalk.method({
  219. selector: unescape('whileTrue'),
  220. fn: function () {
  221. var self = this;
  222. smalltalk.send(self, "_whileTrue_", [function () {return nil;}]);
  223. return self;
  224. }
  225. }),
  226. smalltalk.BlockClosure);
  227. smalltalk.addMethod(
  228. unescape('_whileTrue_'),
  229. smalltalk.method({
  230. selector: unescape('whileTrue%3A'),
  231. fn: function (aBlock) {
  232. var self = this;
  233. while (self()) {
  234. aBlock();
  235. }
  236. return self;
  237. }
  238. }),
  239. smalltalk.BlockClosure);
  240. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  241. smalltalk.addMethod(
  242. unescape('_arguments'),
  243. smalltalk.method({
  244. selector: unescape('arguments'),
  245. fn: function () {
  246. var self = this;
  247. return self.args || [];
  248. return self;
  249. }
  250. }),
  251. smalltalk.CompiledMethod);
  252. smalltalk.addMethod(
  253. unescape('_category'),
  254. smalltalk.method({
  255. selector: unescape('category'),
  256. fn: function () {
  257. var self = this;
  258. return ($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil ||
  259. $receiver == undefined ? function () {return "";}() : $receiver;
  260. return self;
  261. }
  262. }),
  263. smalltalk.CompiledMethod);
  264. smalltalk.addMethod(
  265. unescape('_category_'),
  266. smalltalk.method({
  267. selector: unescape('category%3A'),
  268. fn: function (aString) {
  269. var self = this;
  270. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  271. return self;
  272. }
  273. }),
  274. smalltalk.CompiledMethod);
  275. smalltalk.addMethod(
  276. unescape('_fn'),
  277. smalltalk.method({
  278. selector: unescape('fn'),
  279. fn: function () {
  280. var self = this;
  281. return smalltalk.send(self, "_basicAt_", ["fn"]);
  282. return self;
  283. }
  284. }),
  285. smalltalk.CompiledMethod);
  286. smalltalk.addMethod(
  287. unescape('_fn_'),
  288. smalltalk.method({
  289. selector: unescape('fn%3A'),
  290. fn: function (aBlock) {
  291. var self = this;
  292. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  293. return self;
  294. }
  295. }),
  296. smalltalk.CompiledMethod);
  297. smalltalk.addMethod(
  298. unescape('_messageSends'),
  299. smalltalk.method({
  300. selector: unescape('messageSends'),
  301. fn: function () {
  302. var self = this;
  303. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  304. return self;
  305. }
  306. }),
  307. smalltalk.CompiledMethod);
  308. smalltalk.addMethod(
  309. unescape('_methodClass'),
  310. smalltalk.method({
  311. selector: unescape('methodClass'),
  312. fn: function () {
  313. var self = this;
  314. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  315. return self;
  316. }
  317. }),
  318. smalltalk.CompiledMethod);
  319. smalltalk.addMethod(
  320. unescape('_referencedClasses'),
  321. smalltalk.method({
  322. selector: unescape('referencedClasses'),
  323. fn: function () {
  324. var self = this;
  325. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  326. return self;
  327. }
  328. }),
  329. smalltalk.CompiledMethod);
  330. smalltalk.addMethod(
  331. unescape('_selector'),
  332. smalltalk.method({
  333. selector: unescape('selector'),
  334. fn: function () {
  335. var self = this;
  336. return smalltalk.send(self, "_basicAt_", ["selector"]);
  337. return self;
  338. }
  339. }),
  340. smalltalk.CompiledMethod);
  341. smalltalk.addMethod(
  342. unescape('_selector_'),
  343. smalltalk.method({
  344. selector: unescape('selector%3A'),
  345. fn: function (aString) {
  346. var self = this;
  347. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  348. return self;
  349. }
  350. }),
  351. smalltalk.CompiledMethod);
  352. smalltalk.addMethod(
  353. unescape('_source'),
  354. smalltalk.method({
  355. selector: unescape('source'),
  356. fn: function () {
  357. var self = this;
  358. return ($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil ||
  359. $receiver == undefined ? function () {return "";}() : $receiver;
  360. return self;
  361. }
  362. }),
  363. smalltalk.CompiledMethod);
  364. smalltalk.addMethod(
  365. unescape('_source_'),
  366. smalltalk.method({
  367. selector: unescape('source%3A'),
  368. fn: function (aString) {
  369. var self = this;
  370. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  371. return self;
  372. }
  373. }),
  374. smalltalk.CompiledMethod);
  375. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  376. smalltalk.addMethod(
  377. unescape('_arguments'),
  378. smalltalk.method({
  379. selector: unescape('arguments'),
  380. fn: function () {
  381. var self = this;
  382. return self['@arguments'];
  383. return self;
  384. }
  385. }),
  386. smalltalk.Message);
  387. smalltalk.addMethod(
  388. unescape('_arguments_'),
  389. smalltalk.method({
  390. selector: unescape('arguments%3A'),
  391. fn: function (anArray) {
  392. var self = this;
  393. self['@arguments'] = anArray;
  394. return self;
  395. }
  396. }),
  397. smalltalk.Message);
  398. smalltalk.addMethod(
  399. unescape('_printString'),
  400. smalltalk.method({
  401. selector: unescape('printString'),
  402. fn: function () {
  403. var self = this;
  404. 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);}]);
  405. return self;
  406. }
  407. }),
  408. smalltalk.Message);
  409. smalltalk.addMethod(
  410. unescape('_selector'),
  411. smalltalk.method({
  412. selector: unescape('selector'),
  413. fn: function () {
  414. var self = this;
  415. return self['@selector'];
  416. return self;
  417. }
  418. }),
  419. smalltalk.Message);
  420. smalltalk.addMethod(
  421. unescape('_selector_'),
  422. smalltalk.method({
  423. selector: unescape('selector%3A'),
  424. fn: function (aString) {
  425. var self = this;
  426. self['@selector'] = aString;
  427. return self;
  428. }
  429. }),
  430. smalltalk.Message);
  431. smalltalk.addMethod(
  432. unescape('_sendTo_'),
  433. smalltalk.method({
  434. selector: unescape('sendTo%3A'),
  435. fn: function (anObject) {
  436. var self = this;
  437. smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_send_to_arguments_", [smalltalk.send(self, "_selector", []), anObject, smalltalk.send(self, "_arguments", [])]);
  438. return self;
  439. }
  440. }),
  441. smalltalk.Message);
  442. smalltalk.addMethod(
  443. unescape('_selector_arguments_'),
  444. smalltalk.method({
  445. selector: unescape('selector%3Aarguments%3A'),
  446. fn: function (aString, anArray) {
  447. var self = this;
  448. return function ($rec) {smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  449. return self;
  450. }
  451. }),
  452. smalltalk.Message.klass);
  453. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  454. smalltalk.addMethod(
  455. unescape('_asString'),
  456. smalltalk.method({
  457. selector: unescape('asString'),
  458. fn: function () {
  459. var self = this;
  460. 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", [])]);
  461. return self;
  462. }
  463. }),
  464. smalltalk.MethodContext);
  465. smalltalk.addMethod(
  466. unescape('_home'),
  467. smalltalk.method({
  468. selector: unescape('home'),
  469. fn: function () {
  470. var self = this;
  471. return self.homeContext;
  472. return self;
  473. }
  474. }),
  475. smalltalk.MethodContext);
  476. smalltalk.addMethod(
  477. unescape('_printString'),
  478. smalltalk.method({
  479. selector: unescape('printString'),
  480. fn: function () {
  481. var self = this;
  482. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  483. return self;
  484. }
  485. }),
  486. smalltalk.MethodContext);
  487. smalltalk.addMethod(
  488. unescape('_receiver'),
  489. smalltalk.method({
  490. selector: unescape('receiver'),
  491. fn: function () {
  492. var self = this;
  493. return self.receiver;
  494. return self;
  495. }
  496. }),
  497. smalltalk.MethodContext);
  498. smalltalk.addMethod(
  499. unescape('_selector'),
  500. smalltalk.method({
  501. selector: unescape('selector'),
  502. fn: function () {
  503. var self = this;
  504. return smalltalk.convertSelector(self.selector);
  505. return self;
  506. }
  507. }),
  508. smalltalk.MethodContext);
  509. smalltalk.addMethod(
  510. unescape('_temps'),
  511. smalltalk.method({
  512. selector: unescape('temps'),
  513. fn: function () {
  514. var self = this;
  515. return self.temps;
  516. return self;
  517. }
  518. }),
  519. smalltalk.MethodContext);