Kernel-Methods.deploy.js 13 KB

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