Kernel.deploy.js 114 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260
  1. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  2. smalltalk.addMethod(
  3. '__eq',
  4. smalltalk.method({
  5. selector: '=',
  6. fn: function (anObject){
  7. var self=this;
  8. return self == anObject;
  9. return self;}
  10. }),
  11. smalltalk.Object);
  12. smalltalk.addMethod(
  13. '_~_eq',
  14. smalltalk.method({
  15. selector: '~=',
  16. fn: function (anObject){
  17. var self=this;
  18. return (($receiver = (($receiver = self).klass === smalltalk.Number) ? $receiver ==anObject : smalltalk.send($receiver, "__eq", [anObject])).klass === smalltalk.Number) ? $receiver ==false : smalltalk.send($receiver, "__eq", [false]);
  19. return self;}
  20. }),
  21. smalltalk.Object);
  22. smalltalk.addMethod(
  23. '_initialize',
  24. smalltalk.method({
  25. selector: 'initialize',
  26. fn: function (){
  27. var self=this;
  28. return self;}
  29. }),
  30. smalltalk.Object);
  31. smalltalk.addMethod(
  32. '_yourself',
  33. smalltalk.method({
  34. selector: 'yourself',
  35. fn: function (){
  36. var self=this;
  37. return self;
  38. return self;}
  39. }),
  40. smalltalk.Object);
  41. smalltalk.addMethod(
  42. '_class',
  43. smalltalk.method({
  44. selector: 'class',
  45. fn: function (){
  46. var self=this;
  47. return self.klass;
  48. return self;}
  49. }),
  50. smalltalk.Object);
  51. smalltalk.addMethod(
  52. '_size',
  53. smalltalk.method({
  54. selector: 'size',
  55. fn: function (){
  56. var self=this;
  57. smalltalk.send(self, "_error_", ["Object not indexable"]);
  58. return self;}
  59. }),
  60. smalltalk.Object);
  61. smalltalk.addMethod(
  62. '_copy',
  63. smalltalk.method({
  64. selector: 'copy',
  65. fn: function (){
  66. var self=this;
  67. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  68. return self;}
  69. }),
  70. smalltalk.Object);
  71. smalltalk.addMethod(
  72. '_shallowCopy',
  73. smalltalk.method({
  74. selector: 'shallowCopy',
  75. fn: function (){
  76. var self=this;
  77. var copy = self.klass._new();
  78. for(var i in self) {
  79. if(/^@.+/.test(i)) {
  80. copy[i] = self[i];
  81. }
  82. }
  83. return copy;
  84. ;
  85. return self;}
  86. }),
  87. smalltalk.Object);
  88. smalltalk.addMethod(
  89. '_deepCopy',
  90. smalltalk.method({
  91. selector: 'deepCopy',
  92. fn: function (){
  93. var self=this;
  94. var copy = self.klass._new();
  95. for(var i in self) {
  96. if(/^@.+/.test(i)) {
  97. copy[i] = self[i]._deepCopy();
  98. }
  99. }
  100. return copy;
  101. ;
  102. return self;}
  103. }),
  104. smalltalk.Object);
  105. smalltalk.addMethod(
  106. '_postCopy',
  107. smalltalk.method({
  108. selector: 'postCopy',
  109. fn: function (){
  110. var self=this;
  111. return self;}
  112. }),
  113. smalltalk.Object);
  114. smalltalk.addMethod(
  115. '__minus_gt',
  116. smalltalk.method({
  117. selector: '->',
  118. fn: function (anObject){
  119. var self=this;
  120. return smalltalk.send(smalltalk.Association, "_key_value_", [self, anObject]);
  121. return self;}
  122. }),
  123. smalltalk.Object);
  124. smalltalk.addMethod(
  125. '_asString',
  126. smalltalk.method({
  127. selector: 'asString',
  128. fn: function (){
  129. var self=this;
  130. return smalltalk.send(self, "_printString", []);
  131. return self;}
  132. }),
  133. smalltalk.Object);
  134. smalltalk.addMethod(
  135. '_asJavascript',
  136. smalltalk.method({
  137. selector: 'asJavascript',
  138. fn: function (){
  139. var self=this;
  140. return smalltalk.send(self, "_asString", []);
  141. return self;}
  142. }),
  143. smalltalk.Object);
  144. smalltalk.addMethod(
  145. '_perform_',
  146. smalltalk.method({
  147. selector: 'perform:',
  148. fn: function (aSymbol){
  149. var self=this;
  150. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  151. return self;}
  152. }),
  153. smalltalk.Object);
  154. smalltalk.addMethod(
  155. '_perform_withArguments_',
  156. smalltalk.method({
  157. selector: 'perform:withArguments:',
  158. fn: function (aSymbol, aCollection){
  159. var self=this;
  160. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  161. return self;}
  162. }),
  163. smalltalk.Object);
  164. smalltalk.addMethod(
  165. '_instVarAt_',
  166. smalltalk.method({
  167. selector: 'instVarAt:',
  168. fn: function (aString){
  169. var self=this;
  170. return self['@'+aString];
  171. return self;}
  172. }),
  173. smalltalk.Object);
  174. smalltalk.addMethod(
  175. '_instVarAt_put_',
  176. smalltalk.method({
  177. selector: 'instVarAt:put:',
  178. fn: function (aString, anObject){
  179. var self=this;
  180. self['@' + aString] = anObject;
  181. return self;}
  182. }),
  183. smalltalk.Object);
  184. smalltalk.addMethod(
  185. '_basicAt_',
  186. smalltalk.method({
  187. selector: 'basicAt:',
  188. fn: function (aString){
  189. var self=this;
  190. return self[aString];
  191. return self;}
  192. }),
  193. smalltalk.Object);
  194. smalltalk.addMethod(
  195. '_basicAt_put_',
  196. smalltalk.method({
  197. selector: 'basicAt:put:',
  198. fn: function (aString, anObject){
  199. var self=this;
  200. return self[aString] = anObject;
  201. return self;}
  202. }),
  203. smalltalk.Object);
  204. smalltalk.addMethod(
  205. '_error_',
  206. smalltalk.method({
  207. selector: 'error:',
  208. fn: function (aString){
  209. var self=this;
  210. smalltalk.send(smalltalk.Error, "_signal_", [aString]);
  211. return self;}
  212. }),
  213. smalltalk.Object);
  214. smalltalk.addMethod(
  215. '_subclassResponsibility',
  216. smalltalk.method({
  217. selector: 'subclassResponsibility',
  218. fn: function (){
  219. var self=this;
  220. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  221. return self;}
  222. }),
  223. smalltalk.Object);
  224. smalltalk.addMethod(
  225. '_shouldNotImplement',
  226. smalltalk.method({
  227. selector: 'shouldNotImplement',
  228. fn: function (){
  229. var self=this;
  230. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  231. return self;}
  232. }),
  233. smalltalk.Object);
  234. smalltalk.addMethod(
  235. '_try_catch_',
  236. smalltalk.method({
  237. selector: 'try:catch:',
  238. fn: function (aBlock, anotherBlock){
  239. var self=this;
  240. try{aBlock()} catch(e) {anotherBlock(e)};
  241. return self;}
  242. }),
  243. smalltalk.Object);
  244. smalltalk.addMethod(
  245. '_printString',
  246. smalltalk.method({
  247. selector: 'printString',
  248. fn: function (){
  249. var self=this;
  250. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  251. return self;}
  252. }),
  253. smalltalk.Object);
  254. smalltalk.addMethod(
  255. '_printNl',
  256. smalltalk.method({
  257. selector: 'printNl',
  258. fn: function (){
  259. var self=this;
  260. console.log(self);
  261. return self;}
  262. }),
  263. smalltalk.Object);
  264. smalltalk.addMethod(
  265. '_isKindOf_',
  266. smalltalk.method({
  267. selector: 'isKindOf:',
  268. fn: function (aClass){
  269. var self=this;
  270. return smalltalk.send(smalltalk.send(self, "_isMemberOf_", [aClass]), "_ifTrue_ifFalse_", [(function(){return true;}), (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})]);
  271. return self;}
  272. }),
  273. smalltalk.Object);
  274. smalltalk.addMethod(
  275. '_isMemberOf_',
  276. smalltalk.method({
  277. selector: 'isMemberOf:',
  278. fn: function (aClass){
  279. var self=this;
  280. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  281. return self;}
  282. }),
  283. smalltalk.Object);
  284. smalltalk.addMethod(
  285. '_ifNil_',
  286. smalltalk.method({
  287. selector: 'ifNil:',
  288. fn: function (aBlock){
  289. var self=this;
  290. return self;
  291. return self;}
  292. }),
  293. smalltalk.Object);
  294. smalltalk.addMethod(
  295. '_ifNil_ifNotNil_',
  296. smalltalk.method({
  297. selector: 'ifNil:ifNotNil:',
  298. fn: function (aBlock, anotherBlock){
  299. var self=this;
  300. return smalltalk.send(anotherBlock, "_value", []);
  301. return self;}
  302. }),
  303. smalltalk.Object);
  304. smalltalk.addMethod(
  305. '_ifNotNil_',
  306. smalltalk.method({
  307. selector: 'ifNotNil:',
  308. fn: function (aBlock){
  309. var self=this;
  310. return smalltalk.send(aBlock, "_value", []);
  311. return self;}
  312. }),
  313. smalltalk.Object);
  314. smalltalk.addMethod(
  315. '_ifNotNil_ifNil_',
  316. smalltalk.method({
  317. selector: 'ifNotNil:ifNil:',
  318. fn: function (aBlock, anotherBlock){
  319. var self=this;
  320. return smalltalk.send(aBlock, "_value", []);
  321. return self;}
  322. }),
  323. smalltalk.Object);
  324. smalltalk.addMethod(
  325. '_isNil',
  326. smalltalk.method({
  327. selector: 'isNil',
  328. fn: function (){
  329. var self=this;
  330. return false;
  331. return self;}
  332. }),
  333. smalltalk.Object);
  334. smalltalk.addMethod(
  335. '_notNil',
  336. smalltalk.method({
  337. selector: 'notNil',
  338. fn: function (){
  339. var self=this;
  340. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  341. return self;}
  342. }),
  343. smalltalk.Object);
  344. smalltalk.addMethod(
  345. '_isClass',
  346. smalltalk.method({
  347. selector: 'isClass',
  348. fn: function (){
  349. var self=this;
  350. return false;
  351. return self;}
  352. }),
  353. smalltalk.Object);
  354. smalltalk.addMethod(
  355. '_isMetaclass',
  356. smalltalk.method({
  357. selector: 'isMetaclass',
  358. fn: function (){
  359. var self=this;
  360. return false;
  361. return self;}
  362. }),
  363. smalltalk.Object);
  364. smalltalk.addMethod(
  365. '_isNumber',
  366. smalltalk.method({
  367. selector: 'isNumber',
  368. fn: function (){
  369. var self=this;
  370. return false;
  371. return self;}
  372. }),
  373. smalltalk.Object);
  374. smalltalk.addMethod(
  375. '_isString',
  376. smalltalk.method({
  377. selector: 'isString',
  378. fn: function (){
  379. var self=this;
  380. return false;
  381. return self;}
  382. }),
  383. smalltalk.Object);
  384. smalltalk.addMethod(
  385. '_isParseFailure',
  386. smalltalk.method({
  387. selector: 'isParseFailure',
  388. fn: function (){
  389. var self=this;
  390. return false;
  391. return self;}
  392. }),
  393. smalltalk.Object);
  394. smalltalk.addMethod(
  395. '_basicPerform_',
  396. smalltalk.method({
  397. selector: 'basicPerform:',
  398. fn: function (aSymbol){
  399. var self=this;
  400. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  401. return self;}
  402. }),
  403. smalltalk.Object);
  404. smalltalk.addMethod(
  405. '_basicPerform_withArguments_',
  406. smalltalk.method({
  407. selector: 'basicPerform:withArguments:',
  408. fn: function (aSymbol, aCollection){
  409. var self=this;
  410. return self[aSymbol].apply(self, aCollection);;
  411. return self;}
  412. }),
  413. smalltalk.Object);
  414. smalltalk.addMethod(
  415. '_basicDelete_',
  416. smalltalk.method({
  417. selector: 'basicDelete:',
  418. fn: function (aString){
  419. var self=this;
  420. delete self[aString];
  421. return self;}
  422. }),
  423. smalltalk.Object);
  424. smalltalk.addMethod(
  425. '_doesNotUnderstand_',
  426. smalltalk.method({
  427. selector: 'doesNotUnderstand:',
  428. fn: function (aMessage){
  429. var self=this;
  430. (function($rec){smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(smalltalk.MessageNotUnderstood, "_new", []));
  431. return self;}
  432. }),
  433. smalltalk.Object);
  434. smalltalk.addMethod(
  435. '_asJSON',
  436. smalltalk.method({
  437. selector: 'asJSON',
  438. fn: function (){
  439. var self=this;
  440. return JSON.stringify(self._asJSONObject());
  441. return self;}
  442. }),
  443. smalltalk.Object);
  444. smalltalk.addMethod(
  445. '_asJSONObject',
  446. smalltalk.method({
  447. selector: 'asJSONObject',
  448. fn: function (){
  449. var self=this;
  450. var object=nil;
  451. object=smalltalk.send(smalltalk.Object, "_new", []);
  452. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_instanceVariableNames", []), "_do_", [(function(each){return smalltalk.send(object, "_basicAt_put_", [each, smalltalk.send(smalltalk.send(self, "_instVarAt_", [each]), "_asJSONObject", [])]);})]);
  453. return object;
  454. return self;}
  455. }),
  456. smalltalk.Object);
  457. smalltalk.addMethod(
  458. '_halt',
  459. smalltalk.method({
  460. selector: 'halt',
  461. fn: function (){
  462. var self=this;
  463. smalltalk.send(self, "_error_", ["Halt encountered"]);
  464. return self;}
  465. }),
  466. smalltalk.Object);
  467. smalltalk.addMethod(
  468. '_initialize',
  469. smalltalk.method({
  470. selector: 'initialize',
  471. fn: function (){
  472. var self=this;
  473. return self;}
  474. }),
  475. smalltalk.Object.klass);
  476. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  477. smalltalk.addMethod(
  478. '_classes',
  479. smalltalk.method({
  480. selector: 'classes',
  481. fn: function (){
  482. var self=this;
  483. return self.classes();
  484. return self;}
  485. }),
  486. smalltalk.Smalltalk);
  487. smalltalk.addMethod(
  488. '_readJSON_',
  489. smalltalk.method({
  490. selector: 'readJSON:',
  491. fn: function (anObject){
  492. var self=this;
  493. return self.readJSObject(anObject);
  494. return self;}
  495. }),
  496. smalltalk.Smalltalk);
  497. smalltalk.addMethod(
  498. '_at_',
  499. smalltalk.method({
  500. selector: 'at:',
  501. fn: function (aString){
  502. var self=this;
  503. return self[aString];
  504. return self;}
  505. }),
  506. smalltalk.Smalltalk);
  507. smalltalk.addMethod(
  508. '_removeClass_',
  509. smalltalk.method({
  510. selector: 'removeClass:',
  511. fn: function (aClass){
  512. var self=this;
  513. smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);})]);
  514. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  515. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  516. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  517. return self;}
  518. }),
  519. smalltalk.Smalltalk);
  520. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  521. smalltalk.addMethod(
  522. '_current',
  523. smalltalk.method({
  524. selector: 'current',
  525. fn: function (){
  526. var self=this;
  527. return smalltalk;
  528. return self;}
  529. }),
  530. smalltalk.Smalltalk.klass);
  531. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  532. smalltalk.addMethod(
  533. '_new',
  534. smalltalk.method({
  535. selector: 'new',
  536. fn: function (){
  537. var self=this;
  538. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  539. return self;}
  540. }),
  541. smalltalk.Behavior);
  542. smalltalk.addMethod(
  543. '_basicNew',
  544. smalltalk.method({
  545. selector: 'basicNew',
  546. fn: function (){
  547. var self=this;
  548. return new self.fn();
  549. return self;}
  550. }),
  551. smalltalk.Behavior);
  552. smalltalk.addMethod(
  553. '_name',
  554. smalltalk.method({
  555. selector: 'name',
  556. fn: function (){
  557. var self=this;
  558. return self.className || nil;
  559. return self;}
  560. }),
  561. smalltalk.Behavior);
  562. smalltalk.addMethod(
  563. '_superclass',
  564. smalltalk.method({
  565. selector: 'superclass',
  566. fn: function (){
  567. var self=this;
  568. return self.superclass || nil;
  569. return self;}
  570. }),
  571. smalltalk.Behavior);
  572. smalltalk.addMethod(
  573. '_subclasses',
  574. smalltalk.method({
  575. selector: 'subclasses',
  576. fn: function (){
  577. var self=this;
  578. return smalltalk.subclasses(self);
  579. return self;}
  580. }),
  581. smalltalk.Behavior);
  582. smalltalk.addMethod(
  583. '_allSubclasses',
  584. smalltalk.method({
  585. selector: 'allSubclasses',
  586. fn: function (){
  587. var self=this;
  588. var result=nil;
  589. result=smalltalk.send(self, "_subclasses", []);
  590. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  591. return result;
  592. return self;}
  593. }),
  594. smalltalk.Behavior);
  595. smalltalk.addMethod(
  596. '_withAllSubclasses',
  597. smalltalk.method({
  598. selector: 'withAllSubclasses',
  599. fn: function (){
  600. var self=this;
  601. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.Array, "_with_", [self]));
  602. return self;}
  603. }),
  604. smalltalk.Behavior);
  605. smalltalk.addMethod(
  606. '_prototype',
  607. smalltalk.method({
  608. selector: 'prototype',
  609. fn: function (){
  610. var self=this;
  611. return self.fn.prototype;
  612. return self;}
  613. }),
  614. smalltalk.Behavior);
  615. smalltalk.addMethod(
  616. '_methodDictionary',
  617. smalltalk.method({
  618. selector: 'methodDictionary',
  619. fn: function (){
  620. var self=this;
  621. var dict = smalltalk.Dictionary._new();
  622. var methods = self.fn.prototype.methods;
  623. for(var i in methods) {
  624. if(methods[i].selector) {
  625. dict._at_put_(methods[i].selector, methods[i]);
  626. }
  627. };
  628. return dict;
  629. return self;}
  630. }),
  631. smalltalk.Behavior);
  632. smalltalk.addMethod(
  633. '_methodsFor_',
  634. smalltalk.method({
  635. selector: 'methodsFor:',
  636. fn: function (aString){
  637. var self=this;
  638. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.ClassCategoryReader, "_new", []));
  639. return self;}
  640. }),
  641. smalltalk.Behavior);
  642. smalltalk.addMethod(
  643. '_addCompiledMethod_',
  644. smalltalk.method({
  645. selector: 'addCompiledMethod:',
  646. fn: function (aMethod){
  647. var self=this;
  648. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  649. return self;}
  650. }),
  651. smalltalk.Behavior);
  652. smalltalk.addMethod(
  653. '_instanceVariableNames',
  654. smalltalk.method({
  655. selector: 'instanceVariableNames',
  656. fn: function (){
  657. var self=this;
  658. return self.iVarNames;
  659. return self;}
  660. }),
  661. smalltalk.Behavior);
  662. smalltalk.addMethod(
  663. '_comment',
  664. smalltalk.method({
  665. selector: 'comment',
  666. fn: function (){
  667. var self=this;
  668. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["comment"]), "_ifNil_", [(function(){return "";})]);
  669. return self;}
  670. }),
  671. smalltalk.Behavior);
  672. smalltalk.addMethod(
  673. '_comment_',
  674. smalltalk.method({
  675. selector: 'comment:',
  676. fn: function (aString){
  677. var self=this;
  678. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  679. return self;}
  680. }),
  681. smalltalk.Behavior);
  682. smalltalk.addMethod(
  683. '_commentStamp',
  684. smalltalk.method({
  685. selector: 'commentStamp',
  686. fn: function (){
  687. var self=this;
  688. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.ClassCommentReader, "_new", []));
  689. return self;}
  690. }),
  691. smalltalk.Behavior);
  692. smalltalk.addMethod(
  693. '_removeCompiledMethod_',
  694. smalltalk.method({
  695. selector: 'removeCompiledMethod:',
  696. fn: function (aMethod){
  697. var self=this;
  698. delete self.fn.prototype[aMethod.selector._asSelector()];
  699. delete self.fn.prototype.methods[aMethod.selector];
  700. smalltalk.init(self);;
  701. return self;}
  702. }),
  703. smalltalk.Behavior);
  704. smalltalk.addMethod(
  705. '_inheritsFrom_',
  706. smalltalk.method({
  707. selector: 'inheritsFrom:',
  708. fn: function (aClass){
  709. var self=this;
  710. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  711. return self;}
  712. }),
  713. smalltalk.Behavior);
  714. smalltalk.addMethod(
  715. '_protocols',
  716. smalltalk.method({
  717. selector: 'protocols',
  718. fn: function (){
  719. var self=this;
  720. var protocols=nil;
  721. protocols=smalltalk.send(smalltalk.Array, "_new", []);
  722. smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(protocols, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);
  723. return smalltalk.send(protocols, "_sort", []);
  724. return self;}
  725. }),
  726. smalltalk.Behavior);
  727. smalltalk.addMethod(
  728. '_protocolsDo_',
  729. smalltalk.method({
  730. selector: 'protocolsDo:',
  731. fn: function (aBlock){
  732. var self=this;
  733. var methodsByCategory=nil;
  734. methodsByCategory=smalltalk.send(smalltalk.Dictionary, "_new", []);
  735. smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_values", []), "_do_", [(function(m){return smalltalk.send(smalltalk.send(methodsByCategory, "_at_ifAbsentPut_", [smalltalk.send(m, "_category", []), (function(){return smalltalk.send(smalltalk.Array, "_new", []);})]), "_add_", [m]);})]);
  736. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  737. return self;}
  738. }),
  739. smalltalk.Behavior);
  740. smalltalk.addMethod(
  741. '_allInstanceVariableNames',
  742. smalltalk.method({
  743. selector: 'allInstanceVariableNames',
  744. fn: function (){
  745. var self=this;
  746. var result=nil;
  747. result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []);
  748. smalltalk.send(smalltalk.send(self, "_superclass", []), "_ifNotNil_", [(function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})]);
  749. return result;
  750. return self;}
  751. }),
  752. smalltalk.Behavior);
  753. smalltalk.addMethod(
  754. '_methodAt_',
  755. smalltalk.method({
  756. selector: 'methodAt:',
  757. fn: function (aString){
  758. var self=this;
  759. return smalltalk.methods(self)[aString];
  760. return self;}
  761. }),
  762. smalltalk.Behavior);
  763. smalltalk.addMethod(
  764. '_methodsFor_stamp_',
  765. smalltalk.method({
  766. selector: 'methodsFor:stamp:',
  767. fn: function (aString, aStamp){
  768. var self=this;
  769. return smalltalk.send(self, "_methodsFor_", [aString]);
  770. return self;}
  771. }),
  772. smalltalk.Behavior);
  773. smalltalk.addMethod(
  774. '_commentStamp_prior_',
  775. smalltalk.method({
  776. selector: 'commentStamp:prior:',
  777. fn: function (aStamp, prior){
  778. var self=this;
  779. return smalltalk.send(self, "_commentStamp", []);
  780. return self;}
  781. }),
  782. smalltalk.Behavior);
  783. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  784. smalltalk.addMethod(
  785. '_category',
  786. smalltalk.method({
  787. selector: 'category',
  788. fn: function (){
  789. var self=this;
  790. return self.category;
  791. return self;}
  792. }),
  793. smalltalk.Class);
  794. smalltalk.addMethod(
  795. '_category_',
  796. smalltalk.method({
  797. selector: 'category:',
  798. fn: function (aString){
  799. var self=this;
  800. self.category = aString;
  801. return self;}
  802. }),
  803. smalltalk.Class);
  804. smalltalk.addMethod(
  805. '_subclass_instanceVariableNames_',
  806. smalltalk.method({
  807. selector: 'subclass:instanceVariableNames:',
  808. fn: function (aString, anotherString){
  809. var self=this;
  810. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  811. return self;}
  812. }),
  813. smalltalk.Class);
  814. smalltalk.addMethod(
  815. '_subclass_instanceVariableNames_category_',
  816. smalltalk.method({
  817. selector: 'subclass:instanceVariableNames:category:',
  818. fn: function (aString, aString2, aString3){
  819. var self=this;
  820. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  821. return self;}
  822. }),
  823. smalltalk.Class);
  824. smalltalk.addMethod(
  825. '_isClass',
  826. smalltalk.method({
  827. selector: 'isClass',
  828. fn: function (){
  829. var self=this;
  830. return true;
  831. return self;}
  832. }),
  833. smalltalk.Class);
  834. smalltalk.addMethod(
  835. '_printString',
  836. smalltalk.method({
  837. selector: 'printString',
  838. fn: function (){
  839. var self=this;
  840. return smalltalk.send(self, "_name", []);
  841. return self;}
  842. }),
  843. smalltalk.Class);
  844. smalltalk.addMethod(
  845. '_rename_',
  846. smalltalk.method({
  847. selector: 'rename:',
  848. fn: function (aString){
  849. var self=this;
  850. smalltalk[aString] = self;
  851. delete smalltalk[self.className];
  852. self.className = aString;
  853. ;
  854. return self;}
  855. }),
  856. smalltalk.Class);
  857. smalltalk.addMethod(
  858. '_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_',
  859. smalltalk.method({
  860. selector: 'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:',
  861. fn: function (aString, aString2, classVars, pools, aString3){
  862. var self=this;
  863. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, aString2, aString3]);
  864. return self;}
  865. }),
  866. smalltalk.Class);
  867. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  868. smalltalk.addMethod(
  869. '_instanceClass',
  870. smalltalk.method({
  871. selector: 'instanceClass',
  872. fn: function (){
  873. var self=this;
  874. return self.instanceClass;
  875. return self;}
  876. }),
  877. smalltalk.Metaclass);
  878. smalltalk.addMethod(
  879. '_instanceVariableNames_',
  880. smalltalk.method({
  881. selector: 'instanceVariableNames:',
  882. fn: function (aCollection){
  883. var self=this;
  884. smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  885. return self;}
  886. }),
  887. smalltalk.Metaclass);
  888. smalltalk.addMethod(
  889. '_isMetaclass',
  890. smalltalk.method({
  891. selector: 'isMetaclass',
  892. fn: function (){
  893. var self=this;
  894. return true;
  895. return self;}
  896. }),
  897. smalltalk.Metaclass);
  898. smalltalk.addMethod(
  899. '_printString',
  900. smalltalk.method({
  901. selector: 'printString',
  902. fn: function (){
  903. var self=this;
  904. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  905. return self;}
  906. }),
  907. smalltalk.Metaclass);
  908. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  909. smalltalk.addMethod(
  910. '_source',
  911. smalltalk.method({
  912. selector: 'source',
  913. fn: function (){
  914. var self=this;
  915. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["source"]), "_ifNil_", [(function(){return "";})]);
  916. return self;}
  917. }),
  918. smalltalk.CompiledMethod);
  919. smalltalk.addMethod(
  920. '_source_',
  921. smalltalk.method({
  922. selector: 'source:',
  923. fn: function (aString){
  924. var self=this;
  925. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  926. return self;}
  927. }),
  928. smalltalk.CompiledMethod);
  929. smalltalk.addMethod(
  930. '_category',
  931. smalltalk.method({
  932. selector: 'category',
  933. fn: function (){
  934. var self=this;
  935. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["category"]), "_ifNil_", [(function(){return "";})]);
  936. return self;}
  937. }),
  938. smalltalk.CompiledMethod);
  939. smalltalk.addMethod(
  940. '_category_',
  941. smalltalk.method({
  942. selector: 'category:',
  943. fn: function (aString){
  944. var self=this;
  945. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  946. return self;}
  947. }),
  948. smalltalk.CompiledMethod);
  949. smalltalk.addMethod(
  950. '_selector',
  951. smalltalk.method({
  952. selector: 'selector',
  953. fn: function (){
  954. var self=this;
  955. return smalltalk.send(self, "_basicAt_", ["selector"]);
  956. return self;}
  957. }),
  958. smalltalk.CompiledMethod);
  959. smalltalk.addMethod(
  960. '_selector_',
  961. smalltalk.method({
  962. selector: 'selector:',
  963. fn: function (aString){
  964. var self=this;
  965. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  966. return self;}
  967. }),
  968. smalltalk.CompiledMethod);
  969. smalltalk.addMethod(
  970. '_fn',
  971. smalltalk.method({
  972. selector: 'fn',
  973. fn: function (){
  974. var self=this;
  975. return smalltalk.send(self, "_basicAt_", ["fn"]);
  976. return self;}
  977. }),
  978. smalltalk.CompiledMethod);
  979. smalltalk.addMethod(
  980. '_fn_',
  981. smalltalk.method({
  982. selector: 'fn:',
  983. fn: function (aBlock){
  984. var self=this;
  985. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  986. return self;}
  987. }),
  988. smalltalk.CompiledMethod);
  989. smalltalk.addMethod(
  990. '_messageSends',
  991. smalltalk.method({
  992. selector: 'messageSends',
  993. fn: function (){
  994. var self=this;
  995. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  996. return self;}
  997. }),
  998. smalltalk.CompiledMethod);
  999. smalltalk.addMethod(
  1000. '_methodClass',
  1001. smalltalk.method({
  1002. selector: 'methodClass',
  1003. fn: function (){
  1004. var self=this;
  1005. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  1006. return self;}
  1007. }),
  1008. smalltalk.CompiledMethod);
  1009. smalltalk.addMethod(
  1010. '_referencedClasses',
  1011. smalltalk.method({
  1012. selector: 'referencedClasses',
  1013. fn: function (){
  1014. var self=this;
  1015. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  1016. return self;}
  1017. }),
  1018. smalltalk.CompiledMethod);
  1019. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1020. smalltalk.addMethod(
  1021. '__eq',
  1022. smalltalk.method({
  1023. selector: '=',
  1024. fn: function (aNumber){
  1025. var self=this;
  1026. return Number(self) == aNumber;
  1027. return self;}
  1028. }),
  1029. smalltalk.Number);
  1030. smalltalk.addMethod(
  1031. '__gt',
  1032. smalltalk.method({
  1033. selector: '>',
  1034. fn: function (aNumber){
  1035. var self=this;
  1036. return self > aNumber;
  1037. return self;}
  1038. }),
  1039. smalltalk.Number);
  1040. smalltalk.addMethod(
  1041. '__lt',
  1042. smalltalk.method({
  1043. selector: '<',
  1044. fn: function (aNumber){
  1045. var self=this;
  1046. return self < aNumber;
  1047. return self;}
  1048. }),
  1049. smalltalk.Number);
  1050. smalltalk.addMethod(
  1051. '__gt_eq',
  1052. smalltalk.method({
  1053. selector: '>=',
  1054. fn: function (aNumber){
  1055. var self=this;
  1056. return self >= aNumber;
  1057. return self;}
  1058. }),
  1059. smalltalk.Number);
  1060. smalltalk.addMethod(
  1061. '__lt_eq',
  1062. smalltalk.method({
  1063. selector: '<=',
  1064. fn: function (aNumber){
  1065. var self=this;
  1066. return self <= aNumber;
  1067. return self;}
  1068. }),
  1069. smalltalk.Number);
  1070. smalltalk.addMethod(
  1071. '__plus',
  1072. smalltalk.method({
  1073. selector: '+',
  1074. fn: function (aNumber){
  1075. var self=this;
  1076. return self + aNumber;
  1077. return self;}
  1078. }),
  1079. smalltalk.Number);
  1080. smalltalk.addMethod(
  1081. '__minus',
  1082. smalltalk.method({
  1083. selector: '-',
  1084. fn: function (aNumber){
  1085. var self=this;
  1086. return self - aNumber;
  1087. return self;}
  1088. }),
  1089. smalltalk.Number);
  1090. smalltalk.addMethod(
  1091. '__star',
  1092. smalltalk.method({
  1093. selector: '*',
  1094. fn: function (aNumber){
  1095. var self=this;
  1096. return self * aNumber;
  1097. return self;}
  1098. }),
  1099. smalltalk.Number);
  1100. smalltalk.addMethod(
  1101. '__slash',
  1102. smalltalk.method({
  1103. selector: '/',
  1104. fn: function (aNumber){
  1105. var self=this;
  1106. return self / aNumber;
  1107. return self;}
  1108. }),
  1109. smalltalk.Number);
  1110. smalltalk.addMethod(
  1111. '_max_',
  1112. smalltalk.method({
  1113. selector: 'max:',
  1114. fn: function (aNumber){
  1115. var self=this;
  1116. return Math.max(self, aNumber);;
  1117. return self;}
  1118. }),
  1119. smalltalk.Number);
  1120. smalltalk.addMethod(
  1121. '_min_',
  1122. smalltalk.method({
  1123. selector: 'min:',
  1124. fn: function (aNumber){
  1125. var self=this;
  1126. return Math.min(self, aNumber);;
  1127. return self;}
  1128. }),
  1129. smalltalk.Number);
  1130. smalltalk.addMethod(
  1131. '_rounded',
  1132. smalltalk.method({
  1133. selector: 'rounded',
  1134. fn: function (){
  1135. var self=this;
  1136. return Math.round(self);;
  1137. return self;}
  1138. }),
  1139. smalltalk.Number);
  1140. smalltalk.addMethod(
  1141. '_truncated',
  1142. smalltalk.method({
  1143. selector: 'truncated',
  1144. fn: function (){
  1145. var self=this;
  1146. return Math.floor(self);;
  1147. return self;}
  1148. }),
  1149. smalltalk.Number);
  1150. smalltalk.addMethod(
  1151. '_to_',
  1152. smalltalk.method({
  1153. selector: 'to:',
  1154. fn: function (aNumber){
  1155. var self=this;
  1156. var array=nil;
  1157. var first=nil;
  1158. var last=nil;
  1159. var count=nil;
  1160. first=smalltalk.send(self, "_truncated", []);
  1161. last=smalltalk.send(smalltalk.send(aNumber, "_truncated", []), "__plus", [(1)]);
  1162. count=(1);
  1163. smalltalk.send(smalltalk.send(first, "__lt_eq", [last]), "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", ["Wrong interval"]);})]);
  1164. array=smalltalk.send(smalltalk.Array, "_new", []);
  1165. smalltalk.send(smalltalk.send(last, "__minus", [first]), "_timesRepeat_", [(function(){smalltalk.send(array, "_at_put_", [count, first]);count=smalltalk.send(count, "__plus", [(1)]);return first=smalltalk.send(first, "__plus", [(1)]);})]);
  1166. return array;
  1167. return self;}
  1168. }),
  1169. smalltalk.Number);
  1170. smalltalk.addMethod(
  1171. '_timesRepeat_',
  1172. smalltalk.method({
  1173. selector: 'timesRepeat:',
  1174. fn: function (aBlock){
  1175. var self=this;
  1176. var integer=nil;
  1177. var count=nil;
  1178. integer=smalltalk.send(self, "_truncated", []);
  1179. count=(1);
  1180. smalltalk.send((function(){return smalltalk.send(count, "__gt", [self]);}), "_whileFalse_", [(function(){smalltalk.send(aBlock, "_value", []);return count=smalltalk.send(count, "__plus", [(1)]);})]);
  1181. return self;}
  1182. }),
  1183. smalltalk.Number);
  1184. smalltalk.addMethod(
  1185. '_to_do_',
  1186. smalltalk.method({
  1187. selector: 'to:do:',
  1188. fn: function (aNumber, aBlock){
  1189. var self=this;
  1190. return smalltalk.send(smalltalk.send(self, "_to_", [aNumber]), "_do_", [aBlock]);
  1191. return self;}
  1192. }),
  1193. smalltalk.Number);
  1194. smalltalk.addMethod(
  1195. '_asString',
  1196. smalltalk.method({
  1197. selector: 'asString',
  1198. fn: function (){
  1199. var self=this;
  1200. return smalltalk.send(self, "_printString", []);
  1201. return self;}
  1202. }),
  1203. smalltalk.Number);
  1204. smalltalk.addMethod(
  1205. '_asJavascript',
  1206. smalltalk.method({
  1207. selector: 'asJavascript',
  1208. fn: function (){
  1209. var self=this;
  1210. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1211. return self;}
  1212. }),
  1213. smalltalk.Number);
  1214. smalltalk.addMethod(
  1215. '_printString',
  1216. smalltalk.method({
  1217. selector: 'printString',
  1218. fn: function (){
  1219. var self=this;
  1220. return String(self);
  1221. return self;}
  1222. }),
  1223. smalltalk.Number);
  1224. smalltalk.addMethod(
  1225. '_isNumber',
  1226. smalltalk.method({
  1227. selector: 'isNumber',
  1228. fn: function (){
  1229. var self=this;
  1230. return true;
  1231. return self;}
  1232. }),
  1233. smalltalk.Number);
  1234. smalltalk.addMethod(
  1235. '_atRandom',
  1236. smalltalk.method({
  1237. selector: 'atRandom',
  1238. fn: function (){
  1239. var self=this;
  1240. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Random, "_new", []), "_next", []), "__star", [self]), "_truncated", []), "__plus", [(1)]);
  1241. return self;}
  1242. }),
  1243. smalltalk.Number);
  1244. smalltalk.addMethod(
  1245. '__at',
  1246. smalltalk.method({
  1247. selector: '@',
  1248. fn: function (aNumber){
  1249. var self=this;
  1250. return smalltalk.send(smalltalk.Point, "_x_y_", [self, aNumber]);
  1251. return self;}
  1252. }),
  1253. smalltalk.Number);
  1254. smalltalk.addMethod(
  1255. '_asPoint',
  1256. smalltalk.method({
  1257. selector: 'asPoint',
  1258. fn: function (){
  1259. var self=this;
  1260. return smalltalk.send(smalltalk.Point, "_x_y_", [self, self]);
  1261. return self;}
  1262. }),
  1263. smalltalk.Number);
  1264. smalltalk.addMethod(
  1265. '_clearInterval',
  1266. smalltalk.method({
  1267. selector: 'clearInterval',
  1268. fn: function (){
  1269. var self=this;
  1270. clearInterval(Number(self));
  1271. return self;}
  1272. }),
  1273. smalltalk.Number);
  1274. smalltalk.addMethod(
  1275. '_asJSONObject',
  1276. smalltalk.method({
  1277. selector: 'asJSONObject',
  1278. fn: function (){
  1279. var self=this;
  1280. return self;
  1281. return self;}
  1282. }),
  1283. smalltalk.Number);
  1284. smalltalk.addMethod(
  1285. '_clearTimeout',
  1286. smalltalk.method({
  1287. selector: 'clearTimeout',
  1288. fn: function (){
  1289. var self=this;
  1290. clearTimeout(Number(self));
  1291. return self;}
  1292. }),
  1293. smalltalk.Number);
  1294. smalltalk.addMethod(
  1295. '_modulo_',
  1296. smalltalk.method({
  1297. selector: 'modulo:',
  1298. fn: function (aNumber){
  1299. var self=this;
  1300. return self % aNumber;
  1301. return self;}
  1302. }),
  1303. smalltalk.Number);
  1304. smalltalk.addMethod(
  1305. '_even',
  1306. smalltalk.method({
  1307. selector: 'even',
  1308. fn: function (){
  1309. var self=this;
  1310. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_modulo_", [(2)])]);
  1311. return self;}
  1312. }),
  1313. smalltalk.Number);
  1314. smalltalk.addMethod(
  1315. '_odd',
  1316. smalltalk.method({
  1317. selector: 'odd',
  1318. fn: function (){
  1319. var self=this;
  1320. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1321. return self;}
  1322. }),
  1323. smalltalk.Number);
  1324. smalltalk.addMethod(
  1325. '_pi',
  1326. smalltalk.method({
  1327. selector: 'pi',
  1328. fn: function (){
  1329. var self=this;
  1330. return Math.PI;
  1331. return self;}
  1332. }),
  1333. smalltalk.Number.klass);
  1334. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1335. smalltalk.addMethod(
  1336. '_compiledSource',
  1337. smalltalk.method({
  1338. selector: 'compiledSource',
  1339. fn: function (){
  1340. var self=this;
  1341. return self.toString();
  1342. return self;}
  1343. }),
  1344. smalltalk.BlockClosure);
  1345. smalltalk.addMethod(
  1346. '_whileTrue_',
  1347. smalltalk.method({
  1348. selector: 'whileTrue:',
  1349. fn: function (aBlock){
  1350. var self=this;
  1351. while(self()) {aBlock()};
  1352. return self;}
  1353. }),
  1354. smalltalk.BlockClosure);
  1355. smalltalk.addMethod(
  1356. '_whileFalse_',
  1357. smalltalk.method({
  1358. selector: 'whileFalse:',
  1359. fn: function (aBlock){
  1360. var self=this;
  1361. while(!self()) {aBlock()};
  1362. return self;}
  1363. }),
  1364. smalltalk.BlockClosure);
  1365. smalltalk.addMethod(
  1366. '_value',
  1367. smalltalk.method({
  1368. selector: 'value',
  1369. fn: function (){
  1370. var self=this;
  1371. return self();;
  1372. return self;}
  1373. }),
  1374. smalltalk.BlockClosure);
  1375. smalltalk.addMethod(
  1376. '_value_',
  1377. smalltalk.method({
  1378. selector: 'value:',
  1379. fn: function (anArg){
  1380. var self=this;
  1381. return self(anArg);;
  1382. return self;}
  1383. }),
  1384. smalltalk.BlockClosure);
  1385. smalltalk.addMethod(
  1386. '_value_value_',
  1387. smalltalk.method({
  1388. selector: 'value:value:',
  1389. fn: function (firstArg, secondArg){
  1390. var self=this;
  1391. return self(firstArg, secondArg);;
  1392. return self;}
  1393. }),
  1394. smalltalk.BlockClosure);
  1395. smalltalk.addMethod(
  1396. '_value_value_value_',
  1397. smalltalk.method({
  1398. selector: 'value:value:value:',
  1399. fn: function (firstArg, secondArg, thirdArg){
  1400. var self=this;
  1401. return self(firstArg, secondArg, thirdArg);;
  1402. return self;}
  1403. }),
  1404. smalltalk.BlockClosure);
  1405. smalltalk.addMethod(
  1406. '_valueWithPossibleArguments_',
  1407. smalltalk.method({
  1408. selector: 'valueWithPossibleArguments:',
  1409. fn: function (aCollection){
  1410. var self=this;
  1411. return self.apply(null, aCollection);;
  1412. return self;}
  1413. }),
  1414. smalltalk.BlockClosure);
  1415. smalltalk.addMethod(
  1416. '_on_do_',
  1417. smalltalk.method({
  1418. selector: 'on:do:',
  1419. fn: function (anErrorClass, aBlock){
  1420. var self=this;
  1421. smalltalk.send(self, "_try_catch_", [self, (function(error){return smalltalk.send(smalltalk.send(error, "_isKindOf_", [anErrorClass]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [error]);}), (function(){return smalltalk.send(error, "_signal", []);})]);})]);
  1422. return self;}
  1423. }),
  1424. smalltalk.BlockClosure);
  1425. smalltalk.addMethod(
  1426. '_valueWithTimeout_',
  1427. smalltalk.method({
  1428. selector: 'valueWithTimeout:',
  1429. fn: function (aNumber){
  1430. var self=this;
  1431. return setTimeout(self, aNumber);
  1432. return self;}
  1433. }),
  1434. smalltalk.BlockClosure);
  1435. smalltalk.addMethod(
  1436. '_valueWithInterval_',
  1437. smalltalk.method({
  1438. selector: 'valueWithInterval:',
  1439. fn: function (aNumber){
  1440. var self=this;
  1441. return setInterval(self, aNumber);
  1442. return self;}
  1443. }),
  1444. smalltalk.BlockClosure);
  1445. smalltalk.addMethod(
  1446. '_printString',
  1447. smalltalk.method({
  1448. selector: 'printString',
  1449. fn: function (){
  1450. var self=this;
  1451. return smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_compiledSource", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);return smalltalk.send($rec, "_cr", []);})(aStream);})]);
  1452. return self;}
  1453. }),
  1454. smalltalk.BlockClosure);
  1455. smalltalk.addMethod(
  1456. '_whileFalse',
  1457. smalltalk.method({
  1458. selector: 'whileFalse',
  1459. fn: function (){
  1460. var self=this;
  1461. smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
  1462. return self;}
  1463. }),
  1464. smalltalk.BlockClosure);
  1465. smalltalk.addMethod(
  1466. '_whileTrue',
  1467. smalltalk.method({
  1468. selector: 'whileTrue',
  1469. fn: function (){
  1470. var self=this;
  1471. smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
  1472. return self;}
  1473. }),
  1474. smalltalk.BlockClosure);
  1475. smalltalk.addMethod(
  1476. '_new',
  1477. smalltalk.method({
  1478. selector: 'new',
  1479. fn: function (){
  1480. var self=this;
  1481. return new self();
  1482. return self;}
  1483. }),
  1484. smalltalk.BlockClosure);
  1485. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  1486. smalltalk.addMethod(
  1487. '__eq',
  1488. smalltalk.method({
  1489. selector: '=',
  1490. fn: function (aBoolean){
  1491. var self=this;
  1492. return Boolean(self == true) == aBoolean;
  1493. return self;}
  1494. }),
  1495. smalltalk.Boolean);
  1496. smalltalk.addMethod(
  1497. '_shallowCopy',
  1498. smalltalk.method({
  1499. selector: 'shallowCopy',
  1500. fn: function (){
  1501. var self=this;
  1502. return self;
  1503. return self;}
  1504. }),
  1505. smalltalk.Boolean);
  1506. smalltalk.addMethod(
  1507. '_deepCopy',
  1508. smalltalk.method({
  1509. selector: 'deepCopy',
  1510. fn: function (){
  1511. var self=this;
  1512. return self;
  1513. return self;}
  1514. }),
  1515. smalltalk.Boolean);
  1516. smalltalk.addMethod(
  1517. '_ifTrue_',
  1518. smalltalk.method({
  1519. selector: 'ifTrue:',
  1520. fn: function (aBlock){
  1521. var self=this;
  1522. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  1523. return self;}
  1524. }),
  1525. smalltalk.Boolean);
  1526. smalltalk.addMethod(
  1527. '_ifFalse_',
  1528. smalltalk.method({
  1529. selector: 'ifFalse:',
  1530. fn: function (aBlock){
  1531. var self=this;
  1532. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  1533. return self;}
  1534. }),
  1535. smalltalk.Boolean);
  1536. smalltalk.addMethod(
  1537. '_ifFalse_ifTrue_',
  1538. smalltalk.method({
  1539. selector: 'ifFalse:ifTrue:',
  1540. fn: function (aBlock, anotherBlock){
  1541. var self=this;
  1542. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1543. return self;}
  1544. }),
  1545. smalltalk.Boolean);
  1546. smalltalk.addMethod(
  1547. '_ifTrue_ifFalse_',
  1548. smalltalk.method({
  1549. selector: 'ifTrue:ifFalse:',
  1550. fn: function (aBlock, anotherBlock){
  1551. var self=this;
  1552. if(self == true) {
  1553. return aBlock();
  1554. } else {
  1555. return anotherBlock();
  1556. }
  1557. ;
  1558. return self;}
  1559. }),
  1560. smalltalk.Boolean);
  1561. smalltalk.addMethod(
  1562. '_and_',
  1563. smalltalk.method({
  1564. selector: 'and:',
  1565. fn: function (aBlock){
  1566. var self=this;
  1567. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  1568. return self;}
  1569. }),
  1570. smalltalk.Boolean);
  1571. smalltalk.addMethod(
  1572. '_or_',
  1573. smalltalk.method({
  1574. selector: 'or:',
  1575. fn: function (aBlock){
  1576. var self=this;
  1577. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  1578. return self;}
  1579. }),
  1580. smalltalk.Boolean);
  1581. smalltalk.addMethod(
  1582. '_not',
  1583. smalltalk.method({
  1584. selector: 'not',
  1585. fn: function (){
  1586. var self=this;
  1587. return smalltalk.send(self, "__eq", [false]);
  1588. return self;}
  1589. }),
  1590. smalltalk.Boolean);
  1591. smalltalk.addMethod(
  1592. '_printString',
  1593. smalltalk.method({
  1594. selector: 'printString',
  1595. fn: function (){
  1596. var self=this;
  1597. return self.toString();
  1598. return self;}
  1599. }),
  1600. smalltalk.Boolean);
  1601. smalltalk.addMethod(
  1602. '_asJSONObject',
  1603. smalltalk.method({
  1604. selector: 'asJSONObject',
  1605. fn: function (){
  1606. var self=this;
  1607. return self;
  1608. return self;}
  1609. }),
  1610. smalltalk.Boolean);
  1611. smalltalk.addMethod(
  1612. '_&',
  1613. smalltalk.method({
  1614. selector: '&',
  1615. fn: function (aBoolean){
  1616. var self=this;
  1617. if(self == true) {
  1618. return aBoolean;
  1619. } else {
  1620. return false;
  1621. }
  1622. ;
  1623. return self;}
  1624. }),
  1625. smalltalk.Boolean);
  1626. smalltalk.addMethod(
  1627. '_|',
  1628. smalltalk.method({
  1629. selector: '|',
  1630. fn: function (aBoolean){
  1631. var self=this;
  1632. if(self == true) {
  1633. return true;
  1634. } else {
  1635. return aBoolean;
  1636. }
  1637. ;
  1638. return self;}
  1639. }),
  1640. smalltalk.Boolean);
  1641. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  1642. smalltalk.addMethod(
  1643. '_year',
  1644. smalltalk.method({
  1645. selector: 'year',
  1646. fn: function (){
  1647. var self=this;
  1648. return self.getFullYear();
  1649. return self;}
  1650. }),
  1651. smalltalk.Date);
  1652. smalltalk.addMethod(
  1653. '_month',
  1654. smalltalk.method({
  1655. selector: 'month',
  1656. fn: function (){
  1657. var self=this;
  1658. return self.getMonth() + 1;
  1659. return self;}
  1660. }),
  1661. smalltalk.Date);
  1662. smalltalk.addMethod(
  1663. '_month_',
  1664. smalltalk.method({
  1665. selector: 'month:',
  1666. fn: function (aNumber){
  1667. var self=this;
  1668. self.setMonth(aNumber - 1);
  1669. return self;}
  1670. }),
  1671. smalltalk.Date);
  1672. smalltalk.addMethod(
  1673. '_day',
  1674. smalltalk.method({
  1675. selector: 'day',
  1676. fn: function (){
  1677. var self=this;
  1678. return smalltalk.send(self, "_dayOfWeek", []);
  1679. return self;}
  1680. }),
  1681. smalltalk.Date);
  1682. smalltalk.addMethod(
  1683. '_dayOfWeek',
  1684. smalltalk.method({
  1685. selector: 'dayOfWeek',
  1686. fn: function (){
  1687. var self=this;
  1688. return self.getDay() + 1;
  1689. return self;}
  1690. }),
  1691. smalltalk.Date);
  1692. smalltalk.addMethod(
  1693. '_dayOfWeek_',
  1694. smalltalk.method({
  1695. selector: 'dayOfWeek:',
  1696. fn: function (aNumber){
  1697. var self=this;
  1698. return self.setDay(aNumber - 1);
  1699. return self;}
  1700. }),
  1701. smalltalk.Date);
  1702. smalltalk.addMethod(
  1703. '_day_',
  1704. smalltalk.method({
  1705. selector: 'day:',
  1706. fn: function (aNumber){
  1707. var self=this;
  1708. smalltalk.send(self, "_day_", [aNumber]);
  1709. return self;}
  1710. }),
  1711. smalltalk.Date);
  1712. smalltalk.addMethod(
  1713. '_year_',
  1714. smalltalk.method({
  1715. selector: 'year:',
  1716. fn: function (aNumber){
  1717. var self=this;
  1718. self.setFullYear(aNumber);
  1719. return self;}
  1720. }),
  1721. smalltalk.Date);
  1722. smalltalk.addMethod(
  1723. '_dayOfMonth',
  1724. smalltalk.method({
  1725. selector: 'dayOfMonth',
  1726. fn: function (){
  1727. var self=this;
  1728. return self.getDate();
  1729. return self;}
  1730. }),
  1731. smalltalk.Date);
  1732. smalltalk.addMethod(
  1733. '_dayOfMonth_',
  1734. smalltalk.method({
  1735. selector: 'dayOfMonth:',
  1736. fn: function (aNumber){
  1737. var self=this;
  1738. self.setDate(aNumber);
  1739. return self;}
  1740. }),
  1741. smalltalk.Date);
  1742. smalltalk.addMethod(
  1743. '_asString',
  1744. smalltalk.method({
  1745. selector: 'asString',
  1746. fn: function (){
  1747. var self=this;
  1748. return self.toString();
  1749. return self;}
  1750. }),
  1751. smalltalk.Date);
  1752. smalltalk.addMethod(
  1753. '_printString',
  1754. smalltalk.method({
  1755. selector: 'printString',
  1756. fn: function (){
  1757. var self=this;
  1758. return smalltalk.send(self, "_asString", []);
  1759. return self;}
  1760. }),
  1761. smalltalk.Date);
  1762. smalltalk.addMethod(
  1763. '_asMilliseconds',
  1764. smalltalk.method({
  1765. selector: 'asMilliseconds',
  1766. fn: function (){
  1767. var self=this;
  1768. return smalltalk.send(self, "_time", []);
  1769. return self;}
  1770. }),
  1771. smalltalk.Date);
  1772. smalltalk.addMethod(
  1773. '_time',
  1774. smalltalk.method({
  1775. selector: 'time',
  1776. fn: function (){
  1777. var self=this;
  1778. return self.getTime();
  1779. return self;}
  1780. }),
  1781. smalltalk.Date);
  1782. smalltalk.addMethod(
  1783. '_time_',
  1784. smalltalk.method({
  1785. selector: 'time:',
  1786. fn: function (aNumber){
  1787. var self=this;
  1788. self.setTime(aNumber);
  1789. return self;}
  1790. }),
  1791. smalltalk.Date);
  1792. smalltalk.addMethod(
  1793. '_asDateString',
  1794. smalltalk.method({
  1795. selector: 'asDateString',
  1796. fn: function (){
  1797. var self=this;
  1798. return self.toDateString();
  1799. return self;}
  1800. }),
  1801. smalltalk.Date);
  1802. smalltalk.addMethod(
  1803. '_asTimeString',
  1804. smalltalk.method({
  1805. selector: 'asTimeString',
  1806. fn: function (){
  1807. var self=this;
  1808. return self.toTimeString();
  1809. return self;}
  1810. }),
  1811. smalltalk.Date);
  1812. smalltalk.addMethod(
  1813. '_asLocaleString',
  1814. smalltalk.method({
  1815. selector: 'asLocaleString',
  1816. fn: function (){
  1817. var self=this;
  1818. return self.toLocaleString();
  1819. return self;}
  1820. }),
  1821. smalltalk.Date);
  1822. smalltalk.addMethod(
  1823. '_asNumber',
  1824. smalltalk.method({
  1825. selector: 'asNumber',
  1826. fn: function (){
  1827. var self=this;
  1828. return smalltalk.send(self, "_asMilliseconds", []);
  1829. return self;}
  1830. }),
  1831. smalltalk.Date);
  1832. smalltalk.addMethod(
  1833. '_hours_',
  1834. smalltalk.method({
  1835. selector: 'hours:',
  1836. fn: function (aNumber){
  1837. var self=this;
  1838. self.setHours(aNumber);
  1839. return self;}
  1840. }),
  1841. smalltalk.Date);
  1842. smalltalk.addMethod(
  1843. '_minutes_',
  1844. smalltalk.method({
  1845. selector: 'minutes:',
  1846. fn: function (aNumber){
  1847. var self=this;
  1848. self.setMinutes(aNumber);
  1849. return self;}
  1850. }),
  1851. smalltalk.Date);
  1852. smalltalk.addMethod(
  1853. '_seconds_',
  1854. smalltalk.method({
  1855. selector: 'seconds:',
  1856. fn: function (aNumber){
  1857. var self=this;
  1858. self.setSeconds(aNumber);
  1859. return self;}
  1860. }),
  1861. smalltalk.Date);
  1862. smalltalk.addMethod(
  1863. '_milliseconds_',
  1864. smalltalk.method({
  1865. selector: 'milliseconds:',
  1866. fn: function (aNumber){
  1867. var self=this;
  1868. self.setMilliseconds(aNumber);
  1869. return self;}
  1870. }),
  1871. smalltalk.Date);
  1872. smalltalk.addMethod(
  1873. '_hours',
  1874. smalltalk.method({
  1875. selector: 'hours',
  1876. fn: function (){
  1877. var self=this;
  1878. return self.getHours();
  1879. return self;}
  1880. }),
  1881. smalltalk.Date);
  1882. smalltalk.addMethod(
  1883. '_minutes',
  1884. smalltalk.method({
  1885. selector: 'minutes',
  1886. fn: function (){
  1887. var self=this;
  1888. return self.getMinutes();
  1889. return self;}
  1890. }),
  1891. smalltalk.Date);
  1892. smalltalk.addMethod(
  1893. '_seconds',
  1894. smalltalk.method({
  1895. selector: 'seconds',
  1896. fn: function (){
  1897. var self=this;
  1898. return self.getSeconds();
  1899. return self;}
  1900. }),
  1901. smalltalk.Date);
  1902. smalltalk.addMethod(
  1903. '_milliseconds',
  1904. smalltalk.method({
  1905. selector: 'milliseconds',
  1906. fn: function (){
  1907. var self=this;
  1908. return self.getMilliseconds();
  1909. return self;}
  1910. }),
  1911. smalltalk.Date);
  1912. smalltalk.addMethod(
  1913. '__lt',
  1914. smalltalk.method({
  1915. selector: '<',
  1916. fn: function (aDate){
  1917. var self=this;
  1918. return self < aDate;
  1919. return self;}
  1920. }),
  1921. smalltalk.Date);
  1922. smalltalk.addMethod(
  1923. '__gt',
  1924. smalltalk.method({
  1925. selector: '>',
  1926. fn: function (aDate){
  1927. var self=this;
  1928. return self > aDate;
  1929. return self;}
  1930. }),
  1931. smalltalk.Date);
  1932. smalltalk.addMethod(
  1933. '__lt_eq',
  1934. smalltalk.method({
  1935. selector: '<=',
  1936. fn: function (aDate){
  1937. var self=this;
  1938. self <= aDate;
  1939. return self;}
  1940. }),
  1941. smalltalk.Date);
  1942. smalltalk.addMethod(
  1943. '__gt_eq',
  1944. smalltalk.method({
  1945. selector: '>=',
  1946. fn: function (aDate){
  1947. var self=this;
  1948. self >= aDate;
  1949. return self;}
  1950. }),
  1951. smalltalk.Date);
  1952. smalltalk.addMethod(
  1953. '__minus',
  1954. smalltalk.method({
  1955. selector: '-',
  1956. fn: function (aDate){
  1957. var self=this;
  1958. return self - aDate;
  1959. return self;}
  1960. }),
  1961. smalltalk.Date);
  1962. smalltalk.addMethod(
  1963. '__plus',
  1964. smalltalk.method({
  1965. selector: '+',
  1966. fn: function (aDate){
  1967. var self=this;
  1968. return self + aDate;
  1969. return self;}
  1970. }),
  1971. smalltalk.Date);
  1972. smalltalk.addMethod(
  1973. '_asJSONObject',
  1974. smalltalk.method({
  1975. selector: 'asJSONObject',
  1976. fn: function (){
  1977. var self=this;
  1978. return self;
  1979. return self;}
  1980. }),
  1981. smalltalk.Date);
  1982. smalltalk.addMethod(
  1983. '_new_',
  1984. smalltalk.method({
  1985. selector: 'new:',
  1986. fn: function (anObject){
  1987. var self=this;
  1988. return new Date(anObject);
  1989. return self;}
  1990. }),
  1991. smalltalk.Date.klass);
  1992. smalltalk.addMethod(
  1993. '_fromString_',
  1994. smalltalk.method({
  1995. selector: 'fromString:',
  1996. fn: function (aString){
  1997. var self=this;
  1998. return smalltalk.send(self, "_new_", [aString]);
  1999. return self;}
  2000. }),
  2001. smalltalk.Date.klass);
  2002. smalltalk.addMethod(
  2003. '_fromSeconds_',
  2004. smalltalk.method({
  2005. selector: 'fromSeconds:',
  2006. fn: function (aNumber){
  2007. var self=this;
  2008. return smalltalk.send(self, "_fromMilliseconds_", [smalltalk.send(aNumber, "__star", [(1000)])]);
  2009. return self;}
  2010. }),
  2011. smalltalk.Date.klass);
  2012. smalltalk.addMethod(
  2013. '_fromMilliseconds_',
  2014. smalltalk.method({
  2015. selector: 'fromMilliseconds:',
  2016. fn: function (aNumber){
  2017. var self=this;
  2018. return smalltalk.send(self, "_new_", [aNumber]);
  2019. return self;}
  2020. }),
  2021. smalltalk.Date.klass);
  2022. smalltalk.addMethod(
  2023. '_today',
  2024. smalltalk.method({
  2025. selector: 'today',
  2026. fn: function (){
  2027. var self=this;
  2028. return smalltalk.send(self, "_new", []);
  2029. return self;}
  2030. }),
  2031. smalltalk.Date.klass);
  2032. smalltalk.addMethod(
  2033. '_now',
  2034. smalltalk.method({
  2035. selector: 'now',
  2036. fn: function (){
  2037. var self=this;
  2038. return smalltalk.send(self, "_today", []);
  2039. return self;}
  2040. }),
  2041. smalltalk.Date.klass);
  2042. smalltalk.addMethod(
  2043. '_millisecondsToRun_',
  2044. smalltalk.method({
  2045. selector: 'millisecondsToRun:',
  2046. fn: function (aBlock){
  2047. var self=this;
  2048. var t=nil;
  2049. t=smalltalk.send(smalltalk.Date, "_now", []);
  2050. smalltalk.send(aBlock, "_value", []);
  2051. return smalltalk.send(smalltalk.send(smalltalk.Date, "_now", []), "__minus", [t]);
  2052. return self;}
  2053. }),
  2054. smalltalk.Date.klass);
  2055. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2056. smalltalk.addMethod(
  2057. '_subclass_instanceVariableNames_',
  2058. smalltalk.method({
  2059. selector: 'subclass:instanceVariableNames:',
  2060. fn: function (aString, anotherString){
  2061. var self=this;
  2062. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  2063. return self;}
  2064. }),
  2065. smalltalk.UndefinedObject);
  2066. smalltalk.addMethod(
  2067. '_subclass_instanceVariableNames_category_',
  2068. smalltalk.method({
  2069. selector: 'subclass:instanceVariableNames:category:',
  2070. fn: function (aString, aString2, aString3){
  2071. var self=this;
  2072. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  2073. return self;}
  2074. }),
  2075. smalltalk.UndefinedObject);
  2076. smalltalk.addMethod(
  2077. '_shallowCopy',
  2078. smalltalk.method({
  2079. selector: 'shallowCopy',
  2080. fn: function (){
  2081. var self=this;
  2082. return self;
  2083. return self;}
  2084. }),
  2085. smalltalk.UndefinedObject);
  2086. smalltalk.addMethod(
  2087. '_deepCopy',
  2088. smalltalk.method({
  2089. selector: 'deepCopy',
  2090. fn: function (){
  2091. var self=this;
  2092. return self;
  2093. return self;}
  2094. }),
  2095. smalltalk.UndefinedObject);
  2096. smalltalk.addMethod(
  2097. '_ifNil_',
  2098. smalltalk.method({
  2099. selector: 'ifNil:',
  2100. fn: function (aBlock){
  2101. var self=this;
  2102. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2103. return self;}
  2104. }),
  2105. smalltalk.UndefinedObject);
  2106. smalltalk.addMethod(
  2107. '_ifNotNil_',
  2108. smalltalk.method({
  2109. selector: 'ifNotNil:',
  2110. fn: function (aBlock){
  2111. var self=this;
  2112. return self;
  2113. return self;}
  2114. }),
  2115. smalltalk.UndefinedObject);
  2116. smalltalk.addMethod(
  2117. '_ifNil_ifNotNil_',
  2118. smalltalk.method({
  2119. selector: 'ifNil:ifNotNil:',
  2120. fn: function (aBlock, anotherBlock){
  2121. var self=this;
  2122. return smalltalk.send(aBlock, "_value", []);
  2123. return self;}
  2124. }),
  2125. smalltalk.UndefinedObject);
  2126. smalltalk.addMethod(
  2127. '_ifNotNil_ifNil_',
  2128. smalltalk.method({
  2129. selector: 'ifNotNil:ifNil:',
  2130. fn: function (aBlock, anotherBlock){
  2131. var self=this;
  2132. return smalltalk.send(anotherBlock, "_value", []);
  2133. return self;}
  2134. }),
  2135. smalltalk.UndefinedObject);
  2136. smalltalk.addMethod(
  2137. '_isNil',
  2138. smalltalk.method({
  2139. selector: 'isNil',
  2140. fn: function (){
  2141. var self=this;
  2142. return true;
  2143. return self;}
  2144. }),
  2145. smalltalk.UndefinedObject);
  2146. smalltalk.addMethod(
  2147. '_notNil',
  2148. smalltalk.method({
  2149. selector: 'notNil',
  2150. fn: function (){
  2151. var self=this;
  2152. return false;
  2153. return self;}
  2154. }),
  2155. smalltalk.UndefinedObject);
  2156. smalltalk.addMethod(
  2157. '_printString',
  2158. smalltalk.method({
  2159. selector: 'printString',
  2160. fn: function (){
  2161. var self=this;
  2162. return "nil";
  2163. return self;}
  2164. }),
  2165. smalltalk.UndefinedObject);
  2166. smalltalk.addMethod(
  2167. '_new',
  2168. smalltalk.method({
  2169. selector: 'new',
  2170. fn: function (){
  2171. var self=this;
  2172. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2173. return self;}
  2174. }),
  2175. smalltalk.UndefinedObject.klass);
  2176. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  2177. smalltalk.addMethod(
  2178. '_size',
  2179. smalltalk.method({
  2180. selector: 'size',
  2181. fn: function (){
  2182. var self=this;
  2183. smalltalk.send(self, "_subclassResponsibility", []);
  2184. return self;}
  2185. }),
  2186. smalltalk.Collection);
  2187. smalltalk.addMethod(
  2188. '_readStream',
  2189. smalltalk.method({
  2190. selector: 'readStream',
  2191. fn: function (){
  2192. var self=this;
  2193. return smalltalk.send(self, "_stream", []);
  2194. return self;}
  2195. }),
  2196. smalltalk.Collection);
  2197. smalltalk.addMethod(
  2198. '_writeStream',
  2199. smalltalk.method({
  2200. selector: 'writeStream',
  2201. fn: function (){
  2202. var self=this;
  2203. return smalltalk.send(self, "_stream", []);
  2204. return self;}
  2205. }),
  2206. smalltalk.Collection);
  2207. smalltalk.addMethod(
  2208. '_stream',
  2209. smalltalk.method({
  2210. selector: 'stream',
  2211. fn: function (){
  2212. var self=this;
  2213. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  2214. return self;}
  2215. }),
  2216. smalltalk.Collection);
  2217. smalltalk.addMethod(
  2218. '_streamClass',
  2219. smalltalk.method({
  2220. selector: 'streamClass',
  2221. fn: function (){
  2222. var self=this;
  2223. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  2224. return self;}
  2225. }),
  2226. smalltalk.Collection);
  2227. smalltalk.addMethod(
  2228. '_add_',
  2229. smalltalk.method({
  2230. selector: 'add:',
  2231. fn: function (anObject){
  2232. var self=this;
  2233. smalltalk.send(self, "_subclassResponsibility", []);
  2234. return self;}
  2235. }),
  2236. smalltalk.Collection);
  2237. smalltalk.addMethod(
  2238. '_addAll_',
  2239. smalltalk.method({
  2240. selector: 'addAll:',
  2241. fn: function (aCollection){
  2242. var self=this;
  2243. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  2244. return aCollection;
  2245. return self;}
  2246. }),
  2247. smalltalk.Collection);
  2248. smalltalk.addMethod(
  2249. '__comma',
  2250. smalltalk.method({
  2251. selector: ',',
  2252. fn: function (aCollection){
  2253. var self=this;
  2254. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2255. return self;}
  2256. }),
  2257. smalltalk.Collection);
  2258. smalltalk.addMethod(
  2259. '_copyWith_',
  2260. smalltalk.method({
  2261. selector: 'copyWith:',
  2262. fn: function (anObject){
  2263. var self=this;
  2264. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2265. return self;}
  2266. }),
  2267. smalltalk.Collection);
  2268. smalltalk.addMethod(
  2269. '_copyWithAll_',
  2270. smalltalk.method({
  2271. selector: 'copyWithAll:',
  2272. fn: function (aCollection){
  2273. var self=this;
  2274. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2275. return self;}
  2276. }),
  2277. smalltalk.Collection);
  2278. smalltalk.addMethod(
  2279. '_asArray',
  2280. smalltalk.method({
  2281. selector: 'asArray',
  2282. fn: function (){
  2283. var self=this;
  2284. var array=nil;
  2285. var index=nil;
  2286. array=smalltalk.send(smalltalk.Array, "_new", []);
  2287. index=(0);
  2288. smalltalk.send(self, "_do_", [(function(each){index=smalltalk.send(index, "__plus", [(1)]);return smalltalk.send(array, "_at_put_", [index, each]);})]);
  2289. return array;
  2290. return self;}
  2291. }),
  2292. smalltalk.Collection);
  2293. smalltalk.addMethod(
  2294. '_do_',
  2295. smalltalk.method({
  2296. selector: 'do:',
  2297. fn: function (aBlock){
  2298. var self=this;
  2299. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  2300. return self;}
  2301. }),
  2302. smalltalk.Collection);
  2303. smalltalk.addMethod(
  2304. '_collect_',
  2305. smalltalk.method({
  2306. selector: 'collect:',
  2307. fn: function (aBlock){
  2308. var self=this;
  2309. var newCollection=nil;
  2310. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2311. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  2312. return newCollection;
  2313. return self;}
  2314. }),
  2315. smalltalk.Collection);
  2316. smalltalk.addMethod(
  2317. '_detect_',
  2318. smalltalk.method({
  2319. selector: 'detect:',
  2320. fn: function (aBlock){
  2321. var self=this;
  2322. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2323. return self;}
  2324. }),
  2325. smalltalk.Collection);
  2326. smalltalk.addMethod(
  2327. '_detect_ifNone_',
  2328. smalltalk.method({
  2329. selector: 'detect:ifNone:',
  2330. fn: function (aBlock, anotherBlock){
  2331. var self=this;
  2332. for(var i = 0; i < self.length; i++)
  2333. if(aBlock(self[i]))
  2334. return self[i];
  2335. return anotherBlock();
  2336. ;
  2337. return self;}
  2338. }),
  2339. smalltalk.Collection);
  2340. smalltalk.addMethod(
  2341. '_do_separatedBy_',
  2342. smalltalk.method({
  2343. selector: 'do:separatedBy:',
  2344. fn: function (aBlock, anotherBlock){
  2345. var self=this;
  2346. var first=nil;
  2347. first=true;
  2348. smalltalk.send(self, "_do_", [(function(each){smalltalk.send(first, "_ifTrue_ifFalse_", [(function(){return first=false;}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]);return smalltalk.send(aBlock, "_value_", [each]);})]);
  2349. return self;}
  2350. }),
  2351. smalltalk.Collection);
  2352. smalltalk.addMethod(
  2353. '_inject_into_',
  2354. smalltalk.method({
  2355. selector: 'inject:into:',
  2356. fn: function (anObject, aBlock){
  2357. var self=this;
  2358. var result=nil;
  2359. result=anObject;
  2360. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  2361. return result;
  2362. return self;}
  2363. }),
  2364. smalltalk.Collection);
  2365. smalltalk.addMethod(
  2366. '_reject_',
  2367. smalltalk.method({
  2368. selector: 'reject:',
  2369. fn: function (aBlock){
  2370. var self=this;
  2371. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  2372. return self;}
  2373. }),
  2374. smalltalk.Collection);
  2375. smalltalk.addMethod(
  2376. '_select_',
  2377. smalltalk.method({
  2378. selector: 'select:',
  2379. fn: function (aBlock){
  2380. var self=this;
  2381. var stream=nil;
  2382. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  2383. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]);})]);
  2384. return smalltalk.send(stream, "_contents", []);
  2385. return self;}
  2386. }),
  2387. smalltalk.Collection);
  2388. smalltalk.addMethod(
  2389. '_errorNotFound',
  2390. smalltalk.method({
  2391. selector: 'errorNotFound',
  2392. fn: function (){
  2393. var self=this;
  2394. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  2395. return self;}
  2396. }),
  2397. smalltalk.Collection);
  2398. smalltalk.addMethod(
  2399. '_includes_',
  2400. smalltalk.method({
  2401. selector: 'includes:',
  2402. fn: function (anObject){
  2403. var self=this;
  2404. var i = self.length;
  2405. while (i--) {
  2406. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  2407. }
  2408. return false
  2409. ;
  2410. return self;}
  2411. }),
  2412. smalltalk.Collection);
  2413. smalltalk.addMethod(
  2414. '_notEmpty',
  2415. smalltalk.method({
  2416. selector: 'notEmpty',
  2417. fn: function (){
  2418. var self=this;
  2419. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  2420. return self;}
  2421. }),
  2422. smalltalk.Collection);
  2423. smalltalk.addMethod(
  2424. '_isEmpty',
  2425. smalltalk.method({
  2426. selector: 'isEmpty',
  2427. fn: function (){
  2428. var self=this;
  2429. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  2430. return self;}
  2431. }),
  2432. smalltalk.Collection);
  2433. smalltalk.addMethod(
  2434. '_remove_',
  2435. smalltalk.method({
  2436. selector: 'remove:',
  2437. fn: function (anObject){
  2438. var self=this;
  2439. smalltalk.send(self, "_subclassResponsibility", []);
  2440. return self;}
  2441. }),
  2442. smalltalk.Collection);
  2443. smalltalk.addMethod(
  2444. '_streamClass',
  2445. smalltalk.method({
  2446. selector: 'streamClass',
  2447. fn: function (){
  2448. var self=this;
  2449. return smalltalk.Stream;
  2450. return self;}
  2451. }),
  2452. smalltalk.Collection.klass);
  2453. smalltalk.addMethod(
  2454. '_with_',
  2455. smalltalk.method({
  2456. selector: 'with:',
  2457. fn: function (anObject){
  2458. var self=this;
  2459. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2460. return self;}
  2461. }),
  2462. smalltalk.Collection.klass);
  2463. smalltalk.addMethod(
  2464. '_with_with_',
  2465. smalltalk.method({
  2466. selector: 'with:with:',
  2467. fn: function (anObject, anotherObject){
  2468. var self=this;
  2469. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2470. return self;}
  2471. }),
  2472. smalltalk.Collection.klass);
  2473. smalltalk.addMethod(
  2474. '_with_with_with_',
  2475. smalltalk.method({
  2476. selector: 'with:with:with:',
  2477. fn: function (firstObject, secondObject, thirdObject){
  2478. var self=this;
  2479. return (function($rec){smalltalk.send($rec, "_add_", [firstObject]);smalltalk.send($rec, "_add_", [secondObject]);smalltalk.send($rec, "_add_", [thirdObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2480. return self;}
  2481. }),
  2482. smalltalk.Collection.klass);
  2483. smalltalk.addMethod(
  2484. '_withAll_',
  2485. smalltalk.method({
  2486. selector: 'withAll:',
  2487. fn: function (aCollection){
  2488. var self=this;
  2489. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2490. return self;}
  2491. }),
  2492. smalltalk.Collection.klass);
  2493. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  2494. smalltalk.addMethod(
  2495. '_at_',
  2496. smalltalk.method({
  2497. selector: 'at:',
  2498. fn: function (anIndex){
  2499. var self=this;
  2500. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2501. return self;}
  2502. }),
  2503. smalltalk.SequenceableCollection);
  2504. smalltalk.addMethod(
  2505. '_at_ifAbsent_',
  2506. smalltalk.method({
  2507. selector: 'at:ifAbsent:',
  2508. fn: function (anIndex, aBlock){
  2509. var self=this;
  2510. smalltalk.send(self, "_subclassResponsibility", []);
  2511. return self;}
  2512. }),
  2513. smalltalk.SequenceableCollection);
  2514. smalltalk.addMethod(
  2515. '_at_put_',
  2516. smalltalk.method({
  2517. selector: 'at:put:',
  2518. fn: function (anIndex, anObject){
  2519. var self=this;
  2520. smalltalk.send(self, "_subclassResponsibility", []);
  2521. return self;}
  2522. }),
  2523. smalltalk.SequenceableCollection);
  2524. smalltalk.addMethod(
  2525. '_copyFrom_to_',
  2526. smalltalk.method({
  2527. selector: 'copyFrom:to:',
  2528. fn: function (anIndex, anotherIndex){
  2529. var self=this;
  2530. smalltalk.send(self, "_subclassResponsibility", []);
  2531. return self;}
  2532. }),
  2533. smalltalk.SequenceableCollection);
  2534. smalltalk.addMethod(
  2535. '_first',
  2536. smalltalk.method({
  2537. selector: 'first',
  2538. fn: function (){
  2539. var self=this;
  2540. return smalltalk.send(self, "_at_", [(1)]);
  2541. return self;}
  2542. }),
  2543. smalltalk.SequenceableCollection);
  2544. smalltalk.addMethod(
  2545. '_fourth',
  2546. smalltalk.method({
  2547. selector: 'fourth',
  2548. fn: function (){
  2549. var self=this;
  2550. return smalltalk.send(self, "_at_", [(4)]);
  2551. return self;}
  2552. }),
  2553. smalltalk.SequenceableCollection);
  2554. smalltalk.addMethod(
  2555. '_last',
  2556. smalltalk.method({
  2557. selector: 'last',
  2558. fn: function (){
  2559. var self=this;
  2560. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  2561. return self;}
  2562. }),
  2563. smalltalk.SequenceableCollection);
  2564. smalltalk.addMethod(
  2565. '_second',
  2566. smalltalk.method({
  2567. selector: 'second',
  2568. fn: function (){
  2569. var self=this;
  2570. return smalltalk.send(self, "_at_", [(2)]);
  2571. return self;}
  2572. }),
  2573. smalltalk.SequenceableCollection);
  2574. smalltalk.addMethod(
  2575. '_third',
  2576. smalltalk.method({
  2577. selector: 'third',
  2578. fn: function (){
  2579. var self=this;
  2580. return smalltalk.send(self, "_at_", [(3)]);
  2581. return self;}
  2582. }),
  2583. smalltalk.SequenceableCollection);
  2584. smalltalk.addMethod(
  2585. '_removeLast',
  2586. smalltalk.method({
  2587. selector: 'removeLast',
  2588. fn: function (){
  2589. var self=this;
  2590. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  2591. return self;}
  2592. }),
  2593. smalltalk.SequenceableCollection);
  2594. smalltalk.addMethod(
  2595. '_addLast_',
  2596. smalltalk.method({
  2597. selector: 'addLast:',
  2598. fn: function (anObject){
  2599. var self=this;
  2600. smalltalk.send(self, "_add_", [anObject]);
  2601. return self;}
  2602. }),
  2603. smalltalk.SequenceableCollection);
  2604. smalltalk.addMethod(
  2605. '_withIndexDo_',
  2606. smalltalk.method({
  2607. selector: 'withIndexDo:',
  2608. fn: function (aBlock){
  2609. var self=this;
  2610. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  2611. return self;}
  2612. }),
  2613. smalltalk.SequenceableCollection);
  2614. smalltalk.addMethod(
  2615. '_allButFirst',
  2616. smalltalk.method({
  2617. selector: 'allButFirst',
  2618. fn: function (){
  2619. var self=this;
  2620. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  2621. return self;}
  2622. }),
  2623. smalltalk.SequenceableCollection);
  2624. smalltalk.addMethod(
  2625. '_allButLast',
  2626. smalltalk.method({
  2627. selector: 'allButLast',
  2628. fn: function (){
  2629. var self=this;
  2630. return smalltalk.send(self, "_copyFrom_to_", [(1), smalltalk.send(smalltalk.send(self, "_size", []), "__minus", [(1)])]);
  2631. return self;}
  2632. }),
  2633. smalltalk.SequenceableCollection);
  2634. smalltalk.addMethod(
  2635. '_indexOf_',
  2636. smalltalk.method({
  2637. selector: 'indexOf:',
  2638. fn: function (anObject){
  2639. var self=this;
  2640. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2641. return self;}
  2642. }),
  2643. smalltalk.SequenceableCollection);
  2644. smalltalk.addMethod(
  2645. '_indexOf_ifAbsent_',
  2646. smalltalk.method({
  2647. selector: 'indexOf:ifAbsent:',
  2648. fn: function (anObject, aBlock){
  2649. var self=this;
  2650. for(var i=0;i<self.length;i++){
  2651. if(self[i].__eq(anObject)) {return i+1}
  2652. }
  2653. return aBlock();
  2654. ;
  2655. return self;}
  2656. }),
  2657. smalltalk.SequenceableCollection);
  2658. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  2659. smalltalk.addMethod(
  2660. '__eq',
  2661. smalltalk.method({
  2662. selector: '=',
  2663. fn: function (aString){
  2664. var self=this;
  2665. return String(self) == aString;
  2666. return self;}
  2667. }),
  2668. smalltalk.String);
  2669. smalltalk.addMethod(
  2670. '_size',
  2671. smalltalk.method({
  2672. selector: 'size',
  2673. fn: function (){
  2674. var self=this;
  2675. return self.length;
  2676. return self;}
  2677. }),
  2678. smalltalk.String);
  2679. smalltalk.addMethod(
  2680. '_at_',
  2681. smalltalk.method({
  2682. selector: 'at:',
  2683. fn: function (anIndex){
  2684. var self=this;
  2685. return self[anIndex - 1];
  2686. return self;}
  2687. }),
  2688. smalltalk.String);
  2689. smalltalk.addMethod(
  2690. '_at_put_',
  2691. smalltalk.method({
  2692. selector: 'at:put:',
  2693. fn: function (anIndex, anObject){
  2694. var self=this;
  2695. smalltalk.send(self, "_errorReadOnly", []);
  2696. return self;}
  2697. }),
  2698. smalltalk.String);
  2699. smalltalk.addMethod(
  2700. '_at_ifAbsent_',
  2701. smalltalk.method({
  2702. selector: 'at:ifAbsent:',
  2703. fn: function (anIndex, aBlock){
  2704. var self=this;
  2705. smalltalk.send(smalltalk.send(self, "_at_", [anIndex]), "_ifNil_", [(function(){return aBlock;})]);
  2706. return self;}
  2707. }),
  2708. smalltalk.String);
  2709. smalltalk.addMethod(
  2710. '_escaped',
  2711. smalltalk.method({
  2712. selector: 'escaped',
  2713. fn: function (){
  2714. var self=this;
  2715. return escape(self);
  2716. return self;}
  2717. }),
  2718. smalltalk.String);
  2719. smalltalk.addMethod(
  2720. '_unescaped',
  2721. smalltalk.method({
  2722. selector: 'unescaped',
  2723. fn: function (){
  2724. var self=this;
  2725. return unescape(self);
  2726. return self;}
  2727. }),
  2728. smalltalk.String);
  2729. smalltalk.addMethod(
  2730. '_add_',
  2731. smalltalk.method({
  2732. selector: 'add:',
  2733. fn: function (anObject){
  2734. var self=this;
  2735. smalltalk.send(self, "_errorReadOnly", []);
  2736. return self;}
  2737. }),
  2738. smalltalk.String);
  2739. smalltalk.addMethod(
  2740. '__comma',
  2741. smalltalk.method({
  2742. selector: ',',
  2743. fn: function (aString){
  2744. var self=this;
  2745. return self + aString;
  2746. return self;}
  2747. }),
  2748. smalltalk.String);
  2749. smalltalk.addMethod(
  2750. '_copyFrom_to_',
  2751. smalltalk.method({
  2752. selector: 'copyFrom:to:',
  2753. fn: function (anIndex, anotherIndex){
  2754. var self=this;
  2755. return self.substring(anIndex - 1, anotherIndex);
  2756. return self;}
  2757. }),
  2758. smalltalk.String);
  2759. smalltalk.addMethod(
  2760. '_shallowCopy',
  2761. smalltalk.method({
  2762. selector: 'shallowCopy',
  2763. fn: function (){
  2764. var self=this;
  2765. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  2766. return self;}
  2767. }),
  2768. smalltalk.String);
  2769. smalltalk.addMethod(
  2770. '_deepCopy',
  2771. smalltalk.method({
  2772. selector: 'deepCopy',
  2773. fn: function (){
  2774. var self=this;
  2775. return smalltalk.send(self, "_shallowCopy", []);
  2776. return self;}
  2777. }),
  2778. smalltalk.String);
  2779. smalltalk.addMethod(
  2780. '_asSelector',
  2781. smalltalk.method({
  2782. selector: 'asSelector',
  2783. fn: function (){
  2784. var self=this;
  2785. var selector=nil;
  2786. selector=smalltalk.send("_", "__comma", [self]);
  2787. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  2788. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  2789. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  2790. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  2791. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  2792. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  2793. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  2794. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  2795. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  2796. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  2797. return selector;
  2798. return self;}
  2799. }),
  2800. smalltalk.String);
  2801. smalltalk.addMethod(
  2802. '_asJavascript',
  2803. smalltalk.method({
  2804. selector: 'asJavascript',
  2805. fn: function (){
  2806. var self=this;
  2807. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2808. return "unescape(\"" + escape(self) + "\")";
  2809. else
  2810. return "\"" + self + "\"";
  2811. ;
  2812. return self;}
  2813. }),
  2814. smalltalk.String);
  2815. smalltalk.addMethod(
  2816. '_replace_with_',
  2817. smalltalk.method({
  2818. selector: 'replace:with:',
  2819. fn: function (aString, anotherString){
  2820. var self=this;
  2821. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [aString, "g"]), anotherString]);
  2822. return self;}
  2823. }),
  2824. smalltalk.String);
  2825. smalltalk.addMethod(
  2826. '_replaceRegexp_with_',
  2827. smalltalk.method({
  2828. selector: 'replaceRegexp:with:',
  2829. fn: function (aRegexp, aString){
  2830. var self=this;
  2831. return self.replace(aRegexp, aString);
  2832. return self;}
  2833. }),
  2834. smalltalk.String);
  2835. smalltalk.addMethod(
  2836. '_tokenize_',
  2837. smalltalk.method({
  2838. selector: 'tokenize:',
  2839. fn: function (aString){
  2840. var self=this;
  2841. return self.split(aString);
  2842. return self;}
  2843. }),
  2844. smalltalk.String);
  2845. smalltalk.addMethod(
  2846. '_match_',
  2847. smalltalk.method({
  2848. selector: 'match:',
  2849. fn: function (aRegexp){
  2850. var self=this;
  2851. return self.search(aRegexp) != -1;
  2852. return self;}
  2853. }),
  2854. smalltalk.String);
  2855. smalltalk.addMethod(
  2856. '_asString',
  2857. smalltalk.method({
  2858. selector: 'asString',
  2859. fn: function (){
  2860. var self=this;
  2861. return self;
  2862. return self;}
  2863. }),
  2864. smalltalk.String);
  2865. smalltalk.addMethod(
  2866. '_asNumber',
  2867. smalltalk.method({
  2868. selector: 'asNumber',
  2869. fn: function (){
  2870. var self=this;
  2871. return Number(self);
  2872. return self;}
  2873. }),
  2874. smalltalk.String);
  2875. smalltalk.addMethod(
  2876. '_asParser',
  2877. smalltalk.method({
  2878. selector: 'asParser',
  2879. fn: function (){
  2880. var self=this;
  2881. return smalltalk.send(smalltalk.send(smalltalk.PPStringParser, "_new", []), "_string_", [self]);
  2882. return self;}
  2883. }),
  2884. smalltalk.String);
  2885. smalltalk.addMethod(
  2886. '_asChoiceParser',
  2887. smalltalk.method({
  2888. selector: 'asChoiceParser',
  2889. fn: function (){
  2890. var self=this;
  2891. return smalltalk.send(smalltalk.PPChoiceParser, "_withAll_", [smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asParser", []);})])]);
  2892. return self;}
  2893. }),
  2894. smalltalk.String);
  2895. smalltalk.addMethod(
  2896. '_asCharacterParser',
  2897. smalltalk.method({
  2898. selector: 'asCharacterParser',
  2899. fn: function (){
  2900. var self=this;
  2901. return smalltalk.send(smalltalk.send(smalltalk.PPCharacterParser, "_new", []), "_string_", [self]);
  2902. return self;}
  2903. }),
  2904. smalltalk.String);
  2905. smalltalk.addMethod(
  2906. '_errorReadOnly',
  2907. smalltalk.method({
  2908. selector: 'errorReadOnly',
  2909. fn: function (){
  2910. var self=this;
  2911. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  2912. return self;}
  2913. }),
  2914. smalltalk.String);
  2915. smalltalk.addMethod(
  2916. '_printString',
  2917. smalltalk.method({
  2918. selector: 'printString',
  2919. fn: function (){
  2920. var self=this;
  2921. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  2922. return self;}
  2923. }),
  2924. smalltalk.String);
  2925. smalltalk.addMethod(
  2926. '_printNl',
  2927. smalltalk.method({
  2928. selector: 'printNl',
  2929. fn: function (){
  2930. var self=this;
  2931. console.log(self);
  2932. return self;}
  2933. }),
  2934. smalltalk.String);
  2935. smalltalk.addMethod(
  2936. '_isString',
  2937. smalltalk.method({
  2938. selector: 'isString',
  2939. fn: function (){
  2940. var self=this;
  2941. return true;
  2942. return self;}
  2943. }),
  2944. smalltalk.String);
  2945. smalltalk.addMethod(
  2946. '__gt',
  2947. smalltalk.method({
  2948. selector: '>',
  2949. fn: function (aString){
  2950. var self=this;
  2951. return String(self) > aString;
  2952. return self;}
  2953. }),
  2954. smalltalk.String);
  2955. smalltalk.addMethod(
  2956. '__lt',
  2957. smalltalk.method({
  2958. selector: '<',
  2959. fn: function (aString){
  2960. var self=this;
  2961. return String(self) < aString;
  2962. return self;}
  2963. }),
  2964. smalltalk.String);
  2965. smalltalk.addMethod(
  2966. '__gt_eq',
  2967. smalltalk.method({
  2968. selector: '>=',
  2969. fn: function (aString){
  2970. var self=this;
  2971. return String(self) >= aString;
  2972. return self;}
  2973. }),
  2974. smalltalk.String);
  2975. smalltalk.addMethod(
  2976. '__lt_eq',
  2977. smalltalk.method({
  2978. selector: '<=',
  2979. fn: function (aString){
  2980. var self=this;
  2981. return String(self) <= aString;
  2982. return self;}
  2983. }),
  2984. smalltalk.String);
  2985. smalltalk.addMethod(
  2986. '_remove_',
  2987. smalltalk.method({
  2988. selector: 'remove:',
  2989. fn: function (anObject){
  2990. var self=this;
  2991. smalltalk.send(self, "_errorReadOnly", []);
  2992. return self;}
  2993. }),
  2994. smalltalk.String);
  2995. smalltalk.addMethod(
  2996. '_asJSONObject',
  2997. smalltalk.method({
  2998. selector: 'asJSONObject',
  2999. fn: function (){
  3000. var self=this;
  3001. return self;
  3002. return self;}
  3003. }),
  3004. smalltalk.String);
  3005. smalltalk.addMethod(
  3006. '_trimLeft_',
  3007. smalltalk.method({
  3008. selector: 'trimLeft:',
  3009. fn: function (separators){
  3010. var self=this;
  3011. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5E%5B"), "__comma", [separators]), "__comma", [unescape("%5D+")]), "g"]), ""]);
  3012. return self;}
  3013. }),
  3014. smalltalk.String);
  3015. smalltalk.addMethod(
  3016. '_trimRight_',
  3017. smalltalk.method({
  3018. selector: 'trimRight:',
  3019. fn: function (separators){
  3020. var self=this;
  3021. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [separators]), "__comma", [unescape("%5D+%24")]), "g"]), ""]);
  3022. return self;}
  3023. }),
  3024. smalltalk.String);
  3025. smalltalk.addMethod(
  3026. '_trimLeft',
  3027. smalltalk.method({
  3028. selector: 'trimLeft',
  3029. fn: function (){
  3030. var self=this;
  3031. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  3032. return self;}
  3033. }),
  3034. smalltalk.String);
  3035. smalltalk.addMethod(
  3036. '_trimRight',
  3037. smalltalk.method({
  3038. selector: 'trimRight',
  3039. fn: function (){
  3040. var self=this;
  3041. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  3042. return self;}
  3043. }),
  3044. smalltalk.String);
  3045. smalltalk.addMethod(
  3046. '_trimBoth',
  3047. smalltalk.method({
  3048. selector: 'trimBoth',
  3049. fn: function (){
  3050. var self=this;
  3051. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  3052. return self;}
  3053. }),
  3054. smalltalk.String);
  3055. smalltalk.addMethod(
  3056. '_trimBoth_',
  3057. smalltalk.method({
  3058. selector: 'trimBoth:',
  3059. fn: function (separators){
  3060. var self=this;
  3061. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  3062. return self;}
  3063. }),
  3064. smalltalk.String);
  3065. smalltalk.addMethod(
  3066. '_asLowercase',
  3067. smalltalk.method({
  3068. selector: 'asLowercase',
  3069. fn: function (){
  3070. var self=this;
  3071. return self.toLowerCase();
  3072. return self;}
  3073. }),
  3074. smalltalk.String);
  3075. smalltalk.addMethod(
  3076. '_asUppercase',
  3077. smalltalk.method({
  3078. selector: 'asUppercase',
  3079. fn: function (){
  3080. var self=this;
  3081. return self.toUpperCase();
  3082. return self;}
  3083. }),
  3084. smalltalk.String);
  3085. smalltalk.addMethod(
  3086. '_join_',
  3087. smalltalk.method({
  3088. selector: 'join:',
  3089. fn: function (aCollection){
  3090. var self=this;
  3091. return smalltalk.send(smalltalk.String, "_streamContents_", [(function(stream){return smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(each, "_asString", [])]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [self]);})]);})]);
  3092. return self;}
  3093. }),
  3094. smalltalk.String);
  3095. smalltalk.addMethod(
  3096. '_includesSubString_',
  3097. smalltalk.method({
  3098. selector: 'includesSubString:',
  3099. fn: function (subString){
  3100. var self=this;
  3101. return self.indexOf(subString) != -1 ;
  3102. return self;}
  3103. }),
  3104. smalltalk.String);
  3105. smalltalk.addMethod(
  3106. '_asciiValue',
  3107. smalltalk.method({
  3108. selector: 'asciiValue',
  3109. fn: function (){
  3110. var self=this;
  3111. return self.charCodeAt(0);;
  3112. return self;}
  3113. }),
  3114. smalltalk.String);
  3115. smalltalk.addMethod(
  3116. '_streamClass',
  3117. smalltalk.method({
  3118. selector: 'streamClass',
  3119. fn: function (){
  3120. var self=this;
  3121. return smalltalk.StringStream;
  3122. return self;}
  3123. }),
  3124. smalltalk.String.klass);
  3125. smalltalk.addMethod(
  3126. '_fromString_',
  3127. smalltalk.method({
  3128. selector: 'fromString:',
  3129. fn: function (aString){
  3130. var self=this;
  3131. return new self.fn(aString);
  3132. return self;}
  3133. }),
  3134. smalltalk.String.klass);
  3135. smalltalk.addMethod(
  3136. '_cr',
  3137. smalltalk.method({
  3138. selector: 'cr',
  3139. fn: function (){
  3140. var self=this;
  3141. return '\r';
  3142. return self;}
  3143. }),
  3144. smalltalk.String.klass);
  3145. smalltalk.addMethod(
  3146. '_lf',
  3147. smalltalk.method({
  3148. selector: 'lf',
  3149. fn: function (){
  3150. var self=this;
  3151. return '\n';
  3152. return self;}
  3153. }),
  3154. smalltalk.String.klass);
  3155. smalltalk.addMethod(
  3156. '_space',
  3157. smalltalk.method({
  3158. selector: 'space',
  3159. fn: function (){
  3160. var self=this;
  3161. return ' ';
  3162. return self;}
  3163. }),
  3164. smalltalk.String.klass);
  3165. smalltalk.addMethod(
  3166. '_tab',
  3167. smalltalk.method({
  3168. selector: 'tab',
  3169. fn: function (){
  3170. var self=this;
  3171. return '\t';
  3172. return self;}
  3173. }),
  3174. smalltalk.String.klass);
  3175. smalltalk.addMethod(
  3176. '_crlf',
  3177. smalltalk.method({
  3178. selector: 'crlf',
  3179. fn: function (){
  3180. var self=this;
  3181. return '\r\n';
  3182. return self;}
  3183. }),
  3184. smalltalk.String.klass);
  3185. smalltalk.addMethod(
  3186. '_streamContents_',
  3187. smalltalk.method({
  3188. selector: 'streamContents:',
  3189. fn: function (blockWithArg){
  3190. var self=this;
  3191. var stream=nil;
  3192. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send(smalltalk.String, "_new", [])]);
  3193. smalltalk.send(blockWithArg, "_value_", [stream]);
  3194. return smalltalk.send(stream, "_contents", []);
  3195. return self;}
  3196. }),
  3197. smalltalk.String.klass);
  3198. smalltalk.addMethod(
  3199. '_value_',
  3200. smalltalk.method({
  3201. selector: 'value:',
  3202. fn: function (aUTFCharCode){
  3203. var self=this;
  3204. return String.fromCharCode(aUTFCharCode);;
  3205. return self;}
  3206. }),
  3207. smalltalk.String.klass);
  3208. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  3209. smalltalk.addMethod(
  3210. '_size',
  3211. smalltalk.method({
  3212. selector: 'size',
  3213. fn: function (){
  3214. var self=this;
  3215. return self.length;
  3216. return self;}
  3217. }),
  3218. smalltalk.Array);
  3219. smalltalk.addMethod(
  3220. '_at_put_',
  3221. smalltalk.method({
  3222. selector: 'at:put:',
  3223. fn: function (anIndex, anObject){
  3224. var self=this;
  3225. return self[anIndex - 1] = anObject;
  3226. return self;}
  3227. }),
  3228. smalltalk.Array);
  3229. smalltalk.addMethod(
  3230. '_at_ifAbsent_',
  3231. smalltalk.method({
  3232. selector: 'at:ifAbsent:',
  3233. fn: function (anIndex, aBlock){
  3234. var self=this;
  3235. var value = self[anIndex - 1];
  3236. if(value === undefined) {
  3237. return aBlock();
  3238. } else {
  3239. return value;
  3240. }
  3241. ;
  3242. return self;}
  3243. }),
  3244. smalltalk.Array);
  3245. smalltalk.addMethod(
  3246. '_add_',
  3247. smalltalk.method({
  3248. selector: 'add:',
  3249. fn: function (anObject){
  3250. var self=this;
  3251. self.push(anObject); return anObject;;
  3252. return self;}
  3253. }),
  3254. smalltalk.Array);
  3255. smalltalk.addMethod(
  3256. '_shallowCopy',
  3257. smalltalk.method({
  3258. selector: 'shallowCopy',
  3259. fn: function (){
  3260. var self=this;
  3261. var newCollection=nil;
  3262. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3263. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  3264. return newCollection;
  3265. return self;}
  3266. }),
  3267. smalltalk.Array);
  3268. smalltalk.addMethod(
  3269. '_deepCopy',
  3270. smalltalk.method({
  3271. selector: 'deepCopy',
  3272. fn: function (){
  3273. var self=this;
  3274. var newCollection=nil;
  3275. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3276. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  3277. return newCollection;
  3278. return self;}
  3279. }),
  3280. smalltalk.Array);
  3281. smalltalk.addMethod(
  3282. '_copyFrom_to_',
  3283. smalltalk.method({
  3284. selector: 'copyFrom:to:',
  3285. fn: function (anIndex, anotherIndex){
  3286. var self=this;
  3287. var array=nil;
  3288. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3289. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  3290. return array;
  3291. return self;}
  3292. }),
  3293. smalltalk.Array);
  3294. smalltalk.addMethod(
  3295. '_join_',
  3296. smalltalk.method({
  3297. selector: 'join:',
  3298. fn: function (aString){
  3299. var self=this;
  3300. return self.join(aString);
  3301. return self;}
  3302. }),
  3303. smalltalk.Array);
  3304. smalltalk.addMethod(
  3305. '_asJavascript',
  3306. smalltalk.method({
  3307. selector: 'asJavascript',
  3308. fn: function (){
  3309. var self=this;
  3310. return smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [smalltalk.send(smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJavascript", []);})]), "_join_", [unescape("%2C%20")])]), "__comma", [unescape("%5D")]);
  3311. return self;}
  3312. }),
  3313. smalltalk.Array);
  3314. smalltalk.addMethod(
  3315. '_sort',
  3316. smalltalk.method({
  3317. selector: 'sort',
  3318. fn: function (){
  3319. var self=this;
  3320. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  3321. return self;}
  3322. }),
  3323. smalltalk.Array);
  3324. smalltalk.addMethod(
  3325. '_sort_',
  3326. smalltalk.method({
  3327. selector: 'sort:',
  3328. fn: function (aBlock){
  3329. var self=this;
  3330. return self.sort(function(a, b) {
  3331. if(aBlock(a,b)) {return -1} else {return 1}
  3332. })
  3333. ;
  3334. return self;}
  3335. }),
  3336. smalltalk.Array);
  3337. smalltalk.addMethod(
  3338. '_remove_',
  3339. smalltalk.method({
  3340. selector: 'remove:',
  3341. fn: function (anObject){
  3342. var self=this;
  3343. for(var i=0;i<self.length;i++) {
  3344. if(self[i] == anObject) {
  3345. self.splice(i,1);
  3346. break;
  3347. }
  3348. }
  3349. ;
  3350. return self;}
  3351. }),
  3352. smalltalk.Array);
  3353. smalltalk.addMethod(
  3354. '_sorted',
  3355. smalltalk.method({
  3356. selector: 'sorted',
  3357. fn: function (){
  3358. var self=this;
  3359. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  3360. return self;}
  3361. }),
  3362. smalltalk.Array);
  3363. smalltalk.addMethod(
  3364. '_sorted_',
  3365. smalltalk.method({
  3366. selector: 'sorted:',
  3367. fn: function (aBlock){
  3368. var self=this;
  3369. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  3370. return self;}
  3371. }),
  3372. smalltalk.Array);
  3373. smalltalk.addMethod(
  3374. '_asJSONObject',
  3375. smalltalk.method({
  3376. selector: 'asJSONObject',
  3377. fn: function (){
  3378. var self=this;
  3379. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  3380. return self;}
  3381. }),
  3382. smalltalk.Array);
  3383. smalltalk.addMethod(
  3384. '_removeFrom_to_',
  3385. smalltalk.method({
  3386. selector: 'removeFrom:to:',
  3387. fn: function (aNumber, anotherNumber){
  3388. var self=this;
  3389. self.splice(aNumber - 1,anotherNumber - 1);
  3390. return self;}
  3391. }),
  3392. smalltalk.Array);
  3393. smalltalk.addMethod(
  3394. '_printString',
  3395. smalltalk.method({
  3396. selector: 'printString',
  3397. fn: function (){
  3398. var self=this;
  3399. var str=nil;
  3400. str=smalltalk.send("", "_writeStream", []);
  3401. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  3402. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  3403. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  3404. return smalltalk.send(str, "_contents", []);
  3405. return self;}
  3406. }),
  3407. smalltalk.Array);
  3408. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  3409. smalltalk.addMethod(
  3410. '_compile_',
  3411. smalltalk.method({
  3412. selector: 'compile:',
  3413. fn: function (aString){
  3414. var self=this;
  3415. return self.compile(aString);
  3416. return self;}
  3417. }),
  3418. smalltalk.RegularExpression);
  3419. smalltalk.addMethod(
  3420. '_exec_',
  3421. smalltalk.method({
  3422. selector: 'exec:',
  3423. fn: function (aString){
  3424. var self=this;
  3425. return self.exec(aString) || nil;
  3426. return self;}
  3427. }),
  3428. smalltalk.RegularExpression);
  3429. smalltalk.addMethod(
  3430. '_test_',
  3431. smalltalk.method({
  3432. selector: 'test:',
  3433. fn: function (aString){
  3434. var self=this;
  3435. return self.test(aString);
  3436. return self;}
  3437. }),
  3438. smalltalk.RegularExpression);
  3439. smalltalk.addMethod(
  3440. '_fromString_flag_',
  3441. smalltalk.method({
  3442. selector: 'fromString:flag:',
  3443. fn: function (aString, anotherString){
  3444. var self=this;
  3445. return new RegExp(aString, anotherString);
  3446. return self;}
  3447. }),
  3448. smalltalk.RegularExpression.klass);
  3449. smalltalk.addMethod(
  3450. '_fromString_',
  3451. smalltalk.method({
  3452. selector: 'fromString:',
  3453. fn: function (aString){
  3454. var self=this;
  3455. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  3456. return self;}
  3457. }),
  3458. smalltalk.RegularExpression.klass);
  3459. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  3460. smalltalk.addMethod(
  3461. '_messageText',
  3462. smalltalk.method({
  3463. selector: 'messageText',
  3464. fn: function (){
  3465. var self=this;
  3466. return self['@messageText'];
  3467. return self;}
  3468. }),
  3469. smalltalk.Error);
  3470. smalltalk.addMethod(
  3471. '_messageText_',
  3472. smalltalk.method({
  3473. selector: 'messageText:',
  3474. fn: function (aString){
  3475. var self=this;
  3476. self['@messageText']=aString;
  3477. return self;}
  3478. }),
  3479. smalltalk.Error);
  3480. smalltalk.addMethod(
  3481. '_signal',
  3482. smalltalk.method({
  3483. selector: 'signal',
  3484. fn: function (){
  3485. var self=this;
  3486. self.context = thisContext; self.smalltalkError = true; throw(self);
  3487. return self;}
  3488. }),
  3489. smalltalk.Error);
  3490. smalltalk.addMethod(
  3491. '_context',
  3492. smalltalk.method({
  3493. selector: 'context',
  3494. fn: function (){
  3495. var self=this;
  3496. return self.context;
  3497. return self;}
  3498. }),
  3499. smalltalk.Error);
  3500. smalltalk.addMethod(
  3501. '_signal_',
  3502. smalltalk.method({
  3503. selector: 'signal:',
  3504. fn: function (aString){
  3505. var self=this;
  3506. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  3507. return self;}
  3508. }),
  3509. smalltalk.Error.klass);
  3510. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel');
  3511. smalltalk.addMethod(
  3512. '_receiver',
  3513. smalltalk.method({
  3514. selector: 'receiver',
  3515. fn: function (){
  3516. var self=this;
  3517. return self.receiver;
  3518. return self;}
  3519. }),
  3520. smalltalk.MethodContext);
  3521. smalltalk.addMethod(
  3522. '_selector',
  3523. smalltalk.method({
  3524. selector: 'selector',
  3525. fn: function (){
  3526. var self=this;
  3527. return smalltalk.convertSelector(self.selector);
  3528. return self;}
  3529. }),
  3530. smalltalk.MethodContext);
  3531. smalltalk.addMethod(
  3532. '_home',
  3533. smalltalk.method({
  3534. selector: 'home',
  3535. fn: function (){
  3536. var self=this;
  3537. return self.homeContext;
  3538. return self;}
  3539. }),
  3540. smalltalk.MethodContext);
  3541. smalltalk.addMethod(
  3542. '_temps',
  3543. smalltalk.method({
  3544. selector: 'temps',
  3545. fn: function (){
  3546. var self=this;
  3547. return self.temps;
  3548. return self;}
  3549. }),
  3550. smalltalk.MethodContext);
  3551. smalltalk.addMethod(
  3552. '_printString',
  3553. smalltalk.method({
  3554. selector: 'printString',
  3555. fn: function (){
  3556. var self=this;
  3557. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  3558. return self;}
  3559. }),
  3560. smalltalk.MethodContext);
  3561. smalltalk.addMethod(
  3562. '_asString',
  3563. smalltalk.method({
  3564. selector: 'asString',
  3565. fn: function (){
  3566. var self=this;
  3567. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [unescape("%20%3E%3E%20")]), "__comma", [smalltalk.send(self, "_selector", [])]);
  3568. return self;}
  3569. }),
  3570. smalltalk.MethodContext);
  3571. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  3572. smalltalk.addMethod(
  3573. '__eq',
  3574. smalltalk.method({
  3575. selector: '=',
  3576. fn: function (anAssociation){
  3577. var self=this;
  3578. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(anAssociation, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_key", []), "__eq", [smalltalk.send(anAssociation, "_key", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_value", []), "__eq", [smalltalk.send(anAssociation, "_value", [])]);})]);})]);
  3579. return self;}
  3580. }),
  3581. smalltalk.Association);
  3582. smalltalk.addMethod(
  3583. '_key_',
  3584. smalltalk.method({
  3585. selector: 'key:',
  3586. fn: function (aKey){
  3587. var self=this;
  3588. self['@key']=aKey;
  3589. return self;}
  3590. }),
  3591. smalltalk.Association);
  3592. smalltalk.addMethod(
  3593. '_key',
  3594. smalltalk.method({
  3595. selector: 'key',
  3596. fn: function (){
  3597. var self=this;
  3598. return self['@key'];
  3599. return self;}
  3600. }),
  3601. smalltalk.Association);
  3602. smalltalk.addMethod(
  3603. '_value_',
  3604. smalltalk.method({
  3605. selector: 'value:',
  3606. fn: function (aValue){
  3607. var self=this;
  3608. self['@value']=aValue;
  3609. return self;}
  3610. }),
  3611. smalltalk.Association);
  3612. smalltalk.addMethod(
  3613. '_value',
  3614. smalltalk.method({
  3615. selector: 'value',
  3616. fn: function (){
  3617. var self=this;
  3618. return self['@value'];
  3619. return self;}
  3620. }),
  3621. smalltalk.Association);
  3622. smalltalk.addMethod(
  3623. '_key_value_',
  3624. smalltalk.method({
  3625. selector: 'key:value:',
  3626. fn: function (aKey, aValue){
  3627. var self=this;
  3628. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3629. return self;}
  3630. }),
  3631. smalltalk.Association.klass);
  3632. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  3633. smalltalk.addMethod(
  3634. '__eq',
  3635. smalltalk.method({
  3636. selector: '=',
  3637. fn: function (aDictionary){
  3638. var self=this;
  3639. try{smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aDictionary, "_class", [])]), "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  3640. smalltalk.send(self, "_associationsDo_", [(function(assoc){return smalltalk.send(smalltalk.send(smalltalk.send(aDictionary, "_at_ifAbsent_", [smalltalk.send(assoc, "_key", []), (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]), "__eq", [smalltalk.send(assoc, "_value", [])]), "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);})]);
  3641. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  3642. return self;
  3643. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  3644. }),
  3645. smalltalk.Dictionary);
  3646. smalltalk.addMethod(
  3647. '_shallowCopy',
  3648. smalltalk.method({
  3649. selector: 'shallowCopy',
  3650. fn: function (){
  3651. var self=this;
  3652. var copy=nil;
  3653. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3654. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  3655. return copy;
  3656. return self;}
  3657. }),
  3658. smalltalk.Dictionary);
  3659. smalltalk.addMethod(
  3660. '_initialize',
  3661. smalltalk.method({
  3662. selector: 'initialize',
  3663. fn: function (){
  3664. var self=this;
  3665. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  3666. self['@keys']=[];
  3667. return self;}
  3668. }),
  3669. smalltalk.Dictionary);
  3670. smalltalk.addMethod(
  3671. '_size',
  3672. smalltalk.method({
  3673. selector: 'size',
  3674. fn: function (){
  3675. var self=this;
  3676. return smalltalk.send(self['@keys'], "_size", []);
  3677. return self;}
  3678. }),
  3679. smalltalk.Dictionary);
  3680. smalltalk.addMethod(
  3681. '_associations',
  3682. smalltalk.method({
  3683. selector: 'associations',
  3684. fn: function (){
  3685. var self=this;
  3686. var associations=nil;
  3687. associations=[];
  3688. smalltalk.send(self['@keys'], "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send(smalltalk.Association, "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
  3689. return associations;
  3690. return self;}
  3691. }),
  3692. smalltalk.Dictionary);
  3693. smalltalk.addMethod(
  3694. '_keys',
  3695. smalltalk.method({
  3696. selector: 'keys',
  3697. fn: function (){
  3698. var self=this;
  3699. return smalltalk.send(self['@keys'], "_copy", []);
  3700. return self;}
  3701. }),
  3702. smalltalk.Dictionary);
  3703. smalltalk.addMethod(
  3704. '_values',
  3705. smalltalk.method({
  3706. selector: 'values',
  3707. fn: function (){
  3708. var self=this;
  3709. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  3710. return self;}
  3711. }),
  3712. smalltalk.Dictionary);
  3713. smalltalk.addMethod(
  3714. '_at_put_',
  3715. smalltalk.method({
  3716. selector: 'at:put:',
  3717. fn: function (aKey, aValue){
  3718. var self=this;
  3719. smalltalk.send(smalltalk.send(self['@keys'], "_includes_", [aKey]), "_ifFalse_", [(function(){return smalltalk.send(self['@keys'], "_add_", [aKey]);})]);
  3720. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  3721. return self;}
  3722. }),
  3723. smalltalk.Dictionary);
  3724. smalltalk.addMethod(
  3725. '_at_ifAbsent_',
  3726. smalltalk.method({
  3727. selector: 'at:ifAbsent:',
  3728. fn: function (aKey, aBlock){
  3729. var self=this;
  3730. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  3731. return self;}
  3732. }),
  3733. smalltalk.Dictionary);
  3734. smalltalk.addMethod(
  3735. '_at_ifAbsentPut_',
  3736. smalltalk.method({
  3737. selector: 'at:ifAbsentPut:',
  3738. fn: function (aKey, aBlock){
  3739. var self=this;
  3740. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  3741. return self;}
  3742. }),
  3743. smalltalk.Dictionary);
  3744. smalltalk.addMethod(
  3745. '_at_ifPresent_',
  3746. smalltalk.method({
  3747. selector: 'at:ifPresent:',
  3748. fn: function (aKey, aBlock){
  3749. var self=this;
  3750. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNotNil_", [(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  3751. return self;}
  3752. }),
  3753. smalltalk.Dictionary);
  3754. smalltalk.addMethod(
  3755. '_at_ifPresent_ifAbsent_',
  3756. smalltalk.method({
  3757. selector: 'at:ifPresent:ifAbsent:',
  3758. fn: function (aKey, aBlock, anotherBlock){
  3759. var self=this;
  3760. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  3761. return self;}
  3762. }),
  3763. smalltalk.Dictionary);
  3764. smalltalk.addMethod(
  3765. '_add_',
  3766. smalltalk.method({
  3767. selector: 'add:',
  3768. fn: function (anAssociation){
  3769. var self=this;
  3770. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  3771. return self;}
  3772. }),
  3773. smalltalk.Dictionary);
  3774. smalltalk.addMethod(
  3775. '_addAll_',
  3776. smalltalk.method({
  3777. selector: 'addAll:',
  3778. fn: function (aDictionary){
  3779. var self=this;
  3780. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  3781. return aDictionary;
  3782. return self;}
  3783. }),
  3784. smalltalk.Dictionary);
  3785. smalltalk.addMethod(
  3786. '__comma',
  3787. smalltalk.method({
  3788. selector: ',',
  3789. fn: function (aCollection){
  3790. var self=this;
  3791. smalltalk.send(self, "_shouldNotImplement", []);
  3792. return self;}
  3793. }),
  3794. smalltalk.Dictionary);
  3795. smalltalk.addMethod(
  3796. '_copyFrom_to_',
  3797. smalltalk.method({
  3798. selector: 'copyFrom:to:',
  3799. fn: function (anIndex, anotherIndex){
  3800. var self=this;
  3801. smalltalk.send(self, "_shouldNotImplement", []);
  3802. return self;}
  3803. }),
  3804. smalltalk.Dictionary);
  3805. smalltalk.addMethod(
  3806. '_associationsDo_',
  3807. smalltalk.method({
  3808. selector: 'associationsDo:',
  3809. fn: function (aBlock){
  3810. var self=this;
  3811. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  3812. return self;}
  3813. }),
  3814. smalltalk.Dictionary);
  3815. smalltalk.addMethod(
  3816. '_keysAndValuesDo_',
  3817. smalltalk.method({
  3818. selector: 'keysAndValuesDo:',
  3819. fn: function (aBlock){
  3820. var self=this;
  3821. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  3822. return self;}
  3823. }),
  3824. smalltalk.Dictionary);
  3825. smalltalk.addMethod(
  3826. '_do_',
  3827. smalltalk.method({
  3828. selector: 'do:',
  3829. fn: function (aBlock){
  3830. var self=this;
  3831. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  3832. return self;}
  3833. }),
  3834. smalltalk.Dictionary);
  3835. smalltalk.addMethod(
  3836. '_select_',
  3837. smalltalk.method({
  3838. selector: 'select:',
  3839. fn: function (aBlock){
  3840. var self=this;
  3841. var newDict=nil;
  3842. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3843. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(smalltalk.send(aBlock, "_value_", [value]), "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]);})]);
  3844. return newDict;
  3845. return self;}
  3846. }),
  3847. smalltalk.Dictionary);
  3848. smalltalk.addMethod(
  3849. '_collect_',
  3850. smalltalk.method({
  3851. selector: 'collect:',
  3852. fn: function (aBlock){
  3853. var self=this;
  3854. var newDict=nil;
  3855. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3856. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  3857. return newDict;
  3858. return self;}
  3859. }),
  3860. smalltalk.Dictionary);
  3861. smalltalk.addMethod(
  3862. '_detect_ifNone_',
  3863. smalltalk.method({
  3864. selector: 'detect:ifNone:',
  3865. fn: function (aBlock, anotherBlock){
  3866. var self=this;
  3867. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  3868. return self;}
  3869. }),
  3870. smalltalk.Dictionary);
  3871. smalltalk.addMethod(
  3872. '_includes_',
  3873. smalltalk.method({
  3874. selector: 'includes:',
  3875. fn: function (anObject){
  3876. var self=this;
  3877. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  3878. return self;}
  3879. }),
  3880. smalltalk.Dictionary);
  3881. smalltalk.addMethod(
  3882. '_remove_',
  3883. smalltalk.method({
  3884. selector: 'remove:',
  3885. fn: function (aKey){
  3886. var self=this;
  3887. smalltalk.send(self, "_removeKey_", [aKey]);
  3888. return self;}
  3889. }),
  3890. smalltalk.Dictionary);
  3891. smalltalk.addMethod(
  3892. '_removeKey_',
  3893. smalltalk.method({
  3894. selector: 'removeKey:',
  3895. fn: function (aKey){
  3896. var self=this;
  3897. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  3898. return self;}
  3899. }),
  3900. smalltalk.Dictionary);
  3901. smalltalk.addMethod(
  3902. '_at_',
  3903. smalltalk.method({
  3904. selector: 'at:',
  3905. fn: function (aKey){
  3906. var self=this;
  3907. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3908. return self;}
  3909. }),
  3910. smalltalk.Dictionary);
  3911. smalltalk.addMethod(
  3912. '_asJSONObject',
  3913. smalltalk.method({
  3914. selector: 'asJSONObject',
  3915. fn: function (){
  3916. var self=this;
  3917. var object=nil;
  3918. object=smalltalk.send(smalltalk.Object, "_new", []);
  3919. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  3920. return object;
  3921. return self;}
  3922. }),
  3923. smalltalk.Dictionary);
  3924. smalltalk.addMethod(
  3925. '_printString',
  3926. smalltalk.method({
  3927. selector: 'printString',
  3928. fn: function (){
  3929. var self=this;
  3930. return smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Collection)]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);})(aStream);smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(anAssociation){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_key", []), "_printString", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%20-%3E%20")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_value", []), "_printString", [])]);})(aStream);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%20%2C%20")]);})]);return smalltalk.send(aStream, "_nextPutAll_", [unescape("%29")]);})]);
  3931. return self;}
  3932. }),
  3933. smalltalk.Dictionary);
  3934. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  3935. smalltalk.addMethod(
  3936. '_superclass_subclass_',
  3937. smalltalk.method({
  3938. selector: 'superclass:subclass:',
  3939. fn: function (aClass, aString){
  3940. var self=this;
  3941. smalltalk.send(self, "_superclass_subclass_instanceVariableNames_category_", [aClass, aString, "", nil]);
  3942. return self;}
  3943. }),
  3944. smalltalk.ClassBuilder);
  3945. smalltalk.addMethod(
  3946. '_superclass_subclass_instanceVariableNames_category_',
  3947. smalltalk.method({
  3948. selector: 'superclass:subclass:instanceVariableNames:category:',
  3949. fn: function (aClass, aString, aString2, aString3){
  3950. var self=this;
  3951. var newClass=nil;
  3952. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2])]);
  3953. smalltalk.send(self, "_setupClass_", [newClass]);
  3954. smalltalk.send(newClass, "_category_", [smalltalk.send(aString3, "_ifNil_", [(function(){return "unclassified";})])]);
  3955. return self;}
  3956. }),
  3957. smalltalk.ClassBuilder);
  3958. smalltalk.addMethod(
  3959. '_class_instanceVariableNames_',
  3960. smalltalk.method({
  3961. selector: 'class:instanceVariableNames:',
  3962. fn: function (aClass, aString){
  3963. var self=this;
  3964. smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]);
  3965. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  3966. smalltalk.send(self, "_setupClass_", [aClass]);
  3967. return self;}
  3968. }),
  3969. smalltalk.ClassBuilder);
  3970. smalltalk.addMethod(
  3971. '_instanceVariableNamesFor_',
  3972. smalltalk.method({
  3973. selector: 'instanceVariableNamesFor:',
  3974. fn: function (aString){
  3975. var self=this;
  3976. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  3977. return self;}
  3978. }),
  3979. smalltalk.ClassBuilder);
  3980. smalltalk.addMethod(
  3981. '_addSubclassOf_named_instanceVariableNames_',
  3982. smalltalk.method({
  3983. selector: 'addSubclassOf:named:instanceVariableNames:',
  3984. fn: function (aClass, aString, aCollection){
  3985. var self=this;
  3986. smalltalk.addClass(aString, aClass, aCollection);
  3987. return smalltalk[aString];
  3988. return self;}
  3989. }),
  3990. smalltalk.ClassBuilder);
  3991. smalltalk.addMethod(
  3992. '_setupClass_',
  3993. smalltalk.method({
  3994. selector: 'setupClass:',
  3995. fn: function (aClass){
  3996. var self=this;
  3997. smalltalk.init(aClass);;
  3998. return self;}
  3999. }),
  4000. smalltalk.ClassBuilder);
  4001. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  4002. smalltalk.addMethod(
  4003. '_initialize',
  4004. smalltalk.method({
  4005. selector: 'initialize',
  4006. fn: function (){
  4007. var self=this;
  4008. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4009. self['@chunkParser']=smalltalk.send(smalltalk.ChunkParser, "_new", []);
  4010. return self;}
  4011. }),
  4012. smalltalk.ClassCategoryReader);
  4013. smalltalk.addMethod(
  4014. '_class_category_',
  4015. smalltalk.method({
  4016. selector: 'class:category:',
  4017. fn: function (aClass, aString){
  4018. var self=this;
  4019. self['@class']=aClass;
  4020. self['@category']=aString;
  4021. return self;}
  4022. }),
  4023. smalltalk.ClassCategoryReader);
  4024. smalltalk.addMethod(
  4025. '_scanFrom_',
  4026. smalltalk.method({
  4027. selector: 'scanFrom:',
  4028. fn: function (aStream){
  4029. var self=this;
  4030. var nextChunk=nil;
  4031. nextChunk=smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  4032. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [(function(){smalltalk.send(self, "_compileMethod_", [smalltalk.send(nextChunk, "_contents", [])]);return smalltalk.send(self, "_scanFrom_", [aStream]);})]);
  4033. return self;}
  4034. }),
  4035. smalltalk.ClassCategoryReader);
  4036. smalltalk.addMethod(
  4037. '_compileMethod_',
  4038. smalltalk.method({
  4039. selector: 'compileMethod:',
  4040. fn: function (aString){
  4041. var self=this;
  4042. var method=nil;
  4043. method=smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_load_forClass_", [aString, self['@class']]);
  4044. smalltalk.send(method, "_category_", [self['@category']]);
  4045. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  4046. return self;}
  4047. }),
  4048. smalltalk.ClassCategoryReader);
  4049. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  4050. smalltalk.addMethod(
  4051. '_collection',
  4052. smalltalk.method({
  4053. selector: 'collection',
  4054. fn: function (){
  4055. var self=this;
  4056. return self['@collection'];
  4057. return self;}
  4058. }),
  4059. smalltalk.Stream);
  4060. smalltalk.addMethod(
  4061. '_setCollection_',
  4062. smalltalk.method({
  4063. selector: 'setCollection:',
  4064. fn: function (aCollection){
  4065. var self=this;
  4066. self['@collection']=aCollection;
  4067. return self;}
  4068. }),
  4069. smalltalk.Stream);
  4070. smalltalk.addMethod(
  4071. '_position',
  4072. smalltalk.method({
  4073. selector: 'position',
  4074. fn: function (){
  4075. var self=this;
  4076. return smalltalk.send(self['@position'], "_ifNil_", [(function(){return self['@position']=(0);})]);
  4077. return self;}
  4078. }),
  4079. smalltalk.Stream);
  4080. smalltalk.addMethod(
  4081. '_position_',
  4082. smalltalk.method({
  4083. selector: 'position:',
  4084. fn: function (anInteger){
  4085. var self=this;
  4086. self['@position']=anInteger;
  4087. return self;}
  4088. }),
  4089. smalltalk.Stream);
  4090. smalltalk.addMethod(
  4091. '_streamSize',
  4092. smalltalk.method({
  4093. selector: 'streamSize',
  4094. fn: function (){
  4095. var self=this;
  4096. return self['@streamSize'];
  4097. return self;}
  4098. }),
  4099. smalltalk.Stream);
  4100. smalltalk.addMethod(
  4101. '_setStreamSize_',
  4102. smalltalk.method({
  4103. selector: 'setStreamSize:',
  4104. fn: function (anInteger){
  4105. var self=this;
  4106. self['@streamSize']=anInteger;
  4107. return self;}
  4108. }),
  4109. smalltalk.Stream);
  4110. smalltalk.addMethod(
  4111. '_contents',
  4112. smalltalk.method({
  4113. selector: 'contents',
  4114. fn: function (){
  4115. var self=this;
  4116. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  4117. return self;}
  4118. }),
  4119. smalltalk.Stream);
  4120. smalltalk.addMethod(
  4121. '_size',
  4122. smalltalk.method({
  4123. selector: 'size',
  4124. fn: function (){
  4125. var self=this;
  4126. return smalltalk.send(self, "_streamSize", []);
  4127. return self;}
  4128. }),
  4129. smalltalk.Stream);
  4130. smalltalk.addMethod(
  4131. '_reset',
  4132. smalltalk.method({
  4133. selector: 'reset',
  4134. fn: function (){
  4135. var self=this;
  4136. smalltalk.send(self, "_position_", [(0)]);
  4137. return self;}
  4138. }),
  4139. smalltalk.Stream);
  4140. smalltalk.addMethod(
  4141. '_close',
  4142. smalltalk.method({
  4143. selector: 'close',
  4144. fn: function (){
  4145. var self=this;
  4146. return self;}
  4147. }),
  4148. smalltalk.Stream);
  4149. smalltalk.addMethod(
  4150. '_flush',
  4151. smalltalk.method({
  4152. selector: 'flush',
  4153. fn: function (){
  4154. var self=this;
  4155. return self;}
  4156. }),
  4157. smalltalk.Stream);
  4158. smalltalk.addMethod(
  4159. '_resetContents',
  4160. smalltalk.method({
  4161. selector: 'resetContents',
  4162. fn: function (){
  4163. var self=this;
  4164. smalltalk.send(self, "_reset", []);
  4165. smalltalk.send(self, "_setStreamSize_", [(0)]);
  4166. return self;}
  4167. }),
  4168. smalltalk.Stream);
  4169. smalltalk.addMethod(
  4170. '_do_',
  4171. smalltalk.method({
  4172. selector: 'do:',
  4173. fn: function (aBlock){
  4174. var self=this;
  4175. smalltalk.send((function(){return smalltalk.send(self, "_atEnd", []);}), "_whileFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})]);
  4176. return self;}
  4177. }),
  4178. smalltalk.Stream);
  4179. smalltalk.addMethod(
  4180. '_setToEnd',
  4181. smalltalk.method({
  4182. selector: 'setToEnd',
  4183. fn: function (){
  4184. var self=this;
  4185. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  4186. return self;}
  4187. }),
  4188. smalltalk.Stream);
  4189. smalltalk.addMethod(
  4190. '_skip_',
  4191. smalltalk.method({
  4192. selector: 'skip:',
  4193. fn: function (anInteger){
  4194. var self=this;
  4195. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [anInteger]), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
  4196. return self;}
  4197. }),
  4198. smalltalk.Stream);
  4199. smalltalk.addMethod(
  4200. '_next',
  4201. smalltalk.method({
  4202. selector: 'next',
  4203. fn: function (){
  4204. var self=this;
  4205. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);
  4206. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  4207. return self;}
  4208. }),
  4209. smalltalk.Stream);
  4210. smalltalk.addMethod(
  4211. '_next_',
  4212. smalltalk.method({
  4213. selector: 'next:',
  4214. fn: function (anInteger){
  4215. var self=this;
  4216. var tempCollection=nil;
  4217. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4218. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]);})]);
  4219. return tempCollection;
  4220. return self;}
  4221. }),
  4222. smalltalk.Stream);
  4223. smalltalk.addMethod(
  4224. '_nextPut_',
  4225. smalltalk.method({
  4226. selector: 'nextPut:',
  4227. fn: function (anObject){
  4228. var self=this;
  4229. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);
  4230. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  4231. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4232. return self;}
  4233. }),
  4234. smalltalk.Stream);
  4235. smalltalk.addMethod(
  4236. '_nextPutAll_',
  4237. smalltalk.method({
  4238. selector: 'nextPutAll:',
  4239. fn: function (aCollection){
  4240. var self=this;
  4241. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  4242. return self;}
  4243. }),
  4244. smalltalk.Stream);
  4245. smalltalk.addMethod(
  4246. '_peek',
  4247. smalltalk.method({
  4248. selector: 'peek',
  4249. fn: function (){
  4250. var self=this;
  4251. return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);})]);
  4252. return self;}
  4253. }),
  4254. smalltalk.Stream);
  4255. smalltalk.addMethod(
  4256. '_atEnd',
  4257. smalltalk.method({
  4258. selector: 'atEnd',
  4259. fn: function (){
  4260. var self=this;
  4261. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  4262. return self;}
  4263. }),
  4264. smalltalk.Stream);
  4265. smalltalk.addMethod(
  4266. '_atStart',
  4267. smalltalk.method({
  4268. selector: 'atStart',
  4269. fn: function (){
  4270. var self=this;
  4271. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  4272. return self;}
  4273. }),
  4274. smalltalk.Stream);
  4275. smalltalk.addMethod(
  4276. '_isEmpty',
  4277. smalltalk.method({
  4278. selector: 'isEmpty',
  4279. fn: function (){
  4280. var self=this;
  4281. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  4282. return self;}
  4283. }),
  4284. smalltalk.Stream);
  4285. smalltalk.addMethod(
  4286. '_on_',
  4287. smalltalk.method({
  4288. selector: 'on:',
  4289. fn: function (aCollection){
  4290. var self=this;
  4291. return (function($rec){smalltalk.send($rec, "_setCollection_", [aCollection]);smalltalk.send($rec, "_setStreamSize_", [smalltalk.send(aCollection, "_size", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4292. return self;}
  4293. }),
  4294. smalltalk.Stream.klass);
  4295. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  4296. smalltalk.addMethod(
  4297. '_next_',
  4298. smalltalk.method({
  4299. selector: 'next:',
  4300. fn: function (anInteger){
  4301. var self=this;
  4302. var tempCollection=nil;
  4303. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4304. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);})]);})]);
  4305. return tempCollection;
  4306. return self;}
  4307. }),
  4308. smalltalk.StringStream);
  4309. smalltalk.addMethod(
  4310. '_nextPut_',
  4311. smalltalk.method({
  4312. selector: 'nextPut:',
  4313. fn: function (aString){
  4314. var self=this;
  4315. smalltalk.send(self, "_nextPutAll_", [aString]);
  4316. return self;}
  4317. }),
  4318. smalltalk.StringStream);
  4319. smalltalk.addMethod(
  4320. '_nextPutAll_',
  4321. smalltalk.method({
  4322. selector: 'nextPutAll:',
  4323. fn: function (aString){
  4324. var self=this;
  4325. smalltalk.send(self, "_setCollection_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_position", [])]), "__comma", [aString]), "__comma", [smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)]), "__plus", [smalltalk.send(aString, "_size", [])]), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
  4326. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [smalltalk.send(aString, "_size", [])])]);
  4327. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4328. return self;}
  4329. }),
  4330. smalltalk.StringStream);
  4331. smalltalk.addMethod(
  4332. '_cr',
  4333. smalltalk.method({
  4334. selector: 'cr',
  4335. fn: function (){
  4336. var self=this;
  4337. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  4338. return self;}
  4339. }),
  4340. smalltalk.StringStream);
  4341. smalltalk.addMethod(
  4342. '_crlf',
  4343. smalltalk.method({
  4344. selector: 'crlf',
  4345. fn: function (){
  4346. var self=this;
  4347. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_crlf", [])]);
  4348. return self;}
  4349. }),
  4350. smalltalk.StringStream);
  4351. smalltalk.addMethod(
  4352. '_lf',
  4353. smalltalk.method({
  4354. selector: 'lf',
  4355. fn: function (){
  4356. var self=this;
  4357. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_lf", [])]);
  4358. return self;}
  4359. }),
  4360. smalltalk.StringStream);
  4361. smalltalk.addMethod(
  4362. '_space',
  4363. smalltalk.method({
  4364. selector: 'space',
  4365. fn: function (){
  4366. var self=this;
  4367. smalltalk.send(self, "_nextPut_", [" "]);
  4368. return self;}
  4369. }),
  4370. smalltalk.StringStream);
  4371. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  4372. smalltalk.addMethod(
  4373. '_class_',
  4374. smalltalk.method({
  4375. selector: 'class:',
  4376. fn: function (aClass){
  4377. var self=this;
  4378. self['@class']=aClass;
  4379. return self;}
  4380. }),
  4381. smalltalk.ClassCommentReader);
  4382. smalltalk.addMethod(
  4383. '_scanFrom_',
  4384. smalltalk.method({
  4385. selector: 'scanFrom:',
  4386. fn: function (aStream){
  4387. var self=this;
  4388. var nextChunk=nil;
  4389. nextChunk=smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  4390. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_setComment_", [smalltalk.send(nextChunk, "_contents", [])]);})]);
  4391. return self;}
  4392. }),
  4393. smalltalk.ClassCommentReader);
  4394. smalltalk.addMethod(
  4395. '_initialize',
  4396. smalltalk.method({
  4397. selector: 'initialize',
  4398. fn: function (){
  4399. var self=this;
  4400. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4401. self['@chunkParser']=smalltalk.send(smalltalk.ChunkParser, "_new", []);
  4402. return self;}
  4403. }),
  4404. smalltalk.ClassCommentReader);
  4405. smalltalk.addMethod(
  4406. '_setComment_',
  4407. smalltalk.method({
  4408. selector: 'setComment:',
  4409. fn: function (aString){
  4410. var self=this;
  4411. smalltalk.send(self['@class'], "_comment_", [aString]);
  4412. return self;}
  4413. }),
  4414. smalltalk.ClassCommentReader);
  4415. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  4416. smalltalk.addMethod(
  4417. '_next',
  4418. smalltalk.method({
  4419. selector: 'next',
  4420. fn: function (){
  4421. var self=this;
  4422. return Math.random();
  4423. return self;}
  4424. }),
  4425. smalltalk.Random);
  4426. smalltalk.addMethod(
  4427. '_next_',
  4428. smalltalk.method({
  4429. selector: 'next:',
  4430. fn: function (anInteger){
  4431. var self=this;
  4432. return smalltalk.send((1), "_to_collect_", [anInteger, (function(each){return smalltalk.send(self, "_next", []);})]);
  4433. return self;}
  4434. }),
  4435. smalltalk.Random);
  4436. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  4437. smalltalk.addMethod(
  4438. '_x',
  4439. smalltalk.method({
  4440. selector: 'x',
  4441. fn: function (){
  4442. var self=this;
  4443. return self['@x'];
  4444. return self;}
  4445. }),
  4446. smalltalk.Point);
  4447. smalltalk.addMethod(
  4448. '_y',
  4449. smalltalk.method({
  4450. selector: 'y',
  4451. fn: function (){
  4452. var self=this;
  4453. return self['@y'];
  4454. return self;}
  4455. }),
  4456. smalltalk.Point);
  4457. smalltalk.addMethod(
  4458. '_y_',
  4459. smalltalk.method({
  4460. selector: 'y:',
  4461. fn: function (aNumber){
  4462. var self=this;
  4463. self['@y']=aNumber;
  4464. return self;}
  4465. }),
  4466. smalltalk.Point);
  4467. smalltalk.addMethod(
  4468. '_x_',
  4469. smalltalk.method({
  4470. selector: 'x:',
  4471. fn: function (aNumber){
  4472. var self=this;
  4473. self['@x']=aNumber;
  4474. return self;}
  4475. }),
  4476. smalltalk.Point);
  4477. smalltalk.addMethod(
  4478. '__star',
  4479. smalltalk.method({
  4480. selector: '*',
  4481. fn: function (aPoint){
  4482. var self=this;
  4483. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4484. return self;}
  4485. }),
  4486. smalltalk.Point);
  4487. smalltalk.addMethod(
  4488. '__plus',
  4489. smalltalk.method({
  4490. selector: '+',
  4491. fn: function (aPoint){
  4492. var self=this;
  4493. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4494. return self;}
  4495. }),
  4496. smalltalk.Point);
  4497. smalltalk.addMethod(
  4498. '__minus',
  4499. smalltalk.method({
  4500. selector: '-',
  4501. fn: function (aPoint){
  4502. var self=this;
  4503. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4504. return self;}
  4505. }),
  4506. smalltalk.Point);
  4507. smalltalk.addMethod(
  4508. '__slash',
  4509. smalltalk.method({
  4510. selector: '/',
  4511. fn: function (aPoint){
  4512. var self=this;
  4513. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4514. return self;}
  4515. }),
  4516. smalltalk.Point);
  4517. smalltalk.addMethod(
  4518. '_asPoint',
  4519. smalltalk.method({
  4520. selector: 'asPoint',
  4521. fn: function (){
  4522. var self=this;
  4523. return self;
  4524. return self;}
  4525. }),
  4526. smalltalk.Point);
  4527. smalltalk.addMethod(
  4528. '_x_y_',
  4529. smalltalk.method({
  4530. selector: 'x:y:',
  4531. fn: function (aNumber, anotherNumber){
  4532. var self=this;
  4533. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4534. return self;}
  4535. }),
  4536. smalltalk.Point.klass);
  4537. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  4538. smalltalk.addMethod(
  4539. '_selector',
  4540. smalltalk.method({
  4541. selector: 'selector',
  4542. fn: function (){
  4543. var self=this;
  4544. return self['@selector'];
  4545. return self;}
  4546. }),
  4547. smalltalk.Message);
  4548. smalltalk.addMethod(
  4549. '_selector_',
  4550. smalltalk.method({
  4551. selector: 'selector:',
  4552. fn: function (aString){
  4553. var self=this;
  4554. self['@selector']=aString;
  4555. return self;}
  4556. }),
  4557. smalltalk.Message);
  4558. smalltalk.addMethod(
  4559. '_arguments_',
  4560. smalltalk.method({
  4561. selector: 'arguments:',
  4562. fn: function (anArray){
  4563. var self=this;
  4564. self['@arguments']=anArray;
  4565. return self;}
  4566. }),
  4567. smalltalk.Message);
  4568. smalltalk.addMethod(
  4569. '_arguments',
  4570. smalltalk.method({
  4571. selector: 'arguments',
  4572. fn: function (){
  4573. var self=this;
  4574. return self['@arguments'];
  4575. return self;}
  4576. }),
  4577. smalltalk.Message);
  4578. smalltalk.addMethod(
  4579. '_selector_arguments_',
  4580. smalltalk.method({
  4581. selector: 'selector:arguments:',
  4582. fn: function (aString, anArray){
  4583. var self=this;
  4584. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4585. return self;}
  4586. }),
  4587. smalltalk.Message.klass);
  4588. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  4589. smalltalk.addMethod(
  4590. '_message',
  4591. smalltalk.method({
  4592. selector: 'message',
  4593. fn: function (){
  4594. var self=this;
  4595. return self['@message'];
  4596. return self;}
  4597. }),
  4598. smalltalk.MessageNotUnderstood);
  4599. smalltalk.addMethod(
  4600. '_message_',
  4601. smalltalk.method({
  4602. selector: 'message:',
  4603. fn: function (aMessage){
  4604. var self=this;
  4605. self['@message']=aMessage;
  4606. return self;}
  4607. }),
  4608. smalltalk.MessageNotUnderstood);
  4609. smalltalk.addMethod(
  4610. '_receiver',
  4611. smalltalk.method({
  4612. selector: 'receiver',
  4613. fn: function (){
  4614. var self=this;
  4615. return self['@receiver'];
  4616. return self;}
  4617. }),
  4618. smalltalk.MessageNotUnderstood);
  4619. smalltalk.addMethod(
  4620. '_receiver_',
  4621. smalltalk.method({
  4622. selector: 'receiver:',
  4623. fn: function (anObject){
  4624. var self=this;
  4625. self['@receiver']=anObject;
  4626. return self;}
  4627. }),
  4628. smalltalk.MessageNotUnderstood);
  4629. smalltalk.addMethod(
  4630. '_messageText',
  4631. smalltalk.method({
  4632. selector: 'messageText',
  4633. fn: function (){
  4634. var self=this;
  4635. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_asString", []), "__comma", [unescape("%20does%20not%20understand%20%23")]), "__comma", [smalltalk.send(smalltalk.send(self, "_message", []), "_selector", [])]);
  4636. return self;}
  4637. }),
  4638. smalltalk.MessageNotUnderstood);
  4639. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel');
  4640. smalltalk.addMethod(
  4641. '_handleError_',
  4642. smalltalk.method({
  4643. selector: 'handleError:',
  4644. fn: function (anError){
  4645. var self=this;
  4646. smalltalk.send(smalltalk.send(anError, "_context", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})]);
  4647. smalltalk.send(self, "_logError_", [anError]);
  4648. return self;}
  4649. }),
  4650. smalltalk.ErrorHandler);
  4651. smalltalk.addMethod(
  4652. '_logContext_',
  4653. smalltalk.method({
  4654. selector: 'logContext:',
  4655. fn: function (aContext){
  4656. var self=this;
  4657. smalltalk.send(smalltalk.send(aContext, "_home", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})]);
  4658. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  4659. return self;}
  4660. }),
  4661. smalltalk.ErrorHandler);
  4662. smalltalk.addMethod(
  4663. '_logErrorContext_',
  4664. smalltalk.method({
  4665. selector: 'logErrorContext:',
  4666. fn: function (aContext){
  4667. var self=this;
  4668. smalltalk.send(aContext, "_ifNotNil_", [(function(){return smalltalk.send(smalltalk.send(aContext, "_home", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})]);})]);
  4669. return self;}
  4670. }),
  4671. smalltalk.ErrorHandler);
  4672. smalltalk.addMethod(
  4673. '_logError_',
  4674. smalltalk.method({
  4675. selector: 'logError:',
  4676. fn: function (anError){
  4677. var self=this;
  4678. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  4679. return self;}
  4680. }),
  4681. smalltalk.ErrorHandler);
  4682. smalltalk.addMethod(
  4683. '_log_',
  4684. smalltalk.method({
  4685. selector: 'log:',
  4686. fn: function (aString){
  4687. var self=this;
  4688. smalltalk.send(console, "_log_", [aString]);
  4689. return self;}
  4690. }),
  4691. smalltalk.ErrorHandler);
  4692. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  4693. smalltalk.addMethod(
  4694. '_current',
  4695. smalltalk.method({
  4696. selector: 'current',
  4697. fn: function (){
  4698. var self=this;
  4699. return self['@current'];
  4700. return self;}
  4701. }),
  4702. smalltalk.ErrorHandler.klass);
  4703. smalltalk.addMethod(
  4704. '_initialize',
  4705. smalltalk.method({
  4706. selector: 'initialize',
  4707. fn: function (){
  4708. var self=this;
  4709. smalltalk.send(self, "_register", []);
  4710. return self;}
  4711. }),
  4712. smalltalk.ErrorHandler.klass);
  4713. smalltalk.addMethod(
  4714. '_register',
  4715. smalltalk.method({
  4716. selector: 'register',
  4717. fn: function (){
  4718. var self=this;
  4719. smalltalk.send(smalltalk.ErrorHandler, "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  4720. return self;}
  4721. }),
  4722. smalltalk.ErrorHandler.klass);
  4723. smalltalk.addMethod(
  4724. '_setCurrent_',
  4725. smalltalk.method({
  4726. selector: 'setCurrent:',
  4727. fn: function (anHandler){
  4728. var self=this;
  4729. self['@current']=anHandler;
  4730. return self;}
  4731. }),
  4732. smalltalk.ErrorHandler.klass);