2
0

Kernel-Objects.deploy.js 65 KB

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