1
0

Kernel-Objects.deploy.js 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590
  1. smalltalk.addPackage('Kernel-Objects', {});
  2. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
  3. smalltalk.addMethod(
  4. '__eq',
  5. smalltalk.method({
  6. selector: '=',
  7. fn: function (anObject){
  8. var self=this;
  9. return smalltalk.send(self, "__eq_eq", [anObject]);
  10. return self;}
  11. }),
  12. smalltalk.Object);
  13. smalltalk.addMethod(
  14. '_~_eq',
  15. smalltalk.method({
  16. selector: '~=',
  17. fn: function (anObject){
  18. var self=this;
  19. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq", [false]);
  20. return self;}
  21. }),
  22. smalltalk.Object);
  23. smalltalk.addMethod(
  24. '_initialize',
  25. smalltalk.method({
  26. selector: 'initialize',
  27. fn: function (){
  28. var self=this;
  29. return self;}
  30. }),
  31. smalltalk.Object);
  32. smalltalk.addMethod(
  33. '_yourself',
  34. smalltalk.method({
  35. selector: 'yourself',
  36. fn: function (){
  37. var self=this;
  38. return self;
  39. return self;}
  40. }),
  41. smalltalk.Object);
  42. smalltalk.addMethod(
  43. '_class',
  44. smalltalk.method({
  45. selector: 'class',
  46. fn: function (){
  47. var self=this;
  48. return self.klass;
  49. return self;}
  50. }),
  51. smalltalk.Object);
  52. smalltalk.addMethod(
  53. '_size',
  54. smalltalk.method({
  55. selector: 'size',
  56. fn: function (){
  57. var self=this;
  58. smalltalk.send(self, "_error_", ["Object not indexable"]);
  59. return self;}
  60. }),
  61. smalltalk.Object);
  62. smalltalk.addMethod(
  63. '_copy',
  64. smalltalk.method({
  65. selector: 'copy',
  66. fn: function (){
  67. var self=this;
  68. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  69. return self;}
  70. }),
  71. smalltalk.Object);
  72. smalltalk.addMethod(
  73. '_shallowCopy',
  74. smalltalk.method({
  75. selector: 'shallowCopy',
  76. fn: function (){
  77. var self=this;
  78. var copy = self.klass._new();
  79. for(var i in self) {
  80. if(/^@.+/.test(i)) {
  81. copy[i] = self[i];
  82. }
  83. }
  84. return copy;
  85. ;
  86. return self;}
  87. }),
  88. smalltalk.Object);
  89. smalltalk.addMethod(
  90. '_deepCopy',
  91. smalltalk.method({
  92. selector: 'deepCopy',
  93. fn: function (){
  94. var self=this;
  95. var copy = self.klass._new();
  96. for(var i in self) {
  97. if(/^@.+/.test(i)) {
  98. copy[i] = self[i]._deepCopy();
  99. }
  100. }
  101. return copy;
  102. ;
  103. return self;}
  104. }),
  105. smalltalk.Object);
  106. smalltalk.addMethod(
  107. '_postCopy',
  108. smalltalk.method({
  109. selector: 'postCopy',
  110. fn: function (){
  111. var self=this;
  112. return self;}
  113. }),
  114. smalltalk.Object);
  115. smalltalk.addMethod(
  116. '__minus_gt',
  117. smalltalk.method({
  118. selector: '->',
  119. fn: function (anObject){
  120. var self=this;
  121. return smalltalk.send((smalltalk.Association || Association), "_key_value_", [self, anObject]);
  122. return self;}
  123. }),
  124. smalltalk.Object);
  125. smalltalk.addMethod(
  126. '_asString',
  127. smalltalk.method({
  128. selector: 'asString',
  129. fn: function (){
  130. var self=this;
  131. return smalltalk.send(self, "_printString", []);
  132. return self;}
  133. }),
  134. smalltalk.Object);
  135. smalltalk.addMethod(
  136. '_asJavascript',
  137. smalltalk.method({
  138. selector: 'asJavascript',
  139. fn: function (){
  140. var self=this;
  141. return smalltalk.send(self, "_asString", []);
  142. return self;}
  143. }),
  144. smalltalk.Object);
  145. smalltalk.addMethod(
  146. '_perform_',
  147. smalltalk.method({
  148. selector: 'perform:',
  149. fn: function (aSymbol){
  150. var self=this;
  151. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  152. return self;}
  153. }),
  154. smalltalk.Object);
  155. smalltalk.addMethod(
  156. '_perform_withArguments_',
  157. smalltalk.method({
  158. selector: 'perform:withArguments:',
  159. fn: function (aSymbol, aCollection){
  160. var self=this;
  161. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  162. return self;}
  163. }),
  164. smalltalk.Object);
  165. smalltalk.addMethod(
  166. '_instVarAt_',
  167. smalltalk.method({
  168. selector: 'instVarAt:',
  169. fn: function (aString){
  170. var self=this;
  171. return self['@'+aString];
  172. return self;}
  173. }),
  174. smalltalk.Object);
  175. smalltalk.addMethod(
  176. '_instVarAt_put_',
  177. smalltalk.method({
  178. selector: 'instVarAt:put:',
  179. fn: function (aString, anObject){
  180. var self=this;
  181. self['@' + aString] = anObject;
  182. return self;}
  183. }),
  184. smalltalk.Object);
  185. smalltalk.addMethod(
  186. '_basicAt_',
  187. smalltalk.method({
  188. selector: 'basicAt:',
  189. fn: function (aString){
  190. var self=this;
  191. return self[aString];
  192. return self;}
  193. }),
  194. smalltalk.Object);
  195. smalltalk.addMethod(
  196. '_basicAt_put_',
  197. smalltalk.method({
  198. selector: 'basicAt:put:',
  199. fn: function (aString, anObject){
  200. var self=this;
  201. return self[aString] = anObject;
  202. return self;}
  203. }),
  204. smalltalk.Object);
  205. smalltalk.addMethod(
  206. '_error_',
  207. smalltalk.method({
  208. selector: 'error:',
  209. fn: function (aString){
  210. var self=this;
  211. smalltalk.send((smalltalk.Error || Error), "_signal_", [aString]);
  212. return self;}
  213. }),
  214. smalltalk.Object);
  215. smalltalk.addMethod(
  216. '_subclassResponsibility',
  217. smalltalk.method({
  218. selector: 'subclassResponsibility',
  219. fn: function (){
  220. var self=this;
  221. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  222. return self;}
  223. }),
  224. smalltalk.Object);
  225. smalltalk.addMethod(
  226. '_shouldNotImplement',
  227. smalltalk.method({
  228. selector: 'shouldNotImplement',
  229. fn: function (){
  230. var self=this;
  231. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  232. return self;}
  233. }),
  234. smalltalk.Object);
  235. smalltalk.addMethod(
  236. '_try_catch_',
  237. smalltalk.method({
  238. selector: 'try:catch:',
  239. fn: function (aBlock, anotherBlock){
  240. var self=this;
  241. try{aBlock()} catch(e) {anotherBlock(e)};
  242. return self;}
  243. }),
  244. smalltalk.Object);
  245. smalltalk.addMethod(
  246. '_printString',
  247. smalltalk.method({
  248. selector: 'printString',
  249. fn: function (){
  250. var self=this;
  251. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  252. return self;}
  253. }),
  254. smalltalk.Object);
  255. smalltalk.addMethod(
  256. '_printNl',
  257. smalltalk.method({
  258. selector: 'printNl',
  259. fn: function (){
  260. var self=this;
  261. console.log(self);
  262. return self;}
  263. }),
  264. smalltalk.Object);
  265. smalltalk.addMethod(
  266. '_isKindOf_',
  267. smalltalk.method({
  268. selector: 'isKindOf:',
  269. fn: function (aClass){
  270. var self=this;
  271. return ((($receiver = smalltalk.send(self, "_isMemberOf_", [aClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return true;})() : (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return true;}), (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})]));
  272. return self;}
  273. }),
  274. smalltalk.Object);
  275. smalltalk.addMethod(
  276. '_isMemberOf_',
  277. smalltalk.method({
  278. selector: 'isMemberOf:',
  279. fn: function (aClass){
  280. var self=this;
  281. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  282. return self;}
  283. }),
  284. smalltalk.Object);
  285. smalltalk.addMethod(
  286. '_ifNil_',
  287. smalltalk.method({
  288. selector: 'ifNil:',
  289. fn: function (aBlock){
  290. var self=this;
  291. return self;
  292. return self;}
  293. }),
  294. smalltalk.Object);
  295. smalltalk.addMethod(
  296. '_ifNil_ifNotNil_',
  297. smalltalk.method({
  298. selector: 'ifNil:ifNotNil:',
  299. fn: function (aBlock, anotherBlock){
  300. var self=this;
  301. return smalltalk.send(anotherBlock, "_value", []);
  302. return self;}
  303. }),
  304. smalltalk.Object);
  305. smalltalk.addMethod(
  306. '_ifNotNil_',
  307. smalltalk.method({
  308. selector: 'ifNotNil:',
  309. fn: function (aBlock){
  310. var self=this;
  311. return smalltalk.send(aBlock, "_value", []);
  312. return self;}
  313. }),
  314. smalltalk.Object);
  315. smalltalk.addMethod(
  316. '_ifNotNil_ifNil_',
  317. smalltalk.method({
  318. selector: 'ifNotNil:ifNil:',
  319. fn: function (aBlock, anotherBlock){
  320. var self=this;
  321. return smalltalk.send(aBlock, "_value", []);
  322. return self;}
  323. }),
  324. smalltalk.Object);
  325. smalltalk.addMethod(
  326. '_isNil',
  327. smalltalk.method({
  328. selector: 'isNil',
  329. fn: function (){
  330. var self=this;
  331. return false;
  332. return self;}
  333. }),
  334. smalltalk.Object);
  335. smalltalk.addMethod(
  336. '_notNil',
  337. smalltalk.method({
  338. selector: 'notNil',
  339. fn: function (){
  340. var self=this;
  341. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  342. return self;}
  343. }),
  344. smalltalk.Object);
  345. smalltalk.addMethod(
  346. '_isClass',
  347. smalltalk.method({
  348. selector: 'isClass',
  349. fn: function (){
  350. var self=this;
  351. return false;
  352. return self;}
  353. }),
  354. smalltalk.Object);
  355. smalltalk.addMethod(
  356. '_isMetaclass',
  357. smalltalk.method({
  358. selector: 'isMetaclass',
  359. fn: function (){
  360. var self=this;
  361. return false;
  362. return self;}
  363. }),
  364. smalltalk.Object);
  365. smalltalk.addMethod(
  366. '_isNumber',
  367. smalltalk.method({
  368. selector: 'isNumber',
  369. fn: function (){
  370. var self=this;
  371. return false;
  372. return self;}
  373. }),
  374. smalltalk.Object);
  375. smalltalk.addMethod(
  376. '_isString',
  377. smalltalk.method({
  378. selector: 'isString',
  379. fn: function (){
  380. var self=this;
  381. return false;
  382. return self;}
  383. }),
  384. smalltalk.Object);
  385. smalltalk.addMethod(
  386. '_isParseFailure',
  387. smalltalk.method({
  388. selector: 'isParseFailure',
  389. fn: function (){
  390. var self=this;
  391. return false;
  392. return self;}
  393. }),
  394. smalltalk.Object);
  395. smalltalk.addMethod(
  396. '_basicPerform_',
  397. smalltalk.method({
  398. selector: 'basicPerform:',
  399. fn: function (aSymbol){
  400. var self=this;
  401. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  402. return self;}
  403. }),
  404. smalltalk.Object);
  405. smalltalk.addMethod(
  406. '_basicPerform_withArguments_',
  407. smalltalk.method({
  408. selector: 'basicPerform:withArguments:',
  409. fn: function (aSymbol, aCollection){
  410. var self=this;
  411. return self[aSymbol].apply(self, aCollection);;
  412. return self;}
  413. }),
  414. smalltalk.Object);
  415. smalltalk.addMethod(
  416. '_basicDelete_',
  417. smalltalk.method({
  418. selector: 'basicDelete:',
  419. fn: function (aString){
  420. var self=this;
  421. delete self[aString]; return aString;
  422. return self;}
  423. }),
  424. smalltalk.Object);
  425. smalltalk.addMethod(
  426. '_doesNotUnderstand_',
  427. smalltalk.method({
  428. selector: 'doesNotUnderstand:',
  429. fn: function (aMessage){
  430. var self=this;
  431. (function($rec){smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.MessageNotUnderstood || MessageNotUnderstood), "_new", []));
  432. return self;}
  433. }),
  434. smalltalk.Object);
  435. smalltalk.addMethod(
  436. '_asJSON',
  437. smalltalk.method({
  438. selector: 'asJSON',
  439. fn: function (){
  440. var self=this;
  441. return smalltalk.send((smalltalk.JSON || JSON), "_parse_", [smalltalk.send(self, "_asJSONString", [])]);
  442. return self;}
  443. }),
  444. smalltalk.Object);
  445. smalltalk.addMethod(
  446. '_halt',
  447. smalltalk.method({
  448. selector: 'halt',
  449. fn: function (){
  450. var self=this;
  451. smalltalk.send(self, "_error_", ["Halt encountered"]);
  452. return self;}
  453. }),
  454. smalltalk.Object);
  455. smalltalk.addMethod(
  456. '_log_block_',
  457. smalltalk.method({
  458. selector: 'log:block:',
  459. fn: function (aString, aBlock){
  460. var self=this;
  461. var result=nil;
  462. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(smalltalk.send(aString, "__comma", [" time: "]), "__comma", [smalltalk.send(smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return result=smalltalk.send(aBlock, "_value", []);})]), "_printString", [])])]);
  463. return result;
  464. return self;}
  465. }),
  466. smalltalk.Object);
  467. smalltalk.addMethod(
  468. '__eq_eq',
  469. smalltalk.method({
  470. selector: '==',
  471. fn: function (anObject){
  472. var self=this;
  473. return self === anObject;
  474. return self;}
  475. }),
  476. smalltalk.Object);
  477. smalltalk.addMethod(
  478. '_~~',
  479. smalltalk.method({
  480. selector: '~~',
  481. fn: function (anObject){
  482. var self=this;
  483. return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
  484. return self;}
  485. }),
  486. smalltalk.Object);
  487. smalltalk.addMethod(
  488. '_deprecatedAPI',
  489. smalltalk.method({
  490. selector: 'deprecatedAPI',
  491. fn: function (){
  492. var self=this;
  493. smalltalk.send((typeof console == 'undefined' ? nil : console), "_warn_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.getThisContext()), "_home", []), "_asString", []), "__comma", [unescape("%20is%20deprecated%21%20%28in%20")]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.getThisContext()), "_home", []), "_home", []), "_asString", [])]), "__comma", [unescape("%29")])]);
  494. return self;}
  495. }),
  496. smalltalk.Object);
  497. smalltalk.addMethod(
  498. '_storeString',
  499. smalltalk.method({
  500. selector: 'storeString',
  501. fn: function (){
  502. var self=this;
  503. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(s){return smalltalk.send(self, "_storeOn_", [s]);})]);
  504. return self;}
  505. }),
  506. smalltalk.Object);
  507. smalltalk.addMethod(
  508. '_storeOn_',
  509. smalltalk.method({
  510. selector: 'storeOn:',
  511. fn: function (aStream){
  512. var self=this;
  513. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(self, "_printString", [])]);
  514. return self;}
  515. }),
  516. smalltalk.Object);
  517. smalltalk.addMethod(
  518. '_asJSONString',
  519. smalltalk.method({
  520. selector: 'asJSONString',
  521. fn: function (){
  522. var self=this;
  523. return smalltalk.send((smalltalk.JSON || JSON), "_stringify_", [self]);
  524. return self;}
  525. }),
  526. smalltalk.Object);
  527. smalltalk.addMethod(
  528. '_initialize',
  529. smalltalk.method({
  530. selector: 'initialize',
  531. fn: function (){
  532. var self=this;
  533. return self;}
  534. }),
  535. smalltalk.Object.klass);
  536. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  537. smalltalk.addMethod(
  538. '_classes',
  539. smalltalk.method({
  540. selector: 'classes',
  541. fn: function (){
  542. var self=this;
  543. return self.classes();
  544. return self;}
  545. }),
  546. smalltalk.Smalltalk);
  547. smalltalk.addMethod(
  548. '_at_',
  549. smalltalk.method({
  550. selector: 'at:',
  551. fn: function (aString){
  552. var self=this;
  553. return self[aString];
  554. return self;}
  555. }),
  556. smalltalk.Smalltalk);
  557. smalltalk.addMethod(
  558. '_removeClass_',
  559. smalltalk.method({
  560. selector: 'removeClass:',
  561. fn: function (aClass){
  562. var self=this;
  563. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);})]));
  564. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  565. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  566. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  567. return self;}
  568. }),
  569. smalltalk.Smalltalk);
  570. smalltalk.addMethod(
  571. '_basicParse_',
  572. smalltalk.method({
  573. selector: 'basicParse:',
  574. fn: function (aString){
  575. var self=this;
  576. return smalltalk.parser.parse(aString);
  577. return self;}
  578. }),
  579. smalltalk.Smalltalk);
  580. smalltalk.addMethod(
  581. '_parse_',
  582. smalltalk.method({
  583. selector: 'parse:',
  584. fn: function (aString){
  585. var self=this;
  586. var result=nil;
  587. smalltalk.send(self, "_try_catch_", [(function(){return result=smalltalk.send(self, "_basicParse_", [aString]);}), (function(ex){return smalltalk.send(smalltalk.send(self, "_parseError_parsing_", [ex, aString]), "_signal", []);})]);
  588. return result;
  589. return self;}
  590. }),
  591. smalltalk.Smalltalk);
  592. smalltalk.addMethod(
  593. '_parseError_parsing_',
  594. smalltalk.method({
  595. selector: 'parseError:parsing:',
  596. fn: function (anException, aString){
  597. var self=this;
  598. var row=nil;
  599. var col=nil;
  600. var message=nil;
  601. var lines=nil;
  602. var badLine=nil;
  603. var code=nil;
  604. row = anException.line;
  605. col = anException.column;
  606. message = anException.message;;
  607. lines=smalltalk.send(aString, "_lines", []);
  608. badLine=smalltalk.send(lines, "_at_", [row]);
  609. badLine=smalltalk.send(smalltalk.send(smalltalk.send(badLine, "_copyFrom_to_", [(1), ((($receiver = col).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]), "__comma", [unescape("%20%3D%3D%3D%3E")]), "__comma", [smalltalk.send(badLine, "_copyFrom_to_", [col, smalltalk.send(badLine, "_size", [])])]);
  610. smalltalk.send(lines, "_at_put_", [row, badLine]);
  611. code=smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(s){return smalltalk.send(lines, "_withIndexDo_", [(function(l, i){return smalltalk.send(s, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(i, "_asString", []), "__comma", [": "]), "__comma", [l]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})]);})]);
  612. return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_messageText_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Parse error on line ", "__comma", [row]), "__comma", [" column "]), "__comma", [col]), "__comma", [" : "]), "__comma", [message]), "__comma", [unescape("%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A")]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", [code])]);
  613. return self;}
  614. }),
  615. smalltalk.Smalltalk);
  616. smalltalk.addMethod(
  617. '_packages',
  618. smalltalk.method({
  619. selector: 'packages',
  620. fn: function (){
  621. var self=this;
  622. return self.packages.all();
  623. return self;}
  624. }),
  625. smalltalk.Smalltalk);
  626. smalltalk.addMethod(
  627. '_packageAt_',
  628. smalltalk.method({
  629. selector: 'packageAt:',
  630. fn: function (packageName){
  631. var self=this;
  632. return self.packages[packageName];
  633. return self;}
  634. }),
  635. smalltalk.Smalltalk);
  636. smalltalk.addMethod(
  637. '_packageAt_ifAbsent_',
  638. smalltalk.method({
  639. selector: 'packageAt:ifAbsent:',
  640. fn: function (packageName, aBlock){
  641. var self=this;
  642. return smalltalk.send(smalltalk.send(self, "_packageAt_", [packageName]), "_ifNil_", [aBlock]);
  643. return self;}
  644. }),
  645. smalltalk.Smalltalk);
  646. smalltalk.addMethod(
  647. '_createPackage_',
  648. smalltalk.method({
  649. selector: 'createPackage:',
  650. fn: function (packageName){
  651. var self=this;
  652. return smalltalk.addPackage(packageName, nil);
  653. return self;}
  654. }),
  655. smalltalk.Smalltalk);
  656. smalltalk.addMethod(
  657. '_deletePackage_',
  658. smalltalk.method({
  659. selector: 'deletePackage:',
  660. fn: function (packageName){
  661. var self=this;
  662. delete smalltalk.packages[packageName];
  663. return self;}
  664. }),
  665. smalltalk.Smalltalk);
  666. smalltalk.addMethod(
  667. '_removePackage_',
  668. smalltalk.method({
  669. selector: 'removePackage:',
  670. fn: function (packageName){
  671. var self=this;
  672. var pkg=nil;
  673. pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  674. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
  675. smalltalk.send(self, "_deletePackage_", [packageName]);
  676. return self;}
  677. }),
  678. smalltalk.Smalltalk);
  679. smalltalk.addMethod(
  680. '_renamePackage_to_',
  681. smalltalk.method({
  682. selector: 'renamePackage:to:',
  683. fn: function (packageName, newName){
  684. var self=this;
  685. var pkg=nil;
  686. pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  687. (($receiver = smalltalk.send(self, "_packageAt_", [newName])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);})() : nil;
  688. smalltalk.packages[newName] = smalltalk.packages[packageName];
  689. smalltalk.send(pkg, "_name_", [newName]);
  690. smalltalk.send(self, "_deletePackage_", [packageName]);
  691. return self;}
  692. }),
  693. smalltalk.Smalltalk);
  694. smalltalk.addMethod(
  695. '_reservedWords',
  696. smalltalk.method({
  697. selector: 'reservedWords',
  698. fn: function (){
  699. var self=this;
  700. return self.reservedWords;
  701. return self;}
  702. }),
  703. smalltalk.Smalltalk);
  704. smalltalk.addMethod(
  705. '_createPackage_properties_',
  706. smalltalk.method({
  707. selector: 'createPackage:properties:',
  708. fn: function (packageName, aDict){
  709. var self=this;
  710. var object=nil;
  711. object = {};;
  712. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  713. return smalltalk.addPackage(packageName, object);
  714. return self;}
  715. }),
  716. smalltalk.Smalltalk);
  717. smalltalk.addMethod(
  718. '_readJSObject_',
  719. smalltalk.method({
  720. selector: 'readJSObject:',
  721. fn: function (anObject){
  722. var self=this;
  723. return self.readJSObject(anObject);
  724. return self;}
  725. }),
  726. smalltalk.Smalltalk);
  727. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  728. smalltalk.addMethod(
  729. '_current',
  730. smalltalk.method({
  731. selector: 'current',
  732. fn: function (){
  733. var self=this;
  734. return smalltalk;
  735. return self;}
  736. }),
  737. smalltalk.Smalltalk.klass);
  738. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  739. smalltalk.addMethod(
  740. '_name',
  741. smalltalk.method({
  742. selector: 'name',
  743. fn: function (){
  744. var self=this;
  745. return self.pkgName;
  746. return self;}
  747. }),
  748. smalltalk.Package);
  749. smalltalk.addMethod(
  750. '_name_',
  751. smalltalk.method({
  752. selector: 'name:',
  753. fn: function (aString){
  754. var self=this;
  755. self.pkgName = aString;
  756. return self;}
  757. }),
  758. smalltalk.Package);
  759. smalltalk.addMethod(
  760. '_classes',
  761. smalltalk.method({
  762. selector: 'classes',
  763. fn: function (){
  764. var self=this;
  765. return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_select_", [(function(c){return smalltalk.send(smalltalk.send(c, "_package", []), "__eq_eq", [self]);})]);
  766. return self;}
  767. }),
  768. smalltalk.Package);
  769. smalltalk.addMethod(
  770. '_printString',
  771. smalltalk.method({
  772. selector: 'printString',
  773. fn: function (){
  774. var self=this;
  775. return smalltalk.send(self, "_name", []);
  776. return self;}
  777. }),
  778. smalltalk.Package);
  779. smalltalk.addMethod(
  780. '_dependencies',
  781. smalltalk.method({
  782. selector: 'dependencies',
  783. fn: function (){
  784. var self=this;
  785. return smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", (function(){return [];})]);
  786. return self;}
  787. }),
  788. smalltalk.Package);
  789. smalltalk.addMethod(
  790. '_dependencies_',
  791. smalltalk.method({
  792. selector: 'dependencies:',
  793. fn: function (anArray){
  794. var self=this;
  795. return smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  796. return self;}
  797. }),
  798. smalltalk.Package);
  799. smalltalk.addMethod(
  800. '_properties',
  801. smalltalk.method({
  802. selector: 'properties',
  803. fn: function (){
  804. var self=this;
  805. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  806. return self;}
  807. }),
  808. smalltalk.Package);
  809. smalltalk.addMethod(
  810. '_propertiesAsJSON',
  811. smalltalk.method({
  812. selector: 'propertiesAsJSON',
  813. fn: function (){
  814. var self=this;
  815. return JSON.stringify(self.properties);
  816. return self;}
  817. }),
  818. smalltalk.Package);
  819. smalltalk.addMethod(
  820. '_properties_',
  821. smalltalk.method({
  822. selector: 'properties:',
  823. fn: function (aDict){
  824. var self=this;
  825. var object=nil;
  826. object = {};;
  827. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  828. return self.properties = object;
  829. return self;}
  830. }),
  831. smalltalk.Package);
  832. smalltalk.addMethod(
  833. '_jsProperties',
  834. smalltalk.method({
  835. selector: 'jsProperties',
  836. fn: function (){
  837. var self=this;
  838. return self.properties;
  839. return self;}
  840. }),
  841. smalltalk.Package);
  842. smalltalk.addMethod(
  843. '_jsProperties_',
  844. smalltalk.method({
  845. selector: 'jsProperties:',
  846. fn: function (aJSObject){
  847. var self=this;
  848. return self.properties = aJSObject;
  849. return self;}
  850. }),
  851. smalltalk.Package);
  852. smalltalk.addMethod(
  853. '_propertyAt_',
  854. smalltalk.method({
  855. selector: 'propertyAt:',
  856. fn: function (key){
  857. var self=this;
  858. return self.properties[key];
  859. return self;}
  860. }),
  861. smalltalk.Package);
  862. smalltalk.addMethod(
  863. '_propertyAt_put_',
  864. smalltalk.method({
  865. selector: 'propertyAt:put:',
  866. fn: function (key, value){
  867. var self=this;
  868. return self.properties[key] = value;
  869. return self;}
  870. }),
  871. smalltalk.Package);
  872. smalltalk.addMethod(
  873. '_propertyAt_ifAbsent_',
  874. smalltalk.method({
  875. selector: 'propertyAt:ifAbsent:',
  876. fn: function (key, block){
  877. var self=this;
  878. return (($receiver = smalltalk.send(self, "_propertyAt_", [key])) == nil || $receiver == undefined) ? (function(){return smalltalk.send(block, "_value", []);})() : $receiver;
  879. return self;}
  880. }),
  881. smalltalk.Package);
  882. smalltalk.addMethod(
  883. '_commitPathJs',
  884. smalltalk.method({
  885. selector: 'commitPathJs',
  886. fn: function (){
  887. var self=this;
  888. return (($receiver = self['@commitPathJs']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);})() : $receiver;
  889. return self;}
  890. }),
  891. smalltalk.Package);
  892. smalltalk.addMethod(
  893. '_commitPathJs_',
  894. smalltalk.method({
  895. selector: 'commitPathJs:',
  896. fn: function (aString){
  897. var self=this;
  898. self['@commitPathJs']=aString;
  899. return self;}
  900. }),
  901. smalltalk.Package);
  902. smalltalk.addMethod(
  903. '_commitPathSt',
  904. smalltalk.method({
  905. selector: 'commitPathSt',
  906. fn: function (){
  907. var self=this;
  908. return (($receiver = self['@commitPathSt']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);})() : $receiver;
  909. return self;}
  910. }),
  911. smalltalk.Package);
  912. smalltalk.addMethod(
  913. '_commitPathSt_',
  914. smalltalk.method({
  915. selector: 'commitPathSt:',
  916. fn: function (aString){
  917. var self=this;
  918. self['@commitPathSt']=aString;
  919. return self;}
  920. }),
  921. smalltalk.Package);
  922. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  923. smalltalk.addMethod(
  924. '_named_',
  925. smalltalk.method({
  926. selector: 'named:',
  927. fn: function (aPackageName){
  928. var self=this;
  929. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [aPackageName]);
  930. return self;}
  931. }),
  932. smalltalk.Package.klass);
  933. smalltalk.addMethod(
  934. '_named_ifAbsent_',
  935. smalltalk.method({
  936. selector: 'named:ifAbsent:',
  937. fn: function (aPackageName, aBlock){
  938. var self=this;
  939. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  940. return self;}
  941. }),
  942. smalltalk.Package.klass);
  943. smalltalk.addMethod(
  944. '_defaultCommitPathJs',
  945. smalltalk.method({
  946. selector: 'defaultCommitPathJs',
  947. fn: function (){
  948. var self=this;
  949. return (($receiver = self['@defaultCommitPathJs']) == nil || $receiver == undefined) ? (function(){return self['@defaultCommitPathJs']="js";})() : $receiver;
  950. return self;}
  951. }),
  952. smalltalk.Package.klass);
  953. smalltalk.addMethod(
  954. '_defaultCommitPathJs_',
  955. smalltalk.method({
  956. selector: 'defaultCommitPathJs:',
  957. fn: function (aString){
  958. var self=this;
  959. self['@defaultCommitPathJs']=aString;
  960. return self;}
  961. }),
  962. smalltalk.Package.klass);
  963. smalltalk.addMethod(
  964. '_defaultCommitPathSt',
  965. smalltalk.method({
  966. selector: 'defaultCommitPathSt',
  967. fn: function (){
  968. var self=this;
  969. return (($receiver = self['@defaultCommitPathSt']) == nil || $receiver == undefined) ? (function(){return self['@defaultCommitPathSt']="st";})() : $receiver;
  970. return self;}
  971. }),
  972. smalltalk.Package.klass);
  973. smalltalk.addMethod(
  974. '_defaultCommitPathSt_',
  975. smalltalk.method({
  976. selector: 'defaultCommitPathSt:',
  977. fn: function (aString){
  978. var self=this;
  979. self['@defaultCommitPathSt']=aString;
  980. return self;}
  981. }),
  982. smalltalk.Package.klass);
  983. smalltalk.addMethod(
  984. '_resetCommitPaths',
  985. smalltalk.method({
  986. selector: 'resetCommitPaths',
  987. fn: function (){
  988. var self=this;
  989. self['@defaultCommitPathJs']=nil;
  990. self['@defaultCommitPathSt']=nil;
  991. return self;}
  992. }),
  993. smalltalk.Package.klass);
  994. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  995. smalltalk.addMethod(
  996. '__eq',
  997. smalltalk.method({
  998. selector: '=',
  999. fn: function (aNumber){
  1000. var self=this;
  1001. try{((($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  1002. return Number(self) == aNumber;
  1003. return self;
  1004. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  1005. }),
  1006. smalltalk.Number);
  1007. smalltalk.addMethod(
  1008. '__gt',
  1009. smalltalk.method({
  1010. selector: '>',
  1011. fn: function (aNumber){
  1012. var self=this;
  1013. return self > aNumber;
  1014. return self;}
  1015. }),
  1016. smalltalk.Number);
  1017. smalltalk.addMethod(
  1018. '__lt',
  1019. smalltalk.method({
  1020. selector: '<',
  1021. fn: function (aNumber){
  1022. var self=this;
  1023. return self < aNumber;
  1024. return self;}
  1025. }),
  1026. smalltalk.Number);
  1027. smalltalk.addMethod(
  1028. '__gt_eq',
  1029. smalltalk.method({
  1030. selector: '>=',
  1031. fn: function (aNumber){
  1032. var self=this;
  1033. return self >= aNumber;
  1034. return self;}
  1035. }),
  1036. smalltalk.Number);
  1037. smalltalk.addMethod(
  1038. '__lt_eq',
  1039. smalltalk.method({
  1040. selector: '<=',
  1041. fn: function (aNumber){
  1042. var self=this;
  1043. return self <= aNumber;
  1044. return self;}
  1045. }),
  1046. smalltalk.Number);
  1047. smalltalk.addMethod(
  1048. '__plus',
  1049. smalltalk.method({
  1050. selector: '+',
  1051. fn: function (aNumber){
  1052. var self=this;
  1053. return self + aNumber;
  1054. return self;}
  1055. }),
  1056. smalltalk.Number);
  1057. smalltalk.addMethod(
  1058. '__minus',
  1059. smalltalk.method({
  1060. selector: '-',
  1061. fn: function (aNumber){
  1062. var self=this;
  1063. return self - aNumber;
  1064. return self;}
  1065. }),
  1066. smalltalk.Number);
  1067. smalltalk.addMethod(
  1068. '__star',
  1069. smalltalk.method({
  1070. selector: '*',
  1071. fn: function (aNumber){
  1072. var self=this;
  1073. return self * aNumber;
  1074. return self;}
  1075. }),
  1076. smalltalk.Number);
  1077. smalltalk.addMethod(
  1078. '__slash',
  1079. smalltalk.method({
  1080. selector: '/',
  1081. fn: function (aNumber){
  1082. var self=this;
  1083. return self / aNumber;
  1084. return self;}
  1085. }),
  1086. smalltalk.Number);
  1087. smalltalk.addMethod(
  1088. '_max_',
  1089. smalltalk.method({
  1090. selector: 'max:',
  1091. fn: function (aNumber){
  1092. var self=this;
  1093. return Math.max(self, aNumber);;
  1094. return self;}
  1095. }),
  1096. smalltalk.Number);
  1097. smalltalk.addMethod(
  1098. '_min_',
  1099. smalltalk.method({
  1100. selector: 'min:',
  1101. fn: function (aNumber){
  1102. var self=this;
  1103. return Math.min(self, aNumber);;
  1104. return self;}
  1105. }),
  1106. smalltalk.Number);
  1107. smalltalk.addMethod(
  1108. '_rounded',
  1109. smalltalk.method({
  1110. selector: 'rounded',
  1111. fn: function (){
  1112. var self=this;
  1113. return Math.round(self);;
  1114. return self;}
  1115. }),
  1116. smalltalk.Number);
  1117. smalltalk.addMethod(
  1118. '_truncated',
  1119. smalltalk.method({
  1120. selector: 'truncated',
  1121. fn: function (){
  1122. var self=this;
  1123. var result=nil;
  1124. ((($receiver = self >= (0)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return result = Math.floor(self);;})() : (function(){return result = (Math.floor(self * (-1)) * (-1));;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return result = Math.floor(self);;}), (function(){return result = (Math.floor(self * (-1)) * (-1));;})]));
  1125. return result;
  1126. return self;}
  1127. }),
  1128. smalltalk.Number);
  1129. smalltalk.addMethod(
  1130. '_to_',
  1131. smalltalk.method({
  1132. selector: 'to:',
  1133. fn: function (aNumber){
  1134. var self=this;
  1135. var array=nil;
  1136. var first=nil;
  1137. var last=nil;
  1138. var count=nil;
  1139. first=smalltalk.send(self, "_truncated", []);
  1140. last=((($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
  1141. count=(1);
  1142. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1143. smalltalk.send(((($receiver = last).klass === smalltalk.Number) ? $receiver -first : smalltalk.send($receiver, "__minus", [first])), "_timesRepeat_", [(function(){smalltalk.send(array, "_at_put_", [count, first]);count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return first=((($receiver = first).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
  1144. return array;
  1145. return self;}
  1146. }),
  1147. smalltalk.Number);
  1148. smalltalk.addMethod(
  1149. '_timesRepeat_',
  1150. smalltalk.method({
  1151. selector: 'timesRepeat:',
  1152. fn: function (aBlock){
  1153. var self=this;
  1154. var integer=nil;
  1155. var count=nil;
  1156. integer=smalltalk.send(self, "_truncated", []);
  1157. count=(1);
  1158. (function(){while(!(function(){return ((($receiver = count).klass === smalltalk.Number) ? $receiver >self : smalltalk.send($receiver, "__gt", [self]));})()) {(function(){smalltalk.send(aBlock, "_value", []);return count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
  1159. return self;}
  1160. }),
  1161. smalltalk.Number);
  1162. smalltalk.addMethod(
  1163. '_to_do_',
  1164. smalltalk.method({
  1165. selector: 'to:do:',
  1166. fn: function (stop, aBlock){
  1167. var self=this;
  1168. var nextValue=nil;
  1169. nextValue=self;
  1170. (function(){while((function(){return ((($receiver = nextValue).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [nextValue]);return nextValue=((($receiver = nextValue).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
  1171. return self;}
  1172. }),
  1173. smalltalk.Number);
  1174. smalltalk.addMethod(
  1175. '_asString',
  1176. smalltalk.method({
  1177. selector: 'asString',
  1178. fn: function (){
  1179. var self=this;
  1180. return smalltalk.send(self, "_printString", []);
  1181. return self;}
  1182. }),
  1183. smalltalk.Number);
  1184. smalltalk.addMethod(
  1185. '_asJavascript',
  1186. smalltalk.method({
  1187. selector: 'asJavascript',
  1188. fn: function (){
  1189. var self=this;
  1190. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1191. return self;}
  1192. }),
  1193. smalltalk.Number);
  1194. smalltalk.addMethod(
  1195. '_printString',
  1196. smalltalk.method({
  1197. selector: 'printString',
  1198. fn: function (){
  1199. var self=this;
  1200. return String(self);
  1201. return self;}
  1202. }),
  1203. smalltalk.Number);
  1204. smalltalk.addMethod(
  1205. '_isNumber',
  1206. smalltalk.method({
  1207. selector: 'isNumber',
  1208. fn: function (){
  1209. var self=this;
  1210. return true;
  1211. return self;}
  1212. }),
  1213. smalltalk.Number);
  1214. smalltalk.addMethod(
  1215. '_atRandom',
  1216. smalltalk.method({
  1217. selector: 'atRandom',
  1218. fn: function (){
  1219. var self=this;
  1220. return ((($receiver = smalltalk.send(((($receiver = smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", [])).klass === smalltalk.Number) ? $receiver *self : smalltalk.send($receiver, "__star", [self])), "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
  1221. return self;}
  1222. }),
  1223. smalltalk.Number);
  1224. smalltalk.addMethod(
  1225. '__at',
  1226. smalltalk.method({
  1227. selector: '@',
  1228. fn: function (aNumber){
  1229. var self=this;
  1230. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, aNumber]);
  1231. return self;}
  1232. }),
  1233. smalltalk.Number);
  1234. smalltalk.addMethod(
  1235. '_asPoint',
  1236. smalltalk.method({
  1237. selector: 'asPoint',
  1238. fn: function (){
  1239. var self=this;
  1240. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, self]);
  1241. return self;}
  1242. }),
  1243. smalltalk.Number);
  1244. smalltalk.addMethod(
  1245. '_clearInterval',
  1246. smalltalk.method({
  1247. selector: 'clearInterval',
  1248. fn: function (){
  1249. var self=this;
  1250. clearInterval(Number(self));
  1251. return self;}
  1252. }),
  1253. smalltalk.Number);
  1254. smalltalk.addMethod(
  1255. '_clearTimeout',
  1256. smalltalk.method({
  1257. selector: 'clearTimeout',
  1258. fn: function (){
  1259. var self=this;
  1260. clearTimeout(Number(self));
  1261. return self;}
  1262. }),
  1263. smalltalk.Number);
  1264. smalltalk.addMethod(
  1265. '_even',
  1266. smalltalk.method({
  1267. selector: 'even',
  1268. fn: function (){
  1269. var self=this;
  1270. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_\\\\", [(2)])]);
  1271. return self;}
  1272. }),
  1273. smalltalk.Number);
  1274. smalltalk.addMethod(
  1275. '_odd',
  1276. smalltalk.method({
  1277. selector: 'odd',
  1278. fn: function (){
  1279. var self=this;
  1280. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1281. return self;}
  1282. }),
  1283. smalltalk.Number);
  1284. smalltalk.addMethod(
  1285. '_negated',
  1286. smalltalk.method({
  1287. selector: 'negated',
  1288. fn: function (){
  1289. var self=this;
  1290. return (0) - self;
  1291. return self;}
  1292. }),
  1293. smalltalk.Number);
  1294. smalltalk.addMethod(
  1295. '__eq_eq',
  1296. smalltalk.method({
  1297. selector: '==',
  1298. fn: function (aNumber){
  1299. var self=this;
  1300. try{((($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]));
  1301. return Number(self) === Number(aNumber);
  1302. return self;
  1303. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  1304. }),
  1305. smalltalk.Number);
  1306. smalltalk.addMethod(
  1307. '_printShowingDecimalPlaces_',
  1308. smalltalk.method({
  1309. selector: 'printShowingDecimalPlaces:',
  1310. fn: function (placesDesired){
  1311. var self=this;
  1312. return self.toFixed(placesDesired);
  1313. return self;}
  1314. }),
  1315. smalltalk.Number);
  1316. smalltalk.addMethod(
  1317. '_\',
  1318. smalltalk.method({
  1319. selector: '\',
  1320. fn: function (aNumber){
  1321. var self=this;
  1322. return self % aNumber;
  1323. return self;}
  1324. }),
  1325. smalltalk.Number);
  1326. smalltalk.addMethod(
  1327. '_to_by_',
  1328. smalltalk.method({
  1329. selector: 'to:by:',
  1330. fn: function (stop, step){
  1331. var self=this;
  1332. var array=nil;
  1333. var value=nil;
  1334. var pos=nil;
  1335. value=self;
  1336. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1337. pos=(1);
  1338. ((($receiver = smalltalk.send(step, "__eq", [(0)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})]));
  1339. ((($receiver = ((($receiver = step).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})() : (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();}), (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})]));
  1340. return array;
  1341. return self;}
  1342. }),
  1343. smalltalk.Number);
  1344. smalltalk.addMethod(
  1345. '_to_by_do_',
  1346. smalltalk.method({
  1347. selector: 'to:by:do:',
  1348. fn: function (stop, step, aBlock){
  1349. var self=this;
  1350. var value=nil;
  1351. value=self;
  1352. ((($receiver = smalltalk.send(step, "__eq", [(0)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})]));
  1353. ((($receiver = ((($receiver = step).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})() : (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();}), (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})]));
  1354. return self;}
  1355. }),
  1356. smalltalk.Number);
  1357. smalltalk.addMethod(
  1358. '_deepCopy',
  1359. smalltalk.method({
  1360. selector: 'deepCopy',
  1361. fn: function (){
  1362. var self=this;
  1363. return smalltalk.send(self, "_copy", []);
  1364. return self;}
  1365. }),
  1366. smalltalk.Number);
  1367. smalltalk.addMethod(
  1368. '_copy',
  1369. smalltalk.method({
  1370. selector: 'copy',
  1371. fn: function (){
  1372. var self=this;
  1373. return self;
  1374. return self;}
  1375. }),
  1376. smalltalk.Number);
  1377. smalltalk.addMethod(
  1378. '_\\',
  1379. smalltalk.method({
  1380. selector: '\\',
  1381. fn: function (aNumber){
  1382. var self=this;
  1383. return self % aNumber;
  1384. return self;}
  1385. }),
  1386. smalltalk.Number);
  1387. smalltalk.addMethod(
  1388. '_sqrt',
  1389. smalltalk.method({
  1390. selector: 'sqrt',
  1391. fn: function (){
  1392. var self=this;
  1393. return Math.sqrt(self);
  1394. return self;}
  1395. }),
  1396. smalltalk.Number);
  1397. smalltalk.addMethod(
  1398. '_squared',
  1399. smalltalk.method({
  1400. selector: 'squared',
  1401. fn: function (){
  1402. var self=this;
  1403. return self * self;
  1404. return self;}
  1405. }),
  1406. smalltalk.Number);
  1407. smalltalk.addMethod(
  1408. '_pi',
  1409. smalltalk.method({
  1410. selector: 'pi',
  1411. fn: function (){
  1412. var self=this;
  1413. return Math.PI;
  1414. return self;}
  1415. }),
  1416. smalltalk.Number.klass);
  1417. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  1418. smalltalk.addMethod(
  1419. '__eq',
  1420. smalltalk.method({
  1421. selector: '=',
  1422. fn: function (aBoolean){
  1423. var self=this;
  1424. try{((($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  1425. return Boolean(self == true) == aBoolean;
  1426. return self;
  1427. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  1428. }),
  1429. smalltalk.Boolean);
  1430. smalltalk.addMethod(
  1431. '_shallowCopy',
  1432. smalltalk.method({
  1433. selector: 'shallowCopy',
  1434. fn: function (){
  1435. var self=this;
  1436. return self;
  1437. return self;}
  1438. }),
  1439. smalltalk.Boolean);
  1440. smalltalk.addMethod(
  1441. '_deepCopy',
  1442. smalltalk.method({
  1443. selector: 'deepCopy',
  1444. fn: function (){
  1445. var self=this;
  1446. return self;
  1447. return self;}
  1448. }),
  1449. smalltalk.Boolean);
  1450. smalltalk.addMethod(
  1451. '_ifTrue_',
  1452. smalltalk.method({
  1453. selector: 'ifTrue:',
  1454. fn: function (aBlock){
  1455. var self=this;
  1456. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  1457. return self;}
  1458. }),
  1459. smalltalk.Boolean);
  1460. smalltalk.addMethod(
  1461. '_ifFalse_',
  1462. smalltalk.method({
  1463. selector: 'ifFalse:',
  1464. fn: function (aBlock){
  1465. var self=this;
  1466. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  1467. return self;}
  1468. }),
  1469. smalltalk.Boolean);
  1470. smalltalk.addMethod(
  1471. '_ifFalse_ifTrue_',
  1472. smalltalk.method({
  1473. selector: 'ifFalse:ifTrue:',
  1474. fn: function (aBlock, anotherBlock){
  1475. var self=this;
  1476. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1477. return self;}
  1478. }),
  1479. smalltalk.Boolean);
  1480. smalltalk.addMethod(
  1481. '_ifTrue_ifFalse_',
  1482. smalltalk.method({
  1483. selector: 'ifTrue:ifFalse:',
  1484. fn: function (aBlock, anotherBlock){
  1485. var self=this;
  1486. if(self == true) {
  1487. return aBlock();
  1488. } else {
  1489. return anotherBlock();
  1490. }
  1491. ;
  1492. return self;}
  1493. }),
  1494. smalltalk.Boolean);
  1495. smalltalk.addMethod(
  1496. '_and_',
  1497. smalltalk.method({
  1498. selector: 'and:',
  1499. fn: function (aBlock){
  1500. var self=this;
  1501. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  1502. return self;}
  1503. }),
  1504. smalltalk.Boolean);
  1505. smalltalk.addMethod(
  1506. '_or_',
  1507. smalltalk.method({
  1508. selector: 'or:',
  1509. fn: function (aBlock){
  1510. var self=this;
  1511. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  1512. return self;}
  1513. }),
  1514. smalltalk.Boolean);
  1515. smalltalk.addMethod(
  1516. '_not',
  1517. smalltalk.method({
  1518. selector: 'not',
  1519. fn: function (){
  1520. var self=this;
  1521. return smalltalk.send(self, "__eq", [false]);
  1522. return self;}
  1523. }),
  1524. smalltalk.Boolean);
  1525. smalltalk.addMethod(
  1526. '_printString',
  1527. smalltalk.method({
  1528. selector: 'printString',
  1529. fn: function (){
  1530. var self=this;
  1531. return self.toString();
  1532. return self;}
  1533. }),
  1534. smalltalk.Boolean);
  1535. smalltalk.addMethod(
  1536. '_&',
  1537. smalltalk.method({
  1538. selector: '&',
  1539. fn: function (aBoolean){
  1540. var self=this;
  1541. if(self == true) {
  1542. return aBoolean;
  1543. } else {
  1544. return false;
  1545. }
  1546. ;
  1547. return self;}
  1548. }),
  1549. smalltalk.Boolean);
  1550. smalltalk.addMethod(
  1551. '_|',
  1552. smalltalk.method({
  1553. selector: '|',
  1554. fn: function (aBoolean){
  1555. var self=this;
  1556. if(self == true) {
  1557. return true;
  1558. } else {
  1559. return aBoolean;
  1560. }
  1561. ;
  1562. return self;}
  1563. }),
  1564. smalltalk.Boolean);
  1565. smalltalk.addMethod(
  1566. '__eq_eq',
  1567. smalltalk.method({
  1568. selector: '==',
  1569. fn: function (aBoolean){
  1570. var self=this;
  1571. try{((($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]));
  1572. return Boolean(self == true) === Boolean(aBoolean == true);
  1573. return self;
  1574. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  1575. }),
  1576. smalltalk.Boolean);
  1577. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  1578. smalltalk.addMethod(
  1579. '_year',
  1580. smalltalk.method({
  1581. selector: 'year',
  1582. fn: function (){
  1583. var self=this;
  1584. return self.getFullYear();
  1585. return self;}
  1586. }),
  1587. smalltalk.Date);
  1588. smalltalk.addMethod(
  1589. '_month',
  1590. smalltalk.method({
  1591. selector: 'month',
  1592. fn: function (){
  1593. var self=this;
  1594. return self.getMonth() + 1;
  1595. return self;}
  1596. }),
  1597. smalltalk.Date);
  1598. smalltalk.addMethod(
  1599. '_month_',
  1600. smalltalk.method({
  1601. selector: 'month:',
  1602. fn: function (aNumber){
  1603. var self=this;
  1604. self.setMonth(aNumber - 1);
  1605. return self;}
  1606. }),
  1607. smalltalk.Date);
  1608. smalltalk.addMethod(
  1609. '_day',
  1610. smalltalk.method({
  1611. selector: 'day',
  1612. fn: function (){
  1613. var self=this;
  1614. return smalltalk.send(self, "_dayOfWeek", []);
  1615. return self;}
  1616. }),
  1617. smalltalk.Date);
  1618. smalltalk.addMethod(
  1619. '_dayOfWeek',
  1620. smalltalk.method({
  1621. selector: 'dayOfWeek',
  1622. fn: function (){
  1623. var self=this;
  1624. return self.getDay() + 1;
  1625. return self;}
  1626. }),
  1627. smalltalk.Date);
  1628. smalltalk.addMethod(
  1629. '_dayOfWeek_',
  1630. smalltalk.method({
  1631. selector: 'dayOfWeek:',
  1632. fn: function (aNumber){
  1633. var self=this;
  1634. return self.setDay(aNumber - 1);
  1635. return self;}
  1636. }),
  1637. smalltalk.Date);
  1638. smalltalk.addMethod(
  1639. '_day_',
  1640. smalltalk.method({
  1641. selector: 'day:',
  1642. fn: function (aNumber){
  1643. var self=this;
  1644. smalltalk.send(self, "_day_", [aNumber]);
  1645. return self;}
  1646. }),
  1647. smalltalk.Date);
  1648. smalltalk.addMethod(
  1649. '_year_',
  1650. smalltalk.method({
  1651. selector: 'year:',
  1652. fn: function (aNumber){
  1653. var self=this;
  1654. self.setFullYear(aNumber);
  1655. return self;}
  1656. }),
  1657. smalltalk.Date);
  1658. smalltalk.addMethod(
  1659. '_dayOfMonth',
  1660. smalltalk.method({
  1661. selector: 'dayOfMonth',
  1662. fn: function (){
  1663. var self=this;
  1664. return self.getDate();
  1665. return self;}
  1666. }),
  1667. smalltalk.Date);
  1668. smalltalk.addMethod(
  1669. '_dayOfMonth_',
  1670. smalltalk.method({
  1671. selector: 'dayOfMonth:',
  1672. fn: function (aNumber){
  1673. var self=this;
  1674. self.setDate(aNumber);
  1675. return self;}
  1676. }),
  1677. smalltalk.Date);
  1678. smalltalk.addMethod(
  1679. '_asString',
  1680. smalltalk.method({
  1681. selector: 'asString',
  1682. fn: function (){
  1683. var self=this;
  1684. return self.toString();
  1685. return self;}
  1686. }),
  1687. smalltalk.Date);
  1688. smalltalk.addMethod(
  1689. '_printString',
  1690. smalltalk.method({
  1691. selector: 'printString',
  1692. fn: function (){
  1693. var self=this;
  1694. return smalltalk.send(self, "_asString", []);
  1695. return self;}
  1696. }),
  1697. smalltalk.Date);
  1698. smalltalk.addMethod(
  1699. '_asMilliseconds',
  1700. smalltalk.method({
  1701. selector: 'asMilliseconds',
  1702. fn: function (){
  1703. var self=this;
  1704. return smalltalk.send(self, "_time", []);
  1705. return self;}
  1706. }),
  1707. smalltalk.Date);
  1708. smalltalk.addMethod(
  1709. '_time',
  1710. smalltalk.method({
  1711. selector: 'time',
  1712. fn: function (){
  1713. var self=this;
  1714. return self.getTime();
  1715. return self;}
  1716. }),
  1717. smalltalk.Date);
  1718. smalltalk.addMethod(
  1719. '_time_',
  1720. smalltalk.method({
  1721. selector: 'time:',
  1722. fn: function (aNumber){
  1723. var self=this;
  1724. self.setTime(aNumber);
  1725. return self;}
  1726. }),
  1727. smalltalk.Date);
  1728. smalltalk.addMethod(
  1729. '_asDateString',
  1730. smalltalk.method({
  1731. selector: 'asDateString',
  1732. fn: function (){
  1733. var self=this;
  1734. return self.toDateString();
  1735. return self;}
  1736. }),
  1737. smalltalk.Date);
  1738. smalltalk.addMethod(
  1739. '_asTimeString',
  1740. smalltalk.method({
  1741. selector: 'asTimeString',
  1742. fn: function (){
  1743. var self=this;
  1744. return self.toTimeString();
  1745. return self;}
  1746. }),
  1747. smalltalk.Date);
  1748. smalltalk.addMethod(
  1749. '_asLocaleString',
  1750. smalltalk.method({
  1751. selector: 'asLocaleString',
  1752. fn: function (){
  1753. var self=this;
  1754. return self.toLocaleString();
  1755. return self;}
  1756. }),
  1757. smalltalk.Date);
  1758. smalltalk.addMethod(
  1759. '_asNumber',
  1760. smalltalk.method({
  1761. selector: 'asNumber',
  1762. fn: function (){
  1763. var self=this;
  1764. return smalltalk.send(self, "_asMilliseconds", []);
  1765. return self;}
  1766. }),
  1767. smalltalk.Date);
  1768. smalltalk.addMethod(
  1769. '_hours_',
  1770. smalltalk.method({
  1771. selector: 'hours:',
  1772. fn: function (aNumber){
  1773. var self=this;
  1774. self.setHours(aNumber);
  1775. return self;}
  1776. }),
  1777. smalltalk.Date);
  1778. smalltalk.addMethod(
  1779. '_minutes_',
  1780. smalltalk.method({
  1781. selector: 'minutes:',
  1782. fn: function (aNumber){
  1783. var self=this;
  1784. self.setMinutes(aNumber);
  1785. return self;}
  1786. }),
  1787. smalltalk.Date);
  1788. smalltalk.addMethod(
  1789. '_seconds_',
  1790. smalltalk.method({
  1791. selector: 'seconds:',
  1792. fn: function (aNumber){
  1793. var self=this;
  1794. self.setSeconds(aNumber);
  1795. return self;}
  1796. }),
  1797. smalltalk.Date);
  1798. smalltalk.addMethod(
  1799. '_milliseconds_',
  1800. smalltalk.method({
  1801. selector: 'milliseconds:',
  1802. fn: function (aNumber){
  1803. var self=this;
  1804. self.setMilliseconds(aNumber);
  1805. return self;}
  1806. }),
  1807. smalltalk.Date);
  1808. smalltalk.addMethod(
  1809. '_hours',
  1810. smalltalk.method({
  1811. selector: 'hours',
  1812. fn: function (){
  1813. var self=this;
  1814. return self.getHours();
  1815. return self;}
  1816. }),
  1817. smalltalk.Date);
  1818. smalltalk.addMethod(
  1819. '_minutes',
  1820. smalltalk.method({
  1821. selector: 'minutes',
  1822. fn: function (){
  1823. var self=this;
  1824. return self.getMinutes();
  1825. return self;}
  1826. }),
  1827. smalltalk.Date);
  1828. smalltalk.addMethod(
  1829. '_seconds',
  1830. smalltalk.method({
  1831. selector: 'seconds',
  1832. fn: function (){
  1833. var self=this;
  1834. return self.getSeconds();
  1835. return self;}
  1836. }),
  1837. smalltalk.Date);
  1838. smalltalk.addMethod(
  1839. '_milliseconds',
  1840. smalltalk.method({
  1841. selector: 'milliseconds',
  1842. fn: function (){
  1843. var self=this;
  1844. return self.getMilliseconds();
  1845. return self;}
  1846. }),
  1847. smalltalk.Date);
  1848. smalltalk.addMethod(
  1849. '__lt',
  1850. smalltalk.method({
  1851. selector: '<',
  1852. fn: function (aDate){
  1853. var self=this;
  1854. return self < aDate;
  1855. return self;}
  1856. }),
  1857. smalltalk.Date);
  1858. smalltalk.addMethod(
  1859. '__gt',
  1860. smalltalk.method({
  1861. selector: '>',
  1862. fn: function (aDate){
  1863. var self=this;
  1864. return self > aDate;
  1865. return self;}
  1866. }),
  1867. smalltalk.Date);
  1868. smalltalk.addMethod(
  1869. '__lt_eq',
  1870. smalltalk.method({
  1871. selector: '<=',
  1872. fn: function (aDate){
  1873. var self=this;
  1874. return self <= aDate;
  1875. return self;}
  1876. }),
  1877. smalltalk.Date);
  1878. smalltalk.addMethod(
  1879. '__gt_eq',
  1880. smalltalk.method({
  1881. selector: '>=',
  1882. fn: function (aDate){
  1883. var self=this;
  1884. return self >= aDate;
  1885. return self;}
  1886. }),
  1887. smalltalk.Date);
  1888. smalltalk.addMethod(
  1889. '__minus',
  1890. smalltalk.method({
  1891. selector: '-',
  1892. fn: function (aDate){
  1893. var self=this;
  1894. return self - aDate;
  1895. return self;}
  1896. }),
  1897. smalltalk.Date);
  1898. smalltalk.addMethod(
  1899. '__plus',
  1900. smalltalk.method({
  1901. selector: '+',
  1902. fn: function (aDate){
  1903. var self=this;
  1904. return self + aDate;
  1905. return self;}
  1906. }),
  1907. smalltalk.Date);
  1908. smalltalk.addMethod(
  1909. '_new_',
  1910. smalltalk.method({
  1911. selector: 'new:',
  1912. fn: function (anObject){
  1913. var self=this;
  1914. return new Date(anObject);
  1915. return self;}
  1916. }),
  1917. smalltalk.Date.klass);
  1918. smalltalk.addMethod(
  1919. '_fromString_',
  1920. smalltalk.method({
  1921. selector: 'fromString:',
  1922. fn: function (aString){
  1923. var self=this;
  1924. return smalltalk.send(self, "_new_", [aString]);
  1925. return self;}
  1926. }),
  1927. smalltalk.Date.klass);
  1928. smalltalk.addMethod(
  1929. '_fromSeconds_',
  1930. smalltalk.method({
  1931. selector: 'fromSeconds:',
  1932. fn: function (aNumber){
  1933. var self=this;
  1934. return smalltalk.send(self, "_fromMilliseconds_", [((($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))]);
  1935. return self;}
  1936. }),
  1937. smalltalk.Date.klass);
  1938. smalltalk.addMethod(
  1939. '_fromMilliseconds_',
  1940. smalltalk.method({
  1941. selector: 'fromMilliseconds:',
  1942. fn: function (aNumber){
  1943. var self=this;
  1944. return smalltalk.send(self, "_new_", [aNumber]);
  1945. return self;}
  1946. }),
  1947. smalltalk.Date.klass);
  1948. smalltalk.addMethod(
  1949. '_today',
  1950. smalltalk.method({
  1951. selector: 'today',
  1952. fn: function (){
  1953. var self=this;
  1954. return smalltalk.send(self, "_new", []);
  1955. return self;}
  1956. }),
  1957. smalltalk.Date.klass);
  1958. smalltalk.addMethod(
  1959. '_now',
  1960. smalltalk.method({
  1961. selector: 'now',
  1962. fn: function (){
  1963. var self=this;
  1964. return smalltalk.send(self, "_today", []);
  1965. return self;}
  1966. }),
  1967. smalltalk.Date.klass);
  1968. smalltalk.addMethod(
  1969. '_millisecondsToRun_',
  1970. smalltalk.method({
  1971. selector: 'millisecondsToRun:',
  1972. fn: function (aBlock){
  1973. var self=this;
  1974. var t=nil;
  1975. t=smalltalk.send((smalltalk.Date || Date), "_now", []);
  1976. smalltalk.send(aBlock, "_value", []);
  1977. return ((($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]));
  1978. return self;}
  1979. }),
  1980. smalltalk.Date.klass);
  1981. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  1982. smalltalk.addMethod(
  1983. '_subclass_instanceVariableNames_',
  1984. smalltalk.method({
  1985. selector: 'subclass:instanceVariableNames:',
  1986. fn: function (aString, anotherString){
  1987. var self=this;
  1988. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  1989. return self;}
  1990. }),
  1991. smalltalk.UndefinedObject);
  1992. smalltalk.addMethod(
  1993. '_subclass_instanceVariableNames_category_',
  1994. smalltalk.method({
  1995. selector: 'subclass:instanceVariableNames:category:',
  1996. fn: function (aString, aString2, aString3){
  1997. var self=this;
  1998. smalltalk.send(self, "_deprecatedAPI", []);
  1999. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  2000. return self;}
  2001. }),
  2002. smalltalk.UndefinedObject);
  2003. smalltalk.addMethod(
  2004. '_shallowCopy',
  2005. smalltalk.method({
  2006. selector: 'shallowCopy',
  2007. fn: function (){
  2008. var self=this;
  2009. return self;
  2010. return self;}
  2011. }),
  2012. smalltalk.UndefinedObject);
  2013. smalltalk.addMethod(
  2014. '_deepCopy',
  2015. smalltalk.method({
  2016. selector: 'deepCopy',
  2017. fn: function (){
  2018. var self=this;
  2019. return self;
  2020. return self;}
  2021. }),
  2022. smalltalk.UndefinedObject);
  2023. smalltalk.addMethod(
  2024. '_ifNil_',
  2025. smalltalk.method({
  2026. selector: 'ifNil:',
  2027. fn: function (aBlock){
  2028. var self=this;
  2029. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2030. return self;}
  2031. }),
  2032. smalltalk.UndefinedObject);
  2033. smalltalk.addMethod(
  2034. '_ifNotNil_',
  2035. smalltalk.method({
  2036. selector: 'ifNotNil:',
  2037. fn: function (aBlock){
  2038. var self=this;
  2039. return self;
  2040. return self;}
  2041. }),
  2042. smalltalk.UndefinedObject);
  2043. smalltalk.addMethod(
  2044. '_ifNil_ifNotNil_',
  2045. smalltalk.method({
  2046. selector: 'ifNil:ifNotNil:',
  2047. fn: function (aBlock, anotherBlock){
  2048. var self=this;
  2049. return smalltalk.send(aBlock, "_value", []);
  2050. return self;}
  2051. }),
  2052. smalltalk.UndefinedObject);
  2053. smalltalk.addMethod(
  2054. '_ifNotNil_ifNil_',
  2055. smalltalk.method({
  2056. selector: 'ifNotNil:ifNil:',
  2057. fn: function (aBlock, anotherBlock){
  2058. var self=this;
  2059. return smalltalk.send(anotherBlock, "_value", []);
  2060. return self;}
  2061. }),
  2062. smalltalk.UndefinedObject);
  2063. smalltalk.addMethod(
  2064. '_isNil',
  2065. smalltalk.method({
  2066. selector: 'isNil',
  2067. fn: function (){
  2068. var self=this;
  2069. return true;
  2070. return self;}
  2071. }),
  2072. smalltalk.UndefinedObject);
  2073. smalltalk.addMethod(
  2074. '_notNil',
  2075. smalltalk.method({
  2076. selector: 'notNil',
  2077. fn: function (){
  2078. var self=this;
  2079. return false;
  2080. return self;}
  2081. }),
  2082. smalltalk.UndefinedObject);
  2083. smalltalk.addMethod(
  2084. '_printString',
  2085. smalltalk.method({
  2086. selector: 'printString',
  2087. fn: function (){
  2088. var self=this;
  2089. return "nil";
  2090. return self;}
  2091. }),
  2092. smalltalk.UndefinedObject);
  2093. smalltalk.addMethod(
  2094. '_subclass_instanceVariableNames_package_',
  2095. smalltalk.method({
  2096. selector: 'subclass:instanceVariableNames:package:',
  2097. fn: function (aString, aString2, aString3){
  2098. var self=this;
  2099. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  2100. return self;}
  2101. }),
  2102. smalltalk.UndefinedObject);
  2103. smalltalk.addMethod(
  2104. '_new',
  2105. smalltalk.method({
  2106. selector: 'new',
  2107. fn: function (){
  2108. var self=this;
  2109. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2110. return self;}
  2111. }),
  2112. smalltalk.UndefinedObject.klass);
  2113. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  2114. smalltalk.addMethod(
  2115. '_next',
  2116. smalltalk.method({
  2117. selector: 'next',
  2118. fn: function (){
  2119. var self=this;
  2120. return Math.random();
  2121. return self;}
  2122. }),
  2123. smalltalk.Random);
  2124. smalltalk.addMethod(
  2125. '_next_',
  2126. smalltalk.method({
  2127. selector: 'next:',
  2128. fn: function (anInteger){
  2129. var self=this;
  2130. return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
  2131. return self;}
  2132. }),
  2133. smalltalk.Random);
  2134. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  2135. smalltalk.addMethod(
  2136. '_x',
  2137. smalltalk.method({
  2138. selector: 'x',
  2139. fn: function (){
  2140. var self=this;
  2141. return self['@x'];
  2142. return self;}
  2143. }),
  2144. smalltalk.Point);
  2145. smalltalk.addMethod(
  2146. '_y',
  2147. smalltalk.method({
  2148. selector: 'y',
  2149. fn: function (){
  2150. var self=this;
  2151. return self['@y'];
  2152. return self;}
  2153. }),
  2154. smalltalk.Point);
  2155. smalltalk.addMethod(
  2156. '_y_',
  2157. smalltalk.method({
  2158. selector: 'y:',
  2159. fn: function (aNumber){
  2160. var self=this;
  2161. self['@y']=aNumber;
  2162. return self;}
  2163. }),
  2164. smalltalk.Point);
  2165. smalltalk.addMethod(
  2166. '_x_',
  2167. smalltalk.method({
  2168. selector: 'x:',
  2169. fn: function (aNumber){
  2170. var self=this;
  2171. self['@x']=aNumber;
  2172. return self;}
  2173. }),
  2174. smalltalk.Point);
  2175. smalltalk.addMethod(
  2176. '__star',
  2177. smalltalk.method({
  2178. selector: '*',
  2179. fn: function (aPoint){
  2180. var self=this;
  2181. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  2182. return self;}
  2183. }),
  2184. smalltalk.Point);
  2185. smalltalk.addMethod(
  2186. '__plus',
  2187. smalltalk.method({
  2188. selector: '+',
  2189. fn: function (aPoint){
  2190. var self=this;
  2191. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  2192. return self;}
  2193. }),
  2194. smalltalk.Point);
  2195. smalltalk.addMethod(
  2196. '__minus',
  2197. smalltalk.method({
  2198. selector: '-',
  2199. fn: function (aPoint){
  2200. var self=this;
  2201. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  2202. return self;}
  2203. }),
  2204. smalltalk.Point);
  2205. smalltalk.addMethod(
  2206. '__slash',
  2207. smalltalk.method({
  2208. selector: '/',
  2209. fn: function (aPoint){
  2210. var self=this;
  2211. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver /smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver /smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  2212. return self;}
  2213. }),
  2214. smalltalk.Point);
  2215. smalltalk.addMethod(
  2216. '_asPoint',
  2217. smalltalk.method({
  2218. selector: 'asPoint',
  2219. fn: function (){
  2220. var self=this;
  2221. return self;
  2222. return self;}
  2223. }),
  2224. smalltalk.Point);
  2225. smalltalk.addMethod(
  2226. '__eq',
  2227. smalltalk.method({
  2228. selector: '=',
  2229. fn: function (aPoint){
  2230. var self=this;
  2231. return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);})]);
  2232. return self;}
  2233. }),
  2234. smalltalk.Point);
  2235. smalltalk.addMethod(
  2236. '_x_y_',
  2237. smalltalk.method({
  2238. selector: 'x:y:',
  2239. fn: function (aNumber, anotherNumber){
  2240. var self=this;
  2241. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2242. return self;}
  2243. }),
  2244. smalltalk.Point.klass);
  2245. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  2246. smalltalk.addMethod(
  2247. '_jsObject_',
  2248. smalltalk.method({
  2249. selector: 'jsObject:',
  2250. fn: function (aJSObject){
  2251. var self=this;
  2252. self['@jsObject']=aJSObject;
  2253. return self;}
  2254. }),
  2255. smalltalk.JSObjectProxy);
  2256. smalltalk.addMethod(
  2257. '_jsObject',
  2258. smalltalk.method({
  2259. selector: 'jsObject',
  2260. fn: function (){
  2261. var self=this;
  2262. return self['@jsObject'];
  2263. return self;}
  2264. }),
  2265. smalltalk.JSObjectProxy);
  2266. smalltalk.addMethod(
  2267. '_printString',
  2268. smalltalk.method({
  2269. selector: 'printString',
  2270. fn: function (){
  2271. var self=this;
  2272. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  2273. return self;}
  2274. }),
  2275. smalltalk.JSObjectProxy);
  2276. smalltalk.addMethod(
  2277. '_inspectOn_',
  2278. smalltalk.method({
  2279. selector: 'inspectOn:',
  2280. fn: function (anInspector){
  2281. var self=this;
  2282. var variables=nil;
  2283. variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  2284. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  2285. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  2286. for(var i in self['@jsObject']) {
  2287. variables._at_put_(i, self['@jsObject'][i]);
  2288. };
  2289. smalltalk.send(anInspector, "_setVariables_", [variables]);
  2290. return self;}
  2291. }),
  2292. smalltalk.JSObjectProxy);
  2293. smalltalk.addMethod(
  2294. '_doesNotUnderstand_',
  2295. smalltalk.method({
  2296. selector: 'doesNotUnderstand:',
  2297. fn: function (aMessage){
  2298. var self=this;
  2299. var obj=nil;
  2300. var selector=nil;
  2301. var jsSelector=nil;
  2302. var arguments=nil;
  2303. obj=smalltalk.send(self, "_jsObject", []);
  2304. selector=smalltalk.send(aMessage, "_selector", []);
  2305. jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []);
  2306. arguments=smalltalk.send(aMessage, "_arguments", []);
  2307. if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
  2308. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  2309. return self;}
  2310. }),
  2311. smalltalk.JSObjectProxy);
  2312. smalltalk.addMethod(
  2313. '_at_',
  2314. smalltalk.method({
  2315. selector: 'at:',
  2316. fn: function (aString){
  2317. var self=this;
  2318. return self['@jsObject'][aString];
  2319. return self;}
  2320. }),
  2321. smalltalk.JSObjectProxy);
  2322. smalltalk.addMethod(
  2323. '_at_put_',
  2324. smalltalk.method({
  2325. selector: 'at:put:',
  2326. fn: function (aString, anObject){
  2327. var self=this;
  2328. self['@jsObject'][aString] = anObject;
  2329. return self;}
  2330. }),
  2331. smalltalk.JSObjectProxy);
  2332. smalltalk.addMethod(
  2333. '_on_',
  2334. smalltalk.method({
  2335. selector: 'on:',
  2336. fn: function (aJSObject){
  2337. var self=this;
  2338. return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2339. return self;}
  2340. }),
  2341. smalltalk.JSObjectProxy.klass);