Kernel.deploy.js 149 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040
  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 smalltalk.send(self, "__eq_eq", [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 smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__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 || 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 || 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 (($receiver = smalltalk.send(self, "_isMemberOf_", [aClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return true;})() : (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return true;}), (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})]);
  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 || 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 || 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. '_log_block_',
  469. smalltalk.method({
  470. selector: 'log:block:',
  471. fn: function (aString, aBlock){
  472. var self=this;
  473. var result=nil;
  474. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(smalltalk.send(aString, "__comma", [" time: "]), "__comma", [smalltalk.send(smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return result=smalltalk.send(aBlock, "_value", []);})]), "_printString", [])])]);
  475. return result;
  476. return self;}
  477. }),
  478. smalltalk.Object);
  479. smalltalk.addMethod(
  480. '__eq_eq',
  481. smalltalk.method({
  482. selector: '==',
  483. fn: function (anObject){
  484. var self=this;
  485. return self === anObject;
  486. return self;}
  487. }),
  488. smalltalk.Object);
  489. smalltalk.addMethod(
  490. '_~~',
  491. smalltalk.method({
  492. selector: '~~',
  493. fn: function (anObject){
  494. var self=this;
  495. return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
  496. return self;}
  497. }),
  498. smalltalk.Object);
  499. smalltalk.addMethod(
  500. '_initialize',
  501. smalltalk.method({
  502. selector: 'initialize',
  503. fn: function (){
  504. var self=this;
  505. return self;}
  506. }),
  507. smalltalk.Object.klass);
  508. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  509. smalltalk.addMethod(
  510. '_classes',
  511. smalltalk.method({
  512. selector: 'classes',
  513. fn: function (){
  514. var self=this;
  515. return self.classes();
  516. return self;}
  517. }),
  518. smalltalk.Smalltalk);
  519. smalltalk.addMethod(
  520. '_readJSON_',
  521. smalltalk.method({
  522. selector: 'readJSON:',
  523. fn: function (anObject){
  524. var self=this;
  525. return self.readJSObject(anObject);
  526. return self;}
  527. }),
  528. smalltalk.Smalltalk);
  529. smalltalk.addMethod(
  530. '_at_',
  531. smalltalk.method({
  532. selector: 'at:',
  533. fn: function (aString){
  534. var self=this;
  535. return self[aString];
  536. return self;}
  537. }),
  538. smalltalk.Smalltalk);
  539. smalltalk.addMethod(
  540. '_removeClass_',
  541. smalltalk.method({
  542. selector: 'removeClass:',
  543. fn: function (aClass){
  544. var self=this;
  545. (($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);})]);
  546. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  547. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  548. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  549. return self;}
  550. }),
  551. smalltalk.Smalltalk);
  552. smalltalk.addMethod(
  553. '_basicParse_',
  554. smalltalk.method({
  555. selector: 'basicParse:',
  556. fn: function (aString){
  557. var self=this;
  558. return smalltalk.parser.parse(aString);
  559. return self;}
  560. }),
  561. smalltalk.Smalltalk);
  562. smalltalk.addMethod(
  563. '_parse_',
  564. smalltalk.method({
  565. selector: 'parse:',
  566. fn: function (aString){
  567. var self=this;
  568. var result=nil;
  569. smalltalk.send(self, "_try_catch_", [(function(){return result=smalltalk.send(self, "_basicParse_", [aString]);}), (function(ex){return smalltalk.send(smalltalk.send(self, "_parseError_parsing_", [ex, aString]), "_signal", []);})]);
  570. return result;
  571. return self;}
  572. }),
  573. smalltalk.Smalltalk);
  574. smalltalk.addMethod(
  575. '_parseError_parsing_',
  576. smalltalk.method({
  577. selector: 'parseError:parsing:',
  578. fn: function (anException, aString){
  579. var self=this;
  580. var row=nil;
  581. var col=nil;
  582. var message=nil;
  583. var lines=nil;
  584. var badLine=nil;
  585. var code=nil;
  586. row = anException.line;
  587. col = anException.column;
  588. message = anException.message;;
  589. lines=smalltalk.send(aString, "_lines", []);
  590. badLine=smalltalk.send(lines, "_at_", [row]);
  591. badLine=smalltalk.send(smalltalk.send(smalltalk.send(badLine, "_copyFrom_to_", [(1), (($receiver = col).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])]), "__comma", [unescape("%20%3D%3D%3D%3E")]), "__comma", [smalltalk.send(badLine, "_copyFrom_to_", [col, smalltalk.send(badLine, "_size", [])])]);
  592. smalltalk.send(lines, "_at_put_", [row, badLine]);
  593. code=smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(s){return smalltalk.send(lines, "_withIndexDo_", [(function(l, i){return smalltalk.send(s, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(i, "_asString", []), "__comma", [": "]), "__comma", [l]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})]);})]);
  594. return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_messageText_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Parse error on line ", "__comma", [row]), "__comma", [" column "]), "__comma", [col]), "__comma", [" : "]), "__comma", [message]), "__comma", [unescape("%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A")]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", [code])]);
  595. return self;}
  596. }),
  597. smalltalk.Smalltalk);
  598. smalltalk.addMethod(
  599. '_packages',
  600. smalltalk.method({
  601. selector: 'packages',
  602. fn: function (){
  603. var self=this;
  604. return self.packages.all();
  605. return self;}
  606. }),
  607. smalltalk.Smalltalk);
  608. smalltalk.addMethod(
  609. '_packageAt_',
  610. smalltalk.method({
  611. selector: 'packageAt:',
  612. fn: function (packageName){
  613. var self=this;
  614. return self.packages[packageName];
  615. return self;}
  616. }),
  617. smalltalk.Smalltalk);
  618. smalltalk.addMethod(
  619. '_packageAt_ifAbsent_',
  620. smalltalk.method({
  621. selector: 'packageAt:ifAbsent:',
  622. fn: function (packageName, aBlock){
  623. var self=this;
  624. return smalltalk.send(smalltalk.send(self, "_packageAt_", [packageName]), "_ifNil_", [aBlock]);
  625. return self;}
  626. }),
  627. smalltalk.Smalltalk);
  628. smalltalk.addMethod(
  629. '_createPackage_',
  630. smalltalk.method({
  631. selector: 'createPackage:',
  632. fn: function (packageName){
  633. var self=this;
  634. return smalltalk.addPackage(packageName);
  635. return self;}
  636. }),
  637. smalltalk.Smalltalk);
  638. smalltalk.addMethod(
  639. '_deletePackage_',
  640. smalltalk.method({
  641. selector: 'deletePackage:',
  642. fn: function (packageName){
  643. var self=this;
  644. delete smalltalk.packages[packageName];
  645. return self;}
  646. }),
  647. smalltalk.Smalltalk);
  648. smalltalk.addMethod(
  649. '_removePackage_',
  650. smalltalk.method({
  651. selector: 'removePackage:',
  652. fn: function (packageName){
  653. var self=this;
  654. var package=nil;
  655. package=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  656. smalltalk.send(smalltalk.send(package, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
  657. smalltalk.send(self, "_deletePackage_", [packageName]);
  658. return self;}
  659. }),
  660. smalltalk.Smalltalk);
  661. smalltalk.addMethod(
  662. '_renamePackage_to_',
  663. smalltalk.method({
  664. selector: 'renamePackage:to:',
  665. fn: function (packageName, newName){
  666. var self=this;
  667. var package=nil;
  668. package=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  669. (($receiver = smalltalk.send(self, "_packageAt_", [newName])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);})() : nil;
  670. smalltalk.packages[newName] = smalltalk.packages[packageName];
  671. smalltalk.send(package, "_name_", [newName]);
  672. smalltalk.send(self, "_deletePackage_", [packageName]);
  673. return self;}
  674. }),
  675. smalltalk.Smalltalk);
  676. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  677. smalltalk.addMethod(
  678. '_current',
  679. smalltalk.method({
  680. selector: 'current',
  681. fn: function (){
  682. var self=this;
  683. return smalltalk;
  684. return self;}
  685. }),
  686. smalltalk.Smalltalk.klass);
  687. smalltalk.addClass('Package', smalltalk.Object, [], 'Kernel');
  688. smalltalk.addMethod(
  689. '_name',
  690. smalltalk.method({
  691. selector: 'name',
  692. fn: function (){
  693. var self=this;
  694. return self.pkgName || nil;
  695. return self;}
  696. }),
  697. smalltalk.Package);
  698. smalltalk.addMethod(
  699. '_requires',
  700. smalltalk.method({
  701. selector: 'requires',
  702. fn: function (){
  703. var self=this;
  704. return self.requires || nil;
  705. return self;}
  706. }),
  707. smalltalk.Package);
  708. smalltalk.addMethod(
  709. '_name_',
  710. smalltalk.method({
  711. selector: 'name:',
  712. fn: function (aString){
  713. var self=this;
  714. return self.pkgName = aString;
  715. return self;}
  716. }),
  717. smalltalk.Package);
  718. smalltalk.addMethod(
  719. '_classes',
  720. smalltalk.method({
  721. selector: 'classes',
  722. fn: function (){
  723. var self=this;
  724. return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_select_", [(function(c){return smalltalk.send(smalltalk.send(c, "_package", []), "__eq_eq", [self]);})]);
  725. return self;}
  726. }),
  727. smalltalk.Package);
  728. smalltalk.addMethod(
  729. '_printString',
  730. smalltalk.method({
  731. selector: 'printString',
  732. fn: function (){
  733. var self=this;
  734. return smalltalk.send(self, "_name", []);
  735. return self;}
  736. }),
  737. smalltalk.Package);
  738. smalltalk.addMethod(
  739. '_named_',
  740. smalltalk.method({
  741. selector: 'named:',
  742. fn: function (aPackageName){
  743. var self=this;
  744. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [aPackageName]);
  745. return self;}
  746. }),
  747. smalltalk.Package.klass);
  748. smalltalk.addMethod(
  749. '_named_ifAbsent_',
  750. smalltalk.method({
  751. selector: 'named:ifAbsent:',
  752. fn: function (aPackageName, aBlock){
  753. var self=this;
  754. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  755. return self;}
  756. }),
  757. smalltalk.Package.klass);
  758. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  759. smalltalk.addMethod(
  760. '_new',
  761. smalltalk.method({
  762. selector: 'new',
  763. fn: function (){
  764. var self=this;
  765. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  766. return self;}
  767. }),
  768. smalltalk.Behavior);
  769. smalltalk.addMethod(
  770. '_basicNew',
  771. smalltalk.method({
  772. selector: 'basicNew',
  773. fn: function (){
  774. var self=this;
  775. return new self.fn();
  776. return self;}
  777. }),
  778. smalltalk.Behavior);
  779. smalltalk.addMethod(
  780. '_name',
  781. smalltalk.method({
  782. selector: 'name',
  783. fn: function (){
  784. var self=this;
  785. return self.className || nil;
  786. return self;}
  787. }),
  788. smalltalk.Behavior);
  789. smalltalk.addMethod(
  790. '_superclass',
  791. smalltalk.method({
  792. selector: 'superclass',
  793. fn: function (){
  794. var self=this;
  795. return self.superclass || nil;
  796. return self;}
  797. }),
  798. smalltalk.Behavior);
  799. smalltalk.addMethod(
  800. '_subclasses',
  801. smalltalk.method({
  802. selector: 'subclasses',
  803. fn: function (){
  804. var self=this;
  805. return smalltalk.subclasses(self);
  806. return self;}
  807. }),
  808. smalltalk.Behavior);
  809. smalltalk.addMethod(
  810. '_allSubclasses',
  811. smalltalk.method({
  812. selector: 'allSubclasses',
  813. fn: function (){
  814. var self=this;
  815. var result=nil;
  816. result=smalltalk.send(self, "_subclasses", []);
  817. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  818. return result;
  819. return self;}
  820. }),
  821. smalltalk.Behavior);
  822. smalltalk.addMethod(
  823. '_withAllSubclasses',
  824. smalltalk.method({
  825. selector: 'withAllSubclasses',
  826. fn: function (){
  827. var self=this;
  828. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
  829. return self;}
  830. }),
  831. smalltalk.Behavior);
  832. smalltalk.addMethod(
  833. '_prototype',
  834. smalltalk.method({
  835. selector: 'prototype',
  836. fn: function (){
  837. var self=this;
  838. return self.fn.prototype;
  839. return self;}
  840. }),
  841. smalltalk.Behavior);
  842. smalltalk.addMethod(
  843. '_methodDictionary',
  844. smalltalk.method({
  845. selector: 'methodDictionary',
  846. fn: function (){
  847. var self=this;
  848. var dict = smalltalk.Dictionary._new();
  849. var methods = self.fn.prototype.methods;
  850. for(var i in methods) {
  851. if(methods[i].selector) {
  852. dict._at_put_(methods[i].selector, methods[i]);
  853. }
  854. };
  855. return dict;
  856. return self;}
  857. }),
  858. smalltalk.Behavior);
  859. smalltalk.addMethod(
  860. '_methodsFor_',
  861. smalltalk.method({
  862. selector: 'methodsFor:',
  863. fn: function (aString){
  864. var self=this;
  865. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
  866. return self;}
  867. }),
  868. smalltalk.Behavior);
  869. smalltalk.addMethod(
  870. '_addCompiledMethod_',
  871. smalltalk.method({
  872. selector: 'addCompiledMethod:',
  873. fn: function (aMethod){
  874. var self=this;
  875. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  876. return self;}
  877. }),
  878. smalltalk.Behavior);
  879. smalltalk.addMethod(
  880. '_instanceVariableNames',
  881. smalltalk.method({
  882. selector: 'instanceVariableNames',
  883. fn: function (){
  884. var self=this;
  885. return self.iVarNames;
  886. return self;}
  887. }),
  888. smalltalk.Behavior);
  889. smalltalk.addMethod(
  890. '_comment',
  891. smalltalk.method({
  892. selector: 'comment',
  893. fn: function (){
  894. var self=this;
  895. return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  896. return self;}
  897. }),
  898. smalltalk.Behavior);
  899. smalltalk.addMethod(
  900. '_comment_',
  901. smalltalk.method({
  902. selector: 'comment:',
  903. fn: function (aString){
  904. var self=this;
  905. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  906. return self;}
  907. }),
  908. smalltalk.Behavior);
  909. smalltalk.addMethod(
  910. '_commentStamp',
  911. smalltalk.method({
  912. selector: 'commentStamp',
  913. fn: function (){
  914. var self=this;
  915. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
  916. return self;}
  917. }),
  918. smalltalk.Behavior);
  919. smalltalk.addMethod(
  920. '_removeCompiledMethod_',
  921. smalltalk.method({
  922. selector: 'removeCompiledMethod:',
  923. fn: function (aMethod){
  924. var self=this;
  925. delete self.fn.prototype[aMethod.selector._asSelector()];
  926. delete self.fn.prototype.methods[aMethod.selector];
  927. smalltalk.init(self);;
  928. return self;}
  929. }),
  930. smalltalk.Behavior);
  931. smalltalk.addMethod(
  932. '_inheritsFrom_',
  933. smalltalk.method({
  934. selector: 'inheritsFrom:',
  935. fn: function (aClass){
  936. var self=this;
  937. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  938. return self;}
  939. }),
  940. smalltalk.Behavior);
  941. smalltalk.addMethod(
  942. '_protocols',
  943. smalltalk.method({
  944. selector: 'protocols',
  945. fn: function (){
  946. var self=this;
  947. var protocols=nil;
  948. protocols=smalltalk.send((smalltalk.Array || Array), "_new", []);
  949. smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_do_", [(function(each){return (($receiver = smalltalk.send(protocols, "_includes_", [smalltalk.send(each, "_category", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);
  950. return smalltalk.send(protocols, "_sort", []);
  951. return self;}
  952. }),
  953. smalltalk.Behavior);
  954. smalltalk.addMethod(
  955. '_protocolsDo_',
  956. smalltalk.method({
  957. selector: 'protocolsDo:',
  958. fn: function (aBlock){
  959. var self=this;
  960. var methodsByCategory=nil;
  961. methodsByCategory=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  962. 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 || Array), "_new", []);})]), "_add_", [m]);})]);
  963. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  964. return self;}
  965. }),
  966. smalltalk.Behavior);
  967. smalltalk.addMethod(
  968. '_allInstanceVariableNames',
  969. smalltalk.method({
  970. selector: 'allInstanceVariableNames',
  971. fn: function (){
  972. var self=this;
  973. var result=nil;
  974. result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []);
  975. (($receiver = smalltalk.send(self, "_superclass", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})() : nil;
  976. return result;
  977. return self;}
  978. }),
  979. smalltalk.Behavior);
  980. smalltalk.addMethod(
  981. '_methodAt_',
  982. smalltalk.method({
  983. selector: 'methodAt:',
  984. fn: function (aString){
  985. var self=this;
  986. return smalltalk.methods(self)[aString];
  987. return self;}
  988. }),
  989. smalltalk.Behavior);
  990. smalltalk.addMethod(
  991. '_methodsFor_stamp_',
  992. smalltalk.method({
  993. selector: 'methodsFor:stamp:',
  994. fn: function (aString, aStamp){
  995. var self=this;
  996. return smalltalk.send(self, "_methodsFor_", [aString]);
  997. return self;}
  998. }),
  999. smalltalk.Behavior);
  1000. smalltalk.addMethod(
  1001. '_commentStamp_prior_',
  1002. smalltalk.method({
  1003. selector: 'commentStamp:prior:',
  1004. fn: function (aStamp, prior){
  1005. var self=this;
  1006. return smalltalk.send(self, "_commentStamp", []);
  1007. return self;}
  1008. }),
  1009. smalltalk.Behavior);
  1010. smalltalk.addMethod(
  1011. '_compile_',
  1012. smalltalk.method({
  1013. selector: 'compile:',
  1014. fn: function (aString){
  1015. var self=this;
  1016. smalltalk.send(self, "_compile_category_", [aString, ""]);
  1017. return self;}
  1018. }),
  1019. smalltalk.Behavior);
  1020. smalltalk.addMethod(
  1021. '_compile_category_',
  1022. smalltalk.method({
  1023. selector: 'compile:category:',
  1024. fn: function (aString, anotherString){
  1025. var self=this;
  1026. var method=nil;
  1027. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self]);
  1028. smalltalk.send(method, "_category_", [anotherString]);
  1029. smalltalk.send(self, "_addCompiledMethod_", [method]);
  1030. return self;}
  1031. }),
  1032. smalltalk.Behavior);
  1033. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  1034. smalltalk.addMethod(
  1035. '_category',
  1036. smalltalk.method({
  1037. selector: 'category',
  1038. fn: function (){
  1039. var self=this;
  1040. return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
  1041. return self;}
  1042. }),
  1043. smalltalk.Class);
  1044. smalltalk.addMethod(
  1045. '_subclass_instanceVariableNames_',
  1046. smalltalk.method({
  1047. selector: 'subclass:instanceVariableNames:',
  1048. fn: function (aString, anotherString){
  1049. var self=this;
  1050. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  1051. return self;}
  1052. }),
  1053. smalltalk.Class);
  1054. smalltalk.addMethod(
  1055. '_subclass_instanceVariableNames_category_',
  1056. smalltalk.method({
  1057. selector: 'subclass:instanceVariableNames:category:',
  1058. fn: function (aString, aString2, aString3){
  1059. var self=this;
  1060. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  1061. return self;}
  1062. }),
  1063. smalltalk.Class);
  1064. smalltalk.addMethod(
  1065. '_isClass',
  1066. smalltalk.method({
  1067. selector: 'isClass',
  1068. fn: function (){
  1069. var self=this;
  1070. return true;
  1071. return self;}
  1072. }),
  1073. smalltalk.Class);
  1074. smalltalk.addMethod(
  1075. '_printString',
  1076. smalltalk.method({
  1077. selector: 'printString',
  1078. fn: function (){
  1079. var self=this;
  1080. return smalltalk.send(self, "_name", []);
  1081. return self;}
  1082. }),
  1083. smalltalk.Class);
  1084. smalltalk.addMethod(
  1085. '_rename_',
  1086. smalltalk.method({
  1087. selector: 'rename:',
  1088. fn: function (aString){
  1089. var self=this;
  1090. smalltalk[aString] = self;
  1091. delete smalltalk[self.className];
  1092. self.className = aString;
  1093. ;
  1094. return self;}
  1095. }),
  1096. smalltalk.Class);
  1097. smalltalk.addMethod(
  1098. '_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_',
  1099. smalltalk.method({
  1100. selector: 'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:',
  1101. fn: function (aString, aString2, classVars, pools, aString3){
  1102. var self=this;
  1103. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  1104. return self;}
  1105. }),
  1106. smalltalk.Class);
  1107. smalltalk.addMethod(
  1108. '_package',
  1109. smalltalk.method({
  1110. selector: 'package',
  1111. fn: function (){
  1112. var self=this;
  1113. return self.pkg;
  1114. return self;}
  1115. }),
  1116. smalltalk.Class);
  1117. smalltalk.addMethod(
  1118. '_package_',
  1119. smalltalk.method({
  1120. selector: 'package:',
  1121. fn: function (aPackage){
  1122. var self=this;
  1123. self.pkg = aPackage;
  1124. return self;}
  1125. }),
  1126. smalltalk.Class);
  1127. smalltalk.addMethod(
  1128. '_subclass_instanceVariableNames_package_',
  1129. smalltalk.method({
  1130. selector: 'subclass:instanceVariableNames:package:',
  1131. fn: function (aString, aString2, aString3){
  1132. var self=this;
  1133. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  1134. return self;}
  1135. }),
  1136. smalltalk.Class);
  1137. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  1138. smalltalk.addMethod(
  1139. '_instanceClass',
  1140. smalltalk.method({
  1141. selector: 'instanceClass',
  1142. fn: function (){
  1143. var self=this;
  1144. return self.instanceClass;
  1145. return self;}
  1146. }),
  1147. smalltalk.Metaclass);
  1148. smalltalk.addMethod(
  1149. '_instanceVariableNames_',
  1150. smalltalk.method({
  1151. selector: 'instanceVariableNames:',
  1152. fn: function (aCollection){
  1153. var self=this;
  1154. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  1155. return self;}
  1156. }),
  1157. smalltalk.Metaclass);
  1158. smalltalk.addMethod(
  1159. '_isMetaclass',
  1160. smalltalk.method({
  1161. selector: 'isMetaclass',
  1162. fn: function (){
  1163. var self=this;
  1164. return true;
  1165. return self;}
  1166. }),
  1167. smalltalk.Metaclass);
  1168. smalltalk.addMethod(
  1169. '_printString',
  1170. smalltalk.method({
  1171. selector: 'printString',
  1172. fn: function (){
  1173. var self=this;
  1174. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  1175. return self;}
  1176. }),
  1177. smalltalk.Metaclass);
  1178. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  1179. smalltalk.addMethod(
  1180. '_source',
  1181. smalltalk.method({
  1182. selector: 'source',
  1183. fn: function (){
  1184. var self=this;
  1185. return (($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1186. return self;}
  1187. }),
  1188. smalltalk.CompiledMethod);
  1189. smalltalk.addMethod(
  1190. '_source_',
  1191. smalltalk.method({
  1192. selector: 'source:',
  1193. fn: function (aString){
  1194. var self=this;
  1195. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  1196. return self;}
  1197. }),
  1198. smalltalk.CompiledMethod);
  1199. smalltalk.addMethod(
  1200. '_category',
  1201. smalltalk.method({
  1202. selector: 'category',
  1203. fn: function (){
  1204. var self=this;
  1205. return (($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1206. return self;}
  1207. }),
  1208. smalltalk.CompiledMethod);
  1209. smalltalk.addMethod(
  1210. '_category_',
  1211. smalltalk.method({
  1212. selector: 'category:',
  1213. fn: function (aString){
  1214. var self=this;
  1215. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  1216. return self;}
  1217. }),
  1218. smalltalk.CompiledMethod);
  1219. smalltalk.addMethod(
  1220. '_selector',
  1221. smalltalk.method({
  1222. selector: 'selector',
  1223. fn: function (){
  1224. var self=this;
  1225. return smalltalk.send(self, "_basicAt_", ["selector"]);
  1226. return self;}
  1227. }),
  1228. smalltalk.CompiledMethod);
  1229. smalltalk.addMethod(
  1230. '_selector_',
  1231. smalltalk.method({
  1232. selector: 'selector:',
  1233. fn: function (aString){
  1234. var self=this;
  1235. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  1236. return self;}
  1237. }),
  1238. smalltalk.CompiledMethod);
  1239. smalltalk.addMethod(
  1240. '_fn',
  1241. smalltalk.method({
  1242. selector: 'fn',
  1243. fn: function (){
  1244. var self=this;
  1245. return smalltalk.send(self, "_basicAt_", ["fn"]);
  1246. return self;}
  1247. }),
  1248. smalltalk.CompiledMethod);
  1249. smalltalk.addMethod(
  1250. '_fn_',
  1251. smalltalk.method({
  1252. selector: 'fn:',
  1253. fn: function (aBlock){
  1254. var self=this;
  1255. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  1256. return self;}
  1257. }),
  1258. smalltalk.CompiledMethod);
  1259. smalltalk.addMethod(
  1260. '_messageSends',
  1261. smalltalk.method({
  1262. selector: 'messageSends',
  1263. fn: function (){
  1264. var self=this;
  1265. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  1266. return self;}
  1267. }),
  1268. smalltalk.CompiledMethod);
  1269. smalltalk.addMethod(
  1270. '_methodClass',
  1271. smalltalk.method({
  1272. selector: 'methodClass',
  1273. fn: function (){
  1274. var self=this;
  1275. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  1276. return self;}
  1277. }),
  1278. smalltalk.CompiledMethod);
  1279. smalltalk.addMethod(
  1280. '_referencedClasses',
  1281. smalltalk.method({
  1282. selector: 'referencedClasses',
  1283. fn: function (){
  1284. var self=this;
  1285. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  1286. return self;}
  1287. }),
  1288. smalltalk.CompiledMethod);
  1289. smalltalk.addMethod(
  1290. '_arguments',
  1291. smalltalk.method({
  1292. selector: 'arguments',
  1293. fn: function (){
  1294. var self=this;
  1295. return self.args || [];
  1296. return self;}
  1297. }),
  1298. smalltalk.CompiledMethod);
  1299. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1300. smalltalk.addMethod(
  1301. '__eq',
  1302. smalltalk.method({
  1303. selector: '=',
  1304. fn: function (aNumber){
  1305. var self=this;
  1306. try{(($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  1307. return Number(self) == aNumber;
  1308. return self;
  1309. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  1310. }),
  1311. smalltalk.Number);
  1312. smalltalk.addMethod(
  1313. '__gt',
  1314. smalltalk.method({
  1315. selector: '>',
  1316. fn: function (aNumber){
  1317. var self=this;
  1318. return self > aNumber;
  1319. return self;}
  1320. }),
  1321. smalltalk.Number);
  1322. smalltalk.addMethod(
  1323. '__lt',
  1324. smalltalk.method({
  1325. selector: '<',
  1326. fn: function (aNumber){
  1327. var self=this;
  1328. return self < aNumber;
  1329. return self;}
  1330. }),
  1331. smalltalk.Number);
  1332. smalltalk.addMethod(
  1333. '__gt_eq',
  1334. smalltalk.method({
  1335. selector: '>=',
  1336. fn: function (aNumber){
  1337. var self=this;
  1338. return self >= aNumber;
  1339. return self;}
  1340. }),
  1341. smalltalk.Number);
  1342. smalltalk.addMethod(
  1343. '__lt_eq',
  1344. smalltalk.method({
  1345. selector: '<=',
  1346. fn: function (aNumber){
  1347. var self=this;
  1348. return self <= aNumber;
  1349. return self;}
  1350. }),
  1351. smalltalk.Number);
  1352. smalltalk.addMethod(
  1353. '__plus',
  1354. smalltalk.method({
  1355. selector: '+',
  1356. fn: function (aNumber){
  1357. var self=this;
  1358. return self + aNumber;
  1359. return self;}
  1360. }),
  1361. smalltalk.Number);
  1362. smalltalk.addMethod(
  1363. '__minus',
  1364. smalltalk.method({
  1365. selector: '-',
  1366. fn: function (aNumber){
  1367. var self=this;
  1368. return self - aNumber;
  1369. return self;}
  1370. }),
  1371. smalltalk.Number);
  1372. smalltalk.addMethod(
  1373. '__star',
  1374. smalltalk.method({
  1375. selector: '*',
  1376. fn: function (aNumber){
  1377. var self=this;
  1378. return self * aNumber;
  1379. return self;}
  1380. }),
  1381. smalltalk.Number);
  1382. smalltalk.addMethod(
  1383. '__slash',
  1384. smalltalk.method({
  1385. selector: '/',
  1386. fn: function (aNumber){
  1387. var self=this;
  1388. return self / aNumber;
  1389. return self;}
  1390. }),
  1391. smalltalk.Number);
  1392. smalltalk.addMethod(
  1393. '_max_',
  1394. smalltalk.method({
  1395. selector: 'max:',
  1396. fn: function (aNumber){
  1397. var self=this;
  1398. return Math.max(self, aNumber);;
  1399. return self;}
  1400. }),
  1401. smalltalk.Number);
  1402. smalltalk.addMethod(
  1403. '_min_',
  1404. smalltalk.method({
  1405. selector: 'min:',
  1406. fn: function (aNumber){
  1407. var self=this;
  1408. return Math.min(self, aNumber);;
  1409. return self;}
  1410. }),
  1411. smalltalk.Number);
  1412. smalltalk.addMethod(
  1413. '_rounded',
  1414. smalltalk.method({
  1415. selector: 'rounded',
  1416. fn: function (){
  1417. var self=this;
  1418. return Math.round(self);;
  1419. return self;}
  1420. }),
  1421. smalltalk.Number);
  1422. smalltalk.addMethod(
  1423. '_truncated',
  1424. smalltalk.method({
  1425. selector: 'truncated',
  1426. fn: function (){
  1427. var self=this;
  1428. var result=nil;
  1429. (($receiver = self >= (0)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return result = Math.floor(self);;})() : (function(){return result = (Math.floor(self * (-1)) * (-1));;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return result = Math.floor(self);;}), (function(){return result = (Math.floor(self * (-1)) * (-1));;})]);
  1430. return result;
  1431. return self;}
  1432. }),
  1433. smalltalk.Number);
  1434. smalltalk.addMethod(
  1435. '_to_',
  1436. smalltalk.method({
  1437. selector: 'to:',
  1438. fn: function (aNumber){
  1439. var self=this;
  1440. var array=nil;
  1441. var first=nil;
  1442. var last=nil;
  1443. var count=nil;
  1444. first=smalltalk.send(self, "_truncated", []);
  1445. last=(($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);
  1446. count=(1);
  1447. (($receiver = (($receiver = first).klass === smalltalk.Number) ? $receiver <=last : smalltalk.send($receiver, "__lt_eq", [last])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", ["Wrong interval"]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", ["Wrong interval"]);})]);
  1448. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1449. smalltalk.send((($receiver = last).klass === smalltalk.Number) ? $receiver -first : smalltalk.send($receiver, "__minus", [first]), "_timesRepeat_", [(function(){smalltalk.send(array, "_at_put_", [count, first]);count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);return first=(($receiver = first).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
  1450. return array;
  1451. return self;}
  1452. }),
  1453. smalltalk.Number);
  1454. smalltalk.addMethod(
  1455. '_timesRepeat_',
  1456. smalltalk.method({
  1457. selector: 'timesRepeat:',
  1458. fn: function (aBlock){
  1459. var self=this;
  1460. var integer=nil;
  1461. var count=nil;
  1462. integer=smalltalk.send(self, "_truncated", []);
  1463. count=(1);
  1464. (function(){while(!(function(){return (($receiver = count).klass === smalltalk.Number) ? $receiver >self : smalltalk.send($receiver, "__gt", [self]);})()) {(function(){smalltalk.send(aBlock, "_value", []);return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
  1465. return self;}
  1466. }),
  1467. smalltalk.Number);
  1468. smalltalk.addMethod(
  1469. '_to_do_',
  1470. smalltalk.method({
  1471. selector: 'to:do:',
  1472. fn: function (aNumber, aBlock){
  1473. var self=this;
  1474. return smalltalk.send(smalltalk.send(self, "_to_", [aNumber]), "_do_", [aBlock]);
  1475. return self;}
  1476. }),
  1477. smalltalk.Number);
  1478. smalltalk.addMethod(
  1479. '_asString',
  1480. smalltalk.method({
  1481. selector: 'asString',
  1482. fn: function (){
  1483. var self=this;
  1484. return smalltalk.send(self, "_printString", []);
  1485. return self;}
  1486. }),
  1487. smalltalk.Number);
  1488. smalltalk.addMethod(
  1489. '_asJavascript',
  1490. smalltalk.method({
  1491. selector: 'asJavascript',
  1492. fn: function (){
  1493. var self=this;
  1494. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1495. return self;}
  1496. }),
  1497. smalltalk.Number);
  1498. smalltalk.addMethod(
  1499. '_printString',
  1500. smalltalk.method({
  1501. selector: 'printString',
  1502. fn: function (){
  1503. var self=this;
  1504. return String(self);
  1505. return self;}
  1506. }),
  1507. smalltalk.Number);
  1508. smalltalk.addMethod(
  1509. '_isNumber',
  1510. smalltalk.method({
  1511. selector: 'isNumber',
  1512. fn: function (){
  1513. var self=this;
  1514. return true;
  1515. return self;}
  1516. }),
  1517. smalltalk.Number);
  1518. smalltalk.addMethod(
  1519. '_atRandom',
  1520. smalltalk.method({
  1521. selector: 'atRandom',
  1522. fn: function (){
  1523. var self=this;
  1524. return (($receiver = smalltalk.send((($receiver = smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", [])).klass === smalltalk.Number) ? $receiver *self : smalltalk.send($receiver, "__star", [self]), "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);
  1525. return self;}
  1526. }),
  1527. smalltalk.Number);
  1528. smalltalk.addMethod(
  1529. '__at',
  1530. smalltalk.method({
  1531. selector: '@',
  1532. fn: function (aNumber){
  1533. var self=this;
  1534. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, aNumber]);
  1535. return self;}
  1536. }),
  1537. smalltalk.Number);
  1538. smalltalk.addMethod(
  1539. '_asPoint',
  1540. smalltalk.method({
  1541. selector: 'asPoint',
  1542. fn: function (){
  1543. var self=this;
  1544. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, self]);
  1545. return self;}
  1546. }),
  1547. smalltalk.Number);
  1548. smalltalk.addMethod(
  1549. '_clearInterval',
  1550. smalltalk.method({
  1551. selector: 'clearInterval',
  1552. fn: function (){
  1553. var self=this;
  1554. clearInterval(Number(self));
  1555. return self;}
  1556. }),
  1557. smalltalk.Number);
  1558. smalltalk.addMethod(
  1559. '_asJSONObject',
  1560. smalltalk.method({
  1561. selector: 'asJSONObject',
  1562. fn: function (){
  1563. var self=this;
  1564. return self;
  1565. return self;}
  1566. }),
  1567. smalltalk.Number);
  1568. smalltalk.addMethod(
  1569. '_clearTimeout',
  1570. smalltalk.method({
  1571. selector: 'clearTimeout',
  1572. fn: function (){
  1573. var self=this;
  1574. clearTimeout(Number(self));
  1575. return self;}
  1576. }),
  1577. smalltalk.Number);
  1578. smalltalk.addMethod(
  1579. '_even',
  1580. smalltalk.method({
  1581. selector: 'even',
  1582. fn: function (){
  1583. var self=this;
  1584. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_\\\\", [(2)])]);
  1585. return self;}
  1586. }),
  1587. smalltalk.Number);
  1588. smalltalk.addMethod(
  1589. '_odd',
  1590. smalltalk.method({
  1591. selector: 'odd',
  1592. fn: function (){
  1593. var self=this;
  1594. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1595. return self;}
  1596. }),
  1597. smalltalk.Number);
  1598. smalltalk.addMethod(
  1599. '_negated',
  1600. smalltalk.method({
  1601. selector: 'negated',
  1602. fn: function (){
  1603. var self=this;
  1604. return (0) - self;
  1605. return self;}
  1606. }),
  1607. smalltalk.Number);
  1608. smalltalk.addMethod(
  1609. '__eq_eq',
  1610. smalltalk.method({
  1611. selector: '==',
  1612. fn: function (aNumber){
  1613. var self=this;
  1614. try{(($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
  1615. return Number(self) === Number(aNumber);
  1616. return self;
  1617. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  1618. }),
  1619. smalltalk.Number);
  1620. smalltalk.addMethod(
  1621. '_printShowingDecimalPlaces_',
  1622. smalltalk.method({
  1623. selector: 'printShowingDecimalPlaces:',
  1624. fn: function (placesDesired){
  1625. var self=this;
  1626. return self.toFixed(placesDesired);
  1627. return self;}
  1628. }),
  1629. smalltalk.Number);
  1630. smalltalk.addMethod(
  1631. '_\\',
  1632. smalltalk.method({
  1633. selector: '\\',
  1634. fn: function (aNumber){
  1635. var self=this;
  1636. return self % aNumber;
  1637. return self;}
  1638. }),
  1639. smalltalk.Number);
  1640. smalltalk.addMethod(
  1641. '_pi',
  1642. smalltalk.method({
  1643. selector: 'pi',
  1644. fn: function (){
  1645. var self=this;
  1646. return Math.PI;
  1647. return self;}
  1648. }),
  1649. smalltalk.Number.klass);
  1650. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1651. smalltalk.addMethod(
  1652. '_compiledSource',
  1653. smalltalk.method({
  1654. selector: 'compiledSource',
  1655. fn: function (){
  1656. var self=this;
  1657. return self.toString();
  1658. return self;}
  1659. }),
  1660. smalltalk.BlockClosure);
  1661. smalltalk.addMethod(
  1662. '_whileTrue_',
  1663. smalltalk.method({
  1664. selector: 'whileTrue:',
  1665. fn: function (aBlock){
  1666. var self=this;
  1667. while(self()) {aBlock()};
  1668. return self;}
  1669. }),
  1670. smalltalk.BlockClosure);
  1671. smalltalk.addMethod(
  1672. '_whileFalse_',
  1673. smalltalk.method({
  1674. selector: 'whileFalse:',
  1675. fn: function (aBlock){
  1676. var self=this;
  1677. while(!self()) {aBlock()};
  1678. return self;}
  1679. }),
  1680. smalltalk.BlockClosure);
  1681. smalltalk.addMethod(
  1682. '_value',
  1683. smalltalk.method({
  1684. selector: 'value',
  1685. fn: function (){
  1686. var self=this;
  1687. return self();;
  1688. return self;}
  1689. }),
  1690. smalltalk.BlockClosure);
  1691. smalltalk.addMethod(
  1692. '_value_',
  1693. smalltalk.method({
  1694. selector: 'value:',
  1695. fn: function (anArg){
  1696. var self=this;
  1697. return self(anArg);;
  1698. return self;}
  1699. }),
  1700. smalltalk.BlockClosure);
  1701. smalltalk.addMethod(
  1702. '_value_value_',
  1703. smalltalk.method({
  1704. selector: 'value:value:',
  1705. fn: function (firstArg, secondArg){
  1706. var self=this;
  1707. return self(firstArg, secondArg);;
  1708. return self;}
  1709. }),
  1710. smalltalk.BlockClosure);
  1711. smalltalk.addMethod(
  1712. '_value_value_value_',
  1713. smalltalk.method({
  1714. selector: 'value:value:value:',
  1715. fn: function (firstArg, secondArg, thirdArg){
  1716. var self=this;
  1717. return self(firstArg, secondArg, thirdArg);;
  1718. return self;}
  1719. }),
  1720. smalltalk.BlockClosure);
  1721. smalltalk.addMethod(
  1722. '_valueWithPossibleArguments_',
  1723. smalltalk.method({
  1724. selector: 'valueWithPossibleArguments:',
  1725. fn: function (aCollection){
  1726. var self=this;
  1727. return self.apply(null, aCollection);;
  1728. return self;}
  1729. }),
  1730. smalltalk.BlockClosure);
  1731. smalltalk.addMethod(
  1732. '_on_do_',
  1733. smalltalk.method({
  1734. selector: 'on:do:',
  1735. fn: function (anErrorClass, aBlock){
  1736. var self=this;
  1737. smalltalk.send(self, "_try_catch_", [self, (function(error){return (($receiver = smalltalk.send(error, "_isKindOf_", [anErrorClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value_", [error]);})() : (function(){return smalltalk.send(error, "_signal", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [error]);}), (function(){return smalltalk.send(error, "_signal", []);})]);})]);
  1738. return self;}
  1739. }),
  1740. smalltalk.BlockClosure);
  1741. smalltalk.addMethod(
  1742. '_valueWithTimeout_',
  1743. smalltalk.method({
  1744. selector: 'valueWithTimeout:',
  1745. fn: function (aNumber){
  1746. var self=this;
  1747. return setTimeout(self, aNumber);
  1748. return self;}
  1749. }),
  1750. smalltalk.BlockClosure);
  1751. smalltalk.addMethod(
  1752. '_valueWithInterval_',
  1753. smalltalk.method({
  1754. selector: 'valueWithInterval:',
  1755. fn: function (aNumber){
  1756. var self=this;
  1757. return setInterval(self, aNumber);
  1758. return self;}
  1759. }),
  1760. smalltalk.BlockClosure);
  1761. smalltalk.addMethod(
  1762. '_whileFalse',
  1763. smalltalk.method({
  1764. selector: 'whileFalse',
  1765. fn: function (){
  1766. var self=this;
  1767. smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
  1768. return self;}
  1769. }),
  1770. smalltalk.BlockClosure);
  1771. smalltalk.addMethod(
  1772. '_whileTrue',
  1773. smalltalk.method({
  1774. selector: 'whileTrue',
  1775. fn: function (){
  1776. var self=this;
  1777. smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
  1778. return self;}
  1779. }),
  1780. smalltalk.BlockClosure);
  1781. smalltalk.addMethod(
  1782. '_new',
  1783. smalltalk.method({
  1784. selector: 'new',
  1785. fn: function (){
  1786. var self=this;
  1787. return new self();
  1788. return self;}
  1789. }),
  1790. smalltalk.BlockClosure);
  1791. smalltalk.addMethod(
  1792. '_applyTo_arguments_',
  1793. smalltalk.method({
  1794. selector: 'applyTo:arguments:',
  1795. fn: function (anObject, aCollection){
  1796. var self=this;
  1797. return self.apply(anObject, aCollection);
  1798. return self;}
  1799. }),
  1800. smalltalk.BlockClosure);
  1801. smalltalk.addMethod(
  1802. '_timeToRun',
  1803. smalltalk.method({
  1804. selector: 'timeToRun',
  1805. fn: function (){
  1806. var self=this;
  1807. return smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [self]);
  1808. return self;}
  1809. }),
  1810. smalltalk.BlockClosure);
  1811. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  1812. smalltalk.addMethod(
  1813. '__eq',
  1814. smalltalk.method({
  1815. selector: '=',
  1816. fn: function (aBoolean){
  1817. var self=this;
  1818. try{(($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  1819. return Boolean(self == true) == aBoolean;
  1820. return self;
  1821. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  1822. }),
  1823. smalltalk.Boolean);
  1824. smalltalk.addMethod(
  1825. '_shallowCopy',
  1826. smalltalk.method({
  1827. selector: 'shallowCopy',
  1828. fn: function (){
  1829. var self=this;
  1830. return self;
  1831. return self;}
  1832. }),
  1833. smalltalk.Boolean);
  1834. smalltalk.addMethod(
  1835. '_deepCopy',
  1836. smalltalk.method({
  1837. selector: 'deepCopy',
  1838. fn: function (){
  1839. var self=this;
  1840. return self;
  1841. return self;}
  1842. }),
  1843. smalltalk.Boolean);
  1844. smalltalk.addMethod(
  1845. '_ifTrue_',
  1846. smalltalk.method({
  1847. selector: 'ifTrue:',
  1848. fn: function (aBlock){
  1849. var self=this;
  1850. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  1851. return self;}
  1852. }),
  1853. smalltalk.Boolean);
  1854. smalltalk.addMethod(
  1855. '_ifFalse_',
  1856. smalltalk.method({
  1857. selector: 'ifFalse:',
  1858. fn: function (aBlock){
  1859. var self=this;
  1860. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  1861. return self;}
  1862. }),
  1863. smalltalk.Boolean);
  1864. smalltalk.addMethod(
  1865. '_ifFalse_ifTrue_',
  1866. smalltalk.method({
  1867. selector: 'ifFalse:ifTrue:',
  1868. fn: function (aBlock, anotherBlock){
  1869. var self=this;
  1870. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1871. return self;}
  1872. }),
  1873. smalltalk.Boolean);
  1874. smalltalk.addMethod(
  1875. '_ifTrue_ifFalse_',
  1876. smalltalk.method({
  1877. selector: 'ifTrue:ifFalse:',
  1878. fn: function (aBlock, anotherBlock){
  1879. var self=this;
  1880. if(self == true) {
  1881. return aBlock();
  1882. } else {
  1883. return anotherBlock();
  1884. }
  1885. ;
  1886. return self;}
  1887. }),
  1888. smalltalk.Boolean);
  1889. smalltalk.addMethod(
  1890. '_and_',
  1891. smalltalk.method({
  1892. selector: 'and:',
  1893. fn: function (aBlock){
  1894. var self=this;
  1895. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  1896. return self;}
  1897. }),
  1898. smalltalk.Boolean);
  1899. smalltalk.addMethod(
  1900. '_or_',
  1901. smalltalk.method({
  1902. selector: 'or:',
  1903. fn: function (aBlock){
  1904. var self=this;
  1905. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  1906. return self;}
  1907. }),
  1908. smalltalk.Boolean);
  1909. smalltalk.addMethod(
  1910. '_not',
  1911. smalltalk.method({
  1912. selector: 'not',
  1913. fn: function (){
  1914. var self=this;
  1915. return smalltalk.send(self, "__eq", [false]);
  1916. return self;}
  1917. }),
  1918. smalltalk.Boolean);
  1919. smalltalk.addMethod(
  1920. '_printString',
  1921. smalltalk.method({
  1922. selector: 'printString',
  1923. fn: function (){
  1924. var self=this;
  1925. return self.toString();
  1926. return self;}
  1927. }),
  1928. smalltalk.Boolean);
  1929. smalltalk.addMethod(
  1930. '_asJSONObject',
  1931. smalltalk.method({
  1932. selector: 'asJSONObject',
  1933. fn: function (){
  1934. var self=this;
  1935. return self;
  1936. return self;}
  1937. }),
  1938. smalltalk.Boolean);
  1939. smalltalk.addMethod(
  1940. '_&',
  1941. smalltalk.method({
  1942. selector: '&',
  1943. fn: function (aBoolean){
  1944. var self=this;
  1945. if(self == true) {
  1946. return aBoolean;
  1947. } else {
  1948. return false;
  1949. }
  1950. ;
  1951. return self;}
  1952. }),
  1953. smalltalk.Boolean);
  1954. smalltalk.addMethod(
  1955. '_|',
  1956. smalltalk.method({
  1957. selector: '|',
  1958. fn: function (aBoolean){
  1959. var self=this;
  1960. if(self == true) {
  1961. return true;
  1962. } else {
  1963. return aBoolean;
  1964. }
  1965. ;
  1966. return self;}
  1967. }),
  1968. smalltalk.Boolean);
  1969. smalltalk.addMethod(
  1970. '__eq_eq',
  1971. smalltalk.method({
  1972. selector: '==',
  1973. fn: function (aBoolean){
  1974. var self=this;
  1975. try{(($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
  1976. return Boolean(self == true) === Boolean(aBoolean == true);
  1977. return self;
  1978. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  1979. }),
  1980. smalltalk.Boolean);
  1981. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  1982. smalltalk.addMethod(
  1983. '_year',
  1984. smalltalk.method({
  1985. selector: 'year',
  1986. fn: function (){
  1987. var self=this;
  1988. return self.getFullYear();
  1989. return self;}
  1990. }),
  1991. smalltalk.Date);
  1992. smalltalk.addMethod(
  1993. '_month',
  1994. smalltalk.method({
  1995. selector: 'month',
  1996. fn: function (){
  1997. var self=this;
  1998. return self.getMonth() + 1;
  1999. return self;}
  2000. }),
  2001. smalltalk.Date);
  2002. smalltalk.addMethod(
  2003. '_month_',
  2004. smalltalk.method({
  2005. selector: 'month:',
  2006. fn: function (aNumber){
  2007. var self=this;
  2008. self.setMonth(aNumber - 1);
  2009. return self;}
  2010. }),
  2011. smalltalk.Date);
  2012. smalltalk.addMethod(
  2013. '_day',
  2014. smalltalk.method({
  2015. selector: 'day',
  2016. fn: function (){
  2017. var self=this;
  2018. return smalltalk.send(self, "_dayOfWeek", []);
  2019. return self;}
  2020. }),
  2021. smalltalk.Date);
  2022. smalltalk.addMethod(
  2023. '_dayOfWeek',
  2024. smalltalk.method({
  2025. selector: 'dayOfWeek',
  2026. fn: function (){
  2027. var self=this;
  2028. return self.getDay() + 1;
  2029. return self;}
  2030. }),
  2031. smalltalk.Date);
  2032. smalltalk.addMethod(
  2033. '_dayOfWeek_',
  2034. smalltalk.method({
  2035. selector: 'dayOfWeek:',
  2036. fn: function (aNumber){
  2037. var self=this;
  2038. return self.setDay(aNumber - 1);
  2039. return self;}
  2040. }),
  2041. smalltalk.Date);
  2042. smalltalk.addMethod(
  2043. '_day_',
  2044. smalltalk.method({
  2045. selector: 'day:',
  2046. fn: function (aNumber){
  2047. var self=this;
  2048. smalltalk.send(self, "_day_", [aNumber]);
  2049. return self;}
  2050. }),
  2051. smalltalk.Date);
  2052. smalltalk.addMethod(
  2053. '_year_',
  2054. smalltalk.method({
  2055. selector: 'year:',
  2056. fn: function (aNumber){
  2057. var self=this;
  2058. self.setFullYear(aNumber);
  2059. return self;}
  2060. }),
  2061. smalltalk.Date);
  2062. smalltalk.addMethod(
  2063. '_dayOfMonth',
  2064. smalltalk.method({
  2065. selector: 'dayOfMonth',
  2066. fn: function (){
  2067. var self=this;
  2068. return self.getDate();
  2069. return self;}
  2070. }),
  2071. smalltalk.Date);
  2072. smalltalk.addMethod(
  2073. '_dayOfMonth_',
  2074. smalltalk.method({
  2075. selector: 'dayOfMonth:',
  2076. fn: function (aNumber){
  2077. var self=this;
  2078. self.setDate(aNumber);
  2079. return self;}
  2080. }),
  2081. smalltalk.Date);
  2082. smalltalk.addMethod(
  2083. '_asString',
  2084. smalltalk.method({
  2085. selector: 'asString',
  2086. fn: function (){
  2087. var self=this;
  2088. return self.toString();
  2089. return self;}
  2090. }),
  2091. smalltalk.Date);
  2092. smalltalk.addMethod(
  2093. '_printString',
  2094. smalltalk.method({
  2095. selector: 'printString',
  2096. fn: function (){
  2097. var self=this;
  2098. return smalltalk.send(self, "_asString", []);
  2099. return self;}
  2100. }),
  2101. smalltalk.Date);
  2102. smalltalk.addMethod(
  2103. '_asMilliseconds',
  2104. smalltalk.method({
  2105. selector: 'asMilliseconds',
  2106. fn: function (){
  2107. var self=this;
  2108. return smalltalk.send(self, "_time", []);
  2109. return self;}
  2110. }),
  2111. smalltalk.Date);
  2112. smalltalk.addMethod(
  2113. '_time',
  2114. smalltalk.method({
  2115. selector: 'time',
  2116. fn: function (){
  2117. var self=this;
  2118. return self.getTime();
  2119. return self;}
  2120. }),
  2121. smalltalk.Date);
  2122. smalltalk.addMethod(
  2123. '_time_',
  2124. smalltalk.method({
  2125. selector: 'time:',
  2126. fn: function (aNumber){
  2127. var self=this;
  2128. self.setTime(aNumber);
  2129. return self;}
  2130. }),
  2131. smalltalk.Date);
  2132. smalltalk.addMethod(
  2133. '_asDateString',
  2134. smalltalk.method({
  2135. selector: 'asDateString',
  2136. fn: function (){
  2137. var self=this;
  2138. return self.toDateString();
  2139. return self;}
  2140. }),
  2141. smalltalk.Date);
  2142. smalltalk.addMethod(
  2143. '_asTimeString',
  2144. smalltalk.method({
  2145. selector: 'asTimeString',
  2146. fn: function (){
  2147. var self=this;
  2148. return self.toTimeString();
  2149. return self;}
  2150. }),
  2151. smalltalk.Date);
  2152. smalltalk.addMethod(
  2153. '_asLocaleString',
  2154. smalltalk.method({
  2155. selector: 'asLocaleString',
  2156. fn: function (){
  2157. var self=this;
  2158. return self.toLocaleString();
  2159. return self;}
  2160. }),
  2161. smalltalk.Date);
  2162. smalltalk.addMethod(
  2163. '_asNumber',
  2164. smalltalk.method({
  2165. selector: 'asNumber',
  2166. fn: function (){
  2167. var self=this;
  2168. return smalltalk.send(self, "_asMilliseconds", []);
  2169. return self;}
  2170. }),
  2171. smalltalk.Date);
  2172. smalltalk.addMethod(
  2173. '_hours_',
  2174. smalltalk.method({
  2175. selector: 'hours:',
  2176. fn: function (aNumber){
  2177. var self=this;
  2178. self.setHours(aNumber);
  2179. return self;}
  2180. }),
  2181. smalltalk.Date);
  2182. smalltalk.addMethod(
  2183. '_minutes_',
  2184. smalltalk.method({
  2185. selector: 'minutes:',
  2186. fn: function (aNumber){
  2187. var self=this;
  2188. self.setMinutes(aNumber);
  2189. return self;}
  2190. }),
  2191. smalltalk.Date);
  2192. smalltalk.addMethod(
  2193. '_seconds_',
  2194. smalltalk.method({
  2195. selector: 'seconds:',
  2196. fn: function (aNumber){
  2197. var self=this;
  2198. self.setSeconds(aNumber);
  2199. return self;}
  2200. }),
  2201. smalltalk.Date);
  2202. smalltalk.addMethod(
  2203. '_milliseconds_',
  2204. smalltalk.method({
  2205. selector: 'milliseconds:',
  2206. fn: function (aNumber){
  2207. var self=this;
  2208. self.setMilliseconds(aNumber);
  2209. return self;}
  2210. }),
  2211. smalltalk.Date);
  2212. smalltalk.addMethod(
  2213. '_hours',
  2214. smalltalk.method({
  2215. selector: 'hours',
  2216. fn: function (){
  2217. var self=this;
  2218. return self.getHours();
  2219. return self;}
  2220. }),
  2221. smalltalk.Date);
  2222. smalltalk.addMethod(
  2223. '_minutes',
  2224. smalltalk.method({
  2225. selector: 'minutes',
  2226. fn: function (){
  2227. var self=this;
  2228. return self.getMinutes();
  2229. return self;}
  2230. }),
  2231. smalltalk.Date);
  2232. smalltalk.addMethod(
  2233. '_seconds',
  2234. smalltalk.method({
  2235. selector: 'seconds',
  2236. fn: function (){
  2237. var self=this;
  2238. return self.getSeconds();
  2239. return self;}
  2240. }),
  2241. smalltalk.Date);
  2242. smalltalk.addMethod(
  2243. '_milliseconds',
  2244. smalltalk.method({
  2245. selector: 'milliseconds',
  2246. fn: function (){
  2247. var self=this;
  2248. return self.getMilliseconds();
  2249. return self;}
  2250. }),
  2251. smalltalk.Date);
  2252. smalltalk.addMethod(
  2253. '__lt',
  2254. smalltalk.method({
  2255. selector: '<',
  2256. fn: function (aDate){
  2257. var self=this;
  2258. return self < aDate;
  2259. return self;}
  2260. }),
  2261. smalltalk.Date);
  2262. smalltalk.addMethod(
  2263. '__gt',
  2264. smalltalk.method({
  2265. selector: '>',
  2266. fn: function (aDate){
  2267. var self=this;
  2268. return self > aDate;
  2269. return self;}
  2270. }),
  2271. smalltalk.Date);
  2272. smalltalk.addMethod(
  2273. '__lt_eq',
  2274. smalltalk.method({
  2275. selector: '<=',
  2276. fn: function (aDate){
  2277. var self=this;
  2278. self <= aDate;
  2279. return self;}
  2280. }),
  2281. smalltalk.Date);
  2282. smalltalk.addMethod(
  2283. '__gt_eq',
  2284. smalltalk.method({
  2285. selector: '>=',
  2286. fn: function (aDate){
  2287. var self=this;
  2288. self >= aDate;
  2289. return self;}
  2290. }),
  2291. smalltalk.Date);
  2292. smalltalk.addMethod(
  2293. '__minus',
  2294. smalltalk.method({
  2295. selector: '-',
  2296. fn: function (aDate){
  2297. var self=this;
  2298. return self - aDate;
  2299. return self;}
  2300. }),
  2301. smalltalk.Date);
  2302. smalltalk.addMethod(
  2303. '__plus',
  2304. smalltalk.method({
  2305. selector: '+',
  2306. fn: function (aDate){
  2307. var self=this;
  2308. return self + aDate;
  2309. return self;}
  2310. }),
  2311. smalltalk.Date);
  2312. smalltalk.addMethod(
  2313. '_asJSONObject',
  2314. smalltalk.method({
  2315. selector: 'asJSONObject',
  2316. fn: function (){
  2317. var self=this;
  2318. return self;
  2319. return self;}
  2320. }),
  2321. smalltalk.Date);
  2322. smalltalk.addMethod(
  2323. '_new_',
  2324. smalltalk.method({
  2325. selector: 'new:',
  2326. fn: function (anObject){
  2327. var self=this;
  2328. return new Date(anObject);
  2329. return self;}
  2330. }),
  2331. smalltalk.Date.klass);
  2332. smalltalk.addMethod(
  2333. '_fromString_',
  2334. smalltalk.method({
  2335. selector: 'fromString:',
  2336. fn: function (aString){
  2337. var self=this;
  2338. return smalltalk.send(self, "_new_", [aString]);
  2339. return self;}
  2340. }),
  2341. smalltalk.Date.klass);
  2342. smalltalk.addMethod(
  2343. '_fromSeconds_',
  2344. smalltalk.method({
  2345. selector: 'fromSeconds:',
  2346. fn: function (aNumber){
  2347. var self=this;
  2348. return smalltalk.send(self, "_fromMilliseconds_", [(($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])]);
  2349. return self;}
  2350. }),
  2351. smalltalk.Date.klass);
  2352. smalltalk.addMethod(
  2353. '_fromMilliseconds_',
  2354. smalltalk.method({
  2355. selector: 'fromMilliseconds:',
  2356. fn: function (aNumber){
  2357. var self=this;
  2358. return smalltalk.send(self, "_new_", [aNumber]);
  2359. return self;}
  2360. }),
  2361. smalltalk.Date.klass);
  2362. smalltalk.addMethod(
  2363. '_today',
  2364. smalltalk.method({
  2365. selector: 'today',
  2366. fn: function (){
  2367. var self=this;
  2368. return smalltalk.send(self, "_new", []);
  2369. return self;}
  2370. }),
  2371. smalltalk.Date.klass);
  2372. smalltalk.addMethod(
  2373. '_now',
  2374. smalltalk.method({
  2375. selector: 'now',
  2376. fn: function (){
  2377. var self=this;
  2378. return smalltalk.send(self, "_today", []);
  2379. return self;}
  2380. }),
  2381. smalltalk.Date.klass);
  2382. smalltalk.addMethod(
  2383. '_millisecondsToRun_',
  2384. smalltalk.method({
  2385. selector: 'millisecondsToRun:',
  2386. fn: function (aBlock){
  2387. var self=this;
  2388. var t=nil;
  2389. t=smalltalk.send((smalltalk.Date || Date), "_now", []);
  2390. smalltalk.send(aBlock, "_value", []);
  2391. return (($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]);
  2392. return self;}
  2393. }),
  2394. smalltalk.Date.klass);
  2395. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2396. smalltalk.addMethod(
  2397. '_subclass_instanceVariableNames_',
  2398. smalltalk.method({
  2399. selector: 'subclass:instanceVariableNames:',
  2400. fn: function (aString, anotherString){
  2401. var self=this;
  2402. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  2403. return self;}
  2404. }),
  2405. smalltalk.UndefinedObject);
  2406. smalltalk.addMethod(
  2407. '_subclass_instanceVariableNames_category_',
  2408. smalltalk.method({
  2409. selector: 'subclass:instanceVariableNames:category:',
  2410. fn: function (aString, aString2, aString3){
  2411. var self=this;
  2412. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  2413. return self;}
  2414. }),
  2415. smalltalk.UndefinedObject);
  2416. smalltalk.addMethod(
  2417. '_shallowCopy',
  2418. smalltalk.method({
  2419. selector: 'shallowCopy',
  2420. fn: function (){
  2421. var self=this;
  2422. return self;
  2423. return self;}
  2424. }),
  2425. smalltalk.UndefinedObject);
  2426. smalltalk.addMethod(
  2427. '_deepCopy',
  2428. smalltalk.method({
  2429. selector: 'deepCopy',
  2430. fn: function (){
  2431. var self=this;
  2432. return self;
  2433. return self;}
  2434. }),
  2435. smalltalk.UndefinedObject);
  2436. smalltalk.addMethod(
  2437. '_ifNil_',
  2438. smalltalk.method({
  2439. selector: 'ifNil:',
  2440. fn: function (aBlock){
  2441. var self=this;
  2442. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2443. return self;}
  2444. }),
  2445. smalltalk.UndefinedObject);
  2446. smalltalk.addMethod(
  2447. '_ifNotNil_',
  2448. smalltalk.method({
  2449. selector: 'ifNotNil:',
  2450. fn: function (aBlock){
  2451. var self=this;
  2452. return self;
  2453. return self;}
  2454. }),
  2455. smalltalk.UndefinedObject);
  2456. smalltalk.addMethod(
  2457. '_ifNil_ifNotNil_',
  2458. smalltalk.method({
  2459. selector: 'ifNil:ifNotNil:',
  2460. fn: function (aBlock, anotherBlock){
  2461. var self=this;
  2462. return smalltalk.send(aBlock, "_value", []);
  2463. return self;}
  2464. }),
  2465. smalltalk.UndefinedObject);
  2466. smalltalk.addMethod(
  2467. '_ifNotNil_ifNil_',
  2468. smalltalk.method({
  2469. selector: 'ifNotNil:ifNil:',
  2470. fn: function (aBlock, anotherBlock){
  2471. var self=this;
  2472. return smalltalk.send(anotherBlock, "_value", []);
  2473. return self;}
  2474. }),
  2475. smalltalk.UndefinedObject);
  2476. smalltalk.addMethod(
  2477. '_isNil',
  2478. smalltalk.method({
  2479. selector: 'isNil',
  2480. fn: function (){
  2481. var self=this;
  2482. return true;
  2483. return self;}
  2484. }),
  2485. smalltalk.UndefinedObject);
  2486. smalltalk.addMethod(
  2487. '_notNil',
  2488. smalltalk.method({
  2489. selector: 'notNil',
  2490. fn: function (){
  2491. var self=this;
  2492. return false;
  2493. return self;}
  2494. }),
  2495. smalltalk.UndefinedObject);
  2496. smalltalk.addMethod(
  2497. '_printString',
  2498. smalltalk.method({
  2499. selector: 'printString',
  2500. fn: function (){
  2501. var self=this;
  2502. return "nil";
  2503. return self;}
  2504. }),
  2505. smalltalk.UndefinedObject);
  2506. smalltalk.addMethod(
  2507. '_subclass_instanceVariableNames_package_',
  2508. smalltalk.method({
  2509. selector: 'subclass:instanceVariableNames:package:',
  2510. fn: function (aString, aString2, aString3){
  2511. var self=this;
  2512. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  2513. return self;}
  2514. }),
  2515. smalltalk.UndefinedObject);
  2516. smalltalk.addMethod(
  2517. '_new',
  2518. smalltalk.method({
  2519. selector: 'new',
  2520. fn: function (){
  2521. var self=this;
  2522. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2523. return self;}
  2524. }),
  2525. smalltalk.UndefinedObject.klass);
  2526. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  2527. smalltalk.addMethod(
  2528. '_size',
  2529. smalltalk.method({
  2530. selector: 'size',
  2531. fn: function (){
  2532. var self=this;
  2533. smalltalk.send(self, "_subclassResponsibility", []);
  2534. return self;}
  2535. }),
  2536. smalltalk.Collection);
  2537. smalltalk.addMethod(
  2538. '_readStream',
  2539. smalltalk.method({
  2540. selector: 'readStream',
  2541. fn: function (){
  2542. var self=this;
  2543. return smalltalk.send(self, "_stream", []);
  2544. return self;}
  2545. }),
  2546. smalltalk.Collection);
  2547. smalltalk.addMethod(
  2548. '_writeStream',
  2549. smalltalk.method({
  2550. selector: 'writeStream',
  2551. fn: function (){
  2552. var self=this;
  2553. return smalltalk.send(self, "_stream", []);
  2554. return self;}
  2555. }),
  2556. smalltalk.Collection);
  2557. smalltalk.addMethod(
  2558. '_stream',
  2559. smalltalk.method({
  2560. selector: 'stream',
  2561. fn: function (){
  2562. var self=this;
  2563. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  2564. return self;}
  2565. }),
  2566. smalltalk.Collection);
  2567. smalltalk.addMethod(
  2568. '_streamClass',
  2569. smalltalk.method({
  2570. selector: 'streamClass',
  2571. fn: function (){
  2572. var self=this;
  2573. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  2574. return self;}
  2575. }),
  2576. smalltalk.Collection);
  2577. smalltalk.addMethod(
  2578. '_add_',
  2579. smalltalk.method({
  2580. selector: 'add:',
  2581. fn: function (anObject){
  2582. var self=this;
  2583. smalltalk.send(self, "_subclassResponsibility", []);
  2584. return self;}
  2585. }),
  2586. smalltalk.Collection);
  2587. smalltalk.addMethod(
  2588. '_addAll_',
  2589. smalltalk.method({
  2590. selector: 'addAll:',
  2591. fn: function (aCollection){
  2592. var self=this;
  2593. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  2594. return aCollection;
  2595. return self;}
  2596. }),
  2597. smalltalk.Collection);
  2598. smalltalk.addMethod(
  2599. '__comma',
  2600. smalltalk.method({
  2601. selector: ',',
  2602. fn: function (aCollection){
  2603. var self=this;
  2604. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2605. return self;}
  2606. }),
  2607. smalltalk.Collection);
  2608. smalltalk.addMethod(
  2609. '_copyWith_',
  2610. smalltalk.method({
  2611. selector: 'copyWith:',
  2612. fn: function (anObject){
  2613. var self=this;
  2614. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2615. return self;}
  2616. }),
  2617. smalltalk.Collection);
  2618. smalltalk.addMethod(
  2619. '_copyWithAll_',
  2620. smalltalk.method({
  2621. selector: 'copyWithAll:',
  2622. fn: function (aCollection){
  2623. var self=this;
  2624. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2625. return self;}
  2626. }),
  2627. smalltalk.Collection);
  2628. smalltalk.addMethod(
  2629. '_asArray',
  2630. smalltalk.method({
  2631. selector: 'asArray',
  2632. fn: function (){
  2633. var self=this;
  2634. var array=nil;
  2635. var index=nil;
  2636. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  2637. index=(0);
  2638. smalltalk.send(self, "_do_", [(function(each){index=(($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);return smalltalk.send(array, "_at_put_", [index, each]);})]);
  2639. return array;
  2640. return self;}
  2641. }),
  2642. smalltalk.Collection);
  2643. smalltalk.addMethod(
  2644. '_do_',
  2645. smalltalk.method({
  2646. selector: 'do:',
  2647. fn: function (aBlock){
  2648. var self=this;
  2649. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  2650. return self;}
  2651. }),
  2652. smalltalk.Collection);
  2653. smalltalk.addMethod(
  2654. '_collect_',
  2655. smalltalk.method({
  2656. selector: 'collect:',
  2657. fn: function (aBlock){
  2658. var self=this;
  2659. var newCollection=nil;
  2660. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2661. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  2662. return newCollection;
  2663. return self;}
  2664. }),
  2665. smalltalk.Collection);
  2666. smalltalk.addMethod(
  2667. '_detect_',
  2668. smalltalk.method({
  2669. selector: 'detect:',
  2670. fn: function (aBlock){
  2671. var self=this;
  2672. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2673. return self;}
  2674. }),
  2675. smalltalk.Collection);
  2676. smalltalk.addMethod(
  2677. '_detect_ifNone_',
  2678. smalltalk.method({
  2679. selector: 'detect:ifNone:',
  2680. fn: function (aBlock, anotherBlock){
  2681. var self=this;
  2682. for(var i = 0; i < self.length; i++)
  2683. if(aBlock(self[i]))
  2684. return self[i];
  2685. return anotherBlock();
  2686. ;
  2687. return self;}
  2688. }),
  2689. smalltalk.Collection);
  2690. smalltalk.addMethod(
  2691. '_do_separatedBy_',
  2692. smalltalk.method({
  2693. selector: 'do:separatedBy:',
  2694. fn: function (aBlock, anotherBlock){
  2695. var self=this;
  2696. var first=nil;
  2697. first=true;
  2698. smalltalk.send(self, "_do_", [(function(each){(($receiver = first).klass === smalltalk.Boolean) ? ($receiver ? (function(){return first=false;})() : (function(){return smalltalk.send(anotherBlock, "_value", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return first=false;}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]);return smalltalk.send(aBlock, "_value_", [each]);})]);
  2699. return self;}
  2700. }),
  2701. smalltalk.Collection);
  2702. smalltalk.addMethod(
  2703. '_inject_into_',
  2704. smalltalk.method({
  2705. selector: 'inject:into:',
  2706. fn: function (anObject, aBlock){
  2707. var self=this;
  2708. var result=nil;
  2709. result=anObject;
  2710. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  2711. return result;
  2712. return self;}
  2713. }),
  2714. smalltalk.Collection);
  2715. smalltalk.addMethod(
  2716. '_reject_',
  2717. smalltalk.method({
  2718. selector: 'reject:',
  2719. fn: function (aBlock){
  2720. var self=this;
  2721. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  2722. return self;}
  2723. }),
  2724. smalltalk.Collection);
  2725. smalltalk.addMethod(
  2726. '_select_',
  2727. smalltalk.method({
  2728. selector: 'select:',
  2729. fn: function (aBlock){
  2730. var self=this;
  2731. var stream=nil;
  2732. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  2733. smalltalk.send(self, "_do_", [(function(each){return (($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(stream, "_nextPut_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]);})]);
  2734. return smalltalk.send(stream, "_contents", []);
  2735. return self;}
  2736. }),
  2737. smalltalk.Collection);
  2738. smalltalk.addMethod(
  2739. '_errorNotFound',
  2740. smalltalk.method({
  2741. selector: 'errorNotFound',
  2742. fn: function (){
  2743. var self=this;
  2744. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  2745. return self;}
  2746. }),
  2747. smalltalk.Collection);
  2748. smalltalk.addMethod(
  2749. '_includes_',
  2750. smalltalk.method({
  2751. selector: 'includes:',
  2752. fn: function (anObject){
  2753. var self=this;
  2754. var i = self.length;
  2755. while (i--) {
  2756. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  2757. }
  2758. return false
  2759. ;
  2760. return self;}
  2761. }),
  2762. smalltalk.Collection);
  2763. smalltalk.addMethod(
  2764. '_notEmpty',
  2765. smalltalk.method({
  2766. selector: 'notEmpty',
  2767. fn: function (){
  2768. var self=this;
  2769. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  2770. return self;}
  2771. }),
  2772. smalltalk.Collection);
  2773. smalltalk.addMethod(
  2774. '_isEmpty',
  2775. smalltalk.method({
  2776. selector: 'isEmpty',
  2777. fn: function (){
  2778. var self=this;
  2779. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  2780. return self;}
  2781. }),
  2782. smalltalk.Collection);
  2783. smalltalk.addMethod(
  2784. '_remove_',
  2785. smalltalk.method({
  2786. selector: 'remove:',
  2787. fn: function (anObject){
  2788. var self=this;
  2789. smalltalk.send(self, "_subclassResponsibility", []);
  2790. return self;}
  2791. }),
  2792. smalltalk.Collection);
  2793. smalltalk.addMethod(
  2794. '_asSet',
  2795. smalltalk.method({
  2796. selector: 'asSet',
  2797. fn: function (){
  2798. var self=this;
  2799. return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
  2800. return self;}
  2801. }),
  2802. smalltalk.Collection);
  2803. smalltalk.addMethod(
  2804. '_ifNotEmpty_',
  2805. smalltalk.method({
  2806. selector: 'ifNotEmpty:',
  2807. fn: function (aBlock){
  2808. var self=this;
  2809. smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
  2810. return self;}
  2811. }),
  2812. smalltalk.Collection);
  2813. smalltalk.addMethod(
  2814. '_ifEmpty_',
  2815. smalltalk.method({
  2816. selector: 'ifEmpty:',
  2817. fn: function (aBlock){
  2818. var self=this;
  2819. smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_ifTrue_", [aBlock]);
  2820. return self;}
  2821. }),
  2822. smalltalk.Collection);
  2823. smalltalk.addMethod(
  2824. '_streamClass',
  2825. smalltalk.method({
  2826. selector: 'streamClass',
  2827. fn: function (){
  2828. var self=this;
  2829. return (smalltalk.Stream || Stream);
  2830. return self;}
  2831. }),
  2832. smalltalk.Collection.klass);
  2833. smalltalk.addMethod(
  2834. '_with_',
  2835. smalltalk.method({
  2836. selector: 'with:',
  2837. fn: function (anObject){
  2838. var self=this;
  2839. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2840. return self;}
  2841. }),
  2842. smalltalk.Collection.klass);
  2843. smalltalk.addMethod(
  2844. '_with_with_',
  2845. smalltalk.method({
  2846. selector: 'with:with:',
  2847. fn: function (anObject, anotherObject){
  2848. var self=this;
  2849. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2850. return self;}
  2851. }),
  2852. smalltalk.Collection.klass);
  2853. smalltalk.addMethod(
  2854. '_with_with_with_',
  2855. smalltalk.method({
  2856. selector: 'with:with:with:',
  2857. fn: function (firstObject, secondObject, thirdObject){
  2858. var self=this;
  2859. 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", []));
  2860. return self;}
  2861. }),
  2862. smalltalk.Collection.klass);
  2863. smalltalk.addMethod(
  2864. '_withAll_',
  2865. smalltalk.method({
  2866. selector: 'withAll:',
  2867. fn: function (aCollection){
  2868. var self=this;
  2869. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2870. return self;}
  2871. }),
  2872. smalltalk.Collection.klass);
  2873. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  2874. smalltalk.addMethod(
  2875. '_at_',
  2876. smalltalk.method({
  2877. selector: 'at:',
  2878. fn: function (anIndex){
  2879. var self=this;
  2880. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2881. return self;}
  2882. }),
  2883. smalltalk.SequenceableCollection);
  2884. smalltalk.addMethod(
  2885. '_at_ifAbsent_',
  2886. smalltalk.method({
  2887. selector: 'at:ifAbsent:',
  2888. fn: function (anIndex, aBlock){
  2889. var self=this;
  2890. smalltalk.send(self, "_subclassResponsibility", []);
  2891. return self;}
  2892. }),
  2893. smalltalk.SequenceableCollection);
  2894. smalltalk.addMethod(
  2895. '_at_put_',
  2896. smalltalk.method({
  2897. selector: 'at:put:',
  2898. fn: function (anIndex, anObject){
  2899. var self=this;
  2900. smalltalk.send(self, "_subclassResponsibility", []);
  2901. return self;}
  2902. }),
  2903. smalltalk.SequenceableCollection);
  2904. smalltalk.addMethod(
  2905. '_copyFrom_to_',
  2906. smalltalk.method({
  2907. selector: 'copyFrom:to:',
  2908. fn: function (anIndex, anotherIndex){
  2909. var self=this;
  2910. smalltalk.send(self, "_subclassResponsibility", []);
  2911. return self;}
  2912. }),
  2913. smalltalk.SequenceableCollection);
  2914. smalltalk.addMethod(
  2915. '_first',
  2916. smalltalk.method({
  2917. selector: 'first',
  2918. fn: function (){
  2919. var self=this;
  2920. return smalltalk.send(self, "_at_", [(1)]);
  2921. return self;}
  2922. }),
  2923. smalltalk.SequenceableCollection);
  2924. smalltalk.addMethod(
  2925. '_fourth',
  2926. smalltalk.method({
  2927. selector: 'fourth',
  2928. fn: function (){
  2929. var self=this;
  2930. return smalltalk.send(self, "_at_", [(4)]);
  2931. return self;}
  2932. }),
  2933. smalltalk.SequenceableCollection);
  2934. smalltalk.addMethod(
  2935. '_last',
  2936. smalltalk.method({
  2937. selector: 'last',
  2938. fn: function (){
  2939. var self=this;
  2940. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  2941. return self;}
  2942. }),
  2943. smalltalk.SequenceableCollection);
  2944. smalltalk.addMethod(
  2945. '_second',
  2946. smalltalk.method({
  2947. selector: 'second',
  2948. fn: function (){
  2949. var self=this;
  2950. return smalltalk.send(self, "_at_", [(2)]);
  2951. return self;}
  2952. }),
  2953. smalltalk.SequenceableCollection);
  2954. smalltalk.addMethod(
  2955. '_third',
  2956. smalltalk.method({
  2957. selector: 'third',
  2958. fn: function (){
  2959. var self=this;
  2960. return smalltalk.send(self, "_at_", [(3)]);
  2961. return self;}
  2962. }),
  2963. smalltalk.SequenceableCollection);
  2964. smalltalk.addMethod(
  2965. '_removeLast',
  2966. smalltalk.method({
  2967. selector: 'removeLast',
  2968. fn: function (){
  2969. var self=this;
  2970. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  2971. return self;}
  2972. }),
  2973. smalltalk.SequenceableCollection);
  2974. smalltalk.addMethod(
  2975. '_addLast_',
  2976. smalltalk.method({
  2977. selector: 'addLast:',
  2978. fn: function (anObject){
  2979. var self=this;
  2980. smalltalk.send(self, "_add_", [anObject]);
  2981. return self;}
  2982. }),
  2983. smalltalk.SequenceableCollection);
  2984. smalltalk.addMethod(
  2985. '_withIndexDo_',
  2986. smalltalk.method({
  2987. selector: 'withIndexDo:',
  2988. fn: function (aBlock){
  2989. var self=this;
  2990. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  2991. return self;}
  2992. }),
  2993. smalltalk.SequenceableCollection);
  2994. smalltalk.addMethod(
  2995. '_allButFirst',
  2996. smalltalk.method({
  2997. selector: 'allButFirst',
  2998. fn: function (){
  2999. var self=this;
  3000. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  3001. return self;}
  3002. }),
  3003. smalltalk.SequenceableCollection);
  3004. smalltalk.addMethod(
  3005. '_allButLast',
  3006. smalltalk.method({
  3007. selector: 'allButLast',
  3008. fn: function (){
  3009. var self=this;
  3010. return smalltalk.send(self, "_copyFrom_to_", [(1), (($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])]);
  3011. return self;}
  3012. }),
  3013. smalltalk.SequenceableCollection);
  3014. smalltalk.addMethod(
  3015. '_indexOf_',
  3016. smalltalk.method({
  3017. selector: 'indexOf:',
  3018. fn: function (anObject){
  3019. var self=this;
  3020. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3021. return self;}
  3022. }),
  3023. smalltalk.SequenceableCollection);
  3024. smalltalk.addMethod(
  3025. '_indexOf_ifAbsent_',
  3026. smalltalk.method({
  3027. selector: 'indexOf:ifAbsent:',
  3028. fn: function (anObject, aBlock){
  3029. var self=this;
  3030. for(var i=0;i<self.length;i++){
  3031. if(self[i].__eq(anObject)) {return i+1}
  3032. }
  3033. return aBlock();
  3034. ;
  3035. return self;}
  3036. }),
  3037. smalltalk.SequenceableCollection);
  3038. smalltalk.addMethod(
  3039. '_indexOf_startingAt_ifAbsent_',
  3040. smalltalk.method({
  3041. selector: 'indexOf:startingAt:ifAbsent:',
  3042. fn: function (anObject, start, aBlock){
  3043. var self=this;
  3044. for(var i=start-1;i<self.length;i++){
  3045. if(self[i].__eq(anObject)) {return i+1}
  3046. }
  3047. return aBlock();
  3048. ;
  3049. return self;}
  3050. }),
  3051. smalltalk.SequenceableCollection);
  3052. smalltalk.addMethod(
  3053. '_indexOf_startingAt_',
  3054. smalltalk.method({
  3055. selector: 'indexOf:startingAt:',
  3056. fn: function (anObject, start){
  3057. var self=this;
  3058. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  3059. return self;}
  3060. }),
  3061. smalltalk.SequenceableCollection);
  3062. smalltalk.addMethod(
  3063. '_reversed',
  3064. smalltalk.method({
  3065. selector: 'reversed',
  3066. fn: function (){
  3067. var self=this;
  3068. smalltalk.send(self, "_subclassResponsibility", []);
  3069. return self;}
  3070. }),
  3071. smalltalk.SequenceableCollection);
  3072. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  3073. smalltalk.addMethod(
  3074. '__eq',
  3075. smalltalk.method({
  3076. selector: '=',
  3077. fn: function (aString){
  3078. var self=this;
  3079. try{(($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  3080. return String(self) == aString;
  3081. return self;
  3082. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  3083. }),
  3084. smalltalk.String);
  3085. smalltalk.addMethod(
  3086. '_size',
  3087. smalltalk.method({
  3088. selector: 'size',
  3089. fn: function (){
  3090. var self=this;
  3091. return self.length;
  3092. return self;}
  3093. }),
  3094. smalltalk.String);
  3095. smalltalk.addMethod(
  3096. '_at_',
  3097. smalltalk.method({
  3098. selector: 'at:',
  3099. fn: function (anIndex){
  3100. var self=this;
  3101. return self[anIndex - 1];
  3102. return self;}
  3103. }),
  3104. smalltalk.String);
  3105. smalltalk.addMethod(
  3106. '_at_put_',
  3107. smalltalk.method({
  3108. selector: 'at:put:',
  3109. fn: function (anIndex, anObject){
  3110. var self=this;
  3111. smalltalk.send(self, "_errorReadOnly", []);
  3112. return self;}
  3113. }),
  3114. smalltalk.String);
  3115. smalltalk.addMethod(
  3116. '_at_ifAbsent_',
  3117. smalltalk.method({
  3118. selector: 'at:ifAbsent:',
  3119. fn: function (anIndex, aBlock){
  3120. var self=this;
  3121. (($receiver = smalltalk.send(self, "_at_", [anIndex])) == nil || $receiver == undefined) ? (function(){return aBlock;})() : $receiver;
  3122. return self;}
  3123. }),
  3124. smalltalk.String);
  3125. smalltalk.addMethod(
  3126. '_escaped',
  3127. smalltalk.method({
  3128. selector: 'escaped',
  3129. fn: function (){
  3130. var self=this;
  3131. return escape(self);
  3132. return self;}
  3133. }),
  3134. smalltalk.String);
  3135. smalltalk.addMethod(
  3136. '_unescaped',
  3137. smalltalk.method({
  3138. selector: 'unescaped',
  3139. fn: function (){
  3140. var self=this;
  3141. return unescape(self);
  3142. return self;}
  3143. }),
  3144. smalltalk.String);
  3145. smalltalk.addMethod(
  3146. '_add_',
  3147. smalltalk.method({
  3148. selector: 'add:',
  3149. fn: function (anObject){
  3150. var self=this;
  3151. smalltalk.send(self, "_errorReadOnly", []);
  3152. return self;}
  3153. }),
  3154. smalltalk.String);
  3155. smalltalk.addMethod(
  3156. '__comma',
  3157. smalltalk.method({
  3158. selector: ',',
  3159. fn: function (aString){
  3160. var self=this;
  3161. return self + aString;
  3162. return self;}
  3163. }),
  3164. smalltalk.String);
  3165. smalltalk.addMethod(
  3166. '_copyFrom_to_',
  3167. smalltalk.method({
  3168. selector: 'copyFrom:to:',
  3169. fn: function (anIndex, anotherIndex){
  3170. var self=this;
  3171. return self.substring(anIndex - 1, anotherIndex);
  3172. return self;}
  3173. }),
  3174. smalltalk.String);
  3175. smalltalk.addMethod(
  3176. '_shallowCopy',
  3177. smalltalk.method({
  3178. selector: 'shallowCopy',
  3179. fn: function (){
  3180. var self=this;
  3181. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  3182. return self;}
  3183. }),
  3184. smalltalk.String);
  3185. smalltalk.addMethod(
  3186. '_deepCopy',
  3187. smalltalk.method({
  3188. selector: 'deepCopy',
  3189. fn: function (){
  3190. var self=this;
  3191. return smalltalk.send(self, "_shallowCopy", []);
  3192. return self;}
  3193. }),
  3194. smalltalk.String);
  3195. smalltalk.addMethod(
  3196. '_asSelector',
  3197. smalltalk.method({
  3198. selector: 'asSelector',
  3199. fn: function (){
  3200. var self=this;
  3201. var selector=nil;
  3202. selector=smalltalk.send("_", "__comma", [self]);
  3203. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  3204. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  3205. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  3206. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  3207. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  3208. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  3209. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  3210. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  3211. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  3212. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  3213. return selector;
  3214. return self;}
  3215. }),
  3216. smalltalk.String);
  3217. smalltalk.addMethod(
  3218. '_asJavascript',
  3219. smalltalk.method({
  3220. selector: 'asJavascript',
  3221. fn: function (){
  3222. var self=this;
  3223. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  3224. return "unescape(\"" + escape(self) + "\")";
  3225. else
  3226. return "\"" + self + "\"";
  3227. ;
  3228. return self;}
  3229. }),
  3230. smalltalk.String);
  3231. smalltalk.addMethod(
  3232. '_replace_with_',
  3233. smalltalk.method({
  3234. selector: 'replace:with:',
  3235. fn: function (aString, anotherString){
  3236. var self=this;
  3237. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  3238. return self;}
  3239. }),
  3240. smalltalk.String);
  3241. smalltalk.addMethod(
  3242. '_replaceRegexp_with_',
  3243. smalltalk.method({
  3244. selector: 'replaceRegexp:with:',
  3245. fn: function (aRegexp, aString){
  3246. var self=this;
  3247. return self.replace(aRegexp, aString);
  3248. return self;}
  3249. }),
  3250. smalltalk.String);
  3251. smalltalk.addMethod(
  3252. '_tokenize_',
  3253. smalltalk.method({
  3254. selector: 'tokenize:',
  3255. fn: function (aString){
  3256. var self=this;
  3257. return self.split(aString);
  3258. return self;}
  3259. }),
  3260. smalltalk.String);
  3261. smalltalk.addMethod(
  3262. '_match_',
  3263. smalltalk.method({
  3264. selector: 'match:',
  3265. fn: function (aRegexp){
  3266. var self=this;
  3267. return self.search(aRegexp) != -1;
  3268. return self;}
  3269. }),
  3270. smalltalk.String);
  3271. smalltalk.addMethod(
  3272. '_asString',
  3273. smalltalk.method({
  3274. selector: 'asString',
  3275. fn: function (){
  3276. var self=this;
  3277. return self;
  3278. return self;}
  3279. }),
  3280. smalltalk.String);
  3281. smalltalk.addMethod(
  3282. '_asNumber',
  3283. smalltalk.method({
  3284. selector: 'asNumber',
  3285. fn: function (){
  3286. var self=this;
  3287. return Number(self);
  3288. return self;}
  3289. }),
  3290. smalltalk.String);
  3291. smalltalk.addMethod(
  3292. '_errorReadOnly',
  3293. smalltalk.method({
  3294. selector: 'errorReadOnly',
  3295. fn: function (){
  3296. var self=this;
  3297. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  3298. return self;}
  3299. }),
  3300. smalltalk.String);
  3301. smalltalk.addMethod(
  3302. '_printString',
  3303. smalltalk.method({
  3304. selector: 'printString',
  3305. fn: function (){
  3306. var self=this;
  3307. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  3308. return self;}
  3309. }),
  3310. smalltalk.String);
  3311. smalltalk.addMethod(
  3312. '_printNl',
  3313. smalltalk.method({
  3314. selector: 'printNl',
  3315. fn: function (){
  3316. var self=this;
  3317. console.log(self);
  3318. return self;}
  3319. }),
  3320. smalltalk.String);
  3321. smalltalk.addMethod(
  3322. '_isString',
  3323. smalltalk.method({
  3324. selector: 'isString',
  3325. fn: function (){
  3326. var self=this;
  3327. return true;
  3328. return self;}
  3329. }),
  3330. smalltalk.String);
  3331. smalltalk.addMethod(
  3332. '__gt',
  3333. smalltalk.method({
  3334. selector: '>',
  3335. fn: function (aString){
  3336. var self=this;
  3337. return String(self) > aString;
  3338. return self;}
  3339. }),
  3340. smalltalk.String);
  3341. smalltalk.addMethod(
  3342. '__lt',
  3343. smalltalk.method({
  3344. selector: '<',
  3345. fn: function (aString){
  3346. var self=this;
  3347. return String(self) < aString;
  3348. return self;}
  3349. }),
  3350. smalltalk.String);
  3351. smalltalk.addMethod(
  3352. '__gt_eq',
  3353. smalltalk.method({
  3354. selector: '>=',
  3355. fn: function (aString){
  3356. var self=this;
  3357. return String(self) >= aString;
  3358. return self;}
  3359. }),
  3360. smalltalk.String);
  3361. smalltalk.addMethod(
  3362. '__lt_eq',
  3363. smalltalk.method({
  3364. selector: '<=',
  3365. fn: function (aString){
  3366. var self=this;
  3367. return String(self) <= aString;
  3368. return self;}
  3369. }),
  3370. smalltalk.String);
  3371. smalltalk.addMethod(
  3372. '_remove_',
  3373. smalltalk.method({
  3374. selector: 'remove:',
  3375. fn: function (anObject){
  3376. var self=this;
  3377. smalltalk.send(self, "_errorReadOnly", []);
  3378. return self;}
  3379. }),
  3380. smalltalk.String);
  3381. smalltalk.addMethod(
  3382. '_asJSONObject',
  3383. smalltalk.method({
  3384. selector: 'asJSONObject',
  3385. fn: function (){
  3386. var self=this;
  3387. return self;
  3388. return self;}
  3389. }),
  3390. smalltalk.String);
  3391. smalltalk.addMethod(
  3392. '_trimLeft_',
  3393. smalltalk.method({
  3394. selector: 'trimLeft:',
  3395. fn: function (separators){
  3396. var self=this;
  3397. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5E%5B"), "__comma", [separators]), "__comma", [unescape("%5D+")]), "g"]), ""]);
  3398. return self;}
  3399. }),
  3400. smalltalk.String);
  3401. smalltalk.addMethod(
  3402. '_trimRight_',
  3403. smalltalk.method({
  3404. selector: 'trimRight:',
  3405. fn: function (separators){
  3406. var self=this;
  3407. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [separators]), "__comma", [unescape("%5D+%24")]), "g"]), ""]);
  3408. return self;}
  3409. }),
  3410. smalltalk.String);
  3411. smalltalk.addMethod(
  3412. '_trimLeft',
  3413. smalltalk.method({
  3414. selector: 'trimLeft',
  3415. fn: function (){
  3416. var self=this;
  3417. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  3418. return self;}
  3419. }),
  3420. smalltalk.String);
  3421. smalltalk.addMethod(
  3422. '_trimRight',
  3423. smalltalk.method({
  3424. selector: 'trimRight',
  3425. fn: function (){
  3426. var self=this;
  3427. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  3428. return self;}
  3429. }),
  3430. smalltalk.String);
  3431. smalltalk.addMethod(
  3432. '_trimBoth',
  3433. smalltalk.method({
  3434. selector: 'trimBoth',
  3435. fn: function (){
  3436. var self=this;
  3437. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  3438. return self;}
  3439. }),
  3440. smalltalk.String);
  3441. smalltalk.addMethod(
  3442. '_trimBoth_',
  3443. smalltalk.method({
  3444. selector: 'trimBoth:',
  3445. fn: function (separators){
  3446. var self=this;
  3447. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  3448. return self;}
  3449. }),
  3450. smalltalk.String);
  3451. smalltalk.addMethod(
  3452. '_asLowercase',
  3453. smalltalk.method({
  3454. selector: 'asLowercase',
  3455. fn: function (){
  3456. var self=this;
  3457. return self.toLowerCase();
  3458. return self;}
  3459. }),
  3460. smalltalk.String);
  3461. smalltalk.addMethod(
  3462. '_asUppercase',
  3463. smalltalk.method({
  3464. selector: 'asUppercase',
  3465. fn: function (){
  3466. var self=this;
  3467. return self.toUpperCase();
  3468. return self;}
  3469. }),
  3470. smalltalk.String);
  3471. smalltalk.addMethod(
  3472. '_join_',
  3473. smalltalk.method({
  3474. selector: 'join:',
  3475. fn: function (aCollection){
  3476. var self=this;
  3477. return smalltalk.send((smalltalk.String || 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]);})]);})]);
  3478. return self;}
  3479. }),
  3480. smalltalk.String);
  3481. smalltalk.addMethod(
  3482. '_includesSubString_',
  3483. smalltalk.method({
  3484. selector: 'includesSubString:',
  3485. fn: function (subString){
  3486. var self=this;
  3487. return self.indexOf(subString) != -1 ;
  3488. return self;}
  3489. }),
  3490. smalltalk.String);
  3491. smalltalk.addMethod(
  3492. '_asciiValue',
  3493. smalltalk.method({
  3494. selector: 'asciiValue',
  3495. fn: function (){
  3496. var self=this;
  3497. return self.charCodeAt(0);;
  3498. return self;}
  3499. }),
  3500. smalltalk.String);
  3501. smalltalk.addMethod(
  3502. '_lineIndicesDo_',
  3503. smalltalk.method({
  3504. selector: 'lineIndicesDo:',
  3505. fn: function (aBlock){
  3506. var self=this;
  3507. try{var cr=nil;
  3508. var lf=nil;
  3509. var start=nil;
  3510. var sz=nil;
  3511. var nextLF=nil;
  3512. var nextCR=nil;
  3513. start=(1);
  3514. sz=smalltalk.send(self, "_size", []);
  3515. cr=smalltalk.send((smalltalk.String || String), "_cr", []);
  3516. nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]);
  3517. lf=smalltalk.send((smalltalk.String || String), "_lf", []);
  3518. nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]);
  3519. (function(){while((function(){return (($receiver = start).klass === smalltalk.Number) ? $receiver <=sz : smalltalk.send($receiver, "__lt_eq", [sz]);})()) {(function(){(($receiver = smalltalk.send(smalltalk.send(nextLF, "__eq", [(0)]), "_and_", [(function(){return smalltalk.send(nextCR, "__eq", [(0)]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw({name: 'stReturn', selector: '_lineIndicesDo_', fn: function(){return self}})})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw({name: 'stReturn', selector: '_lineIndicesDo_', fn: function(){return self}})})();})]);return (($receiver = smalltalk.send(smalltalk.send(nextCR, "__eq", [(0)]), "_or_", [(function(){return smalltalk.send((0) < nextLF, "_and_", [(function(){return (($receiver = nextLF).klass === smalltalk.Number) ? $receiver <nextCR : smalltalk.send($receiver, "__lt", [nextCR]);})]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextLF]);start=(1) + nextLF;return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);})() : (function(){return (($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextLF]);start=(1) + nextLF;nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextCR]);start=(1) + nextCR;return nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextLF]);start=(1) + nextLF;nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextCR]);start=(1) + nextCR;return nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);})]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextLF]);start=(1) + nextLF;return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);}), (function(){return (($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextLF]);start=(1) + nextLF;nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextCR]);start=(1) + nextCR;return nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextLF]);start=(1) + nextLF;nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);return nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]);}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, (($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), nextCR]);start=(1) + nextCR;return nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]);})]);})]);})()}})();
  3520. return self;
  3521. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}}
  3522. }),
  3523. smalltalk.String);
  3524. smalltalk.addMethod(
  3525. '_linesDo_',
  3526. smalltalk.method({
  3527. selector: 'linesDo:',
  3528. fn: function (aBlock){
  3529. var self=this;
  3530. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  3531. return self;}
  3532. }),
  3533. smalltalk.String);
  3534. smalltalk.addMethod(
  3535. '_lines',
  3536. smalltalk.method({
  3537. selector: 'lines',
  3538. fn: function (){
  3539. var self=this;
  3540. var lines=nil;
  3541. lines=smalltalk.send((smalltalk.Array || Array), "_new", []);
  3542. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  3543. return lines;
  3544. return self;}
  3545. }),
  3546. smalltalk.String);
  3547. smalltalk.addMethod(
  3548. '_lineNumber_',
  3549. smalltalk.method({
  3550. selector: 'lineNumber:',
  3551. fn: function (anIndex){
  3552. var self=this;
  3553. try{var lineCount=nil;
  3554. lineCount=(0);
  3555. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return (($receiver = smalltalk.send(lineCount=(($receiver = lineCount).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]), "__eq", [anIndex])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})})();})]);})]);
  3556. (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
  3557. return self;
  3558. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}}
  3559. }),
  3560. smalltalk.String);
  3561. smalltalk.addMethod(
  3562. '_reversed',
  3563. smalltalk.method({
  3564. selector: 'reversed',
  3565. fn: function (){
  3566. var self=this;
  3567. return self.split("").reverse().join("");
  3568. return self;}
  3569. }),
  3570. smalltalk.String);
  3571. smalltalk.addMethod(
  3572. '__eq_eq',
  3573. smalltalk.method({
  3574. selector: '==',
  3575. fn: function (aString){
  3576. var self=this;
  3577. try{(($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]);
  3578. return String(self) === String(aString);
  3579. return self;
  3580. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  3581. }),
  3582. smalltalk.String);
  3583. smalltalk.addMethod(
  3584. '_streamClass',
  3585. smalltalk.method({
  3586. selector: 'streamClass',
  3587. fn: function (){
  3588. var self=this;
  3589. return (smalltalk.StringStream || StringStream);
  3590. return self;}
  3591. }),
  3592. smalltalk.String.klass);
  3593. smalltalk.addMethod(
  3594. '_fromString_',
  3595. smalltalk.method({
  3596. selector: 'fromString:',
  3597. fn: function (aString){
  3598. var self=this;
  3599. return new self.fn(aString);
  3600. return self;}
  3601. }),
  3602. smalltalk.String.klass);
  3603. smalltalk.addMethod(
  3604. '_cr',
  3605. smalltalk.method({
  3606. selector: 'cr',
  3607. fn: function (){
  3608. var self=this;
  3609. return '\r';
  3610. return self;}
  3611. }),
  3612. smalltalk.String.klass);
  3613. smalltalk.addMethod(
  3614. '_lf',
  3615. smalltalk.method({
  3616. selector: 'lf',
  3617. fn: function (){
  3618. var self=this;
  3619. return '\n';
  3620. return self;}
  3621. }),
  3622. smalltalk.String.klass);
  3623. smalltalk.addMethod(
  3624. '_space',
  3625. smalltalk.method({
  3626. selector: 'space',
  3627. fn: function (){
  3628. var self=this;
  3629. return ' ';
  3630. return self;}
  3631. }),
  3632. smalltalk.String.klass);
  3633. smalltalk.addMethod(
  3634. '_tab',
  3635. smalltalk.method({
  3636. selector: 'tab',
  3637. fn: function (){
  3638. var self=this;
  3639. return '\t';
  3640. return self;}
  3641. }),
  3642. smalltalk.String.klass);
  3643. smalltalk.addMethod(
  3644. '_crlf',
  3645. smalltalk.method({
  3646. selector: 'crlf',
  3647. fn: function (){
  3648. var self=this;
  3649. return '\r\n';
  3650. return self;}
  3651. }),
  3652. smalltalk.String.klass);
  3653. smalltalk.addMethod(
  3654. '_streamContents_',
  3655. smalltalk.method({
  3656. selector: 'streamContents:',
  3657. fn: function (blockWithArg){
  3658. var self=this;
  3659. var stream=nil;
  3660. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]);
  3661. smalltalk.send(blockWithArg, "_value_", [stream]);
  3662. return smalltalk.send(stream, "_contents", []);
  3663. return self;}
  3664. }),
  3665. smalltalk.String.klass);
  3666. smalltalk.addMethod(
  3667. '_value_',
  3668. smalltalk.method({
  3669. selector: 'value:',
  3670. fn: function (aUTFCharCode){
  3671. var self=this;
  3672. return String.fromCharCode(aUTFCharCode);;
  3673. return self;}
  3674. }),
  3675. smalltalk.String.klass);
  3676. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  3677. smalltalk.addMethod(
  3678. '_size',
  3679. smalltalk.method({
  3680. selector: 'size',
  3681. fn: function (){
  3682. var self=this;
  3683. return self.length;
  3684. return self;}
  3685. }),
  3686. smalltalk.Array);
  3687. smalltalk.addMethod(
  3688. '_at_put_',
  3689. smalltalk.method({
  3690. selector: 'at:put:',
  3691. fn: function (anIndex, anObject){
  3692. var self=this;
  3693. return self[anIndex - 1] = anObject;
  3694. return self;}
  3695. }),
  3696. smalltalk.Array);
  3697. smalltalk.addMethod(
  3698. '_at_ifAbsent_',
  3699. smalltalk.method({
  3700. selector: 'at:ifAbsent:',
  3701. fn: function (anIndex, aBlock){
  3702. var self=this;
  3703. var value = self[anIndex - 1];
  3704. if(value === undefined) {
  3705. return aBlock();
  3706. } else {
  3707. return value;
  3708. }
  3709. ;
  3710. return self;}
  3711. }),
  3712. smalltalk.Array);
  3713. smalltalk.addMethod(
  3714. '_add_',
  3715. smalltalk.method({
  3716. selector: 'add:',
  3717. fn: function (anObject){
  3718. var self=this;
  3719. self.push(anObject); return anObject;;
  3720. return self;}
  3721. }),
  3722. smalltalk.Array);
  3723. smalltalk.addMethod(
  3724. '_shallowCopy',
  3725. smalltalk.method({
  3726. selector: 'shallowCopy',
  3727. fn: function (){
  3728. var self=this;
  3729. var newCollection=nil;
  3730. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3731. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  3732. return newCollection;
  3733. return self;}
  3734. }),
  3735. smalltalk.Array);
  3736. smalltalk.addMethod(
  3737. '_deepCopy',
  3738. smalltalk.method({
  3739. selector: 'deepCopy',
  3740. fn: function (){
  3741. var self=this;
  3742. var newCollection=nil;
  3743. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3744. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  3745. return newCollection;
  3746. return self;}
  3747. }),
  3748. smalltalk.Array);
  3749. smalltalk.addMethod(
  3750. '_copyFrom_to_',
  3751. smalltalk.method({
  3752. selector: 'copyFrom:to:',
  3753. fn: function (anIndex, anotherIndex){
  3754. var self=this;
  3755. var array=nil;
  3756. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3757. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  3758. return array;
  3759. return self;}
  3760. }),
  3761. smalltalk.Array);
  3762. smalltalk.addMethod(
  3763. '_join_',
  3764. smalltalk.method({
  3765. selector: 'join:',
  3766. fn: function (aString){
  3767. var self=this;
  3768. return self.join(aString);
  3769. return self;}
  3770. }),
  3771. smalltalk.Array);
  3772. smalltalk.addMethod(
  3773. '_asJavascript',
  3774. smalltalk.method({
  3775. selector: 'asJavascript',
  3776. fn: function (){
  3777. var self=this;
  3778. 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")]);
  3779. return self;}
  3780. }),
  3781. smalltalk.Array);
  3782. smalltalk.addMethod(
  3783. '_sort',
  3784. smalltalk.method({
  3785. selector: 'sort',
  3786. fn: function (){
  3787. var self=this;
  3788. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  3789. return self;}
  3790. }),
  3791. smalltalk.Array);
  3792. smalltalk.addMethod(
  3793. '_sort_',
  3794. smalltalk.method({
  3795. selector: 'sort:',
  3796. fn: function (aBlock){
  3797. var self=this;
  3798. return self.sort(function(a, b) {
  3799. if(aBlock(a,b)) {return -1} else {return 1}
  3800. })
  3801. ;
  3802. return self;}
  3803. }),
  3804. smalltalk.Array);
  3805. smalltalk.addMethod(
  3806. '_remove_',
  3807. smalltalk.method({
  3808. selector: 'remove:',
  3809. fn: function (anObject){
  3810. var self=this;
  3811. for(var i=0;i<self.length;i++) {
  3812. if(self[i] == anObject) {
  3813. self.splice(i,1);
  3814. break;
  3815. }
  3816. }
  3817. ;
  3818. return self;}
  3819. }),
  3820. smalltalk.Array);
  3821. smalltalk.addMethod(
  3822. '_sorted',
  3823. smalltalk.method({
  3824. selector: 'sorted',
  3825. fn: function (){
  3826. var self=this;
  3827. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  3828. return self;}
  3829. }),
  3830. smalltalk.Array);
  3831. smalltalk.addMethod(
  3832. '_sorted_',
  3833. smalltalk.method({
  3834. selector: 'sorted:',
  3835. fn: function (aBlock){
  3836. var self=this;
  3837. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  3838. return self;}
  3839. }),
  3840. smalltalk.Array);
  3841. smalltalk.addMethod(
  3842. '_asJSONObject',
  3843. smalltalk.method({
  3844. selector: 'asJSONObject',
  3845. fn: function (){
  3846. var self=this;
  3847. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  3848. return self;}
  3849. }),
  3850. smalltalk.Array);
  3851. smalltalk.addMethod(
  3852. '_removeFrom_to_',
  3853. smalltalk.method({
  3854. selector: 'removeFrom:to:',
  3855. fn: function (aNumber, anotherNumber){
  3856. var self=this;
  3857. self.splice(aNumber - 1,anotherNumber - 1);
  3858. return self;}
  3859. }),
  3860. smalltalk.Array);
  3861. smalltalk.addMethod(
  3862. '_printString',
  3863. smalltalk.method({
  3864. selector: 'printString',
  3865. fn: function (){
  3866. var self=this;
  3867. var str=nil;
  3868. str=smalltalk.send("", "_writeStream", []);
  3869. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  3870. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  3871. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  3872. return smalltalk.send(str, "_contents", []);
  3873. return self;}
  3874. }),
  3875. smalltalk.Array);
  3876. smalltalk.addMethod(
  3877. '_reversed',
  3878. smalltalk.method({
  3879. selector: 'reversed',
  3880. fn: function (){
  3881. var self=this;
  3882. return self._copy().reverse();
  3883. return self;}
  3884. }),
  3885. smalltalk.Array);
  3886. smalltalk.addMethod(
  3887. '__eq',
  3888. smalltalk.method({
  3889. selector: '=',
  3890. fn: function (aCollection){
  3891. var self=this;
  3892. try{(($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aCollection, "_size", [])]);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  3893. smalltalk.send(self, "_withIndexDo_", [(function(each, i){return (($receiver = smalltalk.send(smalltalk.send(aCollection, "_at_", [i]), "__eq", [each])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);})]);
  3894. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  3895. return self;
  3896. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  3897. }),
  3898. smalltalk.Array);
  3899. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  3900. smalltalk.addMethod(
  3901. '_compile_',
  3902. smalltalk.method({
  3903. selector: 'compile:',
  3904. fn: function (aString){
  3905. var self=this;
  3906. return self.compile(aString);
  3907. return self;}
  3908. }),
  3909. smalltalk.RegularExpression);
  3910. smalltalk.addMethod(
  3911. '_exec_',
  3912. smalltalk.method({
  3913. selector: 'exec:',
  3914. fn: function (aString){
  3915. var self=this;
  3916. return self.exec(aString) || nil;
  3917. return self;}
  3918. }),
  3919. smalltalk.RegularExpression);
  3920. smalltalk.addMethod(
  3921. '_test_',
  3922. smalltalk.method({
  3923. selector: 'test:',
  3924. fn: function (aString){
  3925. var self=this;
  3926. return self.test(aString);
  3927. return self;}
  3928. }),
  3929. smalltalk.RegularExpression);
  3930. smalltalk.addMethod(
  3931. '_fromString_flag_',
  3932. smalltalk.method({
  3933. selector: 'fromString:flag:',
  3934. fn: function (aString, anotherString){
  3935. var self=this;
  3936. return new RegExp(aString, anotherString);
  3937. return self;}
  3938. }),
  3939. smalltalk.RegularExpression.klass);
  3940. smalltalk.addMethod(
  3941. '_fromString_',
  3942. smalltalk.method({
  3943. selector: 'fromString:',
  3944. fn: function (aString){
  3945. var self=this;
  3946. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  3947. return self;}
  3948. }),
  3949. smalltalk.RegularExpression.klass);
  3950. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  3951. smalltalk.addMethod(
  3952. '_messageText',
  3953. smalltalk.method({
  3954. selector: 'messageText',
  3955. fn: function (){
  3956. var self=this;
  3957. return self['@messageText'];
  3958. return self;}
  3959. }),
  3960. smalltalk.Error);
  3961. smalltalk.addMethod(
  3962. '_messageText_',
  3963. smalltalk.method({
  3964. selector: 'messageText:',
  3965. fn: function (aString){
  3966. var self=this;
  3967. self['@messageText']=aString;
  3968. return self;}
  3969. }),
  3970. smalltalk.Error);
  3971. smalltalk.addMethod(
  3972. '_signal',
  3973. smalltalk.method({
  3974. selector: 'signal',
  3975. fn: function (){
  3976. var self=this;
  3977. self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  3978. return self;}
  3979. }),
  3980. smalltalk.Error);
  3981. smalltalk.addMethod(
  3982. '_context',
  3983. smalltalk.method({
  3984. selector: 'context',
  3985. fn: function (){
  3986. var self=this;
  3987. return self.context;
  3988. return self;}
  3989. }),
  3990. smalltalk.Error);
  3991. smalltalk.addMethod(
  3992. '_signal_',
  3993. smalltalk.method({
  3994. selector: 'signal:',
  3995. fn: function (aString){
  3996. var self=this;
  3997. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  3998. return self;}
  3999. }),
  4000. smalltalk.Error.klass);
  4001. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel');
  4002. smalltalk.addMethod(
  4003. '_receiver',
  4004. smalltalk.method({
  4005. selector: 'receiver',
  4006. fn: function (){
  4007. var self=this;
  4008. return self.receiver;
  4009. return self;}
  4010. }),
  4011. smalltalk.MethodContext);
  4012. smalltalk.addMethod(
  4013. '_selector',
  4014. smalltalk.method({
  4015. selector: 'selector',
  4016. fn: function (){
  4017. var self=this;
  4018. return smalltalk.convertSelector(self.selector);
  4019. return self;}
  4020. }),
  4021. smalltalk.MethodContext);
  4022. smalltalk.addMethod(
  4023. '_home',
  4024. smalltalk.method({
  4025. selector: 'home',
  4026. fn: function (){
  4027. var self=this;
  4028. return self.homeContext;
  4029. return self;}
  4030. }),
  4031. smalltalk.MethodContext);
  4032. smalltalk.addMethod(
  4033. '_temps',
  4034. smalltalk.method({
  4035. selector: 'temps',
  4036. fn: function (){
  4037. var self=this;
  4038. return self.temps;
  4039. return self;}
  4040. }),
  4041. smalltalk.MethodContext);
  4042. smalltalk.addMethod(
  4043. '_printString',
  4044. smalltalk.method({
  4045. selector: 'printString',
  4046. fn: function (){
  4047. var self=this;
  4048. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  4049. return self;}
  4050. }),
  4051. smalltalk.MethodContext);
  4052. smalltalk.addMethod(
  4053. '_asString',
  4054. smalltalk.method({
  4055. selector: 'asString',
  4056. fn: function (){
  4057. var self=this;
  4058. 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", [])]);
  4059. return self;}
  4060. }),
  4061. smalltalk.MethodContext);
  4062. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  4063. smalltalk.addMethod(
  4064. '__eq',
  4065. smalltalk.method({
  4066. selector: '=',
  4067. fn: function (anAssociation){
  4068. var self=this;
  4069. 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", [])]);})]);})]);
  4070. return self;}
  4071. }),
  4072. smalltalk.Association);
  4073. smalltalk.addMethod(
  4074. '_key_',
  4075. smalltalk.method({
  4076. selector: 'key:',
  4077. fn: function (aKey){
  4078. var self=this;
  4079. self['@key']=aKey;
  4080. return self;}
  4081. }),
  4082. smalltalk.Association);
  4083. smalltalk.addMethod(
  4084. '_key',
  4085. smalltalk.method({
  4086. selector: 'key',
  4087. fn: function (){
  4088. var self=this;
  4089. return self['@key'];
  4090. return self;}
  4091. }),
  4092. smalltalk.Association);
  4093. smalltalk.addMethod(
  4094. '_value_',
  4095. smalltalk.method({
  4096. selector: 'value:',
  4097. fn: function (aValue){
  4098. var self=this;
  4099. self['@value']=aValue;
  4100. return self;}
  4101. }),
  4102. smalltalk.Association);
  4103. smalltalk.addMethod(
  4104. '_value',
  4105. smalltalk.method({
  4106. selector: 'value',
  4107. fn: function (){
  4108. var self=this;
  4109. return self['@value'];
  4110. return self;}
  4111. }),
  4112. smalltalk.Association);
  4113. smalltalk.addMethod(
  4114. '_key_value_',
  4115. smalltalk.method({
  4116. selector: 'key:value:',
  4117. fn: function (aKey, aValue){
  4118. var self=this;
  4119. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4120. return self;}
  4121. }),
  4122. smalltalk.Association.klass);
  4123. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  4124. smalltalk.addMethod(
  4125. '__eq',
  4126. smalltalk.method({
  4127. selector: '=',
  4128. fn: function (aDictionary){
  4129. var self=this;
  4130. try{(($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aDictionary, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  4131. (($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aDictionary, "_size", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]);
  4132. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
  4133. return self;
  4134. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  4135. }),
  4136. smalltalk.Dictionary);
  4137. smalltalk.addMethod(
  4138. '_shallowCopy',
  4139. smalltalk.method({
  4140. selector: 'shallowCopy',
  4141. fn: function (){
  4142. var self=this;
  4143. var copy=nil;
  4144. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4145. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4146. return copy;
  4147. return self;}
  4148. }),
  4149. smalltalk.Dictionary);
  4150. smalltalk.addMethod(
  4151. '_initialize',
  4152. smalltalk.method({
  4153. selector: 'initialize',
  4154. fn: function (){
  4155. var self=this;
  4156. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  4157. self['@keys']=[];
  4158. return self;}
  4159. }),
  4160. smalltalk.Dictionary);
  4161. smalltalk.addMethod(
  4162. '_size',
  4163. smalltalk.method({
  4164. selector: 'size',
  4165. fn: function (){
  4166. var self=this;
  4167. return smalltalk.send(self['@keys'], "_size", []);
  4168. return self;}
  4169. }),
  4170. smalltalk.Dictionary);
  4171. smalltalk.addMethod(
  4172. '_associations',
  4173. smalltalk.method({
  4174. selector: 'associations',
  4175. fn: function (){
  4176. var self=this;
  4177. var associations=nil;
  4178. associations=[];
  4179. smalltalk.send(self['@keys'], "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send((smalltalk.Association || Association), "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
  4180. return associations;
  4181. return self;}
  4182. }),
  4183. smalltalk.Dictionary);
  4184. smalltalk.addMethod(
  4185. '_keys',
  4186. smalltalk.method({
  4187. selector: 'keys',
  4188. fn: function (){
  4189. var self=this;
  4190. return smalltalk.send(self['@keys'], "_copy", []);
  4191. return self;}
  4192. }),
  4193. smalltalk.Dictionary);
  4194. smalltalk.addMethod(
  4195. '_values',
  4196. smalltalk.method({
  4197. selector: 'values',
  4198. fn: function (){
  4199. var self=this;
  4200. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  4201. return self;}
  4202. }),
  4203. smalltalk.Dictionary);
  4204. smalltalk.addMethod(
  4205. '_at_put_',
  4206. smalltalk.method({
  4207. selector: 'at:put:',
  4208. fn: function (aKey, aValue){
  4209. var self=this;
  4210. (($receiver = smalltalk.send(self['@keys'], "_includes_", [aKey])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@keys'], "_add_", [aKey]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@keys'], "_add_", [aKey]);})]);
  4211. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  4212. return self;}
  4213. }),
  4214. smalltalk.Dictionary);
  4215. smalltalk.addMethod(
  4216. '_at_ifAbsent_',
  4217. smalltalk.method({
  4218. selector: 'at:ifAbsent:',
  4219. fn: function (aKey, aBlock){
  4220. var self=this;
  4221. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  4222. return self;}
  4223. }),
  4224. smalltalk.Dictionary);
  4225. smalltalk.addMethod(
  4226. '_at_ifAbsentPut_',
  4227. smalltalk.method({
  4228. selector: 'at:ifAbsentPut:',
  4229. fn: function (aKey, aBlock){
  4230. var self=this;
  4231. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  4232. return self;}
  4233. }),
  4234. smalltalk.Dictionary);
  4235. smalltalk.addMethod(
  4236. '_at_ifPresent_',
  4237. smalltalk.method({
  4238. selector: 'at:ifPresent:',
  4239. fn: function (aKey, aBlock){
  4240. var self=this;
  4241. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  4242. return self;}
  4243. }),
  4244. smalltalk.Dictionary);
  4245. smalltalk.addMethod(
  4246. '_at_ifPresent_ifAbsent_',
  4247. smalltalk.method({
  4248. selector: 'at:ifPresent:ifAbsent:',
  4249. fn: function (aKey, aBlock, anotherBlock){
  4250. var self=this;
  4251. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  4252. return self;}
  4253. }),
  4254. smalltalk.Dictionary);
  4255. smalltalk.addMethod(
  4256. '_add_',
  4257. smalltalk.method({
  4258. selector: 'add:',
  4259. fn: function (anAssociation){
  4260. var self=this;
  4261. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  4262. return self;}
  4263. }),
  4264. smalltalk.Dictionary);
  4265. smalltalk.addMethod(
  4266. '_addAll_',
  4267. smalltalk.method({
  4268. selector: 'addAll:',
  4269. fn: function (aDictionary){
  4270. var self=this;
  4271. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  4272. return aDictionary;
  4273. return self;}
  4274. }),
  4275. smalltalk.Dictionary);
  4276. smalltalk.addMethod(
  4277. '__comma',
  4278. smalltalk.method({
  4279. selector: ',',
  4280. fn: function (aCollection){
  4281. var self=this;
  4282. smalltalk.send(self, "_shouldNotImplement", []);
  4283. return self;}
  4284. }),
  4285. smalltalk.Dictionary);
  4286. smalltalk.addMethod(
  4287. '_copyFrom_to_',
  4288. smalltalk.method({
  4289. selector: 'copyFrom:to:',
  4290. fn: function (anIndex, anotherIndex){
  4291. var self=this;
  4292. smalltalk.send(self, "_shouldNotImplement", []);
  4293. return self;}
  4294. }),
  4295. smalltalk.Dictionary);
  4296. smalltalk.addMethod(
  4297. '_associationsDo_',
  4298. smalltalk.method({
  4299. selector: 'associationsDo:',
  4300. fn: function (aBlock){
  4301. var self=this;
  4302. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  4303. return self;}
  4304. }),
  4305. smalltalk.Dictionary);
  4306. smalltalk.addMethod(
  4307. '_keysAndValuesDo_',
  4308. smalltalk.method({
  4309. selector: 'keysAndValuesDo:',
  4310. fn: function (aBlock){
  4311. var self=this;
  4312. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4313. return self;}
  4314. }),
  4315. smalltalk.Dictionary);
  4316. smalltalk.addMethod(
  4317. '_do_',
  4318. smalltalk.method({
  4319. selector: 'do:',
  4320. fn: function (aBlock){
  4321. var self=this;
  4322. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  4323. return self;}
  4324. }),
  4325. smalltalk.Dictionary);
  4326. smalltalk.addMethod(
  4327. '_select_',
  4328. smalltalk.method({
  4329. selector: 'select:',
  4330. fn: function (aBlock){
  4331. var self=this;
  4332. var newDict=nil;
  4333. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4334. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return (($receiver = smalltalk.send(aBlock, "_value_", [value])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]);})]);
  4335. return newDict;
  4336. return self;}
  4337. }),
  4338. smalltalk.Dictionary);
  4339. smalltalk.addMethod(
  4340. '_collect_',
  4341. smalltalk.method({
  4342. selector: 'collect:',
  4343. fn: function (aBlock){
  4344. var self=this;
  4345. var newDict=nil;
  4346. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4347. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  4348. return newDict;
  4349. return self;}
  4350. }),
  4351. smalltalk.Dictionary);
  4352. smalltalk.addMethod(
  4353. '_detect_ifNone_',
  4354. smalltalk.method({
  4355. selector: 'detect:ifNone:',
  4356. fn: function (aBlock, anotherBlock){
  4357. var self=this;
  4358. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  4359. return self;}
  4360. }),
  4361. smalltalk.Dictionary);
  4362. smalltalk.addMethod(
  4363. '_includes_',
  4364. smalltalk.method({
  4365. selector: 'includes:',
  4366. fn: function (anObject){
  4367. var self=this;
  4368. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  4369. return self;}
  4370. }),
  4371. smalltalk.Dictionary);
  4372. smalltalk.addMethod(
  4373. '_remove_',
  4374. smalltalk.method({
  4375. selector: 'remove:',
  4376. fn: function (aKey){
  4377. var self=this;
  4378. smalltalk.send(self, "_removeKey_", [aKey]);
  4379. return self;}
  4380. }),
  4381. smalltalk.Dictionary);
  4382. smalltalk.addMethod(
  4383. '_removeKey_',
  4384. smalltalk.method({
  4385. selector: 'removeKey:',
  4386. fn: function (aKey){
  4387. var self=this;
  4388. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  4389. return self;}
  4390. }),
  4391. smalltalk.Dictionary);
  4392. smalltalk.addMethod(
  4393. '_at_',
  4394. smalltalk.method({
  4395. selector: 'at:',
  4396. fn: function (aKey){
  4397. var self=this;
  4398. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  4399. return self;}
  4400. }),
  4401. smalltalk.Dictionary);
  4402. smalltalk.addMethod(
  4403. '_asJSONObject',
  4404. smalltalk.method({
  4405. selector: 'asJSONObject',
  4406. fn: function (){
  4407. var self=this;
  4408. var object=nil;
  4409. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  4410. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  4411. return object;
  4412. return self;}
  4413. }),
  4414. smalltalk.Dictionary);
  4415. smalltalk.addMethod(
  4416. '_printString',
  4417. smalltalk.method({
  4418. selector: 'printString',
  4419. fn: function (){
  4420. var self=this;
  4421. return smalltalk.send((smalltalk.String || 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")]);})]);
  4422. return self;}
  4423. }),
  4424. smalltalk.Dictionary);
  4425. smalltalk.addMethod(
  4426. '_fromPairs_',
  4427. smalltalk.method({
  4428. selector: 'fromPairs:',
  4429. fn: function (aCollection){
  4430. var self=this;
  4431. var dict=nil;
  4432. dict=smalltalk.send(self, "_new", []);
  4433. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  4434. return dict;
  4435. return self;}
  4436. }),
  4437. smalltalk.Dictionary.klass);
  4438. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  4439. smalltalk.addMethod(
  4440. '_superclass_subclass_',
  4441. smalltalk.method({
  4442. selector: 'superclass:subclass:',
  4443. fn: function (aClass, aString){
  4444. var self=this;
  4445. return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
  4446. return self;}
  4447. }),
  4448. smalltalk.ClassBuilder);
  4449. smalltalk.addMethod(
  4450. '_class_instanceVariableNames_',
  4451. smalltalk.method({
  4452. selector: 'class:instanceVariableNames:',
  4453. fn: function (aClass, aString){
  4454. var self=this;
  4455. (($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]);
  4456. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  4457. smalltalk.send(self, "_setupClass_", [aClass]);
  4458. return self;}
  4459. }),
  4460. smalltalk.ClassBuilder);
  4461. smalltalk.addMethod(
  4462. '_instanceVariableNamesFor_',
  4463. smalltalk.method({
  4464. selector: 'instanceVariableNamesFor:',
  4465. fn: function (aString){
  4466. var self=this;
  4467. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  4468. return self;}
  4469. }),
  4470. smalltalk.ClassBuilder);
  4471. smalltalk.addMethod(
  4472. '_addSubclassOf_named_instanceVariableNames_',
  4473. smalltalk.method({
  4474. selector: 'addSubclassOf:named:instanceVariableNames:',
  4475. fn: function (aClass, aString, aCollection){
  4476. var self=this;
  4477. smalltalk.addClass(aString, aClass, aCollection);
  4478. return smalltalk[aString];
  4479. return self;}
  4480. }),
  4481. smalltalk.ClassBuilder);
  4482. smalltalk.addMethod(
  4483. '_setupClass_',
  4484. smalltalk.method({
  4485. selector: 'setupClass:',
  4486. fn: function (aClass){
  4487. var self=this;
  4488. smalltalk.init(aClass);;
  4489. return self;}
  4490. }),
  4491. smalltalk.ClassBuilder);
  4492. smalltalk.addMethod(
  4493. '_superclass_subclass_instanceVariableNames_module_',
  4494. smalltalk.method({
  4495. selector: 'superclass:subclass:instanceVariableNames:module:',
  4496. fn: function (aClass, aString, aString2, aString3){
  4497. var self=this;
  4498. var newClass=nil;
  4499. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_module_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]);
  4500. smalltalk.send(self, "_setupClass_", [newClass]);
  4501. return self;}
  4502. }),
  4503. smalltalk.ClassBuilder);
  4504. smalltalk.addMethod(
  4505. '_addSubclassOf_named_instanceVariableNames_module_',
  4506. smalltalk.method({
  4507. selector: 'addSubclassOf:named:instanceVariableNames:module:',
  4508. fn: function (aClass, aString, aCollection, moduleName){
  4509. var self=this;
  4510. smalltalk.addClass(aString, aClass, aCollection, moduleName);
  4511. return smalltalk[aString];
  4512. return self;}
  4513. }),
  4514. smalltalk.ClassBuilder);
  4515. smalltalk.addMethod(
  4516. '_superclass_subclass_instanceVariableNames_package_',
  4517. smalltalk.method({
  4518. selector: 'superclass:subclass:instanceVariableNames:package:',
  4519. fn: function (aClass, aString, aString2, aString3){
  4520. var self=this;
  4521. var newClass=nil;
  4522. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]);
  4523. smalltalk.send(self, "_setupClass_", [newClass]);
  4524. return self;}
  4525. }),
  4526. smalltalk.ClassBuilder);
  4527. smalltalk.addMethod(
  4528. '_addSubclassOf_named_instanceVariableNames_package_',
  4529. smalltalk.method({
  4530. selector: 'addSubclassOf:named:instanceVariableNames:package:',
  4531. fn: function (aClass, aString, aCollection, packageName){
  4532. var self=this;
  4533. smalltalk.addClass(aString, aClass, aCollection, packageName);
  4534. return smalltalk[aString];
  4535. return self;}
  4536. }),
  4537. smalltalk.ClassBuilder);
  4538. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  4539. smalltalk.addMethod(
  4540. '_initialize',
  4541. smalltalk.method({
  4542. selector: 'initialize',
  4543. fn: function (){
  4544. var self=this;
  4545. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4546. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  4547. return self;}
  4548. }),
  4549. smalltalk.ClassCategoryReader);
  4550. smalltalk.addMethod(
  4551. '_class_category_',
  4552. smalltalk.method({
  4553. selector: 'class:category:',
  4554. fn: function (aClass, aString){
  4555. var self=this;
  4556. self['@class']=aClass;
  4557. self['@category']=aString;
  4558. return self;}
  4559. }),
  4560. smalltalk.ClassCategoryReader);
  4561. smalltalk.addMethod(
  4562. '_scanFrom_',
  4563. smalltalk.method({
  4564. selector: 'scanFrom:',
  4565. fn: function (aChunkParser){
  4566. var self=this;
  4567. var chunk=nil;
  4568. (function(){while(!(function(){chunk=smalltalk.send(aChunkParser, "_nextChunk", []);return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  4569. return self;}
  4570. }),
  4571. smalltalk.ClassCategoryReader);
  4572. smalltalk.addMethod(
  4573. '_compileMethod_',
  4574. smalltalk.method({
  4575. selector: 'compileMethod:',
  4576. fn: function (aString){
  4577. var self=this;
  4578. var method=nil;
  4579. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self['@class']]);
  4580. smalltalk.send(method, "_category_", [self['@category']]);
  4581. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  4582. return self;}
  4583. }),
  4584. smalltalk.ClassCategoryReader);
  4585. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  4586. smalltalk.addMethod(
  4587. '_collection',
  4588. smalltalk.method({
  4589. selector: 'collection',
  4590. fn: function (){
  4591. var self=this;
  4592. return self['@collection'];
  4593. return self;}
  4594. }),
  4595. smalltalk.Stream);
  4596. smalltalk.addMethod(
  4597. '_setCollection_',
  4598. smalltalk.method({
  4599. selector: 'setCollection:',
  4600. fn: function (aCollection){
  4601. var self=this;
  4602. self['@collection']=aCollection;
  4603. return self;}
  4604. }),
  4605. smalltalk.Stream);
  4606. smalltalk.addMethod(
  4607. '_position',
  4608. smalltalk.method({
  4609. selector: 'position',
  4610. fn: function (){
  4611. var self=this;
  4612. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return self['@position']=(0);})() : $receiver;
  4613. return self;}
  4614. }),
  4615. smalltalk.Stream);
  4616. smalltalk.addMethod(
  4617. '_position_',
  4618. smalltalk.method({
  4619. selector: 'position:',
  4620. fn: function (anInteger){
  4621. var self=this;
  4622. self['@position']=anInteger;
  4623. return self;}
  4624. }),
  4625. smalltalk.Stream);
  4626. smalltalk.addMethod(
  4627. '_streamSize',
  4628. smalltalk.method({
  4629. selector: 'streamSize',
  4630. fn: function (){
  4631. var self=this;
  4632. return self['@streamSize'];
  4633. return self;}
  4634. }),
  4635. smalltalk.Stream);
  4636. smalltalk.addMethod(
  4637. '_setStreamSize_',
  4638. smalltalk.method({
  4639. selector: 'setStreamSize:',
  4640. fn: function (anInteger){
  4641. var self=this;
  4642. self['@streamSize']=anInteger;
  4643. return self;}
  4644. }),
  4645. smalltalk.Stream);
  4646. smalltalk.addMethod(
  4647. '_contents',
  4648. smalltalk.method({
  4649. selector: 'contents',
  4650. fn: function (){
  4651. var self=this;
  4652. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  4653. return self;}
  4654. }),
  4655. smalltalk.Stream);
  4656. smalltalk.addMethod(
  4657. '_size',
  4658. smalltalk.method({
  4659. selector: 'size',
  4660. fn: function (){
  4661. var self=this;
  4662. return smalltalk.send(self, "_streamSize", []);
  4663. return self;}
  4664. }),
  4665. smalltalk.Stream);
  4666. smalltalk.addMethod(
  4667. '_reset',
  4668. smalltalk.method({
  4669. selector: 'reset',
  4670. fn: function (){
  4671. var self=this;
  4672. smalltalk.send(self, "_position_", [(0)]);
  4673. return self;}
  4674. }),
  4675. smalltalk.Stream);
  4676. smalltalk.addMethod(
  4677. '_close',
  4678. smalltalk.method({
  4679. selector: 'close',
  4680. fn: function (){
  4681. var self=this;
  4682. return self;}
  4683. }),
  4684. smalltalk.Stream);
  4685. smalltalk.addMethod(
  4686. '_flush',
  4687. smalltalk.method({
  4688. selector: 'flush',
  4689. fn: function (){
  4690. var self=this;
  4691. return self;}
  4692. }),
  4693. smalltalk.Stream);
  4694. smalltalk.addMethod(
  4695. '_resetContents',
  4696. smalltalk.method({
  4697. selector: 'resetContents',
  4698. fn: function (){
  4699. var self=this;
  4700. smalltalk.send(self, "_reset", []);
  4701. smalltalk.send(self, "_setStreamSize_", [(0)]);
  4702. return self;}
  4703. }),
  4704. smalltalk.Stream);
  4705. smalltalk.addMethod(
  4706. '_do_',
  4707. smalltalk.method({
  4708. selector: 'do:',
  4709. fn: function (aBlock){
  4710. var self=this;
  4711. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  4712. return self;}
  4713. }),
  4714. smalltalk.Stream);
  4715. smalltalk.addMethod(
  4716. '_setToEnd',
  4717. smalltalk.method({
  4718. selector: 'setToEnd',
  4719. fn: function (){
  4720. var self=this;
  4721. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  4722. return self;}
  4723. }),
  4724. smalltalk.Stream);
  4725. smalltalk.addMethod(
  4726. '_skip_',
  4727. smalltalk.method({
  4728. selector: 'skip:',
  4729. fn: function (anInteger){
  4730. var self=this;
  4731. smalltalk.send(self, "_position_", [smalltalk.send((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +anInteger : smalltalk.send($receiver, "__plus", [anInteger]), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
  4732. return self;}
  4733. }),
  4734. smalltalk.Stream);
  4735. smalltalk.addMethod(
  4736. '_next',
  4737. smalltalk.method({
  4738. selector: 'next',
  4739. fn: function (){
  4740. var self=this;
  4741. smalltalk.send(self, "_position_", [(($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])]);
  4742. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  4743. return self;}
  4744. }),
  4745. smalltalk.Stream);
  4746. smalltalk.addMethod(
  4747. '_next_',
  4748. smalltalk.method({
  4749. selector: 'next:',
  4750. fn: function (anInteger){
  4751. var self=this;
  4752. var tempCollection=nil;
  4753. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4754. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return (($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]);})]);
  4755. return tempCollection;
  4756. return self;}
  4757. }),
  4758. smalltalk.Stream);
  4759. smalltalk.addMethod(
  4760. '_nextPut_',
  4761. smalltalk.method({
  4762. selector: 'nextPut:',
  4763. fn: function (anObject){
  4764. var self=this;
  4765. smalltalk.send(self, "_position_", [(($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])]);
  4766. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  4767. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4768. return self;}
  4769. }),
  4770. smalltalk.Stream);
  4771. smalltalk.addMethod(
  4772. '_nextPutAll_',
  4773. smalltalk.method({
  4774. selector: 'nextPutAll:',
  4775. fn: function (aCollection){
  4776. var self=this;
  4777. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  4778. return self;}
  4779. }),
  4780. smalltalk.Stream);
  4781. smalltalk.addMethod(
  4782. '_peek',
  4783. smalltalk.method({
  4784. selector: 'peek',
  4785. fn: function (){
  4786. var self=this;
  4787. return (($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [(($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [(($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])]);})]);
  4788. return self;}
  4789. }),
  4790. smalltalk.Stream);
  4791. smalltalk.addMethod(
  4792. '_atEnd',
  4793. smalltalk.method({
  4794. selector: 'atEnd',
  4795. fn: function (){
  4796. var self=this;
  4797. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  4798. return self;}
  4799. }),
  4800. smalltalk.Stream);
  4801. smalltalk.addMethod(
  4802. '_atStart',
  4803. smalltalk.method({
  4804. selector: 'atStart',
  4805. fn: function (){
  4806. var self=this;
  4807. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  4808. return self;}
  4809. }),
  4810. smalltalk.Stream);
  4811. smalltalk.addMethod(
  4812. '_isEmpty',
  4813. smalltalk.method({
  4814. selector: 'isEmpty',
  4815. fn: function (){
  4816. var self=this;
  4817. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  4818. return self;}
  4819. }),
  4820. smalltalk.Stream);
  4821. smalltalk.addMethod(
  4822. '_on_',
  4823. smalltalk.method({
  4824. selector: 'on:',
  4825. fn: function (aCollection){
  4826. var self=this;
  4827. 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", []));
  4828. return self;}
  4829. }),
  4830. smalltalk.Stream.klass);
  4831. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  4832. smalltalk.addMethod(
  4833. '_next_',
  4834. smalltalk.method({
  4835. selector: 'next:',
  4836. fn: function (anInteger){
  4837. var self=this;
  4838. var tempCollection=nil;
  4839. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4840. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return (($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);})]);})]);
  4841. return tempCollection;
  4842. return self;}
  4843. }),
  4844. smalltalk.StringStream);
  4845. smalltalk.addMethod(
  4846. '_nextPut_',
  4847. smalltalk.method({
  4848. selector: 'nextPut:',
  4849. fn: function (aString){
  4850. var self=this;
  4851. smalltalk.send(self, "_nextPutAll_", [aString]);
  4852. return self;}
  4853. }),
  4854. smalltalk.StringStream);
  4855. smalltalk.addMethod(
  4856. '_nextPutAll_',
  4857. smalltalk.method({
  4858. selector: 'nextPutAll:',
  4859. fn: function (aString){
  4860. var self=this;
  4861. 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_", [(($receiver = (($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])]), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
  4862. smalltalk.send(self, "_position_", [(($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])])]);
  4863. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4864. return self;}
  4865. }),
  4866. smalltalk.StringStream);
  4867. smalltalk.addMethod(
  4868. '_cr',
  4869. smalltalk.method({
  4870. selector: 'cr',
  4871. fn: function (){
  4872. var self=this;
  4873. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  4874. return self;}
  4875. }),
  4876. smalltalk.StringStream);
  4877. smalltalk.addMethod(
  4878. '_crlf',
  4879. smalltalk.method({
  4880. selector: 'crlf',
  4881. fn: function (){
  4882. var self=this;
  4883. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  4884. return self;}
  4885. }),
  4886. smalltalk.StringStream);
  4887. smalltalk.addMethod(
  4888. '_lf',
  4889. smalltalk.method({
  4890. selector: 'lf',
  4891. fn: function (){
  4892. var self=this;
  4893. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  4894. return self;}
  4895. }),
  4896. smalltalk.StringStream);
  4897. smalltalk.addMethod(
  4898. '_space',
  4899. smalltalk.method({
  4900. selector: 'space',
  4901. fn: function (){
  4902. var self=this;
  4903. smalltalk.send(self, "_nextPut_", [" "]);
  4904. return self;}
  4905. }),
  4906. smalltalk.StringStream);
  4907. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  4908. smalltalk.addMethod(
  4909. '_class_',
  4910. smalltalk.method({
  4911. selector: 'class:',
  4912. fn: function (aClass){
  4913. var self=this;
  4914. self['@class']=aClass;
  4915. return self;}
  4916. }),
  4917. smalltalk.ClassCommentReader);
  4918. smalltalk.addMethod(
  4919. '_scanFrom_',
  4920. smalltalk.method({
  4921. selector: 'scanFrom:',
  4922. fn: function (aChunkParser){
  4923. var self=this;
  4924. var chunk=nil;
  4925. chunk=smalltalk.send(aChunkParser, "_nextChunk", []);
  4926. (($receiver = smalltalk.send(chunk, "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_setComment_", [chunk]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_setComment_", [chunk]);})]);
  4927. return self;}
  4928. }),
  4929. smalltalk.ClassCommentReader);
  4930. smalltalk.addMethod(
  4931. '_initialize',
  4932. smalltalk.method({
  4933. selector: 'initialize',
  4934. fn: function (){
  4935. var self=this;
  4936. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4937. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  4938. return self;}
  4939. }),
  4940. smalltalk.ClassCommentReader);
  4941. smalltalk.addMethod(
  4942. '_setComment_',
  4943. smalltalk.method({
  4944. selector: 'setComment:',
  4945. fn: function (aString){
  4946. var self=this;
  4947. smalltalk.send(self['@class'], "_comment_", [aString]);
  4948. return self;}
  4949. }),
  4950. smalltalk.ClassCommentReader);
  4951. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  4952. smalltalk.addMethod(
  4953. '_next',
  4954. smalltalk.method({
  4955. selector: 'next',
  4956. fn: function (){
  4957. var self=this;
  4958. return Math.random();
  4959. return self;}
  4960. }),
  4961. smalltalk.Random);
  4962. smalltalk.addMethod(
  4963. '_next_',
  4964. smalltalk.method({
  4965. selector: 'next:',
  4966. fn: function (anInteger){
  4967. var self=this;
  4968. return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
  4969. return self;}
  4970. }),
  4971. smalltalk.Random);
  4972. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  4973. smalltalk.addMethod(
  4974. '_x',
  4975. smalltalk.method({
  4976. selector: 'x',
  4977. fn: function (){
  4978. var self=this;
  4979. return self['@x'];
  4980. return self;}
  4981. }),
  4982. smalltalk.Point);
  4983. smalltalk.addMethod(
  4984. '_y',
  4985. smalltalk.method({
  4986. selector: 'y',
  4987. fn: function (){
  4988. var self=this;
  4989. return self['@y'];
  4990. return self;}
  4991. }),
  4992. smalltalk.Point);
  4993. smalltalk.addMethod(
  4994. '_y_',
  4995. smalltalk.method({
  4996. selector: 'y:',
  4997. fn: function (aNumber){
  4998. var self=this;
  4999. self['@y']=aNumber;
  5000. return self;}
  5001. }),
  5002. smalltalk.Point);
  5003. smalltalk.addMethod(
  5004. '_x_',
  5005. smalltalk.method({
  5006. selector: 'x:',
  5007. fn: function (aNumber){
  5008. var self=this;
  5009. self['@x']=aNumber;
  5010. return self;}
  5011. }),
  5012. smalltalk.Point);
  5013. smalltalk.addMethod(
  5014. '__star',
  5015. smalltalk.method({
  5016. selector: '*',
  5017. fn: function (aPoint){
  5018. var self=this;
  5019. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [(($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), (($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  5020. return self;}
  5021. }),
  5022. smalltalk.Point);
  5023. smalltalk.addMethod(
  5024. '__plus',
  5025. smalltalk.method({
  5026. selector: '+',
  5027. fn: function (aPoint){
  5028. var self=this;
  5029. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [(($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), (($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  5030. return self;}
  5031. }),
  5032. smalltalk.Point);
  5033. smalltalk.addMethod(
  5034. '__minus',
  5035. smalltalk.method({
  5036. selector: '-',
  5037. fn: function (aPoint){
  5038. var self=this;
  5039. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [(($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), (($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  5040. return self;}
  5041. }),
  5042. smalltalk.Point);
  5043. smalltalk.addMethod(
  5044. '__slash',
  5045. smalltalk.method({
  5046. selector: '/',
  5047. fn: function (aPoint){
  5048. var self=this;
  5049. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [(($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver /smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), (($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver /smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  5050. return self;}
  5051. }),
  5052. smalltalk.Point);
  5053. smalltalk.addMethod(
  5054. '_asPoint',
  5055. smalltalk.method({
  5056. selector: 'asPoint',
  5057. fn: function (){
  5058. var self=this;
  5059. return self;
  5060. return self;}
  5061. }),
  5062. smalltalk.Point);
  5063. smalltalk.addMethod(
  5064. '_x_y_',
  5065. smalltalk.method({
  5066. selector: 'x:y:',
  5067. fn: function (aNumber, anotherNumber){
  5068. var self=this;
  5069. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5070. return self;}
  5071. }),
  5072. smalltalk.Point.klass);
  5073. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  5074. smalltalk.addMethod(
  5075. '_selector',
  5076. smalltalk.method({
  5077. selector: 'selector',
  5078. fn: function (){
  5079. var self=this;
  5080. return self['@selector'];
  5081. return self;}
  5082. }),
  5083. smalltalk.Message);
  5084. smalltalk.addMethod(
  5085. '_selector_',
  5086. smalltalk.method({
  5087. selector: 'selector:',
  5088. fn: function (aString){
  5089. var self=this;
  5090. self['@selector']=aString;
  5091. return self;}
  5092. }),
  5093. smalltalk.Message);
  5094. smalltalk.addMethod(
  5095. '_arguments_',
  5096. smalltalk.method({
  5097. selector: 'arguments:',
  5098. fn: function (anArray){
  5099. var self=this;
  5100. self['@arguments']=anArray;
  5101. return self;}
  5102. }),
  5103. smalltalk.Message);
  5104. smalltalk.addMethod(
  5105. '_arguments',
  5106. smalltalk.method({
  5107. selector: 'arguments',
  5108. fn: function (){
  5109. var self=this;
  5110. return self['@arguments'];
  5111. return self;}
  5112. }),
  5113. smalltalk.Message);
  5114. smalltalk.addMethod(
  5115. '_selector_arguments_',
  5116. smalltalk.method({
  5117. selector: 'selector:arguments:',
  5118. fn: function (aString, anArray){
  5119. var self=this;
  5120. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5121. return self;}
  5122. }),
  5123. smalltalk.Message.klass);
  5124. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  5125. smalltalk.addMethod(
  5126. '_message',
  5127. smalltalk.method({
  5128. selector: 'message',
  5129. fn: function (){
  5130. var self=this;
  5131. return self['@message'];
  5132. return self;}
  5133. }),
  5134. smalltalk.MessageNotUnderstood);
  5135. smalltalk.addMethod(
  5136. '_message_',
  5137. smalltalk.method({
  5138. selector: 'message:',
  5139. fn: function (aMessage){
  5140. var self=this;
  5141. self['@message']=aMessage;
  5142. return self;}
  5143. }),
  5144. smalltalk.MessageNotUnderstood);
  5145. smalltalk.addMethod(
  5146. '_receiver',
  5147. smalltalk.method({
  5148. selector: 'receiver',
  5149. fn: function (){
  5150. var self=this;
  5151. return self['@receiver'];
  5152. return self;}
  5153. }),
  5154. smalltalk.MessageNotUnderstood);
  5155. smalltalk.addMethod(
  5156. '_receiver_',
  5157. smalltalk.method({
  5158. selector: 'receiver:',
  5159. fn: function (anObject){
  5160. var self=this;
  5161. self['@receiver']=anObject;
  5162. return self;}
  5163. }),
  5164. smalltalk.MessageNotUnderstood);
  5165. smalltalk.addMethod(
  5166. '_messageText',
  5167. smalltalk.method({
  5168. selector: 'messageText',
  5169. fn: function (){
  5170. var self=this;
  5171. 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", [])]);
  5172. return self;}
  5173. }),
  5174. smalltalk.MessageNotUnderstood);
  5175. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel');
  5176. smalltalk.addMethod(
  5177. '_handleError_',
  5178. smalltalk.method({
  5179. selector: 'handleError:',
  5180. fn: function (anError){
  5181. var self=this;
  5182. (($receiver = smalltalk.send(anError, "_context", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})() : nil;
  5183. smalltalk.send(self, "_logError_", [anError]);
  5184. return self;}
  5185. }),
  5186. smalltalk.ErrorHandler);
  5187. smalltalk.addMethod(
  5188. '_logContext_',
  5189. smalltalk.method({
  5190. selector: 'logContext:',
  5191. fn: function (aContext){
  5192. var self=this;
  5193. (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;
  5194. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  5195. return self;}
  5196. }),
  5197. smalltalk.ErrorHandler);
  5198. smalltalk.addMethod(
  5199. '_logErrorContext_',
  5200. smalltalk.method({
  5201. selector: 'logErrorContext:',
  5202. fn: function (aContext){
  5203. var self=this;
  5204. (($receiver = aContext) != nil && $receiver != undefined) ? (function(){return (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;})() : nil;
  5205. return self;}
  5206. }),
  5207. smalltalk.ErrorHandler);
  5208. smalltalk.addMethod(
  5209. '_logError_',
  5210. smalltalk.method({
  5211. selector: 'logError:',
  5212. fn: function (anError){
  5213. var self=this;
  5214. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  5215. return self;}
  5216. }),
  5217. smalltalk.ErrorHandler);
  5218. smalltalk.addMethod(
  5219. '_log_',
  5220. smalltalk.method({
  5221. selector: 'log:',
  5222. fn: function (aString){
  5223. var self=this;
  5224. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [aString]);
  5225. return self;}
  5226. }),
  5227. smalltalk.ErrorHandler);
  5228. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  5229. smalltalk.addMethod(
  5230. '_current',
  5231. smalltalk.method({
  5232. selector: 'current',
  5233. fn: function (){
  5234. var self=this;
  5235. return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return self['@current']=smalltalk.send(self, "_new", []);})() : $receiver;
  5236. return self;}
  5237. }),
  5238. smalltalk.ErrorHandler.klass);
  5239. smalltalk.addMethod(
  5240. '_initialize',
  5241. smalltalk.method({
  5242. selector: 'initialize',
  5243. fn: function (){
  5244. var self=this;
  5245. smalltalk.send(self, "_register", []);
  5246. return self;}
  5247. }),
  5248. smalltalk.ErrorHandler.klass);
  5249. smalltalk.addMethod(
  5250. '_register',
  5251. smalltalk.method({
  5252. selector: 'register',
  5253. fn: function (){
  5254. var self=this;
  5255. smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  5256. return self;}
  5257. }),
  5258. smalltalk.ErrorHandler.klass);
  5259. smalltalk.addMethod(
  5260. '_setCurrent_',
  5261. smalltalk.method({
  5262. selector: 'setCurrent:',
  5263. fn: function (anHandler){
  5264. var self=this;
  5265. self['@current']=anHandler;
  5266. return self;}
  5267. }),
  5268. smalltalk.ErrorHandler.klass);
  5269. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel');
  5270. smalltalk.addMethod(
  5271. '_jsObject_',
  5272. smalltalk.method({
  5273. selector: 'jsObject:',
  5274. fn: function (aJSObject){
  5275. var self=this;
  5276. self['@jsObject']=aJSObject;
  5277. return self;}
  5278. }),
  5279. smalltalk.JSObjectProxy);
  5280. smalltalk.addMethod(
  5281. '_jsObject',
  5282. smalltalk.method({
  5283. selector: 'jsObject',
  5284. fn: function (){
  5285. var self=this;
  5286. return self['@jsObject'];
  5287. return self;}
  5288. }),
  5289. smalltalk.JSObjectProxy);
  5290. smalltalk.addMethod(
  5291. '_printString',
  5292. smalltalk.method({
  5293. selector: 'printString',
  5294. fn: function (){
  5295. var self=this;
  5296. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  5297. return self;}
  5298. }),
  5299. smalltalk.JSObjectProxy);
  5300. smalltalk.addMethod(
  5301. '_inspectOn_',
  5302. smalltalk.method({
  5303. selector: 'inspectOn:',
  5304. fn: function (anInspector){
  5305. var self=this;
  5306. var variables=nil;
  5307. variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  5308. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  5309. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  5310. for(var i in self['@jsObject']) {
  5311. variables._at_put_(i, self['@jsObject'][i]);
  5312. };
  5313. smalltalk.send(anInspector, "_setVariables_", [variables]);
  5314. return self;}
  5315. }),
  5316. smalltalk.JSObjectProxy);
  5317. smalltalk.addMethod(
  5318. '_doesNotUnderstand_',
  5319. smalltalk.method({
  5320. selector: 'doesNotUnderstand:',
  5321. fn: function (aMessage){
  5322. var self=this;
  5323. var obj=nil;
  5324. var selector=nil;
  5325. var arguments=nil;
  5326. obj=smalltalk.send(self, "_jsObject", []);
  5327. selector=smalltalk.send(aMessage, "_selector", []);
  5328. arguments=smalltalk.send(aMessage, "_arguments", []);
  5329. if(obj[selector]) {return smalltalk.send(obj, selector, arguments)};
  5330. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  5331. return self;}
  5332. }),
  5333. smalltalk.JSObjectProxy);
  5334. smalltalk.addMethod(
  5335. '_on_',
  5336. smalltalk.method({
  5337. selector: 'on:',
  5338. fn: function (aJSObject){
  5339. var self=this;
  5340. return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5341. return self;}
  5342. }),
  5343. smalltalk.JSObjectProxy.klass);
  5344. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel');
  5345. smalltalk.addMethod(
  5346. '_add_',
  5347. smalltalk.method({
  5348. selector: 'add:',
  5349. fn: function (anObject){
  5350. var self=this;
  5351. var found;
  5352. for(var i in self['@elements']) {
  5353. if(anObject == self['@elements'][i]) {
  5354. found = true;
  5355. break;
  5356. }
  5357. }
  5358. if(!found) {self['@elements'].push(anObject)}
  5359. ;
  5360. return self;}
  5361. }),
  5362. smalltalk.Set);
  5363. smalltalk.addMethod(
  5364. '_remove_',
  5365. smalltalk.method({
  5366. selector: 'remove:',
  5367. fn: function (anObject){
  5368. var self=this;
  5369. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  5370. return self;}
  5371. }),
  5372. smalltalk.Set);
  5373. smalltalk.addMethod(
  5374. '_initialize',
  5375. smalltalk.method({
  5376. selector: 'initialize',
  5377. fn: function (){
  5378. var self=this;
  5379. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  5380. self['@elements']=[];
  5381. return self;}
  5382. }),
  5383. smalltalk.Set);
  5384. smalltalk.addMethod(
  5385. '_size',
  5386. smalltalk.method({
  5387. selector: 'size',
  5388. fn: function (){
  5389. var self=this;
  5390. return smalltalk.send(self['@elements'], "_size", []);
  5391. return self;}
  5392. }),
  5393. smalltalk.Set);
  5394. smalltalk.addMethod(
  5395. '_asArray',
  5396. smalltalk.method({
  5397. selector: 'asArray',
  5398. fn: function (){
  5399. var self=this;
  5400. return smalltalk.send(self['@elements'], "_copy", []);
  5401. return self;}
  5402. }),
  5403. smalltalk.Set);
  5404. smalltalk.addMethod(
  5405. '_detect_ifNone_',
  5406. smalltalk.method({
  5407. selector: 'detect:ifNone:',
  5408. fn: function (aBlock, anotherBlock){
  5409. var self=this;
  5410. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  5411. return self;}
  5412. }),
  5413. smalltalk.Set);
  5414. smalltalk.addMethod(
  5415. '_do_',
  5416. smalltalk.method({
  5417. selector: 'do:',
  5418. fn: function (aBlock){
  5419. var self=this;
  5420. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  5421. return self;}
  5422. }),
  5423. smalltalk.Set);
  5424. smalltalk.addMethod(
  5425. '_includes_',
  5426. smalltalk.method({
  5427. selector: 'includes:',
  5428. fn: function (anObject){
  5429. var self=this;
  5430. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  5431. return self;}
  5432. }),
  5433. smalltalk.Set);
  5434. smalltalk.addMethod(
  5435. '__eq',
  5436. smalltalk.method({
  5437. selector: '=',
  5438. fn: function (aCollection){
  5439. var self=this;
  5440. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(self['@elements'], "__eq", [smalltalk.send(aCollection, "_asArray", [])]);})]);
  5441. return self;}
  5442. }),
  5443. smalltalk.Set);