1
0

Kernel.deploy.js 180 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021
  1. smalltalk.addPackage('Kernel', {});
  2. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  3. smalltalk.addMethod(
  4. '__eq',
  5. smalltalk.method({
  6. selector: '=',
  7. fn: function (anObject){
  8. var self=this;
  9. return smalltalk.send(self, "__eq_eq", [anObject]);
  10. return self;}
  11. }),
  12. smalltalk.Object);
  13. smalltalk.addMethod(
  14. '_~_eq',
  15. smalltalk.method({
  16. selector: '~=',
  17. fn: function (anObject){
  18. var self=this;
  19. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq", [false]);
  20. return self;}
  21. }),
  22. smalltalk.Object);
  23. smalltalk.addMethod(
  24. '_initialize',
  25. smalltalk.method({
  26. selector: 'initialize',
  27. fn: function (){
  28. var self=this;
  29. return self;}
  30. }),
  31. smalltalk.Object);
  32. smalltalk.addMethod(
  33. '_yourself',
  34. smalltalk.method({
  35. selector: 'yourself',
  36. fn: function (){
  37. var self=this;
  38. return self;
  39. return self;}
  40. }),
  41. smalltalk.Object);
  42. smalltalk.addMethod(
  43. '_class',
  44. smalltalk.method({
  45. selector: 'class',
  46. fn: function (){
  47. var self=this;
  48. return self.klass;
  49. return self;}
  50. }),
  51. smalltalk.Object);
  52. smalltalk.addMethod(
  53. '_size',
  54. smalltalk.method({
  55. selector: 'size',
  56. fn: function (){
  57. var self=this;
  58. smalltalk.send(self, "_error_", ["Object not indexable"]);
  59. return self;}
  60. }),
  61. smalltalk.Object);
  62. smalltalk.addMethod(
  63. '_copy',
  64. smalltalk.method({
  65. selector: 'copy',
  66. fn: function (){
  67. var self=this;
  68. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  69. return self;}
  70. }),
  71. smalltalk.Object);
  72. smalltalk.addMethod(
  73. '_shallowCopy',
  74. smalltalk.method({
  75. selector: 'shallowCopy',
  76. fn: function (){
  77. var self=this;
  78. var copy = self.klass._new();
  79. for(var i in self) {
  80. if(/^@.+/.test(i)) {
  81. copy[i] = self[i];
  82. }
  83. }
  84. return copy;
  85. ;
  86. return self;}
  87. }),
  88. smalltalk.Object);
  89. smalltalk.addMethod(
  90. '_deepCopy',
  91. smalltalk.method({
  92. selector: 'deepCopy',
  93. fn: function (){
  94. var self=this;
  95. var copy = self.klass._new();
  96. for(var i in self) {
  97. if(/^@.+/.test(i)) {
  98. copy[i] = self[i]._deepCopy();
  99. }
  100. }
  101. return copy;
  102. ;
  103. return self;}
  104. }),
  105. smalltalk.Object);
  106. smalltalk.addMethod(
  107. '_postCopy',
  108. smalltalk.method({
  109. selector: 'postCopy',
  110. fn: function (){
  111. var self=this;
  112. return self;}
  113. }),
  114. smalltalk.Object);
  115. smalltalk.addMethod(
  116. '__minus_gt',
  117. smalltalk.method({
  118. selector: '->',
  119. fn: function (anObject){
  120. var self=this;
  121. return smalltalk.send((smalltalk.Association || Association), "_key_value_", [self, anObject]);
  122. return self;}
  123. }),
  124. smalltalk.Object);
  125. smalltalk.addMethod(
  126. '_asString',
  127. smalltalk.method({
  128. selector: 'asString',
  129. fn: function (){
  130. var self=this;
  131. return smalltalk.send(self, "_printString", []);
  132. return self;}
  133. }),
  134. smalltalk.Object);
  135. smalltalk.addMethod(
  136. '_asJavascript',
  137. smalltalk.method({
  138. selector: 'asJavascript',
  139. fn: function (){
  140. var self=this;
  141. return smalltalk.send(self, "_asString", []);
  142. return self;}
  143. }),
  144. smalltalk.Object);
  145. smalltalk.addMethod(
  146. '_perform_',
  147. smalltalk.method({
  148. selector: 'perform:',
  149. fn: function (aSymbol){
  150. var self=this;
  151. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  152. return self;}
  153. }),
  154. smalltalk.Object);
  155. smalltalk.addMethod(
  156. '_perform_withArguments_',
  157. smalltalk.method({
  158. selector: 'perform:withArguments:',
  159. fn: function (aSymbol, aCollection){
  160. var self=this;
  161. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  162. return self;}
  163. }),
  164. smalltalk.Object);
  165. smalltalk.addMethod(
  166. '_instVarAt_',
  167. smalltalk.method({
  168. selector: 'instVarAt:',
  169. fn: function (aString){
  170. var self=this;
  171. return self['@'+aString];
  172. return self;}
  173. }),
  174. smalltalk.Object);
  175. smalltalk.addMethod(
  176. '_instVarAt_put_',
  177. smalltalk.method({
  178. selector: 'instVarAt:put:',
  179. fn: function (aString, anObject){
  180. var self=this;
  181. self['@' + aString] = anObject;
  182. return self;}
  183. }),
  184. smalltalk.Object);
  185. smalltalk.addMethod(
  186. '_basicAt_',
  187. smalltalk.method({
  188. selector: 'basicAt:',
  189. fn: function (aString){
  190. var self=this;
  191. return self[aString];
  192. return self;}
  193. }),
  194. smalltalk.Object);
  195. smalltalk.addMethod(
  196. '_basicAt_put_',
  197. smalltalk.method({
  198. selector: 'basicAt:put:',
  199. fn: function (aString, anObject){
  200. var self=this;
  201. return self[aString] = anObject;
  202. return self;}
  203. }),
  204. smalltalk.Object);
  205. smalltalk.addMethod(
  206. '_error_',
  207. smalltalk.method({
  208. selector: 'error:',
  209. fn: function (aString){
  210. var self=this;
  211. smalltalk.send((smalltalk.Error || Error), "_signal_", [aString]);
  212. return self;}
  213. }),
  214. smalltalk.Object);
  215. smalltalk.addMethod(
  216. '_subclassResponsibility',
  217. smalltalk.method({
  218. selector: 'subclassResponsibility',
  219. fn: function (){
  220. var self=this;
  221. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  222. return self;}
  223. }),
  224. smalltalk.Object);
  225. smalltalk.addMethod(
  226. '_shouldNotImplement',
  227. smalltalk.method({
  228. selector: 'shouldNotImplement',
  229. fn: function (){
  230. var self=this;
  231. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  232. return self;}
  233. }),
  234. smalltalk.Object);
  235. smalltalk.addMethod(
  236. '_try_catch_',
  237. smalltalk.method({
  238. selector: 'try:catch:',
  239. fn: function (aBlock, anotherBlock){
  240. var self=this;
  241. try{aBlock()} catch(e) {anotherBlock(e)};
  242. return self;}
  243. }),
  244. smalltalk.Object);
  245. smalltalk.addMethod(
  246. '_printString',
  247. smalltalk.method({
  248. selector: 'printString',
  249. fn: function (){
  250. var self=this;
  251. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  252. return self;}
  253. }),
  254. smalltalk.Object);
  255. smalltalk.addMethod(
  256. '_printNl',
  257. smalltalk.method({
  258. selector: 'printNl',
  259. fn: function (){
  260. var self=this;
  261. console.log(self);
  262. return self;}
  263. }),
  264. smalltalk.Object);
  265. smalltalk.addMethod(
  266. '_isKindOf_',
  267. smalltalk.method({
  268. selector: 'isKindOf:',
  269. fn: function (aClass){
  270. var self=this;
  271. return ((($receiver = smalltalk.send(self, "_isMemberOf_", [aClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return true;})() : (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return true;}), (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})]));
  272. return self;}
  273. }),
  274. smalltalk.Object);
  275. smalltalk.addMethod(
  276. '_isMemberOf_',
  277. smalltalk.method({
  278. selector: 'isMemberOf:',
  279. fn: function (aClass){
  280. var self=this;
  281. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  282. return self;}
  283. }),
  284. smalltalk.Object);
  285. smalltalk.addMethod(
  286. '_ifNil_',
  287. smalltalk.method({
  288. selector: 'ifNil:',
  289. fn: function (aBlock){
  290. var self=this;
  291. return self;
  292. return self;}
  293. }),
  294. smalltalk.Object);
  295. smalltalk.addMethod(
  296. '_ifNil_ifNotNil_',
  297. smalltalk.method({
  298. selector: 'ifNil:ifNotNil:',
  299. fn: function (aBlock, anotherBlock){
  300. var self=this;
  301. return smalltalk.send(anotherBlock, "_value", []);
  302. return self;}
  303. }),
  304. smalltalk.Object);
  305. smalltalk.addMethod(
  306. '_ifNotNil_',
  307. smalltalk.method({
  308. selector: 'ifNotNil:',
  309. fn: function (aBlock){
  310. var self=this;
  311. return smalltalk.send(aBlock, "_value", []);
  312. return self;}
  313. }),
  314. smalltalk.Object);
  315. smalltalk.addMethod(
  316. '_ifNotNil_ifNil_',
  317. smalltalk.method({
  318. selector: 'ifNotNil:ifNil:',
  319. fn: function (aBlock, anotherBlock){
  320. var self=this;
  321. return smalltalk.send(aBlock, "_value", []);
  322. return self;}
  323. }),
  324. smalltalk.Object);
  325. smalltalk.addMethod(
  326. '_isNil',
  327. smalltalk.method({
  328. selector: 'isNil',
  329. fn: function (){
  330. var self=this;
  331. return false;
  332. return self;}
  333. }),
  334. smalltalk.Object);
  335. smalltalk.addMethod(
  336. '_notNil',
  337. smalltalk.method({
  338. selector: 'notNil',
  339. fn: function (){
  340. var self=this;
  341. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  342. return self;}
  343. }),
  344. smalltalk.Object);
  345. smalltalk.addMethod(
  346. '_isClass',
  347. smalltalk.method({
  348. selector: 'isClass',
  349. fn: function (){
  350. var self=this;
  351. return false;
  352. return self;}
  353. }),
  354. smalltalk.Object);
  355. smalltalk.addMethod(
  356. '_isMetaclass',
  357. smalltalk.method({
  358. selector: 'isMetaclass',
  359. fn: function (){
  360. var self=this;
  361. return false;
  362. return self;}
  363. }),
  364. smalltalk.Object);
  365. smalltalk.addMethod(
  366. '_isNumber',
  367. smalltalk.method({
  368. selector: 'isNumber',
  369. fn: function (){
  370. var self=this;
  371. return false;
  372. return self;}
  373. }),
  374. smalltalk.Object);
  375. smalltalk.addMethod(
  376. '_isString',
  377. smalltalk.method({
  378. selector: 'isString',
  379. fn: function (){
  380. var self=this;
  381. return false;
  382. return self;}
  383. }),
  384. smalltalk.Object);
  385. smalltalk.addMethod(
  386. '_isParseFailure',
  387. smalltalk.method({
  388. selector: 'isParseFailure',
  389. fn: function (){
  390. var self=this;
  391. return false;
  392. return self;}
  393. }),
  394. smalltalk.Object);
  395. smalltalk.addMethod(
  396. '_basicPerform_',
  397. smalltalk.method({
  398. selector: 'basicPerform:',
  399. fn: function (aSymbol){
  400. var self=this;
  401. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  402. return self;}
  403. }),
  404. smalltalk.Object);
  405. smalltalk.addMethod(
  406. '_basicPerform_withArguments_',
  407. smalltalk.method({
  408. selector: 'basicPerform:withArguments:',
  409. fn: function (aSymbol, aCollection){
  410. var self=this;
  411. return self[aSymbol].apply(self, aCollection);;
  412. return self;}
  413. }),
  414. smalltalk.Object);
  415. smalltalk.addMethod(
  416. '_basicDelete_',
  417. smalltalk.method({
  418. selector: 'basicDelete:',
  419. fn: function (aString){
  420. var self=this;
  421. delete self[aString];
  422. return self;}
  423. }),
  424. smalltalk.Object);
  425. smalltalk.addMethod(
  426. '_doesNotUnderstand_',
  427. smalltalk.method({
  428. selector: 'doesNotUnderstand:',
  429. fn: function (aMessage){
  430. var self=this;
  431. (function($rec){smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.MessageNotUnderstood || MessageNotUnderstood), "_new", []));
  432. return self;}
  433. }),
  434. smalltalk.Object);
  435. smalltalk.addMethod(
  436. '_asJSON',
  437. smalltalk.method({
  438. selector: 'asJSON',
  439. fn: function (){
  440. var self=this;
  441. return JSON.stringify(self._asJSONObject());
  442. return self;}
  443. }),
  444. smalltalk.Object);
  445. smalltalk.addMethod(
  446. '_asJSONObject',
  447. smalltalk.method({
  448. selector: 'asJSONObject',
  449. fn: function (){
  450. var self=this;
  451. var object=nil;
  452. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  453. 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", [])]);})]);
  454. return object;
  455. return self;}
  456. }),
  457. smalltalk.Object);
  458. smalltalk.addMethod(
  459. '_halt',
  460. smalltalk.method({
  461. selector: 'halt',
  462. fn: function (){
  463. var self=this;
  464. smalltalk.send(self, "_error_", ["Halt encountered"]);
  465. return self;}
  466. }),
  467. smalltalk.Object);
  468. smalltalk.addMethod(
  469. '_log_block_',
  470. smalltalk.method({
  471. selector: 'log:block:',
  472. fn: function (aString, aBlock){
  473. var self=this;
  474. var result=nil;
  475. 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", [])])]);
  476. return result;
  477. return self;}
  478. }),
  479. smalltalk.Object);
  480. smalltalk.addMethod(
  481. '__eq_eq',
  482. smalltalk.method({
  483. selector: '==',
  484. fn: function (anObject){
  485. var self=this;
  486. return self === anObject;
  487. return self;}
  488. }),
  489. smalltalk.Object);
  490. smalltalk.addMethod(
  491. '_~~',
  492. smalltalk.method({
  493. selector: '~~',
  494. fn: function (anObject){
  495. var self=this;
  496. return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
  497. return self;}
  498. }),
  499. smalltalk.Object);
  500. smalltalk.addMethod(
  501. '_deprecatedAPI',
  502. smalltalk.method({
  503. selector: 'deprecatedAPI',
  504. fn: function (){
  505. var self=this;
  506. smalltalk.send((typeof console == 'undefined' ? nil : console), "_warn_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.getThisContext()), "_home", []), "_asString", []), "__comma", [unescape("%20is%20deprecated%21")])]);
  507. return self;}
  508. }),
  509. smalltalk.Object);
  510. smalltalk.addMethod(
  511. '_storeString',
  512. smalltalk.method({
  513. selector: 'storeString',
  514. fn: function (){
  515. var self=this;
  516. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(s){return smalltalk.send(self, "_storeOn_", [s]);})]);
  517. return self;}
  518. }),
  519. smalltalk.Object);
  520. smalltalk.addMethod(
  521. '_storeOn_',
  522. smalltalk.method({
  523. selector: 'storeOn:',
  524. fn: function (aStream){
  525. var self=this;
  526. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(self, "_printString", [])]);
  527. return self;}
  528. }),
  529. smalltalk.Object);
  530. smalltalk.addMethod(
  531. '_initialize',
  532. smalltalk.method({
  533. selector: 'initialize',
  534. fn: function (){
  535. var self=this;
  536. return self;}
  537. }),
  538. smalltalk.Object.klass);
  539. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  540. smalltalk.addMethod(
  541. '_classes',
  542. smalltalk.method({
  543. selector: 'classes',
  544. fn: function (){
  545. var self=this;
  546. return self.classes();
  547. return self;}
  548. }),
  549. smalltalk.Smalltalk);
  550. smalltalk.addMethod(
  551. '_at_',
  552. smalltalk.method({
  553. selector: 'at:',
  554. fn: function (aString){
  555. var self=this;
  556. return self[aString];
  557. return self;}
  558. }),
  559. smalltalk.Smalltalk);
  560. smalltalk.addMethod(
  561. '_removeClass_',
  562. smalltalk.method({
  563. selector: 'removeClass:',
  564. fn: function (aClass){
  565. var self=this;
  566. ((($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")])]);})]));
  567. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  568. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  569. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  570. return self;}
  571. }),
  572. smalltalk.Smalltalk);
  573. smalltalk.addMethod(
  574. '_basicParse_',
  575. smalltalk.method({
  576. selector: 'basicParse:',
  577. fn: function (aString){
  578. var self=this;
  579. return smalltalk.parser.parse(aString);
  580. return self;}
  581. }),
  582. smalltalk.Smalltalk);
  583. smalltalk.addMethod(
  584. '_parse_',
  585. smalltalk.method({
  586. selector: 'parse:',
  587. fn: function (aString){
  588. var self=this;
  589. var result=nil;
  590. 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", []);})]);
  591. return result;
  592. return self;}
  593. }),
  594. smalltalk.Smalltalk);
  595. smalltalk.addMethod(
  596. '_parseError_parsing_',
  597. smalltalk.method({
  598. selector: 'parseError:parsing:',
  599. fn: function (anException, aString){
  600. var self=this;
  601. var row=nil;
  602. var col=nil;
  603. var message=nil;
  604. var lines=nil;
  605. var badLine=nil;
  606. var code=nil;
  607. row = anException.line;
  608. col = anException.column;
  609. message = anException.message;;
  610. lines=smalltalk.send(aString, "_lines", []);
  611. badLine=smalltalk.send(lines, "_at_", [row]);
  612. 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", [])])]);
  613. smalltalk.send(lines, "_at_put_", [row, badLine]);
  614. 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", [])])]);})]);})]);
  615. 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])]);
  616. return self;}
  617. }),
  618. smalltalk.Smalltalk);
  619. smalltalk.addMethod(
  620. '_packages',
  621. smalltalk.method({
  622. selector: 'packages',
  623. fn: function (){
  624. var self=this;
  625. return self.packages.all();
  626. return self;}
  627. }),
  628. smalltalk.Smalltalk);
  629. smalltalk.addMethod(
  630. '_packageAt_',
  631. smalltalk.method({
  632. selector: 'packageAt:',
  633. fn: function (packageName){
  634. var self=this;
  635. return self.packages[packageName];
  636. return self;}
  637. }),
  638. smalltalk.Smalltalk);
  639. smalltalk.addMethod(
  640. '_packageAt_ifAbsent_',
  641. smalltalk.method({
  642. selector: 'packageAt:ifAbsent:',
  643. fn: function (packageName, aBlock){
  644. var self=this;
  645. return smalltalk.send(smalltalk.send(self, "_packageAt_", [packageName]), "_ifNil_", [aBlock]);
  646. return self;}
  647. }),
  648. smalltalk.Smalltalk);
  649. smalltalk.addMethod(
  650. '_createPackage_',
  651. smalltalk.method({
  652. selector: 'createPackage:',
  653. fn: function (packageName){
  654. var self=this;
  655. return smalltalk.addPackage(packageName, nil);
  656. return self;}
  657. }),
  658. smalltalk.Smalltalk);
  659. smalltalk.addMethod(
  660. '_deletePackage_',
  661. smalltalk.method({
  662. selector: 'deletePackage:',
  663. fn: function (packageName){
  664. var self=this;
  665. delete smalltalk.packages[packageName];
  666. return self;}
  667. }),
  668. smalltalk.Smalltalk);
  669. smalltalk.addMethod(
  670. '_removePackage_',
  671. smalltalk.method({
  672. selector: 'removePackage:',
  673. fn: function (packageName){
  674. var self=this;
  675. var pkg=nil;
  676. pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  677. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
  678. smalltalk.send(self, "_deletePackage_", [packageName]);
  679. return self;}
  680. }),
  681. smalltalk.Smalltalk);
  682. smalltalk.addMethod(
  683. '_renamePackage_to_',
  684. smalltalk.method({
  685. selector: 'renamePackage:to:',
  686. fn: function (packageName, newName){
  687. var self=this;
  688. var pkg=nil;
  689. pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  690. (($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;
  691. smalltalk.packages[newName] = smalltalk.packages[packageName];
  692. smalltalk.send(pkg, "_name_", [newName]);
  693. smalltalk.send(self, "_deletePackage_", [packageName]);
  694. return self;}
  695. }),
  696. smalltalk.Smalltalk);
  697. smalltalk.addMethod(
  698. '_reservedWords',
  699. smalltalk.method({
  700. selector: 'reservedWords',
  701. fn: function (){
  702. var self=this;
  703. return self.reservedWords;
  704. return self;}
  705. }),
  706. smalltalk.Smalltalk);
  707. smalltalk.addMethod(
  708. '_createPackage_properties_',
  709. smalltalk.method({
  710. selector: 'createPackage:properties:',
  711. fn: function (packageName, aDict){
  712. var self=this;
  713. var object=nil;
  714. object = {};;
  715. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  716. return smalltalk.addPackage(packageName, object);
  717. return self;}
  718. }),
  719. smalltalk.Smalltalk);
  720. smalltalk.addMethod(
  721. '_readJSObject_',
  722. smalltalk.method({
  723. selector: 'readJSObject:',
  724. fn: function (anObject){
  725. var self=this;
  726. return self.readJSObject(anObject);
  727. return self;}
  728. }),
  729. smalltalk.Smalltalk);
  730. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  731. smalltalk.addMethod(
  732. '_current',
  733. smalltalk.method({
  734. selector: 'current',
  735. fn: function (){
  736. var self=this;
  737. return smalltalk;
  738. return self;}
  739. }),
  740. smalltalk.Smalltalk.klass);
  741. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel');
  742. smalltalk.addMethod(
  743. '_name',
  744. smalltalk.method({
  745. selector: 'name',
  746. fn: function (){
  747. var self=this;
  748. return self.pkgName;
  749. return self;}
  750. }),
  751. smalltalk.Package);
  752. smalltalk.addMethod(
  753. '_name_',
  754. smalltalk.method({
  755. selector: 'name:',
  756. fn: function (aString){
  757. var self=this;
  758. self.pkgName = aString;
  759. return self;}
  760. }),
  761. smalltalk.Package);
  762. smalltalk.addMethod(
  763. '_classes',
  764. smalltalk.method({
  765. selector: 'classes',
  766. fn: function (){
  767. var self=this;
  768. 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]);})]);
  769. return self;}
  770. }),
  771. smalltalk.Package);
  772. smalltalk.addMethod(
  773. '_printString',
  774. smalltalk.method({
  775. selector: 'printString',
  776. fn: function (){
  777. var self=this;
  778. return smalltalk.send(self, "_name", []);
  779. return self;}
  780. }),
  781. smalltalk.Package);
  782. smalltalk.addMethod(
  783. '_dependencies',
  784. smalltalk.method({
  785. selector: 'dependencies',
  786. fn: function (){
  787. var self=this;
  788. return smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", (function(){return [];})]);
  789. return self;}
  790. }),
  791. smalltalk.Package);
  792. smalltalk.addMethod(
  793. '_dependencies_',
  794. smalltalk.method({
  795. selector: 'dependencies:',
  796. fn: function (anArray){
  797. var self=this;
  798. return smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  799. return self;}
  800. }),
  801. smalltalk.Package);
  802. smalltalk.addMethod(
  803. '_properties',
  804. smalltalk.method({
  805. selector: 'properties',
  806. fn: function (){
  807. var self=this;
  808. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  809. return self;}
  810. }),
  811. smalltalk.Package);
  812. smalltalk.addMethod(
  813. '_propertiesAsJSON',
  814. smalltalk.method({
  815. selector: 'propertiesAsJSON',
  816. fn: function (){
  817. var self=this;
  818. return JSON.stringify(self.properties);
  819. return self;}
  820. }),
  821. smalltalk.Package);
  822. smalltalk.addMethod(
  823. '_properties_',
  824. smalltalk.method({
  825. selector: 'properties:',
  826. fn: function (aDict){
  827. var self=this;
  828. var object=nil;
  829. object = {};;
  830. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  831. return self.properties = object;
  832. return self;}
  833. }),
  834. smalltalk.Package);
  835. smalltalk.addMethod(
  836. '_jsProperties',
  837. smalltalk.method({
  838. selector: 'jsProperties',
  839. fn: function (){
  840. var self=this;
  841. return self.properties;
  842. return self;}
  843. }),
  844. smalltalk.Package);
  845. smalltalk.addMethod(
  846. '_jsProperties_',
  847. smalltalk.method({
  848. selector: 'jsProperties:',
  849. fn: function (aJSObject){
  850. var self=this;
  851. return self.properties = aJSObject;
  852. return self;}
  853. }),
  854. smalltalk.Package);
  855. smalltalk.addMethod(
  856. '_propertyAt_',
  857. smalltalk.method({
  858. selector: 'propertyAt:',
  859. fn: function (key){
  860. var self=this;
  861. return self.properties[key];
  862. return self;}
  863. }),
  864. smalltalk.Package);
  865. smalltalk.addMethod(
  866. '_propertyAt_put_',
  867. smalltalk.method({
  868. selector: 'propertyAt:put:',
  869. fn: function (key, value){
  870. var self=this;
  871. return self.properties[key] = value;
  872. return self;}
  873. }),
  874. smalltalk.Package);
  875. smalltalk.addMethod(
  876. '_propertyAt_ifAbsent_',
  877. smalltalk.method({
  878. selector: 'propertyAt:ifAbsent:',
  879. fn: function (key, block){
  880. var self=this;
  881. return (($receiver = smalltalk.send(self, "_propertyAt_", [key])) == nil || $receiver == undefined) ? (function(){return smalltalk.send(block, "_value", []);})() : $receiver;
  882. return self;}
  883. }),
  884. smalltalk.Package);
  885. smalltalk.addMethod(
  886. '_commitPathSt_',
  887. smalltalk.method({
  888. selector: 'commitPathSt:',
  889. fn: function (aString){
  890. var self=this;
  891. self['@commitPathSt']=aString;
  892. return self;}
  893. }),
  894. smalltalk.Package);
  895. smalltalk.addMethod(
  896. '_commitPathJs',
  897. smalltalk.method({
  898. selector: 'commitPathJs',
  899. fn: function (){
  900. var self=this;
  901. return (($receiver = self['@commitPathJs']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);})() : $receiver;
  902. return self;}
  903. }),
  904. smalltalk.Package);
  905. smalltalk.addMethod(
  906. '_commitPathSt',
  907. smalltalk.method({
  908. selector: 'commitPathSt',
  909. fn: function (){
  910. var self=this;
  911. return (($receiver = self['@commitPathSt']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);})() : $receiver;
  912. return self;}
  913. }),
  914. smalltalk.Package);
  915. smalltalk.addMethod(
  916. '_commitPathJs_',
  917. smalltalk.method({
  918. selector: 'commitPathJs:',
  919. fn: function (aString){
  920. var self=this;
  921. self['@commitPathJs']=aString;
  922. return self;}
  923. }),
  924. smalltalk.Package);
  925. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  926. smalltalk.addMethod(
  927. '_named_',
  928. smalltalk.method({
  929. selector: 'named:',
  930. fn: function (aPackageName){
  931. var self=this;
  932. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [aPackageName]);
  933. return self;}
  934. }),
  935. smalltalk.Package.klass);
  936. smalltalk.addMethod(
  937. '_named_ifAbsent_',
  938. smalltalk.method({
  939. selector: 'named:ifAbsent:',
  940. fn: function (aPackageName, aBlock){
  941. var self=this;
  942. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  943. return self;}
  944. }),
  945. smalltalk.Package.klass);
  946. smalltalk.addMethod(
  947. '_defaultCommitPathSt',
  948. smalltalk.method({
  949. selector: 'defaultCommitPathSt',
  950. fn: function (){
  951. var self=this;
  952. return (($receiver = self['@defaultCommitPathSt']) == nil || $receiver == undefined) ? (function(){return self['@defaultCommitPathSt']="st";})() : $receiver;
  953. return self;}
  954. }),
  955. smalltalk.Package.klass);
  956. smalltalk.addMethod(
  957. '_defaultCommitPathJs',
  958. smalltalk.method({
  959. selector: 'defaultCommitPathJs',
  960. fn: function (){
  961. var self=this;
  962. return (($receiver = self['@defaultCommitPathJs']) == nil || $receiver == undefined) ? (function(){return self['@defaultCommitPathJs']="js";})() : $receiver;
  963. return self;}
  964. }),
  965. smalltalk.Package.klass);
  966. smalltalk.addMethod(
  967. '_defaultCommitPathSt_',
  968. smalltalk.method({
  969. selector: 'defaultCommitPathSt:',
  970. fn: function (aString){
  971. var self=this;
  972. self['@defaultCommitPathSt']=aString;
  973. return self;}
  974. }),
  975. smalltalk.Package.klass);
  976. smalltalk.addMethod(
  977. '_defaultCommitPathJs_',
  978. smalltalk.method({
  979. selector: 'defaultCommitPathJs:',
  980. fn: function (aString){
  981. var self=this;
  982. self['@defaultCommitPathJs']=aString;
  983. return self;}
  984. }),
  985. smalltalk.Package.klass);
  986. smalltalk.addMethod(
  987. '_resetCommitPaths',
  988. smalltalk.method({
  989. selector: 'resetCommitPaths',
  990. fn: function (){
  991. var self=this;
  992. self['@defaultCommitPathJs']=nil;
  993. self['@defaultCommitPathSt']=nil;
  994. return self;}
  995. }),
  996. smalltalk.Package.klass);
  997. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  998. smalltalk.addMethod(
  999. '_new',
  1000. smalltalk.method({
  1001. selector: 'new',
  1002. fn: function (){
  1003. var self=this;
  1004. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  1005. return self;}
  1006. }),
  1007. smalltalk.Behavior);
  1008. smalltalk.addMethod(
  1009. '_basicNew',
  1010. smalltalk.method({
  1011. selector: 'basicNew',
  1012. fn: function (){
  1013. var self=this;
  1014. return new self.fn();
  1015. return self;}
  1016. }),
  1017. smalltalk.Behavior);
  1018. smalltalk.addMethod(
  1019. '_name',
  1020. smalltalk.method({
  1021. selector: 'name',
  1022. fn: function (){
  1023. var self=this;
  1024. return self.className || nil;
  1025. return self;}
  1026. }),
  1027. smalltalk.Behavior);
  1028. smalltalk.addMethod(
  1029. '_superclass',
  1030. smalltalk.method({
  1031. selector: 'superclass',
  1032. fn: function (){
  1033. var self=this;
  1034. return self.superclass || nil;
  1035. return self;}
  1036. }),
  1037. smalltalk.Behavior);
  1038. smalltalk.addMethod(
  1039. '_subclasses',
  1040. smalltalk.method({
  1041. selector: 'subclasses',
  1042. fn: function (){
  1043. var self=this;
  1044. return smalltalk.subclasses(self);
  1045. return self;}
  1046. }),
  1047. smalltalk.Behavior);
  1048. smalltalk.addMethod(
  1049. '_allSubclasses',
  1050. smalltalk.method({
  1051. selector: 'allSubclasses',
  1052. fn: function (){
  1053. var self=this;
  1054. var result=nil;
  1055. result=smalltalk.send(self, "_subclasses", []);
  1056. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  1057. return result;
  1058. return self;}
  1059. }),
  1060. smalltalk.Behavior);
  1061. smalltalk.addMethod(
  1062. '_withAllSubclasses',
  1063. smalltalk.method({
  1064. selector: 'withAllSubclasses',
  1065. fn: function (){
  1066. var self=this;
  1067. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
  1068. return self;}
  1069. }),
  1070. smalltalk.Behavior);
  1071. smalltalk.addMethod(
  1072. '_prototype',
  1073. smalltalk.method({
  1074. selector: 'prototype',
  1075. fn: function (){
  1076. var self=this;
  1077. return self.fn.prototype;
  1078. return self;}
  1079. }),
  1080. smalltalk.Behavior);
  1081. smalltalk.addMethod(
  1082. '_methodDictionary',
  1083. smalltalk.method({
  1084. selector: 'methodDictionary',
  1085. fn: function (){
  1086. var self=this;
  1087. var dict = smalltalk.Dictionary._new();
  1088. var methods = self.fn.prototype.methods;
  1089. for(var i in methods) {
  1090. if(methods[i].selector) {
  1091. dict._at_put_(methods[i].selector, methods[i]);
  1092. }
  1093. };
  1094. return dict;
  1095. return self;}
  1096. }),
  1097. smalltalk.Behavior);
  1098. smalltalk.addMethod(
  1099. '_methodsFor_',
  1100. smalltalk.method({
  1101. selector: 'methodsFor:',
  1102. fn: function (aString){
  1103. var self=this;
  1104. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
  1105. return self;}
  1106. }),
  1107. smalltalk.Behavior);
  1108. smalltalk.addMethod(
  1109. '_addCompiledMethod_',
  1110. smalltalk.method({
  1111. selector: 'addCompiledMethod:',
  1112. fn: function (aMethod){
  1113. var self=this;
  1114. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  1115. return self;}
  1116. }),
  1117. smalltalk.Behavior);
  1118. smalltalk.addMethod(
  1119. '_instanceVariableNames',
  1120. smalltalk.method({
  1121. selector: 'instanceVariableNames',
  1122. fn: function (){
  1123. var self=this;
  1124. return self.iVarNames;
  1125. return self;}
  1126. }),
  1127. smalltalk.Behavior);
  1128. smalltalk.addMethod(
  1129. '_comment',
  1130. smalltalk.method({
  1131. selector: 'comment',
  1132. fn: function (){
  1133. var self=this;
  1134. return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1135. return self;}
  1136. }),
  1137. smalltalk.Behavior);
  1138. smalltalk.addMethod(
  1139. '_comment_',
  1140. smalltalk.method({
  1141. selector: 'comment:',
  1142. fn: function (aString){
  1143. var self=this;
  1144. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  1145. return self;}
  1146. }),
  1147. smalltalk.Behavior);
  1148. smalltalk.addMethod(
  1149. '_commentStamp',
  1150. smalltalk.method({
  1151. selector: 'commentStamp',
  1152. fn: function (){
  1153. var self=this;
  1154. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
  1155. return self;}
  1156. }),
  1157. smalltalk.Behavior);
  1158. smalltalk.addMethod(
  1159. '_removeCompiledMethod_',
  1160. smalltalk.method({
  1161. selector: 'removeCompiledMethod:',
  1162. fn: function (aMethod){
  1163. var self=this;
  1164. delete self.fn.prototype[aMethod.selector._asSelector()];
  1165. delete self.fn.prototype.methods[aMethod.selector];
  1166. smalltalk.init(self);;
  1167. return self;}
  1168. }),
  1169. smalltalk.Behavior);
  1170. smalltalk.addMethod(
  1171. '_inheritsFrom_',
  1172. smalltalk.method({
  1173. selector: 'inheritsFrom:',
  1174. fn: function (aClass){
  1175. var self=this;
  1176. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  1177. return self;}
  1178. }),
  1179. smalltalk.Behavior);
  1180. smalltalk.addMethod(
  1181. '_protocols',
  1182. smalltalk.method({
  1183. selector: 'protocols',
  1184. fn: function (){
  1185. var self=this;
  1186. var protocols=nil;
  1187. protocols=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1188. 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", [])]);})]));})]);
  1189. return smalltalk.send(protocols, "_sort", []);
  1190. return self;}
  1191. }),
  1192. smalltalk.Behavior);
  1193. smalltalk.addMethod(
  1194. '_protocolsDo_',
  1195. smalltalk.method({
  1196. selector: 'protocolsDo:',
  1197. fn: function (aBlock){
  1198. var self=this;
  1199. var methodsByCategory=nil;
  1200. methodsByCategory=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  1201. 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]);})]);
  1202. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  1203. return self;}
  1204. }),
  1205. smalltalk.Behavior);
  1206. smalltalk.addMethod(
  1207. '_allInstanceVariableNames',
  1208. smalltalk.method({
  1209. selector: 'allInstanceVariableNames',
  1210. fn: function (){
  1211. var self=this;
  1212. var result=nil;
  1213. result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []);
  1214. (($receiver = smalltalk.send(self, "_superclass", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})() : nil;
  1215. return result;
  1216. return self;}
  1217. }),
  1218. smalltalk.Behavior);
  1219. smalltalk.addMethod(
  1220. '_methodAt_',
  1221. smalltalk.method({
  1222. selector: 'methodAt:',
  1223. fn: function (aString){
  1224. var self=this;
  1225. return smalltalk.methods(self)[aString];
  1226. return self;}
  1227. }),
  1228. smalltalk.Behavior);
  1229. smalltalk.addMethod(
  1230. '_methodsFor_stamp_',
  1231. smalltalk.method({
  1232. selector: 'methodsFor:stamp:',
  1233. fn: function (aString, aStamp){
  1234. var self=this;
  1235. return smalltalk.send(self, "_methodsFor_", [aString]);
  1236. return self;}
  1237. }),
  1238. smalltalk.Behavior);
  1239. smalltalk.addMethod(
  1240. '_commentStamp_prior_',
  1241. smalltalk.method({
  1242. selector: 'commentStamp:prior:',
  1243. fn: function (aStamp, prior){
  1244. var self=this;
  1245. return smalltalk.send(self, "_commentStamp", []);
  1246. return self;}
  1247. }),
  1248. smalltalk.Behavior);
  1249. smalltalk.addMethod(
  1250. '_compile_',
  1251. smalltalk.method({
  1252. selector: 'compile:',
  1253. fn: function (aString){
  1254. var self=this;
  1255. smalltalk.send(self, "_compile_category_", [aString, ""]);
  1256. return self;}
  1257. }),
  1258. smalltalk.Behavior);
  1259. smalltalk.addMethod(
  1260. '_compile_category_',
  1261. smalltalk.method({
  1262. selector: 'compile:category:',
  1263. fn: function (aString, anotherString){
  1264. var self=this;
  1265. var method=nil;
  1266. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self]);
  1267. smalltalk.send(method, "_category_", [anotherString]);
  1268. smalltalk.send(self, "_addCompiledMethod_", [method]);
  1269. return self;}
  1270. }),
  1271. smalltalk.Behavior);
  1272. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  1273. smalltalk.addMethod(
  1274. '_category',
  1275. smalltalk.method({
  1276. selector: 'category',
  1277. fn: function (){
  1278. var self=this;
  1279. return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
  1280. return self;}
  1281. }),
  1282. smalltalk.Class);
  1283. smalltalk.addMethod(
  1284. '_subclass_instanceVariableNames_',
  1285. smalltalk.method({
  1286. selector: 'subclass:instanceVariableNames:',
  1287. fn: function (aString, anotherString){
  1288. var self=this;
  1289. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  1290. return self;}
  1291. }),
  1292. smalltalk.Class);
  1293. smalltalk.addMethod(
  1294. '_subclass_instanceVariableNames_category_',
  1295. smalltalk.method({
  1296. selector: 'subclass:instanceVariableNames:category:',
  1297. fn: function (aString, aString2, aString3){
  1298. var self=this;
  1299. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  1300. return self;}
  1301. }),
  1302. smalltalk.Class);
  1303. smalltalk.addMethod(
  1304. '_isClass',
  1305. smalltalk.method({
  1306. selector: 'isClass',
  1307. fn: function (){
  1308. var self=this;
  1309. return true;
  1310. return self;}
  1311. }),
  1312. smalltalk.Class);
  1313. smalltalk.addMethod(
  1314. '_printString',
  1315. smalltalk.method({
  1316. selector: 'printString',
  1317. fn: function (){
  1318. var self=this;
  1319. return smalltalk.send(self, "_name", []);
  1320. return self;}
  1321. }),
  1322. smalltalk.Class);
  1323. smalltalk.addMethod(
  1324. '_rename_',
  1325. smalltalk.method({
  1326. selector: 'rename:',
  1327. fn: function (aString){
  1328. var self=this;
  1329. smalltalk[aString] = self;
  1330. delete smalltalk[self.className];
  1331. self.className = aString;
  1332. ;
  1333. return self;}
  1334. }),
  1335. smalltalk.Class);
  1336. smalltalk.addMethod(
  1337. '_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_',
  1338. smalltalk.method({
  1339. selector: 'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:',
  1340. fn: function (aString, aString2, classVars, pools, aString3){
  1341. var self=this;
  1342. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  1343. return self;}
  1344. }),
  1345. smalltalk.Class);
  1346. smalltalk.addMethod(
  1347. '_package',
  1348. smalltalk.method({
  1349. selector: 'package',
  1350. fn: function (){
  1351. var self=this;
  1352. return self.pkg;
  1353. return self;}
  1354. }),
  1355. smalltalk.Class);
  1356. smalltalk.addMethod(
  1357. '_package_',
  1358. smalltalk.method({
  1359. selector: 'package:',
  1360. fn: function (aPackage){
  1361. var self=this;
  1362. self.pkg = aPackage;
  1363. return self;}
  1364. }),
  1365. smalltalk.Class);
  1366. smalltalk.addMethod(
  1367. '_subclass_instanceVariableNames_package_',
  1368. smalltalk.method({
  1369. selector: 'subclass:instanceVariableNames:package:',
  1370. fn: function (aString, aString2, aString3){
  1371. var self=this;
  1372. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  1373. return self;}
  1374. }),
  1375. smalltalk.Class);
  1376. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  1377. smalltalk.addMethod(
  1378. '_instanceClass',
  1379. smalltalk.method({
  1380. selector: 'instanceClass',
  1381. fn: function (){
  1382. var self=this;
  1383. return self.instanceClass;
  1384. return self;}
  1385. }),
  1386. smalltalk.Metaclass);
  1387. smalltalk.addMethod(
  1388. '_instanceVariableNames_',
  1389. smalltalk.method({
  1390. selector: 'instanceVariableNames:',
  1391. fn: function (aCollection){
  1392. var self=this;
  1393. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  1394. return self;}
  1395. }),
  1396. smalltalk.Metaclass);
  1397. smalltalk.addMethod(
  1398. '_isMetaclass',
  1399. smalltalk.method({
  1400. selector: 'isMetaclass',
  1401. fn: function (){
  1402. var self=this;
  1403. return true;
  1404. return self;}
  1405. }),
  1406. smalltalk.Metaclass);
  1407. smalltalk.addMethod(
  1408. '_printString',
  1409. smalltalk.method({
  1410. selector: 'printString',
  1411. fn: function (){
  1412. var self=this;
  1413. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  1414. return self;}
  1415. }),
  1416. smalltalk.Metaclass);
  1417. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  1418. smalltalk.addMethod(
  1419. '_source',
  1420. smalltalk.method({
  1421. selector: 'source',
  1422. fn: function (){
  1423. var self=this;
  1424. return (($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1425. return self;}
  1426. }),
  1427. smalltalk.CompiledMethod);
  1428. smalltalk.addMethod(
  1429. '_source_',
  1430. smalltalk.method({
  1431. selector: 'source:',
  1432. fn: function (aString){
  1433. var self=this;
  1434. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  1435. return self;}
  1436. }),
  1437. smalltalk.CompiledMethod);
  1438. smalltalk.addMethod(
  1439. '_category',
  1440. smalltalk.method({
  1441. selector: 'category',
  1442. fn: function (){
  1443. var self=this;
  1444. return (($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1445. return self;}
  1446. }),
  1447. smalltalk.CompiledMethod);
  1448. smalltalk.addMethod(
  1449. '_category_',
  1450. smalltalk.method({
  1451. selector: 'category:',
  1452. fn: function (aString){
  1453. var self=this;
  1454. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  1455. return self;}
  1456. }),
  1457. smalltalk.CompiledMethod);
  1458. smalltalk.addMethod(
  1459. '_selector',
  1460. smalltalk.method({
  1461. selector: 'selector',
  1462. fn: function (){
  1463. var self=this;
  1464. return smalltalk.send(self, "_basicAt_", ["selector"]);
  1465. return self;}
  1466. }),
  1467. smalltalk.CompiledMethod);
  1468. smalltalk.addMethod(
  1469. '_selector_',
  1470. smalltalk.method({
  1471. selector: 'selector:',
  1472. fn: function (aString){
  1473. var self=this;
  1474. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  1475. return self;}
  1476. }),
  1477. smalltalk.CompiledMethod);
  1478. smalltalk.addMethod(
  1479. '_fn',
  1480. smalltalk.method({
  1481. selector: 'fn',
  1482. fn: function (){
  1483. var self=this;
  1484. return smalltalk.send(self, "_basicAt_", ["fn"]);
  1485. return self;}
  1486. }),
  1487. smalltalk.CompiledMethod);
  1488. smalltalk.addMethod(
  1489. '_fn_',
  1490. smalltalk.method({
  1491. selector: 'fn:',
  1492. fn: function (aBlock){
  1493. var self=this;
  1494. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  1495. return self;}
  1496. }),
  1497. smalltalk.CompiledMethod);
  1498. smalltalk.addMethod(
  1499. '_messageSends',
  1500. smalltalk.method({
  1501. selector: 'messageSends',
  1502. fn: function (){
  1503. var self=this;
  1504. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  1505. return self;}
  1506. }),
  1507. smalltalk.CompiledMethod);
  1508. smalltalk.addMethod(
  1509. '_methodClass',
  1510. smalltalk.method({
  1511. selector: 'methodClass',
  1512. fn: function (){
  1513. var self=this;
  1514. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  1515. return self;}
  1516. }),
  1517. smalltalk.CompiledMethod);
  1518. smalltalk.addMethod(
  1519. '_referencedClasses',
  1520. smalltalk.method({
  1521. selector: 'referencedClasses',
  1522. fn: function (){
  1523. var self=this;
  1524. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  1525. return self;}
  1526. }),
  1527. smalltalk.CompiledMethod);
  1528. smalltalk.addMethod(
  1529. '_arguments',
  1530. smalltalk.method({
  1531. selector: 'arguments',
  1532. fn: function (){
  1533. var self=this;
  1534. return self.args || [];
  1535. return self;}
  1536. }),
  1537. smalltalk.CompiledMethod);
  1538. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1539. smalltalk.addMethod(
  1540. '__eq',
  1541. smalltalk.method({
  1542. selector: '=',
  1543. fn: function (aNumber){
  1544. var self=this;
  1545. 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}})})();})]));
  1546. return Number(self) == aNumber;
  1547. return self;
  1548. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  1549. }),
  1550. smalltalk.Number);
  1551. smalltalk.addMethod(
  1552. '__gt',
  1553. smalltalk.method({
  1554. selector: '>',
  1555. fn: function (aNumber){
  1556. var self=this;
  1557. return self > aNumber;
  1558. return self;}
  1559. }),
  1560. smalltalk.Number);
  1561. smalltalk.addMethod(
  1562. '__lt',
  1563. smalltalk.method({
  1564. selector: '<',
  1565. fn: function (aNumber){
  1566. var self=this;
  1567. return self < aNumber;
  1568. return self;}
  1569. }),
  1570. smalltalk.Number);
  1571. smalltalk.addMethod(
  1572. '__gt_eq',
  1573. smalltalk.method({
  1574. selector: '>=',
  1575. fn: function (aNumber){
  1576. var self=this;
  1577. return self >= aNumber;
  1578. return self;}
  1579. }),
  1580. smalltalk.Number);
  1581. smalltalk.addMethod(
  1582. '__lt_eq',
  1583. smalltalk.method({
  1584. selector: '<=',
  1585. fn: function (aNumber){
  1586. var self=this;
  1587. return self <= aNumber;
  1588. return self;}
  1589. }),
  1590. smalltalk.Number);
  1591. smalltalk.addMethod(
  1592. '__plus',
  1593. smalltalk.method({
  1594. selector: '+',
  1595. fn: function (aNumber){
  1596. var self=this;
  1597. return self + aNumber;
  1598. return self;}
  1599. }),
  1600. smalltalk.Number);
  1601. smalltalk.addMethod(
  1602. '__minus',
  1603. smalltalk.method({
  1604. selector: '-',
  1605. fn: function (aNumber){
  1606. var self=this;
  1607. return self - aNumber;
  1608. return self;}
  1609. }),
  1610. smalltalk.Number);
  1611. smalltalk.addMethod(
  1612. '__star',
  1613. smalltalk.method({
  1614. selector: '*',
  1615. fn: function (aNumber){
  1616. var self=this;
  1617. return self * aNumber;
  1618. return self;}
  1619. }),
  1620. smalltalk.Number);
  1621. smalltalk.addMethod(
  1622. '__slash',
  1623. smalltalk.method({
  1624. selector: '/',
  1625. fn: function (aNumber){
  1626. var self=this;
  1627. return self / aNumber;
  1628. return self;}
  1629. }),
  1630. smalltalk.Number);
  1631. smalltalk.addMethod(
  1632. '_max_',
  1633. smalltalk.method({
  1634. selector: 'max:',
  1635. fn: function (aNumber){
  1636. var self=this;
  1637. return Math.max(self, aNumber);;
  1638. return self;}
  1639. }),
  1640. smalltalk.Number);
  1641. smalltalk.addMethod(
  1642. '_min_',
  1643. smalltalk.method({
  1644. selector: 'min:',
  1645. fn: function (aNumber){
  1646. var self=this;
  1647. return Math.min(self, aNumber);;
  1648. return self;}
  1649. }),
  1650. smalltalk.Number);
  1651. smalltalk.addMethod(
  1652. '_rounded',
  1653. smalltalk.method({
  1654. selector: 'rounded',
  1655. fn: function (){
  1656. var self=this;
  1657. return Math.round(self);;
  1658. return self;}
  1659. }),
  1660. smalltalk.Number);
  1661. smalltalk.addMethod(
  1662. '_truncated',
  1663. smalltalk.method({
  1664. selector: 'truncated',
  1665. fn: function (){
  1666. var self=this;
  1667. var result=nil;
  1668. ((($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));;})]));
  1669. return result;
  1670. return self;}
  1671. }),
  1672. smalltalk.Number);
  1673. smalltalk.addMethod(
  1674. '_to_',
  1675. smalltalk.method({
  1676. selector: 'to:',
  1677. fn: function (aNumber){
  1678. var self=this;
  1679. var array=nil;
  1680. var first=nil;
  1681. var last=nil;
  1682. var count=nil;
  1683. first=smalltalk.send(self, "_truncated", []);
  1684. last=((($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
  1685. count=(1);
  1686. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1687. 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)]));})]);
  1688. return array;
  1689. return self;}
  1690. }),
  1691. smalltalk.Number);
  1692. smalltalk.addMethod(
  1693. '_timesRepeat_',
  1694. smalltalk.method({
  1695. selector: 'timesRepeat:',
  1696. fn: function (aBlock){
  1697. var self=this;
  1698. var integer=nil;
  1699. var count=nil;
  1700. integer=smalltalk.send(self, "_truncated", []);
  1701. count=(1);
  1702. (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)]));})()}})();
  1703. return self;}
  1704. }),
  1705. smalltalk.Number);
  1706. smalltalk.addMethod(
  1707. '_to_do_',
  1708. smalltalk.method({
  1709. selector: 'to:do:',
  1710. fn: function (stop, aBlock){
  1711. var self=this;
  1712. var nextValue=nil;
  1713. nextValue=self;
  1714. (function(){while((function(){return ((($receiver = nextValue).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [nextValue]);return nextValue=((($receiver = nextValue).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
  1715. return self;}
  1716. }),
  1717. smalltalk.Number);
  1718. smalltalk.addMethod(
  1719. '_asString',
  1720. smalltalk.method({
  1721. selector: 'asString',
  1722. fn: function (){
  1723. var self=this;
  1724. return smalltalk.send(self, "_printString", []);
  1725. return self;}
  1726. }),
  1727. smalltalk.Number);
  1728. smalltalk.addMethod(
  1729. '_asJavascript',
  1730. smalltalk.method({
  1731. selector: 'asJavascript',
  1732. fn: function (){
  1733. var self=this;
  1734. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1735. return self;}
  1736. }),
  1737. smalltalk.Number);
  1738. smalltalk.addMethod(
  1739. '_printString',
  1740. smalltalk.method({
  1741. selector: 'printString',
  1742. fn: function (){
  1743. var self=this;
  1744. return String(self);
  1745. return self;}
  1746. }),
  1747. smalltalk.Number);
  1748. smalltalk.addMethod(
  1749. '_isNumber',
  1750. smalltalk.method({
  1751. selector: 'isNumber',
  1752. fn: function (){
  1753. var self=this;
  1754. return true;
  1755. return self;}
  1756. }),
  1757. smalltalk.Number);
  1758. smalltalk.addMethod(
  1759. '_atRandom',
  1760. smalltalk.method({
  1761. selector: 'atRandom',
  1762. fn: function (){
  1763. var self=this;
  1764. 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)]));
  1765. return self;}
  1766. }),
  1767. smalltalk.Number);
  1768. smalltalk.addMethod(
  1769. '__at',
  1770. smalltalk.method({
  1771. selector: '@',
  1772. fn: function (aNumber){
  1773. var self=this;
  1774. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, aNumber]);
  1775. return self;}
  1776. }),
  1777. smalltalk.Number);
  1778. smalltalk.addMethod(
  1779. '_asPoint',
  1780. smalltalk.method({
  1781. selector: 'asPoint',
  1782. fn: function (){
  1783. var self=this;
  1784. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, self]);
  1785. return self;}
  1786. }),
  1787. smalltalk.Number);
  1788. smalltalk.addMethod(
  1789. '_clearInterval',
  1790. smalltalk.method({
  1791. selector: 'clearInterval',
  1792. fn: function (){
  1793. var self=this;
  1794. clearInterval(Number(self));
  1795. return self;}
  1796. }),
  1797. smalltalk.Number);
  1798. smalltalk.addMethod(
  1799. '_asJSONObject',
  1800. smalltalk.method({
  1801. selector: 'asJSONObject',
  1802. fn: function (){
  1803. var self=this;
  1804. return self;
  1805. return self;}
  1806. }),
  1807. smalltalk.Number);
  1808. smalltalk.addMethod(
  1809. '_clearTimeout',
  1810. smalltalk.method({
  1811. selector: 'clearTimeout',
  1812. fn: function (){
  1813. var self=this;
  1814. clearTimeout(Number(self));
  1815. return self;}
  1816. }),
  1817. smalltalk.Number);
  1818. smalltalk.addMethod(
  1819. '_even',
  1820. smalltalk.method({
  1821. selector: 'even',
  1822. fn: function (){
  1823. var self=this;
  1824. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_\\\\", [(2)])]);
  1825. return self;}
  1826. }),
  1827. smalltalk.Number);
  1828. smalltalk.addMethod(
  1829. '_odd',
  1830. smalltalk.method({
  1831. selector: 'odd',
  1832. fn: function (){
  1833. var self=this;
  1834. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1835. return self;}
  1836. }),
  1837. smalltalk.Number);
  1838. smalltalk.addMethod(
  1839. '_negated',
  1840. smalltalk.method({
  1841. selector: 'negated',
  1842. fn: function (){
  1843. var self=this;
  1844. return (0) - self;
  1845. return self;}
  1846. }),
  1847. smalltalk.Number);
  1848. smalltalk.addMethod(
  1849. '__eq_eq',
  1850. smalltalk.method({
  1851. selector: '==',
  1852. fn: function (aNumber){
  1853. var self=this;
  1854. 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}})})();})]));
  1855. return Number(self) === Number(aNumber);
  1856. return self;
  1857. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  1858. }),
  1859. smalltalk.Number);
  1860. smalltalk.addMethod(
  1861. '_printShowingDecimalPlaces_',
  1862. smalltalk.method({
  1863. selector: 'printShowingDecimalPlaces:',
  1864. fn: function (placesDesired){
  1865. var self=this;
  1866. return self.toFixed(placesDesired);
  1867. return self;}
  1868. }),
  1869. smalltalk.Number);
  1870. smalltalk.addMethod(
  1871. '_\',
  1872. smalltalk.method({
  1873. selector: '\',
  1874. fn: function (aNumber){
  1875. var self=this;
  1876. return self % aNumber;
  1877. return self;}
  1878. }),
  1879. smalltalk.Number);
  1880. smalltalk.addMethod(
  1881. '_to_by_',
  1882. smalltalk.method({
  1883. selector: 'to:by:',
  1884. fn: function (stop, step){
  1885. var self=this;
  1886. var array=nil;
  1887. var value=nil;
  1888. var pos=nil;
  1889. value=self;
  1890. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1891. pos=(1);
  1892. ((($receiver = smalltalk.send(step, "__eq", [(0)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})]));
  1893. ((($receiver = ((($receiver = step).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})() : (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();}), (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})]));
  1894. return array;
  1895. return self;}
  1896. }),
  1897. smalltalk.Number);
  1898. smalltalk.addMethod(
  1899. '_to_by_do_',
  1900. smalltalk.method({
  1901. selector: 'to:by:do:',
  1902. fn: function (stop, step, aBlock){
  1903. var self=this;
  1904. var value=nil;
  1905. value=self;
  1906. ((($receiver = smalltalk.send(step, "__eq", [(0)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})]));
  1907. ((($receiver = ((($receiver = step).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})() : (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();}), (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})]));
  1908. return self;}
  1909. }),
  1910. smalltalk.Number);
  1911. smalltalk.addMethod(
  1912. '_deepCopy',
  1913. smalltalk.method({
  1914. selector: 'deepCopy',
  1915. fn: function (){
  1916. var self=this;
  1917. return smalltalk.send(self, "_copy", []);
  1918. return self;}
  1919. }),
  1920. smalltalk.Number);
  1921. smalltalk.addMethod(
  1922. '_copy',
  1923. smalltalk.method({
  1924. selector: 'copy',
  1925. fn: function (){
  1926. var self=this;
  1927. return self;
  1928. return self;}
  1929. }),
  1930. smalltalk.Number);
  1931. smalltalk.addMethod(
  1932. '_\\',
  1933. smalltalk.method({
  1934. selector: '\\',
  1935. fn: function (aNumber){
  1936. var self=this;
  1937. return self % aNumber;
  1938. return self;}
  1939. }),
  1940. smalltalk.Number);
  1941. smalltalk.addMethod(
  1942. '_sqrt',
  1943. smalltalk.method({
  1944. selector: 'sqrt',
  1945. fn: function (){
  1946. var self=this;
  1947. return Math.sqrt(self);
  1948. return self;}
  1949. }),
  1950. smalltalk.Number);
  1951. smalltalk.addMethod(
  1952. '_squared',
  1953. smalltalk.method({
  1954. selector: 'squared',
  1955. fn: function (){
  1956. var self=this;
  1957. return self * self;
  1958. return self;}
  1959. }),
  1960. smalltalk.Number);
  1961. smalltalk.addMethod(
  1962. '_pi',
  1963. smalltalk.method({
  1964. selector: 'pi',
  1965. fn: function (){
  1966. var self=this;
  1967. return Math.PI;
  1968. return self;}
  1969. }),
  1970. smalltalk.Number.klass);
  1971. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1972. smalltalk.addMethod(
  1973. '_compiledSource',
  1974. smalltalk.method({
  1975. selector: 'compiledSource',
  1976. fn: function (){
  1977. var self=this;
  1978. return self.toString();
  1979. return self;}
  1980. }),
  1981. smalltalk.BlockClosure);
  1982. smalltalk.addMethod(
  1983. '_whileTrue_',
  1984. smalltalk.method({
  1985. selector: 'whileTrue:',
  1986. fn: function (aBlock){
  1987. var self=this;
  1988. while(self()) {aBlock()};
  1989. return self;}
  1990. }),
  1991. smalltalk.BlockClosure);
  1992. smalltalk.addMethod(
  1993. '_whileFalse_',
  1994. smalltalk.method({
  1995. selector: 'whileFalse:',
  1996. fn: function (aBlock){
  1997. var self=this;
  1998. while(!self()) {aBlock()};
  1999. return self;}
  2000. }),
  2001. smalltalk.BlockClosure);
  2002. smalltalk.addMethod(
  2003. '_value',
  2004. smalltalk.method({
  2005. selector: 'value',
  2006. fn: function (){
  2007. var self=this;
  2008. return self();;
  2009. return self;}
  2010. }),
  2011. smalltalk.BlockClosure);
  2012. smalltalk.addMethod(
  2013. '_value_',
  2014. smalltalk.method({
  2015. selector: 'value:',
  2016. fn: function (anArg){
  2017. var self=this;
  2018. return self(anArg);;
  2019. return self;}
  2020. }),
  2021. smalltalk.BlockClosure);
  2022. smalltalk.addMethod(
  2023. '_value_value_',
  2024. smalltalk.method({
  2025. selector: 'value:value:',
  2026. fn: function (firstArg, secondArg){
  2027. var self=this;
  2028. return self(firstArg, secondArg);;
  2029. return self;}
  2030. }),
  2031. smalltalk.BlockClosure);
  2032. smalltalk.addMethod(
  2033. '_value_value_value_',
  2034. smalltalk.method({
  2035. selector: 'value:value:value:',
  2036. fn: function (firstArg, secondArg, thirdArg){
  2037. var self=this;
  2038. return self(firstArg, secondArg, thirdArg);;
  2039. return self;}
  2040. }),
  2041. smalltalk.BlockClosure);
  2042. smalltalk.addMethod(
  2043. '_valueWithPossibleArguments_',
  2044. smalltalk.method({
  2045. selector: 'valueWithPossibleArguments:',
  2046. fn: function (aCollection){
  2047. var self=this;
  2048. return self.apply(null, aCollection);;
  2049. return self;}
  2050. }),
  2051. smalltalk.BlockClosure);
  2052. smalltalk.addMethod(
  2053. '_on_do_',
  2054. smalltalk.method({
  2055. selector: 'on:do:',
  2056. fn: function (anErrorClass, aBlock){
  2057. var self=this;
  2058. 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", []);})]));})]);
  2059. return self;}
  2060. }),
  2061. smalltalk.BlockClosure);
  2062. smalltalk.addMethod(
  2063. '_valueWithTimeout_',
  2064. smalltalk.method({
  2065. selector: 'valueWithTimeout:',
  2066. fn: function (aNumber){
  2067. var self=this;
  2068. return setTimeout(self, aNumber);
  2069. return self;}
  2070. }),
  2071. smalltalk.BlockClosure);
  2072. smalltalk.addMethod(
  2073. '_valueWithInterval_',
  2074. smalltalk.method({
  2075. selector: 'valueWithInterval:',
  2076. fn: function (aNumber){
  2077. var self=this;
  2078. return setInterval(self, aNumber);
  2079. return self;}
  2080. }),
  2081. smalltalk.BlockClosure);
  2082. smalltalk.addMethod(
  2083. '_whileFalse',
  2084. smalltalk.method({
  2085. selector: 'whileFalse',
  2086. fn: function (){
  2087. var self=this;
  2088. smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
  2089. return self;}
  2090. }),
  2091. smalltalk.BlockClosure);
  2092. smalltalk.addMethod(
  2093. '_whileTrue',
  2094. smalltalk.method({
  2095. selector: 'whileTrue',
  2096. fn: function (){
  2097. var self=this;
  2098. smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
  2099. return self;}
  2100. }),
  2101. smalltalk.BlockClosure);
  2102. smalltalk.addMethod(
  2103. '_new',
  2104. smalltalk.method({
  2105. selector: 'new',
  2106. fn: function (){
  2107. var self=this;
  2108. return new self();
  2109. return self;}
  2110. }),
  2111. smalltalk.BlockClosure);
  2112. smalltalk.addMethod(
  2113. '_applyTo_arguments_',
  2114. smalltalk.method({
  2115. selector: 'applyTo:arguments:',
  2116. fn: function (anObject, aCollection){
  2117. var self=this;
  2118. return self.apply(anObject, aCollection);
  2119. return self;}
  2120. }),
  2121. smalltalk.BlockClosure);
  2122. smalltalk.addMethod(
  2123. '_timeToRun',
  2124. smalltalk.method({
  2125. selector: 'timeToRun',
  2126. fn: function (){
  2127. var self=this;
  2128. return smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [self]);
  2129. return self;}
  2130. }),
  2131. smalltalk.BlockClosure);
  2132. smalltalk.addMethod(
  2133. '_numArgs',
  2134. smalltalk.method({
  2135. selector: 'numArgs',
  2136. fn: function (){
  2137. var self=this;
  2138. return self.length;
  2139. return self;}
  2140. }),
  2141. smalltalk.BlockClosure);
  2142. smalltalk.addMethod(
  2143. '_ensure_',
  2144. smalltalk.method({
  2145. selector: 'ensure:',
  2146. fn: function (aBlock){
  2147. var self=this;
  2148. var success=nil;
  2149. success=false;
  2150. smalltalk.send((function(){smalltalk.send(self, "_value", []);success=true;return smalltalk.send(aBlock, "_value", []);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){((($receiver = success).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value", []);})]));return smalltalk.send(ex, "_signal", []);})]);
  2151. return self;}
  2152. }),
  2153. smalltalk.BlockClosure);
  2154. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  2155. smalltalk.addMethod(
  2156. '__eq',
  2157. smalltalk.method({
  2158. selector: '=',
  2159. fn: function (aBoolean){
  2160. var self=this;
  2161. 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}})})();})]));
  2162. return Boolean(self == true) == aBoolean;
  2163. return self;
  2164. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  2165. }),
  2166. smalltalk.Boolean);
  2167. smalltalk.addMethod(
  2168. '_shallowCopy',
  2169. smalltalk.method({
  2170. selector: 'shallowCopy',
  2171. fn: function (){
  2172. var self=this;
  2173. return self;
  2174. return self;}
  2175. }),
  2176. smalltalk.Boolean);
  2177. smalltalk.addMethod(
  2178. '_deepCopy',
  2179. smalltalk.method({
  2180. selector: 'deepCopy',
  2181. fn: function (){
  2182. var self=this;
  2183. return self;
  2184. return self;}
  2185. }),
  2186. smalltalk.Boolean);
  2187. smalltalk.addMethod(
  2188. '_ifTrue_',
  2189. smalltalk.method({
  2190. selector: 'ifTrue:',
  2191. fn: function (aBlock){
  2192. var self=this;
  2193. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  2194. return self;}
  2195. }),
  2196. smalltalk.Boolean);
  2197. smalltalk.addMethod(
  2198. '_ifFalse_',
  2199. smalltalk.method({
  2200. selector: 'ifFalse:',
  2201. fn: function (aBlock){
  2202. var self=this;
  2203. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  2204. return self;}
  2205. }),
  2206. smalltalk.Boolean);
  2207. smalltalk.addMethod(
  2208. '_ifFalse_ifTrue_',
  2209. smalltalk.method({
  2210. selector: 'ifFalse:ifTrue:',
  2211. fn: function (aBlock, anotherBlock){
  2212. var self=this;
  2213. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  2214. return self;}
  2215. }),
  2216. smalltalk.Boolean);
  2217. smalltalk.addMethod(
  2218. '_ifTrue_ifFalse_',
  2219. smalltalk.method({
  2220. selector: 'ifTrue:ifFalse:',
  2221. fn: function (aBlock, anotherBlock){
  2222. var self=this;
  2223. if(self == true) {
  2224. return aBlock();
  2225. } else {
  2226. return anotherBlock();
  2227. }
  2228. ;
  2229. return self;}
  2230. }),
  2231. smalltalk.Boolean);
  2232. smalltalk.addMethod(
  2233. '_and_',
  2234. smalltalk.method({
  2235. selector: 'and:',
  2236. fn: function (aBlock){
  2237. var self=this;
  2238. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  2239. return self;}
  2240. }),
  2241. smalltalk.Boolean);
  2242. smalltalk.addMethod(
  2243. '_or_',
  2244. smalltalk.method({
  2245. selector: 'or:',
  2246. fn: function (aBlock){
  2247. var self=this;
  2248. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  2249. return self;}
  2250. }),
  2251. smalltalk.Boolean);
  2252. smalltalk.addMethod(
  2253. '_not',
  2254. smalltalk.method({
  2255. selector: 'not',
  2256. fn: function (){
  2257. var self=this;
  2258. return smalltalk.send(self, "__eq", [false]);
  2259. return self;}
  2260. }),
  2261. smalltalk.Boolean);
  2262. smalltalk.addMethod(
  2263. '_printString',
  2264. smalltalk.method({
  2265. selector: 'printString',
  2266. fn: function (){
  2267. var self=this;
  2268. return self.toString();
  2269. return self;}
  2270. }),
  2271. smalltalk.Boolean);
  2272. smalltalk.addMethod(
  2273. '_asJSONObject',
  2274. smalltalk.method({
  2275. selector: 'asJSONObject',
  2276. fn: function (){
  2277. var self=this;
  2278. return self;
  2279. return self;}
  2280. }),
  2281. smalltalk.Boolean);
  2282. smalltalk.addMethod(
  2283. '_&',
  2284. smalltalk.method({
  2285. selector: '&',
  2286. fn: function (aBoolean){
  2287. var self=this;
  2288. if(self == true) {
  2289. return aBoolean;
  2290. } else {
  2291. return false;
  2292. }
  2293. ;
  2294. return self;}
  2295. }),
  2296. smalltalk.Boolean);
  2297. smalltalk.addMethod(
  2298. '_|',
  2299. smalltalk.method({
  2300. selector: '|',
  2301. fn: function (aBoolean){
  2302. var self=this;
  2303. if(self == true) {
  2304. return true;
  2305. } else {
  2306. return aBoolean;
  2307. }
  2308. ;
  2309. return self;}
  2310. }),
  2311. smalltalk.Boolean);
  2312. smalltalk.addMethod(
  2313. '__eq_eq',
  2314. smalltalk.method({
  2315. selector: '==',
  2316. fn: function (aBoolean){
  2317. var self=this;
  2318. 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}})})();})]));
  2319. return Boolean(self == true) === Boolean(aBoolean == true);
  2320. return self;
  2321. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  2322. }),
  2323. smalltalk.Boolean);
  2324. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  2325. smalltalk.addMethod(
  2326. '_year',
  2327. smalltalk.method({
  2328. selector: 'year',
  2329. fn: function (){
  2330. var self=this;
  2331. return self.getFullYear();
  2332. return self;}
  2333. }),
  2334. smalltalk.Date);
  2335. smalltalk.addMethod(
  2336. '_month',
  2337. smalltalk.method({
  2338. selector: 'month',
  2339. fn: function (){
  2340. var self=this;
  2341. return self.getMonth() + 1;
  2342. return self;}
  2343. }),
  2344. smalltalk.Date);
  2345. smalltalk.addMethod(
  2346. '_month_',
  2347. smalltalk.method({
  2348. selector: 'month:',
  2349. fn: function (aNumber){
  2350. var self=this;
  2351. self.setMonth(aNumber - 1);
  2352. return self;}
  2353. }),
  2354. smalltalk.Date);
  2355. smalltalk.addMethod(
  2356. '_day',
  2357. smalltalk.method({
  2358. selector: 'day',
  2359. fn: function (){
  2360. var self=this;
  2361. return smalltalk.send(self, "_dayOfWeek", []);
  2362. return self;}
  2363. }),
  2364. smalltalk.Date);
  2365. smalltalk.addMethod(
  2366. '_dayOfWeek',
  2367. smalltalk.method({
  2368. selector: 'dayOfWeek',
  2369. fn: function (){
  2370. var self=this;
  2371. return self.getDay() + 1;
  2372. return self;}
  2373. }),
  2374. smalltalk.Date);
  2375. smalltalk.addMethod(
  2376. '_dayOfWeek_',
  2377. smalltalk.method({
  2378. selector: 'dayOfWeek:',
  2379. fn: function (aNumber){
  2380. var self=this;
  2381. return self.setDay(aNumber - 1);
  2382. return self;}
  2383. }),
  2384. smalltalk.Date);
  2385. smalltalk.addMethod(
  2386. '_day_',
  2387. smalltalk.method({
  2388. selector: 'day:',
  2389. fn: function (aNumber){
  2390. var self=this;
  2391. smalltalk.send(self, "_day_", [aNumber]);
  2392. return self;}
  2393. }),
  2394. smalltalk.Date);
  2395. smalltalk.addMethod(
  2396. '_year_',
  2397. smalltalk.method({
  2398. selector: 'year:',
  2399. fn: function (aNumber){
  2400. var self=this;
  2401. self.setFullYear(aNumber);
  2402. return self;}
  2403. }),
  2404. smalltalk.Date);
  2405. smalltalk.addMethod(
  2406. '_dayOfMonth',
  2407. smalltalk.method({
  2408. selector: 'dayOfMonth',
  2409. fn: function (){
  2410. var self=this;
  2411. return self.getDate();
  2412. return self;}
  2413. }),
  2414. smalltalk.Date);
  2415. smalltalk.addMethod(
  2416. '_dayOfMonth_',
  2417. smalltalk.method({
  2418. selector: 'dayOfMonth:',
  2419. fn: function (aNumber){
  2420. var self=this;
  2421. self.setDate(aNumber);
  2422. return self;}
  2423. }),
  2424. smalltalk.Date);
  2425. smalltalk.addMethod(
  2426. '_asString',
  2427. smalltalk.method({
  2428. selector: 'asString',
  2429. fn: function (){
  2430. var self=this;
  2431. return self.toString();
  2432. return self;}
  2433. }),
  2434. smalltalk.Date);
  2435. smalltalk.addMethod(
  2436. '_printString',
  2437. smalltalk.method({
  2438. selector: 'printString',
  2439. fn: function (){
  2440. var self=this;
  2441. return smalltalk.send(self, "_asString", []);
  2442. return self;}
  2443. }),
  2444. smalltalk.Date);
  2445. smalltalk.addMethod(
  2446. '_asMilliseconds',
  2447. smalltalk.method({
  2448. selector: 'asMilliseconds',
  2449. fn: function (){
  2450. var self=this;
  2451. return smalltalk.send(self, "_time", []);
  2452. return self;}
  2453. }),
  2454. smalltalk.Date);
  2455. smalltalk.addMethod(
  2456. '_time',
  2457. smalltalk.method({
  2458. selector: 'time',
  2459. fn: function (){
  2460. var self=this;
  2461. return self.getTime();
  2462. return self;}
  2463. }),
  2464. smalltalk.Date);
  2465. smalltalk.addMethod(
  2466. '_time_',
  2467. smalltalk.method({
  2468. selector: 'time:',
  2469. fn: function (aNumber){
  2470. var self=this;
  2471. self.setTime(aNumber);
  2472. return self;}
  2473. }),
  2474. smalltalk.Date);
  2475. smalltalk.addMethod(
  2476. '_asDateString',
  2477. smalltalk.method({
  2478. selector: 'asDateString',
  2479. fn: function (){
  2480. var self=this;
  2481. return self.toDateString();
  2482. return self;}
  2483. }),
  2484. smalltalk.Date);
  2485. smalltalk.addMethod(
  2486. '_asTimeString',
  2487. smalltalk.method({
  2488. selector: 'asTimeString',
  2489. fn: function (){
  2490. var self=this;
  2491. return self.toTimeString();
  2492. return self;}
  2493. }),
  2494. smalltalk.Date);
  2495. smalltalk.addMethod(
  2496. '_asLocaleString',
  2497. smalltalk.method({
  2498. selector: 'asLocaleString',
  2499. fn: function (){
  2500. var self=this;
  2501. return self.toLocaleString();
  2502. return self;}
  2503. }),
  2504. smalltalk.Date);
  2505. smalltalk.addMethod(
  2506. '_asNumber',
  2507. smalltalk.method({
  2508. selector: 'asNumber',
  2509. fn: function (){
  2510. var self=this;
  2511. return smalltalk.send(self, "_asMilliseconds", []);
  2512. return self;}
  2513. }),
  2514. smalltalk.Date);
  2515. smalltalk.addMethod(
  2516. '_hours_',
  2517. smalltalk.method({
  2518. selector: 'hours:',
  2519. fn: function (aNumber){
  2520. var self=this;
  2521. self.setHours(aNumber);
  2522. return self;}
  2523. }),
  2524. smalltalk.Date);
  2525. smalltalk.addMethod(
  2526. '_minutes_',
  2527. smalltalk.method({
  2528. selector: 'minutes:',
  2529. fn: function (aNumber){
  2530. var self=this;
  2531. self.setMinutes(aNumber);
  2532. return self;}
  2533. }),
  2534. smalltalk.Date);
  2535. smalltalk.addMethod(
  2536. '_seconds_',
  2537. smalltalk.method({
  2538. selector: 'seconds:',
  2539. fn: function (aNumber){
  2540. var self=this;
  2541. self.setSeconds(aNumber);
  2542. return self;}
  2543. }),
  2544. smalltalk.Date);
  2545. smalltalk.addMethod(
  2546. '_milliseconds_',
  2547. smalltalk.method({
  2548. selector: 'milliseconds:',
  2549. fn: function (aNumber){
  2550. var self=this;
  2551. self.setMilliseconds(aNumber);
  2552. return self;}
  2553. }),
  2554. smalltalk.Date);
  2555. smalltalk.addMethod(
  2556. '_hours',
  2557. smalltalk.method({
  2558. selector: 'hours',
  2559. fn: function (){
  2560. var self=this;
  2561. return self.getHours();
  2562. return self;}
  2563. }),
  2564. smalltalk.Date);
  2565. smalltalk.addMethod(
  2566. '_minutes',
  2567. smalltalk.method({
  2568. selector: 'minutes',
  2569. fn: function (){
  2570. var self=this;
  2571. return self.getMinutes();
  2572. return self;}
  2573. }),
  2574. smalltalk.Date);
  2575. smalltalk.addMethod(
  2576. '_seconds',
  2577. smalltalk.method({
  2578. selector: 'seconds',
  2579. fn: function (){
  2580. var self=this;
  2581. return self.getSeconds();
  2582. return self;}
  2583. }),
  2584. smalltalk.Date);
  2585. smalltalk.addMethod(
  2586. '_milliseconds',
  2587. smalltalk.method({
  2588. selector: 'milliseconds',
  2589. fn: function (){
  2590. var self=this;
  2591. return self.getMilliseconds();
  2592. return self;}
  2593. }),
  2594. smalltalk.Date);
  2595. smalltalk.addMethod(
  2596. '__lt',
  2597. smalltalk.method({
  2598. selector: '<',
  2599. fn: function (aDate){
  2600. var self=this;
  2601. return self < aDate;
  2602. return self;}
  2603. }),
  2604. smalltalk.Date);
  2605. smalltalk.addMethod(
  2606. '__gt',
  2607. smalltalk.method({
  2608. selector: '>',
  2609. fn: function (aDate){
  2610. var self=this;
  2611. return self > aDate;
  2612. return self;}
  2613. }),
  2614. smalltalk.Date);
  2615. smalltalk.addMethod(
  2616. '__lt_eq',
  2617. smalltalk.method({
  2618. selector: '<=',
  2619. fn: function (aDate){
  2620. var self=this;
  2621. return self <= aDate;
  2622. return self;}
  2623. }),
  2624. smalltalk.Date);
  2625. smalltalk.addMethod(
  2626. '__gt_eq',
  2627. smalltalk.method({
  2628. selector: '>=',
  2629. fn: function (aDate){
  2630. var self=this;
  2631. return self >= aDate;
  2632. return self;}
  2633. }),
  2634. smalltalk.Date);
  2635. smalltalk.addMethod(
  2636. '__minus',
  2637. smalltalk.method({
  2638. selector: '-',
  2639. fn: function (aDate){
  2640. var self=this;
  2641. return self - aDate;
  2642. return self;}
  2643. }),
  2644. smalltalk.Date);
  2645. smalltalk.addMethod(
  2646. '__plus',
  2647. smalltalk.method({
  2648. selector: '+',
  2649. fn: function (aDate){
  2650. var self=this;
  2651. return self + aDate;
  2652. return self;}
  2653. }),
  2654. smalltalk.Date);
  2655. smalltalk.addMethod(
  2656. '_asJSONObject',
  2657. smalltalk.method({
  2658. selector: 'asJSONObject',
  2659. fn: function (){
  2660. var self=this;
  2661. return self;
  2662. return self;}
  2663. }),
  2664. smalltalk.Date);
  2665. smalltalk.addMethod(
  2666. '_new_',
  2667. smalltalk.method({
  2668. selector: 'new:',
  2669. fn: function (anObject){
  2670. var self=this;
  2671. return new Date(anObject);
  2672. return self;}
  2673. }),
  2674. smalltalk.Date.klass);
  2675. smalltalk.addMethod(
  2676. '_fromString_',
  2677. smalltalk.method({
  2678. selector: 'fromString:',
  2679. fn: function (aString){
  2680. var self=this;
  2681. return smalltalk.send(self, "_new_", [aString]);
  2682. return self;}
  2683. }),
  2684. smalltalk.Date.klass);
  2685. smalltalk.addMethod(
  2686. '_fromSeconds_',
  2687. smalltalk.method({
  2688. selector: 'fromSeconds:',
  2689. fn: function (aNumber){
  2690. var self=this;
  2691. return smalltalk.send(self, "_fromMilliseconds_", [((($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))]);
  2692. return self;}
  2693. }),
  2694. smalltalk.Date.klass);
  2695. smalltalk.addMethod(
  2696. '_fromMilliseconds_',
  2697. smalltalk.method({
  2698. selector: 'fromMilliseconds:',
  2699. fn: function (aNumber){
  2700. var self=this;
  2701. return smalltalk.send(self, "_new_", [aNumber]);
  2702. return self;}
  2703. }),
  2704. smalltalk.Date.klass);
  2705. smalltalk.addMethod(
  2706. '_today',
  2707. smalltalk.method({
  2708. selector: 'today',
  2709. fn: function (){
  2710. var self=this;
  2711. return smalltalk.send(self, "_new", []);
  2712. return self;}
  2713. }),
  2714. smalltalk.Date.klass);
  2715. smalltalk.addMethod(
  2716. '_now',
  2717. smalltalk.method({
  2718. selector: 'now',
  2719. fn: function (){
  2720. var self=this;
  2721. return smalltalk.send(self, "_today", []);
  2722. return self;}
  2723. }),
  2724. smalltalk.Date.klass);
  2725. smalltalk.addMethod(
  2726. '_millisecondsToRun_',
  2727. smalltalk.method({
  2728. selector: 'millisecondsToRun:',
  2729. fn: function (aBlock){
  2730. var self=this;
  2731. var t=nil;
  2732. t=smalltalk.send((smalltalk.Date || Date), "_now", []);
  2733. smalltalk.send(aBlock, "_value", []);
  2734. return ((($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]));
  2735. return self;}
  2736. }),
  2737. smalltalk.Date.klass);
  2738. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2739. smalltalk.addMethod(
  2740. '_subclass_instanceVariableNames_',
  2741. smalltalk.method({
  2742. selector: 'subclass:instanceVariableNames:',
  2743. fn: function (aString, anotherString){
  2744. var self=this;
  2745. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  2746. return self;}
  2747. }),
  2748. smalltalk.UndefinedObject);
  2749. smalltalk.addMethod(
  2750. '_subclass_instanceVariableNames_category_',
  2751. smalltalk.method({
  2752. selector: 'subclass:instanceVariableNames:category:',
  2753. fn: function (aString, aString2, aString3){
  2754. var self=this;
  2755. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  2756. return self;}
  2757. }),
  2758. smalltalk.UndefinedObject);
  2759. smalltalk.addMethod(
  2760. '_shallowCopy',
  2761. smalltalk.method({
  2762. selector: 'shallowCopy',
  2763. fn: function (){
  2764. var self=this;
  2765. return self;
  2766. return self;}
  2767. }),
  2768. smalltalk.UndefinedObject);
  2769. smalltalk.addMethod(
  2770. '_deepCopy',
  2771. smalltalk.method({
  2772. selector: 'deepCopy',
  2773. fn: function (){
  2774. var self=this;
  2775. return self;
  2776. return self;}
  2777. }),
  2778. smalltalk.UndefinedObject);
  2779. smalltalk.addMethod(
  2780. '_ifNil_',
  2781. smalltalk.method({
  2782. selector: 'ifNil:',
  2783. fn: function (aBlock){
  2784. var self=this;
  2785. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2786. return self;}
  2787. }),
  2788. smalltalk.UndefinedObject);
  2789. smalltalk.addMethod(
  2790. '_ifNotNil_',
  2791. smalltalk.method({
  2792. selector: 'ifNotNil:',
  2793. fn: function (aBlock){
  2794. var self=this;
  2795. return self;
  2796. return self;}
  2797. }),
  2798. smalltalk.UndefinedObject);
  2799. smalltalk.addMethod(
  2800. '_ifNil_ifNotNil_',
  2801. smalltalk.method({
  2802. selector: 'ifNil:ifNotNil:',
  2803. fn: function (aBlock, anotherBlock){
  2804. var self=this;
  2805. return smalltalk.send(aBlock, "_value", []);
  2806. return self;}
  2807. }),
  2808. smalltalk.UndefinedObject);
  2809. smalltalk.addMethod(
  2810. '_ifNotNil_ifNil_',
  2811. smalltalk.method({
  2812. selector: 'ifNotNil:ifNil:',
  2813. fn: function (aBlock, anotherBlock){
  2814. var self=this;
  2815. return smalltalk.send(anotherBlock, "_value", []);
  2816. return self;}
  2817. }),
  2818. smalltalk.UndefinedObject);
  2819. smalltalk.addMethod(
  2820. '_isNil',
  2821. smalltalk.method({
  2822. selector: 'isNil',
  2823. fn: function (){
  2824. var self=this;
  2825. return true;
  2826. return self;}
  2827. }),
  2828. smalltalk.UndefinedObject);
  2829. smalltalk.addMethod(
  2830. '_notNil',
  2831. smalltalk.method({
  2832. selector: 'notNil',
  2833. fn: function (){
  2834. var self=this;
  2835. return false;
  2836. return self;}
  2837. }),
  2838. smalltalk.UndefinedObject);
  2839. smalltalk.addMethod(
  2840. '_printString',
  2841. smalltalk.method({
  2842. selector: 'printString',
  2843. fn: function (){
  2844. var self=this;
  2845. return "nil";
  2846. return self;}
  2847. }),
  2848. smalltalk.UndefinedObject);
  2849. smalltalk.addMethod(
  2850. '_subclass_instanceVariableNames_package_',
  2851. smalltalk.method({
  2852. selector: 'subclass:instanceVariableNames:package:',
  2853. fn: function (aString, aString2, aString3){
  2854. var self=this;
  2855. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  2856. return self;}
  2857. }),
  2858. smalltalk.UndefinedObject);
  2859. smalltalk.addMethod(
  2860. '_new',
  2861. smalltalk.method({
  2862. selector: 'new',
  2863. fn: function (){
  2864. var self=this;
  2865. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2866. return self;}
  2867. }),
  2868. smalltalk.UndefinedObject.klass);
  2869. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  2870. smalltalk.addMethod(
  2871. '_size',
  2872. smalltalk.method({
  2873. selector: 'size',
  2874. fn: function (){
  2875. var self=this;
  2876. smalltalk.send(self, "_subclassResponsibility", []);
  2877. return self;}
  2878. }),
  2879. smalltalk.Collection);
  2880. smalltalk.addMethod(
  2881. '_readStream',
  2882. smalltalk.method({
  2883. selector: 'readStream',
  2884. fn: function (){
  2885. var self=this;
  2886. return smalltalk.send(self, "_stream", []);
  2887. return self;}
  2888. }),
  2889. smalltalk.Collection);
  2890. smalltalk.addMethod(
  2891. '_writeStream',
  2892. smalltalk.method({
  2893. selector: 'writeStream',
  2894. fn: function (){
  2895. var self=this;
  2896. return smalltalk.send(self, "_stream", []);
  2897. return self;}
  2898. }),
  2899. smalltalk.Collection);
  2900. smalltalk.addMethod(
  2901. '_stream',
  2902. smalltalk.method({
  2903. selector: 'stream',
  2904. fn: function (){
  2905. var self=this;
  2906. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  2907. return self;}
  2908. }),
  2909. smalltalk.Collection);
  2910. smalltalk.addMethod(
  2911. '_streamClass',
  2912. smalltalk.method({
  2913. selector: 'streamClass',
  2914. fn: function (){
  2915. var self=this;
  2916. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  2917. return self;}
  2918. }),
  2919. smalltalk.Collection);
  2920. smalltalk.addMethod(
  2921. '_add_',
  2922. smalltalk.method({
  2923. selector: 'add:',
  2924. fn: function (anObject){
  2925. var self=this;
  2926. smalltalk.send(self, "_subclassResponsibility", []);
  2927. return self;}
  2928. }),
  2929. smalltalk.Collection);
  2930. smalltalk.addMethod(
  2931. '_addAll_',
  2932. smalltalk.method({
  2933. selector: 'addAll:',
  2934. fn: function (aCollection){
  2935. var self=this;
  2936. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  2937. return aCollection;
  2938. return self;}
  2939. }),
  2940. smalltalk.Collection);
  2941. smalltalk.addMethod(
  2942. '__comma',
  2943. smalltalk.method({
  2944. selector: ',',
  2945. fn: function (aCollection){
  2946. var self=this;
  2947. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2948. return self;}
  2949. }),
  2950. smalltalk.Collection);
  2951. smalltalk.addMethod(
  2952. '_copyWith_',
  2953. smalltalk.method({
  2954. selector: 'copyWith:',
  2955. fn: function (anObject){
  2956. var self=this;
  2957. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2958. return self;}
  2959. }),
  2960. smalltalk.Collection);
  2961. smalltalk.addMethod(
  2962. '_copyWithAll_',
  2963. smalltalk.method({
  2964. selector: 'copyWithAll:',
  2965. fn: function (aCollection){
  2966. var self=this;
  2967. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2968. return self;}
  2969. }),
  2970. smalltalk.Collection);
  2971. smalltalk.addMethod(
  2972. '_asArray',
  2973. smalltalk.method({
  2974. selector: 'asArray',
  2975. fn: function (){
  2976. var self=this;
  2977. var array=nil;
  2978. var index=nil;
  2979. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  2980. index=(0);
  2981. 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]);})]);
  2982. return array;
  2983. return self;}
  2984. }),
  2985. smalltalk.Collection);
  2986. smalltalk.addMethod(
  2987. '_do_',
  2988. smalltalk.method({
  2989. selector: 'do:',
  2990. fn: function (aBlock){
  2991. var self=this;
  2992. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  2993. return self;}
  2994. }),
  2995. smalltalk.Collection);
  2996. smalltalk.addMethod(
  2997. '_collect_',
  2998. smalltalk.method({
  2999. selector: 'collect:',
  3000. fn: function (aBlock){
  3001. var self=this;
  3002. var newCollection=nil;
  3003. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3004. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  3005. return newCollection;
  3006. return self;}
  3007. }),
  3008. smalltalk.Collection);
  3009. smalltalk.addMethod(
  3010. '_detect_',
  3011. smalltalk.method({
  3012. selector: 'detect:',
  3013. fn: function (aBlock){
  3014. var self=this;
  3015. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3016. return self;}
  3017. }),
  3018. smalltalk.Collection);
  3019. smalltalk.addMethod(
  3020. '_detect_ifNone_',
  3021. smalltalk.method({
  3022. selector: 'detect:ifNone:',
  3023. fn: function (aBlock, anotherBlock){
  3024. var self=this;
  3025. for(var i = 0; i < self.length; i++)
  3026. if(aBlock(self[i]))
  3027. return self[i];
  3028. return anotherBlock();
  3029. ;
  3030. return self;}
  3031. }),
  3032. smalltalk.Collection);
  3033. smalltalk.addMethod(
  3034. '_do_separatedBy_',
  3035. smalltalk.method({
  3036. selector: 'do:separatedBy:',
  3037. fn: function (aBlock, anotherBlock){
  3038. var self=this;
  3039. var first=nil;
  3040. first=true;
  3041. 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]);})]);
  3042. return self;}
  3043. }),
  3044. smalltalk.Collection);
  3045. smalltalk.addMethod(
  3046. '_inject_into_',
  3047. smalltalk.method({
  3048. selector: 'inject:into:',
  3049. fn: function (anObject, aBlock){
  3050. var self=this;
  3051. var result=nil;
  3052. result=anObject;
  3053. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  3054. return result;
  3055. return self;}
  3056. }),
  3057. smalltalk.Collection);
  3058. smalltalk.addMethod(
  3059. '_reject_',
  3060. smalltalk.method({
  3061. selector: 'reject:',
  3062. fn: function (aBlock){
  3063. var self=this;
  3064. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  3065. return self;}
  3066. }),
  3067. smalltalk.Collection);
  3068. smalltalk.addMethod(
  3069. '_select_',
  3070. smalltalk.method({
  3071. selector: 'select:',
  3072. fn: function (aBlock){
  3073. var self=this;
  3074. var stream=nil;
  3075. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  3076. 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]);})]));})]);
  3077. return smalltalk.send(stream, "_contents", []);
  3078. return self;}
  3079. }),
  3080. smalltalk.Collection);
  3081. smalltalk.addMethod(
  3082. '_errorNotFound',
  3083. smalltalk.method({
  3084. selector: 'errorNotFound',
  3085. fn: function (){
  3086. var self=this;
  3087. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  3088. return self;}
  3089. }),
  3090. smalltalk.Collection);
  3091. smalltalk.addMethod(
  3092. '_includes_',
  3093. smalltalk.method({
  3094. selector: 'includes:',
  3095. fn: function (anObject){
  3096. var self=this;
  3097. var i = self.length;
  3098. while (i--) {
  3099. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  3100. }
  3101. return false
  3102. ;
  3103. return self;}
  3104. }),
  3105. smalltalk.Collection);
  3106. smalltalk.addMethod(
  3107. '_notEmpty',
  3108. smalltalk.method({
  3109. selector: 'notEmpty',
  3110. fn: function (){
  3111. var self=this;
  3112. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  3113. return self;}
  3114. }),
  3115. smalltalk.Collection);
  3116. smalltalk.addMethod(
  3117. '_isEmpty',
  3118. smalltalk.method({
  3119. selector: 'isEmpty',
  3120. fn: function (){
  3121. var self=this;
  3122. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  3123. return self;}
  3124. }),
  3125. smalltalk.Collection);
  3126. smalltalk.addMethod(
  3127. '_remove_',
  3128. smalltalk.method({
  3129. selector: 'remove:',
  3130. fn: function (anObject){
  3131. var self=this;
  3132. smalltalk.send(self, "_subclassResponsibility", []);
  3133. return self;}
  3134. }),
  3135. smalltalk.Collection);
  3136. smalltalk.addMethod(
  3137. '_asSet',
  3138. smalltalk.method({
  3139. selector: 'asSet',
  3140. fn: function (){
  3141. var self=this;
  3142. return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
  3143. return self;}
  3144. }),
  3145. smalltalk.Collection);
  3146. smalltalk.addMethod(
  3147. '_ifNotEmpty_',
  3148. smalltalk.method({
  3149. selector: 'ifNotEmpty:',
  3150. fn: function (aBlock){
  3151. var self=this;
  3152. smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
  3153. return self;}
  3154. }),
  3155. smalltalk.Collection);
  3156. smalltalk.addMethod(
  3157. '_ifEmpty_',
  3158. smalltalk.method({
  3159. selector: 'ifEmpty:',
  3160. fn: function (aBlock){
  3161. var self=this;
  3162. smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_ifTrue_", [aBlock]);
  3163. return self;}
  3164. }),
  3165. smalltalk.Collection);
  3166. smalltalk.addMethod(
  3167. '_copyWithoutAll_',
  3168. smalltalk.method({
  3169. selector: 'copyWithoutAll:',
  3170. fn: function (aCollection){
  3171. var self=this;
  3172. return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
  3173. return self;}
  3174. }),
  3175. smalltalk.Collection);
  3176. smalltalk.addMethod(
  3177. '_streamClass',
  3178. smalltalk.method({
  3179. selector: 'streamClass',
  3180. fn: function (){
  3181. var self=this;
  3182. return (smalltalk.Stream || Stream);
  3183. return self;}
  3184. }),
  3185. smalltalk.Collection.klass);
  3186. smalltalk.addMethod(
  3187. '_with_',
  3188. smalltalk.method({
  3189. selector: 'with:',
  3190. fn: function (anObject){
  3191. var self=this;
  3192. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3193. return self;}
  3194. }),
  3195. smalltalk.Collection.klass);
  3196. smalltalk.addMethod(
  3197. '_with_with_',
  3198. smalltalk.method({
  3199. selector: 'with:with:',
  3200. fn: function (anObject, anotherObject){
  3201. var self=this;
  3202. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3203. return self;}
  3204. }),
  3205. smalltalk.Collection.klass);
  3206. smalltalk.addMethod(
  3207. '_with_with_with_',
  3208. smalltalk.method({
  3209. selector: 'with:with:with:',
  3210. fn: function (firstObject, secondObject, thirdObject){
  3211. var self=this;
  3212. 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", []));
  3213. return self;}
  3214. }),
  3215. smalltalk.Collection.klass);
  3216. smalltalk.addMethod(
  3217. '_withAll_',
  3218. smalltalk.method({
  3219. selector: 'withAll:',
  3220. fn: function (aCollection){
  3221. var self=this;
  3222. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3223. return self;}
  3224. }),
  3225. smalltalk.Collection.klass);
  3226. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  3227. smalltalk.addMethod(
  3228. '_at_',
  3229. smalltalk.method({
  3230. selector: 'at:',
  3231. fn: function (anIndex){
  3232. var self=this;
  3233. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3234. return self;}
  3235. }),
  3236. smalltalk.SequenceableCollection);
  3237. smalltalk.addMethod(
  3238. '_at_ifAbsent_',
  3239. smalltalk.method({
  3240. selector: 'at:ifAbsent:',
  3241. fn: function (anIndex, aBlock){
  3242. var self=this;
  3243. smalltalk.send(self, "_subclassResponsibility", []);
  3244. return self;}
  3245. }),
  3246. smalltalk.SequenceableCollection);
  3247. smalltalk.addMethod(
  3248. '_at_put_',
  3249. smalltalk.method({
  3250. selector: 'at:put:',
  3251. fn: function (anIndex, anObject){
  3252. var self=this;
  3253. smalltalk.send(self, "_subclassResponsibility", []);
  3254. return self;}
  3255. }),
  3256. smalltalk.SequenceableCollection);
  3257. smalltalk.addMethod(
  3258. '_copyFrom_to_',
  3259. smalltalk.method({
  3260. selector: 'copyFrom:to:',
  3261. fn: function (anIndex, anotherIndex){
  3262. var self=this;
  3263. smalltalk.send(self, "_subclassResponsibility", []);
  3264. return self;}
  3265. }),
  3266. smalltalk.SequenceableCollection);
  3267. smalltalk.addMethod(
  3268. '_first',
  3269. smalltalk.method({
  3270. selector: 'first',
  3271. fn: function (){
  3272. var self=this;
  3273. return smalltalk.send(self, "_at_", [(1)]);
  3274. return self;}
  3275. }),
  3276. smalltalk.SequenceableCollection);
  3277. smalltalk.addMethod(
  3278. '_fourth',
  3279. smalltalk.method({
  3280. selector: 'fourth',
  3281. fn: function (){
  3282. var self=this;
  3283. return smalltalk.send(self, "_at_", [(4)]);
  3284. return self;}
  3285. }),
  3286. smalltalk.SequenceableCollection);
  3287. smalltalk.addMethod(
  3288. '_last',
  3289. smalltalk.method({
  3290. selector: 'last',
  3291. fn: function (){
  3292. var self=this;
  3293. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  3294. return self;}
  3295. }),
  3296. smalltalk.SequenceableCollection);
  3297. smalltalk.addMethod(
  3298. '_second',
  3299. smalltalk.method({
  3300. selector: 'second',
  3301. fn: function (){
  3302. var self=this;
  3303. return smalltalk.send(self, "_at_", [(2)]);
  3304. return self;}
  3305. }),
  3306. smalltalk.SequenceableCollection);
  3307. smalltalk.addMethod(
  3308. '_third',
  3309. smalltalk.method({
  3310. selector: 'third',
  3311. fn: function (){
  3312. var self=this;
  3313. return smalltalk.send(self, "_at_", [(3)]);
  3314. return self;}
  3315. }),
  3316. smalltalk.SequenceableCollection);
  3317. smalltalk.addMethod(
  3318. '_removeLast',
  3319. smalltalk.method({
  3320. selector: 'removeLast',
  3321. fn: function (){
  3322. var self=this;
  3323. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  3324. return self;}
  3325. }),
  3326. smalltalk.SequenceableCollection);
  3327. smalltalk.addMethod(
  3328. '_addLast_',
  3329. smalltalk.method({
  3330. selector: 'addLast:',
  3331. fn: function (anObject){
  3332. var self=this;
  3333. smalltalk.send(self, "_add_", [anObject]);
  3334. return self;}
  3335. }),
  3336. smalltalk.SequenceableCollection);
  3337. smalltalk.addMethod(
  3338. '_withIndexDo_',
  3339. smalltalk.method({
  3340. selector: 'withIndexDo:',
  3341. fn: function (aBlock){
  3342. var self=this;
  3343. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  3344. return self;}
  3345. }),
  3346. smalltalk.SequenceableCollection);
  3347. smalltalk.addMethod(
  3348. '_allButFirst',
  3349. smalltalk.method({
  3350. selector: 'allButFirst',
  3351. fn: function (){
  3352. var self=this;
  3353. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  3354. return self;}
  3355. }),
  3356. smalltalk.SequenceableCollection);
  3357. smalltalk.addMethod(
  3358. '_allButLast',
  3359. smalltalk.method({
  3360. selector: 'allButLast',
  3361. fn: function (){
  3362. var self=this;
  3363. return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
  3364. return self;}
  3365. }),
  3366. smalltalk.SequenceableCollection);
  3367. smalltalk.addMethod(
  3368. '_indexOf_',
  3369. smalltalk.method({
  3370. selector: 'indexOf:',
  3371. fn: function (anObject){
  3372. var self=this;
  3373. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3374. return self;}
  3375. }),
  3376. smalltalk.SequenceableCollection);
  3377. smalltalk.addMethod(
  3378. '_indexOf_ifAbsent_',
  3379. smalltalk.method({
  3380. selector: 'indexOf:ifAbsent:',
  3381. fn: function (anObject, aBlock){
  3382. var self=this;
  3383. for(var i=0;i<self.length;i++){
  3384. if(self[i].__eq(anObject)) {return i+1}
  3385. }
  3386. return aBlock();
  3387. ;
  3388. return self;}
  3389. }),
  3390. smalltalk.SequenceableCollection);
  3391. smalltalk.addMethod(
  3392. '_indexOf_startingAt_ifAbsent_',
  3393. smalltalk.method({
  3394. selector: 'indexOf:startingAt:ifAbsent:',
  3395. fn: function (anObject, start, aBlock){
  3396. var self=this;
  3397. for(var i=start-1;i<self.length;i++){
  3398. if(self[i].__eq(anObject)) {return i+1}
  3399. }
  3400. return aBlock();
  3401. ;
  3402. return self;}
  3403. }),
  3404. smalltalk.SequenceableCollection);
  3405. smalltalk.addMethod(
  3406. '_indexOf_startingAt_',
  3407. smalltalk.method({
  3408. selector: 'indexOf:startingAt:',
  3409. fn: function (anObject, start){
  3410. var self=this;
  3411. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  3412. return self;}
  3413. }),
  3414. smalltalk.SequenceableCollection);
  3415. smalltalk.addMethod(
  3416. '_reversed',
  3417. smalltalk.method({
  3418. selector: 'reversed',
  3419. fn: function (){
  3420. var self=this;
  3421. smalltalk.send(self, "_subclassResponsibility", []);
  3422. return self;}
  3423. }),
  3424. smalltalk.SequenceableCollection);
  3425. smalltalk.addMethod(
  3426. '_atRandom',
  3427. smalltalk.method({
  3428. selector: 'atRandom',
  3429. fn: function (){
  3430. var self=this;
  3431. return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
  3432. return self;}
  3433. }),
  3434. smalltalk.SequenceableCollection);
  3435. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  3436. smalltalk.addMethod(
  3437. '__eq',
  3438. smalltalk.method({
  3439. selector: '=',
  3440. fn: function (aString){
  3441. var self=this;
  3442. 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}})})();})]));
  3443. return String(self) == aString;
  3444. return self;
  3445. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  3446. }),
  3447. smalltalk.String);
  3448. smalltalk.addMethod(
  3449. '_size',
  3450. smalltalk.method({
  3451. selector: 'size',
  3452. fn: function (){
  3453. var self=this;
  3454. return self.length;
  3455. return self;}
  3456. }),
  3457. smalltalk.String);
  3458. smalltalk.addMethod(
  3459. '_at_',
  3460. smalltalk.method({
  3461. selector: 'at:',
  3462. fn: function (anIndex){
  3463. var self=this;
  3464. return self[anIndex - 1];
  3465. return self;}
  3466. }),
  3467. smalltalk.String);
  3468. smalltalk.addMethod(
  3469. '_at_put_',
  3470. smalltalk.method({
  3471. selector: 'at:put:',
  3472. fn: function (anIndex, anObject){
  3473. var self=this;
  3474. smalltalk.send(self, "_errorReadOnly", []);
  3475. return self;}
  3476. }),
  3477. smalltalk.String);
  3478. smalltalk.addMethod(
  3479. '_at_ifAbsent_',
  3480. smalltalk.method({
  3481. selector: 'at:ifAbsent:',
  3482. fn: function (anIndex, aBlock){
  3483. var self=this;
  3484. (($receiver = smalltalk.send(self, "_at_", [anIndex])) == nil || $receiver == undefined) ? (function(){return aBlock;})() : $receiver;
  3485. return self;}
  3486. }),
  3487. smalltalk.String);
  3488. smalltalk.addMethod(
  3489. '_escaped',
  3490. smalltalk.method({
  3491. selector: 'escaped',
  3492. fn: function (){
  3493. var self=this;
  3494. return escape(self);
  3495. return self;}
  3496. }),
  3497. smalltalk.String);
  3498. smalltalk.addMethod(
  3499. '_unescaped',
  3500. smalltalk.method({
  3501. selector: 'unescaped',
  3502. fn: function (){
  3503. var self=this;
  3504. return unescape(self);
  3505. return self;}
  3506. }),
  3507. smalltalk.String);
  3508. smalltalk.addMethod(
  3509. '_add_',
  3510. smalltalk.method({
  3511. selector: 'add:',
  3512. fn: function (anObject){
  3513. var self=this;
  3514. smalltalk.send(self, "_errorReadOnly", []);
  3515. return self;}
  3516. }),
  3517. smalltalk.String);
  3518. smalltalk.addMethod(
  3519. '__comma',
  3520. smalltalk.method({
  3521. selector: ',',
  3522. fn: function (aString){
  3523. var self=this;
  3524. return self + aString;
  3525. return self;}
  3526. }),
  3527. smalltalk.String);
  3528. smalltalk.addMethod(
  3529. '_copyFrom_to_',
  3530. smalltalk.method({
  3531. selector: 'copyFrom:to:',
  3532. fn: function (anIndex, anotherIndex){
  3533. var self=this;
  3534. return self.substring(anIndex - 1, anotherIndex);
  3535. return self;}
  3536. }),
  3537. smalltalk.String);
  3538. smalltalk.addMethod(
  3539. '_shallowCopy',
  3540. smalltalk.method({
  3541. selector: 'shallowCopy',
  3542. fn: function (){
  3543. var self=this;
  3544. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  3545. return self;}
  3546. }),
  3547. smalltalk.String);
  3548. smalltalk.addMethod(
  3549. '_deepCopy',
  3550. smalltalk.method({
  3551. selector: 'deepCopy',
  3552. fn: function (){
  3553. var self=this;
  3554. return smalltalk.send(self, "_shallowCopy", []);
  3555. return self;}
  3556. }),
  3557. smalltalk.String);
  3558. smalltalk.addMethod(
  3559. '_asSelector',
  3560. smalltalk.method({
  3561. selector: 'asSelector',
  3562. fn: function (){
  3563. var self=this;
  3564. var selector=nil;
  3565. selector=smalltalk.send("_", "__comma", [self]);
  3566. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  3567. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  3568. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  3569. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  3570. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  3571. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  3572. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  3573. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  3574. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  3575. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  3576. return selector;
  3577. return self;}
  3578. }),
  3579. smalltalk.String);
  3580. smalltalk.addMethod(
  3581. '_asJavascript',
  3582. smalltalk.method({
  3583. selector: 'asJavascript',
  3584. fn: function (){
  3585. var self=this;
  3586. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  3587. return "unescape(\"" + escape(self) + "\")";
  3588. else
  3589. return "\"" + self + "\"";
  3590. ;
  3591. return self;}
  3592. }),
  3593. smalltalk.String);
  3594. smalltalk.addMethod(
  3595. '_replace_with_',
  3596. smalltalk.method({
  3597. selector: 'replace:with:',
  3598. fn: function (aString, anotherString){
  3599. var self=this;
  3600. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  3601. return self;}
  3602. }),
  3603. smalltalk.String);
  3604. smalltalk.addMethod(
  3605. '_replaceRegexp_with_',
  3606. smalltalk.method({
  3607. selector: 'replaceRegexp:with:',
  3608. fn: function (aRegexp, aString){
  3609. var self=this;
  3610. return self.replace(aRegexp, aString);
  3611. return self;}
  3612. }),
  3613. smalltalk.String);
  3614. smalltalk.addMethod(
  3615. '_tokenize_',
  3616. smalltalk.method({
  3617. selector: 'tokenize:',
  3618. fn: function (aString){
  3619. var self=this;
  3620. return self.split(aString);
  3621. return self;}
  3622. }),
  3623. smalltalk.String);
  3624. smalltalk.addMethod(
  3625. '_match_',
  3626. smalltalk.method({
  3627. selector: 'match:',
  3628. fn: function (aRegexp){
  3629. var self=this;
  3630. return self.search(aRegexp) != -1;
  3631. return self;}
  3632. }),
  3633. smalltalk.String);
  3634. smalltalk.addMethod(
  3635. '_asString',
  3636. smalltalk.method({
  3637. selector: 'asString',
  3638. fn: function (){
  3639. var self=this;
  3640. return self;
  3641. return self;}
  3642. }),
  3643. smalltalk.String);
  3644. smalltalk.addMethod(
  3645. '_asNumber',
  3646. smalltalk.method({
  3647. selector: 'asNumber',
  3648. fn: function (){
  3649. var self=this;
  3650. return Number(self);
  3651. return self;}
  3652. }),
  3653. smalltalk.String);
  3654. smalltalk.addMethod(
  3655. '_errorReadOnly',
  3656. smalltalk.method({
  3657. selector: 'errorReadOnly',
  3658. fn: function (){
  3659. var self=this;
  3660. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  3661. return self;}
  3662. }),
  3663. smalltalk.String);
  3664. smalltalk.addMethod(
  3665. '_printString',
  3666. smalltalk.method({
  3667. selector: 'printString',
  3668. fn: function (){
  3669. var self=this;
  3670. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  3671. return self;}
  3672. }),
  3673. smalltalk.String);
  3674. smalltalk.addMethod(
  3675. '_printNl',
  3676. smalltalk.method({
  3677. selector: 'printNl',
  3678. fn: function (){
  3679. var self=this;
  3680. console.log(self);
  3681. return self;}
  3682. }),
  3683. smalltalk.String);
  3684. smalltalk.addMethod(
  3685. '_isString',
  3686. smalltalk.method({
  3687. selector: 'isString',
  3688. fn: function (){
  3689. var self=this;
  3690. return true;
  3691. return self;}
  3692. }),
  3693. smalltalk.String);
  3694. smalltalk.addMethod(
  3695. '__gt',
  3696. smalltalk.method({
  3697. selector: '>',
  3698. fn: function (aString){
  3699. var self=this;
  3700. return String(self) > aString;
  3701. return self;}
  3702. }),
  3703. smalltalk.String);
  3704. smalltalk.addMethod(
  3705. '__lt',
  3706. smalltalk.method({
  3707. selector: '<',
  3708. fn: function (aString){
  3709. var self=this;
  3710. return String(self) < aString;
  3711. return self;}
  3712. }),
  3713. smalltalk.String);
  3714. smalltalk.addMethod(
  3715. '__gt_eq',
  3716. smalltalk.method({
  3717. selector: '>=',
  3718. fn: function (aString){
  3719. var self=this;
  3720. return String(self) >= aString;
  3721. return self;}
  3722. }),
  3723. smalltalk.String);
  3724. smalltalk.addMethod(
  3725. '__lt_eq',
  3726. smalltalk.method({
  3727. selector: '<=',
  3728. fn: function (aString){
  3729. var self=this;
  3730. return String(self) <= aString;
  3731. return self;}
  3732. }),
  3733. smalltalk.String);
  3734. smalltalk.addMethod(
  3735. '_remove_',
  3736. smalltalk.method({
  3737. selector: 'remove:',
  3738. fn: function (anObject){
  3739. var self=this;
  3740. smalltalk.send(self, "_errorReadOnly", []);
  3741. return self;}
  3742. }),
  3743. smalltalk.String);
  3744. smalltalk.addMethod(
  3745. '_asJSONObject',
  3746. smalltalk.method({
  3747. selector: 'asJSONObject',
  3748. fn: function (){
  3749. var self=this;
  3750. return self;
  3751. return self;}
  3752. }),
  3753. smalltalk.String);
  3754. smalltalk.addMethod(
  3755. '_trimLeft_',
  3756. smalltalk.method({
  3757. selector: 'trimLeft:',
  3758. fn: function (separators){
  3759. var self=this;
  3760. 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"]), ""]);
  3761. return self;}
  3762. }),
  3763. smalltalk.String);
  3764. smalltalk.addMethod(
  3765. '_trimRight_',
  3766. smalltalk.method({
  3767. selector: 'trimRight:',
  3768. fn: function (separators){
  3769. var self=this;
  3770. 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"]), ""]);
  3771. return self;}
  3772. }),
  3773. smalltalk.String);
  3774. smalltalk.addMethod(
  3775. '_trimLeft',
  3776. smalltalk.method({
  3777. selector: 'trimLeft',
  3778. fn: function (){
  3779. var self=this;
  3780. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  3781. return self;}
  3782. }),
  3783. smalltalk.String);
  3784. smalltalk.addMethod(
  3785. '_trimRight',
  3786. smalltalk.method({
  3787. selector: 'trimRight',
  3788. fn: function (){
  3789. var self=this;
  3790. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  3791. return self;}
  3792. }),
  3793. smalltalk.String);
  3794. smalltalk.addMethod(
  3795. '_trimBoth',
  3796. smalltalk.method({
  3797. selector: 'trimBoth',
  3798. fn: function (){
  3799. var self=this;
  3800. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  3801. return self;}
  3802. }),
  3803. smalltalk.String);
  3804. smalltalk.addMethod(
  3805. '_trimBoth_',
  3806. smalltalk.method({
  3807. selector: 'trimBoth:',
  3808. fn: function (separators){
  3809. var self=this;
  3810. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  3811. return self;}
  3812. }),
  3813. smalltalk.String);
  3814. smalltalk.addMethod(
  3815. '_asLowercase',
  3816. smalltalk.method({
  3817. selector: 'asLowercase',
  3818. fn: function (){
  3819. var self=this;
  3820. return self.toLowerCase();
  3821. return self;}
  3822. }),
  3823. smalltalk.String);
  3824. smalltalk.addMethod(
  3825. '_asUppercase',
  3826. smalltalk.method({
  3827. selector: 'asUppercase',
  3828. fn: function (){
  3829. var self=this;
  3830. return self.toUpperCase();
  3831. return self;}
  3832. }),
  3833. smalltalk.String);
  3834. smalltalk.addMethod(
  3835. '_join_',
  3836. smalltalk.method({
  3837. selector: 'join:',
  3838. fn: function (aCollection){
  3839. var self=this;
  3840. 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]);})]);})]);
  3841. return self;}
  3842. }),
  3843. smalltalk.String);
  3844. smalltalk.addMethod(
  3845. '_includesSubString_',
  3846. smalltalk.method({
  3847. selector: 'includesSubString:',
  3848. fn: function (subString){
  3849. var self=this;
  3850. return self.indexOf(subString) != -1 ;
  3851. return self;}
  3852. }),
  3853. smalltalk.String);
  3854. smalltalk.addMethod(
  3855. '_asciiValue',
  3856. smalltalk.method({
  3857. selector: 'asciiValue',
  3858. fn: function (){
  3859. var self=this;
  3860. return self.charCodeAt(0);;
  3861. return self;}
  3862. }),
  3863. smalltalk.String);
  3864. smalltalk.addMethod(
  3865. '_lineIndicesDo_',
  3866. smalltalk.method({
  3867. selector: 'lineIndicesDo:',
  3868. fn: function (aBlock){
  3869. var self=this;
  3870. try{var cr=nil;
  3871. var lf=nil;
  3872. var start=nil;
  3873. var sz=nil;
  3874. var nextLF=nil;
  3875. var nextCR=nil;
  3876. start=(1);
  3877. sz=smalltalk.send(self, "_size", []);
  3878. cr=smalltalk.send((smalltalk.String || String), "_cr", []);
  3879. nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]);
  3880. lf=smalltalk.send((smalltalk.String || String), "_lf", []);
  3881. nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]);
  3882. (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]);})]));})]));})()}})();
  3883. return self;
  3884. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}}
  3885. }),
  3886. smalltalk.String);
  3887. smalltalk.addMethod(
  3888. '_linesDo_',
  3889. smalltalk.method({
  3890. selector: 'linesDo:',
  3891. fn: function (aBlock){
  3892. var self=this;
  3893. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  3894. return self;}
  3895. }),
  3896. smalltalk.String);
  3897. smalltalk.addMethod(
  3898. '_lines',
  3899. smalltalk.method({
  3900. selector: 'lines',
  3901. fn: function (){
  3902. var self=this;
  3903. var lines=nil;
  3904. lines=smalltalk.send((smalltalk.Array || Array), "_new", []);
  3905. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  3906. return lines;
  3907. return self;}
  3908. }),
  3909. smalltalk.String);
  3910. smalltalk.addMethod(
  3911. '_lineNumber_',
  3912. smalltalk.method({
  3913. selector: 'lineNumber:',
  3914. fn: function (anIndex){
  3915. var self=this;
  3916. try{var lineCount=nil;
  3917. lineCount=(0);
  3918. 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])}})})();})]));})]);
  3919. (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
  3920. return self;
  3921. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}}
  3922. }),
  3923. smalltalk.String);
  3924. smalltalk.addMethod(
  3925. '_reversed',
  3926. smalltalk.method({
  3927. selector: 'reversed',
  3928. fn: function (){
  3929. var self=this;
  3930. return self.split("").reverse().join("");
  3931. return self;}
  3932. }),
  3933. smalltalk.String);
  3934. smalltalk.addMethod(
  3935. '__eq_eq',
  3936. smalltalk.method({
  3937. selector: '==',
  3938. fn: function (aString){
  3939. var self=this;
  3940. 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}})})();})]));
  3941. return String(self) === String(aString);
  3942. return self;
  3943. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  3944. }),
  3945. smalltalk.String);
  3946. smalltalk.addMethod(
  3947. '_asJavaScriptSelector',
  3948. smalltalk.method({
  3949. selector: 'asJavaScriptSelector',
  3950. fn: function (){
  3951. var self=this;
  3952. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", [unescape("%5E_"), ""]), "_replace_with_", [unescape("_.*"), ""]);
  3953. return self;}
  3954. }),
  3955. smalltalk.String);
  3956. smalltalk.addMethod(
  3957. '_streamClass',
  3958. smalltalk.method({
  3959. selector: 'streamClass',
  3960. fn: function (){
  3961. var self=this;
  3962. return (smalltalk.StringStream || StringStream);
  3963. return self;}
  3964. }),
  3965. smalltalk.String.klass);
  3966. smalltalk.addMethod(
  3967. '_fromString_',
  3968. smalltalk.method({
  3969. selector: 'fromString:',
  3970. fn: function (aString){
  3971. var self=this;
  3972. return new self.fn(aString);
  3973. return self;}
  3974. }),
  3975. smalltalk.String.klass);
  3976. smalltalk.addMethod(
  3977. '_cr',
  3978. smalltalk.method({
  3979. selector: 'cr',
  3980. fn: function (){
  3981. var self=this;
  3982. return '\r';
  3983. return self;}
  3984. }),
  3985. smalltalk.String.klass);
  3986. smalltalk.addMethod(
  3987. '_lf',
  3988. smalltalk.method({
  3989. selector: 'lf',
  3990. fn: function (){
  3991. var self=this;
  3992. return '\n';
  3993. return self;}
  3994. }),
  3995. smalltalk.String.klass);
  3996. smalltalk.addMethod(
  3997. '_space',
  3998. smalltalk.method({
  3999. selector: 'space',
  4000. fn: function (){
  4001. var self=this;
  4002. return ' ';
  4003. return self;}
  4004. }),
  4005. smalltalk.String.klass);
  4006. smalltalk.addMethod(
  4007. '_tab',
  4008. smalltalk.method({
  4009. selector: 'tab',
  4010. fn: function (){
  4011. var self=this;
  4012. return '\t';
  4013. return self;}
  4014. }),
  4015. smalltalk.String.klass);
  4016. smalltalk.addMethod(
  4017. '_crlf',
  4018. smalltalk.method({
  4019. selector: 'crlf',
  4020. fn: function (){
  4021. var self=this;
  4022. return '\r\n';
  4023. return self;}
  4024. }),
  4025. smalltalk.String.klass);
  4026. smalltalk.addMethod(
  4027. '_streamContents_',
  4028. smalltalk.method({
  4029. selector: 'streamContents:',
  4030. fn: function (blockWithArg){
  4031. var self=this;
  4032. var stream=nil;
  4033. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]);
  4034. smalltalk.send(blockWithArg, "_value_", [stream]);
  4035. return smalltalk.send(stream, "_contents", []);
  4036. return self;}
  4037. }),
  4038. smalltalk.String.klass);
  4039. smalltalk.addMethod(
  4040. '_value_',
  4041. smalltalk.method({
  4042. selector: 'value:',
  4043. fn: function (aUTFCharCode){
  4044. var self=this;
  4045. return String.fromCharCode(aUTFCharCode);;
  4046. return self;}
  4047. }),
  4048. smalltalk.String.klass);
  4049. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  4050. smalltalk.addMethod(
  4051. '_size',
  4052. smalltalk.method({
  4053. selector: 'size',
  4054. fn: function (){
  4055. var self=this;
  4056. return self.length;
  4057. return self;}
  4058. }),
  4059. smalltalk.Array);
  4060. smalltalk.addMethod(
  4061. '_at_put_',
  4062. smalltalk.method({
  4063. selector: 'at:put:',
  4064. fn: function (anIndex, anObject){
  4065. var self=this;
  4066. return self[anIndex - 1] = anObject;
  4067. return self;}
  4068. }),
  4069. smalltalk.Array);
  4070. smalltalk.addMethod(
  4071. '_at_ifAbsent_',
  4072. smalltalk.method({
  4073. selector: 'at:ifAbsent:',
  4074. fn: function (anIndex, aBlock){
  4075. var self=this;
  4076. var value = self[anIndex - 1];
  4077. if(value === undefined) {
  4078. return aBlock();
  4079. } else {
  4080. return value;
  4081. }
  4082. ;
  4083. return self;}
  4084. }),
  4085. smalltalk.Array);
  4086. smalltalk.addMethod(
  4087. '_add_',
  4088. smalltalk.method({
  4089. selector: 'add:',
  4090. fn: function (anObject){
  4091. var self=this;
  4092. self.push(anObject); return anObject;;
  4093. return self;}
  4094. }),
  4095. smalltalk.Array);
  4096. smalltalk.addMethod(
  4097. '_shallowCopy',
  4098. smalltalk.method({
  4099. selector: 'shallowCopy',
  4100. fn: function (){
  4101. var self=this;
  4102. var newCollection=nil;
  4103. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4104. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  4105. return newCollection;
  4106. return self;}
  4107. }),
  4108. smalltalk.Array);
  4109. smalltalk.addMethod(
  4110. '_deepCopy',
  4111. smalltalk.method({
  4112. selector: 'deepCopy',
  4113. fn: function (){
  4114. var self=this;
  4115. var newCollection=nil;
  4116. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4117. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  4118. return newCollection;
  4119. return self;}
  4120. }),
  4121. smalltalk.Array);
  4122. smalltalk.addMethod(
  4123. '_copyFrom_to_',
  4124. smalltalk.method({
  4125. selector: 'copyFrom:to:',
  4126. fn: function (anIndex, anotherIndex){
  4127. var self=this;
  4128. var array=nil;
  4129. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4130. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  4131. return array;
  4132. return self;}
  4133. }),
  4134. smalltalk.Array);
  4135. smalltalk.addMethod(
  4136. '_join_',
  4137. smalltalk.method({
  4138. selector: 'join:',
  4139. fn: function (aString){
  4140. var self=this;
  4141. return self.join(aString);
  4142. return self;}
  4143. }),
  4144. smalltalk.Array);
  4145. smalltalk.addMethod(
  4146. '_asJavascript',
  4147. smalltalk.method({
  4148. selector: 'asJavascript',
  4149. fn: function (){
  4150. var self=this;
  4151. 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")]);
  4152. return self;}
  4153. }),
  4154. smalltalk.Array);
  4155. smalltalk.addMethod(
  4156. '_sort',
  4157. smalltalk.method({
  4158. selector: 'sort',
  4159. fn: function (){
  4160. var self=this;
  4161. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  4162. return self;}
  4163. }),
  4164. smalltalk.Array);
  4165. smalltalk.addMethod(
  4166. '_sort_',
  4167. smalltalk.method({
  4168. selector: 'sort:',
  4169. fn: function (aBlock){
  4170. var self=this;
  4171. return self.sort(function(a, b) {
  4172. if(aBlock(a,b)) {return -1} else {return 1}
  4173. })
  4174. ;
  4175. return self;}
  4176. }),
  4177. smalltalk.Array);
  4178. smalltalk.addMethod(
  4179. '_remove_',
  4180. smalltalk.method({
  4181. selector: 'remove:',
  4182. fn: function (anObject){
  4183. var self=this;
  4184. for(var i=0;i<self.length;i++) {
  4185. if(self[i] == anObject) {
  4186. self.splice(i,1);
  4187. break;
  4188. }
  4189. }
  4190. ;
  4191. return self;}
  4192. }),
  4193. smalltalk.Array);
  4194. smalltalk.addMethod(
  4195. '_sorted',
  4196. smalltalk.method({
  4197. selector: 'sorted',
  4198. fn: function (){
  4199. var self=this;
  4200. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  4201. return self;}
  4202. }),
  4203. smalltalk.Array);
  4204. smalltalk.addMethod(
  4205. '_sorted_',
  4206. smalltalk.method({
  4207. selector: 'sorted:',
  4208. fn: function (aBlock){
  4209. var self=this;
  4210. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  4211. return self;}
  4212. }),
  4213. smalltalk.Array);
  4214. smalltalk.addMethod(
  4215. '_asJSONObject',
  4216. smalltalk.method({
  4217. selector: 'asJSONObject',
  4218. fn: function (){
  4219. var self=this;
  4220. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  4221. return self;}
  4222. }),
  4223. smalltalk.Array);
  4224. smalltalk.addMethod(
  4225. '_removeFrom_to_',
  4226. smalltalk.method({
  4227. selector: 'removeFrom:to:',
  4228. fn: function (aNumber, anotherNumber){
  4229. var self=this;
  4230. self.splice(aNumber - 1,anotherNumber - 1);
  4231. return self;}
  4232. }),
  4233. smalltalk.Array);
  4234. smalltalk.addMethod(
  4235. '_printString',
  4236. smalltalk.method({
  4237. selector: 'printString',
  4238. fn: function (){
  4239. var self=this;
  4240. var str=nil;
  4241. str=smalltalk.send("", "_writeStream", []);
  4242. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  4243. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  4244. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  4245. return smalltalk.send(str, "_contents", []);
  4246. return self;}
  4247. }),
  4248. smalltalk.Array);
  4249. smalltalk.addMethod(
  4250. '_reversed',
  4251. smalltalk.method({
  4252. selector: 'reversed',
  4253. fn: function (){
  4254. var self=this;
  4255. return self._copy().reverse();
  4256. return self;}
  4257. }),
  4258. smalltalk.Array);
  4259. smalltalk.addMethod(
  4260. '__eq',
  4261. smalltalk.method({
  4262. selector: '=',
  4263. fn: function (aCollection){
  4264. var self=this;
  4265. 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}})})();})]));
  4266. 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}})})();})]));})]);
  4267. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  4268. return self;
  4269. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  4270. }),
  4271. smalltalk.Array);
  4272. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  4273. smalltalk.addMethod(
  4274. '_compile_',
  4275. smalltalk.method({
  4276. selector: 'compile:',
  4277. fn: function (aString){
  4278. var self=this;
  4279. return self.compile(aString);
  4280. return self;}
  4281. }),
  4282. smalltalk.RegularExpression);
  4283. smalltalk.addMethod(
  4284. '_exec_',
  4285. smalltalk.method({
  4286. selector: 'exec:',
  4287. fn: function (aString){
  4288. var self=this;
  4289. return self.exec(aString) || nil;
  4290. return self;}
  4291. }),
  4292. smalltalk.RegularExpression);
  4293. smalltalk.addMethod(
  4294. '_test_',
  4295. smalltalk.method({
  4296. selector: 'test:',
  4297. fn: function (aString){
  4298. var self=this;
  4299. return self.test(aString);
  4300. return self;}
  4301. }),
  4302. smalltalk.RegularExpression);
  4303. smalltalk.addMethod(
  4304. '_fromString_flag_',
  4305. smalltalk.method({
  4306. selector: 'fromString:flag:',
  4307. fn: function (aString, anotherString){
  4308. var self=this;
  4309. return new RegExp(aString, anotherString);
  4310. return self;}
  4311. }),
  4312. smalltalk.RegularExpression.klass);
  4313. smalltalk.addMethod(
  4314. '_fromString_',
  4315. smalltalk.method({
  4316. selector: 'fromString:',
  4317. fn: function (aString){
  4318. var self=this;
  4319. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  4320. return self;}
  4321. }),
  4322. smalltalk.RegularExpression.klass);
  4323. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  4324. smalltalk.addMethod(
  4325. '_messageText',
  4326. smalltalk.method({
  4327. selector: 'messageText',
  4328. fn: function (){
  4329. var self=this;
  4330. return self['@messageText'];
  4331. return self;}
  4332. }),
  4333. smalltalk.Error);
  4334. smalltalk.addMethod(
  4335. '_messageText_',
  4336. smalltalk.method({
  4337. selector: 'messageText:',
  4338. fn: function (aString){
  4339. var self=this;
  4340. self['@messageText']=aString;
  4341. return self;}
  4342. }),
  4343. smalltalk.Error);
  4344. smalltalk.addMethod(
  4345. '_signal',
  4346. smalltalk.method({
  4347. selector: 'signal',
  4348. fn: function (){
  4349. var self=this;
  4350. self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  4351. return self;}
  4352. }),
  4353. smalltalk.Error);
  4354. smalltalk.addMethod(
  4355. '_context',
  4356. smalltalk.method({
  4357. selector: 'context',
  4358. fn: function (){
  4359. var self=this;
  4360. return self.context;
  4361. return self;}
  4362. }),
  4363. smalltalk.Error);
  4364. smalltalk.addMethod(
  4365. '_jsStack',
  4366. smalltalk.method({
  4367. selector: 'jsStack',
  4368. fn: function (){
  4369. var self=this;
  4370. return self.stack;
  4371. return self;}
  4372. }),
  4373. smalltalk.Error);
  4374. smalltalk.addMethod(
  4375. '_isSmalltalkError',
  4376. smalltalk.method({
  4377. selector: 'isSmalltalkError',
  4378. fn: function (){
  4379. var self=this;
  4380. return self.smalltalkError === true;
  4381. return self;}
  4382. }),
  4383. smalltalk.Error);
  4384. smalltalk.addMethod(
  4385. '_signal_',
  4386. smalltalk.method({
  4387. selector: 'signal:',
  4388. fn: function (aString){
  4389. var self=this;
  4390. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  4391. return self;}
  4392. }),
  4393. smalltalk.Error.klass);
  4394. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel');
  4395. smalltalk.addMethod(
  4396. '_receiver',
  4397. smalltalk.method({
  4398. selector: 'receiver',
  4399. fn: function (){
  4400. var self=this;
  4401. return self.receiver;
  4402. return self;}
  4403. }),
  4404. smalltalk.MethodContext);
  4405. smalltalk.addMethod(
  4406. '_selector',
  4407. smalltalk.method({
  4408. selector: 'selector',
  4409. fn: function (){
  4410. var self=this;
  4411. return smalltalk.convertSelector(self.selector);
  4412. return self;}
  4413. }),
  4414. smalltalk.MethodContext);
  4415. smalltalk.addMethod(
  4416. '_home',
  4417. smalltalk.method({
  4418. selector: 'home',
  4419. fn: function (){
  4420. var self=this;
  4421. return self.homeContext;
  4422. return self;}
  4423. }),
  4424. smalltalk.MethodContext);
  4425. smalltalk.addMethod(
  4426. '_temps',
  4427. smalltalk.method({
  4428. selector: 'temps',
  4429. fn: function (){
  4430. var self=this;
  4431. return self.temps;
  4432. return self;}
  4433. }),
  4434. smalltalk.MethodContext);
  4435. smalltalk.addMethod(
  4436. '_printString',
  4437. smalltalk.method({
  4438. selector: 'printString',
  4439. fn: function (){
  4440. var self=this;
  4441. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  4442. return self;}
  4443. }),
  4444. smalltalk.MethodContext);
  4445. smalltalk.addMethod(
  4446. '_asString',
  4447. smalltalk.method({
  4448. selector: 'asString',
  4449. fn: function (){
  4450. var self=this;
  4451. 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", [])]);
  4452. return self;}
  4453. }),
  4454. smalltalk.MethodContext);
  4455. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  4456. smalltalk.addMethod(
  4457. '__eq',
  4458. smalltalk.method({
  4459. selector: '=',
  4460. fn: function (anAssociation){
  4461. var self=this;
  4462. 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", [])]);})]);})]);
  4463. return self;}
  4464. }),
  4465. smalltalk.Association);
  4466. smalltalk.addMethod(
  4467. '_key_',
  4468. smalltalk.method({
  4469. selector: 'key:',
  4470. fn: function (aKey){
  4471. var self=this;
  4472. self['@key']=aKey;
  4473. return self;}
  4474. }),
  4475. smalltalk.Association);
  4476. smalltalk.addMethod(
  4477. '_key',
  4478. smalltalk.method({
  4479. selector: 'key',
  4480. fn: function (){
  4481. var self=this;
  4482. return self['@key'];
  4483. return self;}
  4484. }),
  4485. smalltalk.Association);
  4486. smalltalk.addMethod(
  4487. '_value_',
  4488. smalltalk.method({
  4489. selector: 'value:',
  4490. fn: function (aValue){
  4491. var self=this;
  4492. self['@value']=aValue;
  4493. return self;}
  4494. }),
  4495. smalltalk.Association);
  4496. smalltalk.addMethod(
  4497. '_value',
  4498. smalltalk.method({
  4499. selector: 'value',
  4500. fn: function (){
  4501. var self=this;
  4502. return self['@value'];
  4503. return self;}
  4504. }),
  4505. smalltalk.Association);
  4506. smalltalk.addMethod(
  4507. '_storeOn_',
  4508. smalltalk.method({
  4509. selector: 'storeOn:',
  4510. fn: function (aStream){
  4511. var self=this;
  4512. smalltalk.send(self['@key'], "_storeOn_", [aStream]);
  4513. smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
  4514. smalltalk.send(self['@value'], "_storeOn_", [aStream]);
  4515. return self;}
  4516. }),
  4517. smalltalk.Association);
  4518. smalltalk.addMethod(
  4519. '_key_value_',
  4520. smalltalk.method({
  4521. selector: 'key:value:',
  4522. fn: function (aKey, aValue){
  4523. var self=this;
  4524. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4525. return self;}
  4526. }),
  4527. smalltalk.Association.klass);
  4528. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  4529. smalltalk.addMethod(
  4530. '__eq',
  4531. smalltalk.method({
  4532. selector: '=',
  4533. fn: function (aDictionary){
  4534. var self=this;
  4535. 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}})})();})]));
  4536. ((($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}})})();})]));
  4537. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
  4538. return self;
  4539. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  4540. }),
  4541. smalltalk.Dictionary);
  4542. smalltalk.addMethod(
  4543. '_shallowCopy',
  4544. smalltalk.method({
  4545. selector: 'shallowCopy',
  4546. fn: function (){
  4547. var self=this;
  4548. var copy=nil;
  4549. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4550. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4551. return copy;
  4552. return self;}
  4553. }),
  4554. smalltalk.Dictionary);
  4555. smalltalk.addMethod(
  4556. '_initialize',
  4557. smalltalk.method({
  4558. selector: 'initialize',
  4559. fn: function (){
  4560. var self=this;
  4561. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  4562. self['@keys']=[];
  4563. return self;}
  4564. }),
  4565. smalltalk.Dictionary);
  4566. smalltalk.addMethod(
  4567. '_size',
  4568. smalltalk.method({
  4569. selector: 'size',
  4570. fn: function (){
  4571. var self=this;
  4572. return smalltalk.send(self['@keys'], "_size", []);
  4573. return self;}
  4574. }),
  4575. smalltalk.Dictionary);
  4576. smalltalk.addMethod(
  4577. '_associations',
  4578. smalltalk.method({
  4579. selector: 'associations',
  4580. fn: function (){
  4581. var self=this;
  4582. var associations=nil;
  4583. associations=[];
  4584. 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])])]);})]);
  4585. return associations;
  4586. return self;}
  4587. }),
  4588. smalltalk.Dictionary);
  4589. smalltalk.addMethod(
  4590. '_keys',
  4591. smalltalk.method({
  4592. selector: 'keys',
  4593. fn: function (){
  4594. var self=this;
  4595. return smalltalk.send(self['@keys'], "_copy", []);
  4596. return self;}
  4597. }),
  4598. smalltalk.Dictionary);
  4599. smalltalk.addMethod(
  4600. '_values',
  4601. smalltalk.method({
  4602. selector: 'values',
  4603. fn: function (){
  4604. var self=this;
  4605. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  4606. return self;}
  4607. }),
  4608. smalltalk.Dictionary);
  4609. smalltalk.addMethod(
  4610. '_at_put_',
  4611. smalltalk.method({
  4612. selector: 'at:put:',
  4613. fn: function (aKey, aValue){
  4614. var self=this;
  4615. ((($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]);})]));
  4616. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  4617. return self;}
  4618. }),
  4619. smalltalk.Dictionary);
  4620. smalltalk.addMethod(
  4621. '_at_ifAbsent_',
  4622. smalltalk.method({
  4623. selector: 'at:ifAbsent:',
  4624. fn: function (aKey, aBlock){
  4625. var self=this;
  4626. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  4627. return self;}
  4628. }),
  4629. smalltalk.Dictionary);
  4630. smalltalk.addMethod(
  4631. '_at_ifAbsentPut_',
  4632. smalltalk.method({
  4633. selector: 'at:ifAbsentPut:',
  4634. fn: function (aKey, aBlock){
  4635. var self=this;
  4636. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  4637. return self;}
  4638. }),
  4639. smalltalk.Dictionary);
  4640. smalltalk.addMethod(
  4641. '_at_ifPresent_',
  4642. smalltalk.method({
  4643. selector: 'at:ifPresent:',
  4644. fn: function (aKey, aBlock){
  4645. var self=this;
  4646. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  4647. return self;}
  4648. }),
  4649. smalltalk.Dictionary);
  4650. smalltalk.addMethod(
  4651. '_at_ifPresent_ifAbsent_',
  4652. smalltalk.method({
  4653. selector: 'at:ifPresent:ifAbsent:',
  4654. fn: function (aKey, aBlock, anotherBlock){
  4655. var self=this;
  4656. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  4657. return self;}
  4658. }),
  4659. smalltalk.Dictionary);
  4660. smalltalk.addMethod(
  4661. '_add_',
  4662. smalltalk.method({
  4663. selector: 'add:',
  4664. fn: function (anAssociation){
  4665. var self=this;
  4666. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  4667. return self;}
  4668. }),
  4669. smalltalk.Dictionary);
  4670. smalltalk.addMethod(
  4671. '_addAll_',
  4672. smalltalk.method({
  4673. selector: 'addAll:',
  4674. fn: function (aDictionary){
  4675. var self=this;
  4676. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  4677. return aDictionary;
  4678. return self;}
  4679. }),
  4680. smalltalk.Dictionary);
  4681. smalltalk.addMethod(
  4682. '__comma',
  4683. smalltalk.method({
  4684. selector: ',',
  4685. fn: function (aCollection){
  4686. var self=this;
  4687. smalltalk.send(self, "_shouldNotImplement", []);
  4688. return self;}
  4689. }),
  4690. smalltalk.Dictionary);
  4691. smalltalk.addMethod(
  4692. '_copyFrom_to_',
  4693. smalltalk.method({
  4694. selector: 'copyFrom:to:',
  4695. fn: function (anIndex, anotherIndex){
  4696. var self=this;
  4697. smalltalk.send(self, "_shouldNotImplement", []);
  4698. return self;}
  4699. }),
  4700. smalltalk.Dictionary);
  4701. smalltalk.addMethod(
  4702. '_associationsDo_',
  4703. smalltalk.method({
  4704. selector: 'associationsDo:',
  4705. fn: function (aBlock){
  4706. var self=this;
  4707. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  4708. return self;}
  4709. }),
  4710. smalltalk.Dictionary);
  4711. smalltalk.addMethod(
  4712. '_keysAndValuesDo_',
  4713. smalltalk.method({
  4714. selector: 'keysAndValuesDo:',
  4715. fn: function (aBlock){
  4716. var self=this;
  4717. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4718. return self;}
  4719. }),
  4720. smalltalk.Dictionary);
  4721. smalltalk.addMethod(
  4722. '_do_',
  4723. smalltalk.method({
  4724. selector: 'do:',
  4725. fn: function (aBlock){
  4726. var self=this;
  4727. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  4728. return self;}
  4729. }),
  4730. smalltalk.Dictionary);
  4731. smalltalk.addMethod(
  4732. '_select_',
  4733. smalltalk.method({
  4734. selector: 'select:',
  4735. fn: function (aBlock){
  4736. var self=this;
  4737. var newDict=nil;
  4738. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4739. 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]);})]));})]);
  4740. return newDict;
  4741. return self;}
  4742. }),
  4743. smalltalk.Dictionary);
  4744. smalltalk.addMethod(
  4745. '_collect_',
  4746. smalltalk.method({
  4747. selector: 'collect:',
  4748. fn: function (aBlock){
  4749. var self=this;
  4750. var newDict=nil;
  4751. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4752. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  4753. return newDict;
  4754. return self;}
  4755. }),
  4756. smalltalk.Dictionary);
  4757. smalltalk.addMethod(
  4758. '_detect_ifNone_',
  4759. smalltalk.method({
  4760. selector: 'detect:ifNone:',
  4761. fn: function (aBlock, anotherBlock){
  4762. var self=this;
  4763. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  4764. return self;}
  4765. }),
  4766. smalltalk.Dictionary);
  4767. smalltalk.addMethod(
  4768. '_includes_',
  4769. smalltalk.method({
  4770. selector: 'includes:',
  4771. fn: function (anObject){
  4772. var self=this;
  4773. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  4774. return self;}
  4775. }),
  4776. smalltalk.Dictionary);
  4777. smalltalk.addMethod(
  4778. '_remove_',
  4779. smalltalk.method({
  4780. selector: 'remove:',
  4781. fn: function (aKey){
  4782. var self=this;
  4783. smalltalk.send(self, "_removeKey_", [aKey]);
  4784. return self;}
  4785. }),
  4786. smalltalk.Dictionary);
  4787. smalltalk.addMethod(
  4788. '_removeKey_',
  4789. smalltalk.method({
  4790. selector: 'removeKey:',
  4791. fn: function (aKey){
  4792. var self=this;
  4793. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  4794. return self;}
  4795. }),
  4796. smalltalk.Dictionary);
  4797. smalltalk.addMethod(
  4798. '_at_',
  4799. smalltalk.method({
  4800. selector: 'at:',
  4801. fn: function (aKey){
  4802. var self=this;
  4803. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  4804. return self;}
  4805. }),
  4806. smalltalk.Dictionary);
  4807. smalltalk.addMethod(
  4808. '_asJSONObject',
  4809. smalltalk.method({
  4810. selector: 'asJSONObject',
  4811. fn: function (){
  4812. var self=this;
  4813. var object=nil;
  4814. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  4815. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  4816. return object;
  4817. return self;}
  4818. }),
  4819. smalltalk.Dictionary);
  4820. smalltalk.addMethod(
  4821. '_printString',
  4822. smalltalk.method({
  4823. selector: 'printString',
  4824. fn: function (){
  4825. var self=this;
  4826. 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")]);})]);
  4827. return self;}
  4828. }),
  4829. smalltalk.Dictionary);
  4830. smalltalk.addMethod(
  4831. '_storeOn_',
  4832. smalltalk.method({
  4833. selector: 'storeOn:',
  4834. fn: function (aStream){
  4835. var self=this;
  4836. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  4837. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  4838. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  4839. return self;}
  4840. }),
  4841. smalltalk.Dictionary);
  4842. smalltalk.addMethod(
  4843. '_fromPairs_',
  4844. smalltalk.method({
  4845. selector: 'fromPairs:',
  4846. fn: function (aCollection){
  4847. var self=this;
  4848. var dict=nil;
  4849. dict=smalltalk.send(self, "_new", []);
  4850. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  4851. return dict;
  4852. return self;}
  4853. }),
  4854. smalltalk.Dictionary.klass);
  4855. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  4856. smalltalk.addMethod(
  4857. '_superclass_subclass_',
  4858. smalltalk.method({
  4859. selector: 'superclass:subclass:',
  4860. fn: function (aClass, aString){
  4861. var self=this;
  4862. return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
  4863. return self;}
  4864. }),
  4865. smalltalk.ClassBuilder);
  4866. smalltalk.addMethod(
  4867. '_class_instanceVariableNames_',
  4868. smalltalk.method({
  4869. selector: 'class:instanceVariableNames:',
  4870. fn: function (aClass, aString){
  4871. var self=this;
  4872. ((($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"])]);})]));
  4873. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  4874. smalltalk.send(self, "_setupClass_", [aClass]);
  4875. return self;}
  4876. }),
  4877. smalltalk.ClassBuilder);
  4878. smalltalk.addMethod(
  4879. '_instanceVariableNamesFor_',
  4880. smalltalk.method({
  4881. selector: 'instanceVariableNamesFor:',
  4882. fn: function (aString){
  4883. var self=this;
  4884. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  4885. return self;}
  4886. }),
  4887. smalltalk.ClassBuilder);
  4888. smalltalk.addMethod(
  4889. '_addSubclassOf_named_instanceVariableNames_',
  4890. smalltalk.method({
  4891. selector: 'addSubclassOf:named:instanceVariableNames:',
  4892. fn: function (aClass, aString, aCollection){
  4893. var self=this;
  4894. smalltalk.addClass(aString, aClass, aCollection);
  4895. return smalltalk[aString];
  4896. return self;}
  4897. }),
  4898. smalltalk.ClassBuilder);
  4899. smalltalk.addMethod(
  4900. '_setupClass_',
  4901. smalltalk.method({
  4902. selector: 'setupClass:',
  4903. fn: function (aClass){
  4904. var self=this;
  4905. smalltalk.init(aClass);;
  4906. return self;}
  4907. }),
  4908. smalltalk.ClassBuilder);
  4909. smalltalk.addMethod(
  4910. '_superclass_subclass_instanceVariableNames_package_',
  4911. smalltalk.method({
  4912. selector: 'superclass:subclass:instanceVariableNames:package:',
  4913. fn: function (aClass, aString, aString2, aString3){
  4914. var self=this;
  4915. var newClass=nil;
  4916. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]);
  4917. smalltalk.send(self, "_setupClass_", [newClass]);
  4918. return newClass;
  4919. return self;}
  4920. }),
  4921. smalltalk.ClassBuilder);
  4922. smalltalk.addMethod(
  4923. '_addSubclassOf_named_instanceVariableNames_package_',
  4924. smalltalk.method({
  4925. selector: 'addSubclassOf:named:instanceVariableNames:package:',
  4926. fn: function (aClass, aString, aCollection, packageName){
  4927. var self=this;
  4928. smalltalk.addClass(aString, aClass, aCollection, packageName);
  4929. return smalltalk[aString];
  4930. return self;}
  4931. }),
  4932. smalltalk.ClassBuilder);
  4933. smalltalk.addMethod(
  4934. '_copyClass_named_',
  4935. smalltalk.method({
  4936. selector: 'copyClass:named:',
  4937. fn: function (aClass, aString){
  4938. var self=this;
  4939. var newClass=nil;
  4940. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]);
  4941. smalltalk.send(self, "_setupClass_", [newClass]);
  4942. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){smalltalk.send(newClass, "_addCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [smalltalk.send(each, "_source", []), newClass])]);return smalltalk.send(smalltalk.send(smalltalk.send(newClass, "_methodDictionary", []), "_at_", [smalltalk.send(each, "_selector", [])]), "_category_", [smalltalk.send(each, "_category", [])]);})]);
  4943. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){smalltalk.send(smalltalk.send(newClass, "_class", []), "_addCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [smalltalk.send(each, "_source", []), smalltalk.send(newClass, "_class", [])])]);return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(newClass, "_class", []), "_methodDictionary", []), "_at_", [smalltalk.send(each, "_selector", [])]), "_category_", [smalltalk.send(each, "_category", [])]);})]);
  4944. smalltalk.send(self, "_setupClass_", [newClass]);
  4945. return newClass;
  4946. return self;}
  4947. }),
  4948. smalltalk.ClassBuilder);
  4949. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  4950. smalltalk.addMethod(
  4951. '_initialize',
  4952. smalltalk.method({
  4953. selector: 'initialize',
  4954. fn: function (){
  4955. var self=this;
  4956. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4957. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  4958. return self;}
  4959. }),
  4960. smalltalk.ClassCategoryReader);
  4961. smalltalk.addMethod(
  4962. '_class_category_',
  4963. smalltalk.method({
  4964. selector: 'class:category:',
  4965. fn: function (aClass, aString){
  4966. var self=this;
  4967. self['@class']=aClass;
  4968. self['@category']=aString;
  4969. return self;}
  4970. }),
  4971. smalltalk.ClassCategoryReader);
  4972. smalltalk.addMethod(
  4973. '_scanFrom_',
  4974. smalltalk.method({
  4975. selector: 'scanFrom:',
  4976. fn: function (aChunkParser){
  4977. var self=this;
  4978. var chunk=nil;
  4979. (function(){while(!(function(){chunk=smalltalk.send(aChunkParser, "_nextChunk", []);return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  4980. return self;}
  4981. }),
  4982. smalltalk.ClassCategoryReader);
  4983. smalltalk.addMethod(
  4984. '_compileMethod_',
  4985. smalltalk.method({
  4986. selector: 'compileMethod:',
  4987. fn: function (aString){
  4988. var self=this;
  4989. var method=nil;
  4990. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self['@class']]);
  4991. smalltalk.send(method, "_category_", [self['@category']]);
  4992. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  4993. return self;}
  4994. }),
  4995. smalltalk.ClassCategoryReader);
  4996. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  4997. smalltalk.addMethod(
  4998. '_collection',
  4999. smalltalk.method({
  5000. selector: 'collection',
  5001. fn: function (){
  5002. var self=this;
  5003. return self['@collection'];
  5004. return self;}
  5005. }),
  5006. smalltalk.Stream);
  5007. smalltalk.addMethod(
  5008. '_setCollection_',
  5009. smalltalk.method({
  5010. selector: 'setCollection:',
  5011. fn: function (aCollection){
  5012. var self=this;
  5013. self['@collection']=aCollection;
  5014. return self;}
  5015. }),
  5016. smalltalk.Stream);
  5017. smalltalk.addMethod(
  5018. '_position',
  5019. smalltalk.method({
  5020. selector: 'position',
  5021. fn: function (){
  5022. var self=this;
  5023. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return self['@position']=(0);})() : $receiver;
  5024. return self;}
  5025. }),
  5026. smalltalk.Stream);
  5027. smalltalk.addMethod(
  5028. '_position_',
  5029. smalltalk.method({
  5030. selector: 'position:',
  5031. fn: function (anInteger){
  5032. var self=this;
  5033. self['@position']=anInteger;
  5034. return self;}
  5035. }),
  5036. smalltalk.Stream);
  5037. smalltalk.addMethod(
  5038. '_streamSize',
  5039. smalltalk.method({
  5040. selector: 'streamSize',
  5041. fn: function (){
  5042. var self=this;
  5043. return self['@streamSize'];
  5044. return self;}
  5045. }),
  5046. smalltalk.Stream);
  5047. smalltalk.addMethod(
  5048. '_setStreamSize_',
  5049. smalltalk.method({
  5050. selector: 'setStreamSize:',
  5051. fn: function (anInteger){
  5052. var self=this;
  5053. self['@streamSize']=anInteger;
  5054. return self;}
  5055. }),
  5056. smalltalk.Stream);
  5057. smalltalk.addMethod(
  5058. '_contents',
  5059. smalltalk.method({
  5060. selector: 'contents',
  5061. fn: function (){
  5062. var self=this;
  5063. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  5064. return self;}
  5065. }),
  5066. smalltalk.Stream);
  5067. smalltalk.addMethod(
  5068. '_size',
  5069. smalltalk.method({
  5070. selector: 'size',
  5071. fn: function (){
  5072. var self=this;
  5073. return smalltalk.send(self, "_streamSize", []);
  5074. return self;}
  5075. }),
  5076. smalltalk.Stream);
  5077. smalltalk.addMethod(
  5078. '_reset',
  5079. smalltalk.method({
  5080. selector: 'reset',
  5081. fn: function (){
  5082. var self=this;
  5083. smalltalk.send(self, "_position_", [(0)]);
  5084. return self;}
  5085. }),
  5086. smalltalk.Stream);
  5087. smalltalk.addMethod(
  5088. '_close',
  5089. smalltalk.method({
  5090. selector: 'close',
  5091. fn: function (){
  5092. var self=this;
  5093. return self;}
  5094. }),
  5095. smalltalk.Stream);
  5096. smalltalk.addMethod(
  5097. '_flush',
  5098. smalltalk.method({
  5099. selector: 'flush',
  5100. fn: function (){
  5101. var self=this;
  5102. return self;}
  5103. }),
  5104. smalltalk.Stream);
  5105. smalltalk.addMethod(
  5106. '_resetContents',
  5107. smalltalk.method({
  5108. selector: 'resetContents',
  5109. fn: function (){
  5110. var self=this;
  5111. smalltalk.send(self, "_reset", []);
  5112. smalltalk.send(self, "_setStreamSize_", [(0)]);
  5113. return self;}
  5114. }),
  5115. smalltalk.Stream);
  5116. smalltalk.addMethod(
  5117. '_do_',
  5118. smalltalk.method({
  5119. selector: 'do:',
  5120. fn: function (aBlock){
  5121. var self=this;
  5122. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  5123. return self;}
  5124. }),
  5125. smalltalk.Stream);
  5126. smalltalk.addMethod(
  5127. '_setToEnd',
  5128. smalltalk.method({
  5129. selector: 'setToEnd',
  5130. fn: function (){
  5131. var self=this;
  5132. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  5133. return self;}
  5134. }),
  5135. smalltalk.Stream);
  5136. smalltalk.addMethod(
  5137. '_skip_',
  5138. smalltalk.method({
  5139. selector: 'skip:',
  5140. fn: function (anInteger){
  5141. var self=this;
  5142. 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)])]);
  5143. return self;}
  5144. }),
  5145. smalltalk.Stream);
  5146. smalltalk.addMethod(
  5147. '_next',
  5148. smalltalk.method({
  5149. selector: 'next',
  5150. fn: function (){
  5151. var self=this;
  5152. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  5153. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  5154. return self;}
  5155. }),
  5156. smalltalk.Stream);
  5157. smalltalk.addMethod(
  5158. '_next_',
  5159. smalltalk.method({
  5160. selector: 'next:',
  5161. fn: function (anInteger){
  5162. var self=this;
  5163. var tempCollection=nil;
  5164. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  5165. 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", [])]);})]));})]);
  5166. return tempCollection;
  5167. return self;}
  5168. }),
  5169. smalltalk.Stream);
  5170. smalltalk.addMethod(
  5171. '_nextPut_',
  5172. smalltalk.method({
  5173. selector: 'nextPut:',
  5174. fn: function (anObject){
  5175. var self=this;
  5176. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  5177. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  5178. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  5179. return self;}
  5180. }),
  5181. smalltalk.Stream);
  5182. smalltalk.addMethod(
  5183. '_nextPutAll_',
  5184. smalltalk.method({
  5185. selector: 'nextPutAll:',
  5186. fn: function (aCollection){
  5187. var self=this;
  5188. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  5189. return self;}
  5190. }),
  5191. smalltalk.Stream);
  5192. smalltalk.addMethod(
  5193. '_peek',
  5194. smalltalk.method({
  5195. selector: 'peek',
  5196. fn: function (){
  5197. var self=this;
  5198. 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)]))]);})]));
  5199. return self;}
  5200. }),
  5201. smalltalk.Stream);
  5202. smalltalk.addMethod(
  5203. '_atEnd',
  5204. smalltalk.method({
  5205. selector: 'atEnd',
  5206. fn: function (){
  5207. var self=this;
  5208. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  5209. return self;}
  5210. }),
  5211. smalltalk.Stream);
  5212. smalltalk.addMethod(
  5213. '_atStart',
  5214. smalltalk.method({
  5215. selector: 'atStart',
  5216. fn: function (){
  5217. var self=this;
  5218. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  5219. return self;}
  5220. }),
  5221. smalltalk.Stream);
  5222. smalltalk.addMethod(
  5223. '_isEmpty',
  5224. smalltalk.method({
  5225. selector: 'isEmpty',
  5226. fn: function (){
  5227. var self=this;
  5228. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  5229. return self;}
  5230. }),
  5231. smalltalk.Stream);
  5232. smalltalk.addMethod(
  5233. '_on_',
  5234. smalltalk.method({
  5235. selector: 'on:',
  5236. fn: function (aCollection){
  5237. var self=this;
  5238. 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", []));
  5239. return self;}
  5240. }),
  5241. smalltalk.Stream.klass);
  5242. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  5243. smalltalk.addMethod(
  5244. '_next_',
  5245. smalltalk.method({
  5246. selector: 'next:',
  5247. fn: function (anInteger){
  5248. var self=this;
  5249. var tempCollection=nil;
  5250. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  5251. 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", [])]);})]));})]);
  5252. return tempCollection;
  5253. return self;}
  5254. }),
  5255. smalltalk.StringStream);
  5256. smalltalk.addMethod(
  5257. '_nextPut_',
  5258. smalltalk.method({
  5259. selector: 'nextPut:',
  5260. fn: function (aString){
  5261. var self=this;
  5262. smalltalk.send(self, "_nextPutAll_", [aString]);
  5263. return self;}
  5264. }),
  5265. smalltalk.StringStream);
  5266. smalltalk.addMethod(
  5267. '_nextPutAll_',
  5268. smalltalk.method({
  5269. selector: 'nextPutAll:',
  5270. fn: function (aString){
  5271. var self=this;
  5272. 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", [])])])]);
  5273. 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", [])]))]);
  5274. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  5275. return self;}
  5276. }),
  5277. smalltalk.StringStream);
  5278. smalltalk.addMethod(
  5279. '_cr',
  5280. smalltalk.method({
  5281. selector: 'cr',
  5282. fn: function (){
  5283. var self=this;
  5284. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  5285. return self;}
  5286. }),
  5287. smalltalk.StringStream);
  5288. smalltalk.addMethod(
  5289. '_crlf',
  5290. smalltalk.method({
  5291. selector: 'crlf',
  5292. fn: function (){
  5293. var self=this;
  5294. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  5295. return self;}
  5296. }),
  5297. smalltalk.StringStream);
  5298. smalltalk.addMethod(
  5299. '_lf',
  5300. smalltalk.method({
  5301. selector: 'lf',
  5302. fn: function (){
  5303. var self=this;
  5304. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  5305. return self;}
  5306. }),
  5307. smalltalk.StringStream);
  5308. smalltalk.addMethod(
  5309. '_space',
  5310. smalltalk.method({
  5311. selector: 'space',
  5312. fn: function (){
  5313. var self=this;
  5314. smalltalk.send(self, "_nextPut_", [" "]);
  5315. return self;}
  5316. }),
  5317. smalltalk.StringStream);
  5318. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  5319. smalltalk.addMethod(
  5320. '_class_',
  5321. smalltalk.method({
  5322. selector: 'class:',
  5323. fn: function (aClass){
  5324. var self=this;
  5325. self['@class']=aClass;
  5326. return self;}
  5327. }),
  5328. smalltalk.ClassCommentReader);
  5329. smalltalk.addMethod(
  5330. '_scanFrom_',
  5331. smalltalk.method({
  5332. selector: 'scanFrom:',
  5333. fn: function (aChunkParser){
  5334. var self=this;
  5335. var chunk=nil;
  5336. chunk=smalltalk.send(aChunkParser, "_nextChunk", []);
  5337. ((($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]);})]));
  5338. return self;}
  5339. }),
  5340. smalltalk.ClassCommentReader);
  5341. smalltalk.addMethod(
  5342. '_initialize',
  5343. smalltalk.method({
  5344. selector: 'initialize',
  5345. fn: function (){
  5346. var self=this;
  5347. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  5348. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  5349. return self;}
  5350. }),
  5351. smalltalk.ClassCommentReader);
  5352. smalltalk.addMethod(
  5353. '_setComment_',
  5354. smalltalk.method({
  5355. selector: 'setComment:',
  5356. fn: function (aString){
  5357. var self=this;
  5358. smalltalk.send(self['@class'], "_comment_", [aString]);
  5359. return self;}
  5360. }),
  5361. smalltalk.ClassCommentReader);
  5362. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  5363. smalltalk.addMethod(
  5364. '_next',
  5365. smalltalk.method({
  5366. selector: 'next',
  5367. fn: function (){
  5368. var self=this;
  5369. return Math.random();
  5370. return self;}
  5371. }),
  5372. smalltalk.Random);
  5373. smalltalk.addMethod(
  5374. '_next_',
  5375. smalltalk.method({
  5376. selector: 'next:',
  5377. fn: function (anInteger){
  5378. var self=this;
  5379. return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
  5380. return self;}
  5381. }),
  5382. smalltalk.Random);
  5383. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  5384. smalltalk.addMethod(
  5385. '_x',
  5386. smalltalk.method({
  5387. selector: 'x',
  5388. fn: function (){
  5389. var self=this;
  5390. return self['@x'];
  5391. return self;}
  5392. }),
  5393. smalltalk.Point);
  5394. smalltalk.addMethod(
  5395. '_y',
  5396. smalltalk.method({
  5397. selector: 'y',
  5398. fn: function (){
  5399. var self=this;
  5400. return self['@y'];
  5401. return self;}
  5402. }),
  5403. smalltalk.Point);
  5404. smalltalk.addMethod(
  5405. '_y_',
  5406. smalltalk.method({
  5407. selector: 'y:',
  5408. fn: function (aNumber){
  5409. var self=this;
  5410. self['@y']=aNumber;
  5411. return self;}
  5412. }),
  5413. smalltalk.Point);
  5414. smalltalk.addMethod(
  5415. '_x_',
  5416. smalltalk.method({
  5417. selector: 'x:',
  5418. fn: function (aNumber){
  5419. var self=this;
  5420. self['@x']=aNumber;
  5421. return self;}
  5422. }),
  5423. smalltalk.Point);
  5424. smalltalk.addMethod(
  5425. '__star',
  5426. smalltalk.method({
  5427. selector: '*',
  5428. fn: function (aPoint){
  5429. var self=this;
  5430. 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", [])]))]);
  5431. return self;}
  5432. }),
  5433. smalltalk.Point);
  5434. smalltalk.addMethod(
  5435. '__plus',
  5436. smalltalk.method({
  5437. selector: '+',
  5438. fn: function (aPoint){
  5439. var self=this;
  5440. 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", [])]))]);
  5441. return self;}
  5442. }),
  5443. smalltalk.Point);
  5444. smalltalk.addMethod(
  5445. '__minus',
  5446. smalltalk.method({
  5447. selector: '-',
  5448. fn: function (aPoint){
  5449. var self=this;
  5450. 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", [])]))]);
  5451. return self;}
  5452. }),
  5453. smalltalk.Point);
  5454. smalltalk.addMethod(
  5455. '__slash',
  5456. smalltalk.method({
  5457. selector: '/',
  5458. fn: function (aPoint){
  5459. var self=this;
  5460. 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", [])]))]);
  5461. return self;}
  5462. }),
  5463. smalltalk.Point);
  5464. smalltalk.addMethod(
  5465. '_asPoint',
  5466. smalltalk.method({
  5467. selector: 'asPoint',
  5468. fn: function (){
  5469. var self=this;
  5470. return self;
  5471. return self;}
  5472. }),
  5473. smalltalk.Point);
  5474. smalltalk.addMethod(
  5475. '__eq',
  5476. smalltalk.method({
  5477. selector: '=',
  5478. fn: function (aPoint){
  5479. var self=this;
  5480. return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);})]);
  5481. return self;}
  5482. }),
  5483. smalltalk.Point);
  5484. smalltalk.addMethod(
  5485. '_x_y_',
  5486. smalltalk.method({
  5487. selector: 'x:y:',
  5488. fn: function (aNumber, anotherNumber){
  5489. var self=this;
  5490. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5491. return self;}
  5492. }),
  5493. smalltalk.Point.klass);
  5494. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  5495. smalltalk.addMethod(
  5496. '_selector',
  5497. smalltalk.method({
  5498. selector: 'selector',
  5499. fn: function (){
  5500. var self=this;
  5501. return self['@selector'];
  5502. return self;}
  5503. }),
  5504. smalltalk.Message);
  5505. smalltalk.addMethod(
  5506. '_selector_',
  5507. smalltalk.method({
  5508. selector: 'selector:',
  5509. fn: function (aString){
  5510. var self=this;
  5511. self['@selector']=aString;
  5512. return self;}
  5513. }),
  5514. smalltalk.Message);
  5515. smalltalk.addMethod(
  5516. '_arguments_',
  5517. smalltalk.method({
  5518. selector: 'arguments:',
  5519. fn: function (anArray){
  5520. var self=this;
  5521. self['@arguments']=anArray;
  5522. return self;}
  5523. }),
  5524. smalltalk.Message);
  5525. smalltalk.addMethod(
  5526. '_arguments',
  5527. smalltalk.method({
  5528. selector: 'arguments',
  5529. fn: function (){
  5530. var self=this;
  5531. return self['@arguments'];
  5532. return self;}
  5533. }),
  5534. smalltalk.Message);
  5535. smalltalk.addMethod(
  5536. '_printString',
  5537. smalltalk.method({
  5538. selector: 'printString',
  5539. fn: function (){
  5540. var self=this;
  5541. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);})(aStream);})]);
  5542. return self;}
  5543. }),
  5544. smalltalk.Message);
  5545. smalltalk.addMethod(
  5546. '_selector_arguments_',
  5547. smalltalk.method({
  5548. selector: 'selector:arguments:',
  5549. fn: function (aString, anArray){
  5550. var self=this;
  5551. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5552. return self;}
  5553. }),
  5554. smalltalk.Message.klass);
  5555. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  5556. smalltalk.addMethod(
  5557. '_message',
  5558. smalltalk.method({
  5559. selector: 'message',
  5560. fn: function (){
  5561. var self=this;
  5562. return self['@message'];
  5563. return self;}
  5564. }),
  5565. smalltalk.MessageNotUnderstood);
  5566. smalltalk.addMethod(
  5567. '_message_',
  5568. smalltalk.method({
  5569. selector: 'message:',
  5570. fn: function (aMessage){
  5571. var self=this;
  5572. self['@message']=aMessage;
  5573. return self;}
  5574. }),
  5575. smalltalk.MessageNotUnderstood);
  5576. smalltalk.addMethod(
  5577. '_receiver',
  5578. smalltalk.method({
  5579. selector: 'receiver',
  5580. fn: function (){
  5581. var self=this;
  5582. return self['@receiver'];
  5583. return self;}
  5584. }),
  5585. smalltalk.MessageNotUnderstood);
  5586. smalltalk.addMethod(
  5587. '_receiver_',
  5588. smalltalk.method({
  5589. selector: 'receiver:',
  5590. fn: function (anObject){
  5591. var self=this;
  5592. self['@receiver']=anObject;
  5593. return self;}
  5594. }),
  5595. smalltalk.MessageNotUnderstood);
  5596. smalltalk.addMethod(
  5597. '_messageText',
  5598. smalltalk.method({
  5599. selector: 'messageText',
  5600. fn: function (){
  5601. var self=this;
  5602. 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", [])]);
  5603. return self;}
  5604. }),
  5605. smalltalk.MessageNotUnderstood);
  5606. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel');
  5607. smalltalk.addMethod(
  5608. '_handleError_',
  5609. smalltalk.method({
  5610. selector: 'handleError:',
  5611. fn: function (anError){
  5612. var self=this;
  5613. (($receiver = smalltalk.send(anError, "_context", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})() : nil;
  5614. smalltalk.send(self, "_logError_", [anError]);
  5615. return self;}
  5616. }),
  5617. smalltalk.ErrorHandler);
  5618. smalltalk.addMethod(
  5619. '_logContext_',
  5620. smalltalk.method({
  5621. selector: 'logContext:',
  5622. fn: function (aContext){
  5623. var self=this;
  5624. (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;
  5625. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  5626. return self;}
  5627. }),
  5628. smalltalk.ErrorHandler);
  5629. smalltalk.addMethod(
  5630. '_logErrorContext_',
  5631. smalltalk.method({
  5632. selector: 'logErrorContext:',
  5633. fn: function (aContext){
  5634. var self=this;
  5635. (($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;
  5636. return self;}
  5637. }),
  5638. smalltalk.ErrorHandler);
  5639. smalltalk.addMethod(
  5640. '_logError_',
  5641. smalltalk.method({
  5642. selector: 'logError:',
  5643. fn: function (anError){
  5644. var self=this;
  5645. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  5646. return self;}
  5647. }),
  5648. smalltalk.ErrorHandler);
  5649. smalltalk.addMethod(
  5650. '_log_',
  5651. smalltalk.method({
  5652. selector: 'log:',
  5653. fn: function (aString){
  5654. var self=this;
  5655. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [aString]);
  5656. return self;}
  5657. }),
  5658. smalltalk.ErrorHandler);
  5659. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  5660. smalltalk.addMethod(
  5661. '_current',
  5662. smalltalk.method({
  5663. selector: 'current',
  5664. fn: function (){
  5665. var self=this;
  5666. return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return self['@current']=smalltalk.send(self, "_new", []);})() : $receiver;
  5667. return self;}
  5668. }),
  5669. smalltalk.ErrorHandler.klass);
  5670. smalltalk.addMethod(
  5671. '_initialize',
  5672. smalltalk.method({
  5673. selector: 'initialize',
  5674. fn: function (){
  5675. var self=this;
  5676. smalltalk.send(self, "_register", []);
  5677. return self;}
  5678. }),
  5679. smalltalk.ErrorHandler.klass);
  5680. smalltalk.addMethod(
  5681. '_register',
  5682. smalltalk.method({
  5683. selector: 'register',
  5684. fn: function (){
  5685. var self=this;
  5686. smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  5687. return self;}
  5688. }),
  5689. smalltalk.ErrorHandler.klass);
  5690. smalltalk.addMethod(
  5691. '_setCurrent_',
  5692. smalltalk.method({
  5693. selector: 'setCurrent:',
  5694. fn: function (anHandler){
  5695. var self=this;
  5696. self['@current']=anHandler;
  5697. return self;}
  5698. }),
  5699. smalltalk.ErrorHandler.klass);
  5700. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel');
  5701. smalltalk.addMethod(
  5702. '_jsObject_',
  5703. smalltalk.method({
  5704. selector: 'jsObject:',
  5705. fn: function (aJSObject){
  5706. var self=this;
  5707. self['@jsObject']=aJSObject;
  5708. return self;}
  5709. }),
  5710. smalltalk.JSObjectProxy);
  5711. smalltalk.addMethod(
  5712. '_jsObject',
  5713. smalltalk.method({
  5714. selector: 'jsObject',
  5715. fn: function (){
  5716. var self=this;
  5717. return self['@jsObject'];
  5718. return self;}
  5719. }),
  5720. smalltalk.JSObjectProxy);
  5721. smalltalk.addMethod(
  5722. '_printString',
  5723. smalltalk.method({
  5724. selector: 'printString',
  5725. fn: function (){
  5726. var self=this;
  5727. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  5728. return self;}
  5729. }),
  5730. smalltalk.JSObjectProxy);
  5731. smalltalk.addMethod(
  5732. '_inspectOn_',
  5733. smalltalk.method({
  5734. selector: 'inspectOn:',
  5735. fn: function (anInspector){
  5736. var self=this;
  5737. var variables=nil;
  5738. variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  5739. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  5740. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  5741. for(var i in self['@jsObject']) {
  5742. variables._at_put_(i, self['@jsObject'][i]);
  5743. };
  5744. smalltalk.send(anInspector, "_setVariables_", [variables]);
  5745. return self;}
  5746. }),
  5747. smalltalk.JSObjectProxy);
  5748. smalltalk.addMethod(
  5749. '_doesNotUnderstand_',
  5750. smalltalk.method({
  5751. selector: 'doesNotUnderstand:',
  5752. fn: function (aMessage){
  5753. var self=this;
  5754. var obj=nil;
  5755. var selector=nil;
  5756. var jsSelector=nil;
  5757. var arguments=nil;
  5758. obj=smalltalk.send(self, "_jsObject", []);
  5759. selector=smalltalk.send(aMessage, "_selector", []);
  5760. jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []);
  5761. arguments=smalltalk.send(aMessage, "_arguments", []);
  5762. if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
  5763. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  5764. return self;}
  5765. }),
  5766. smalltalk.JSObjectProxy);
  5767. smalltalk.addMethod(
  5768. '_at_',
  5769. smalltalk.method({
  5770. selector: 'at:',
  5771. fn: function (aString){
  5772. var self=this;
  5773. return self['@jsObject'][aString];
  5774. return self;}
  5775. }),
  5776. smalltalk.JSObjectProxy);
  5777. smalltalk.addMethod(
  5778. '_at_put_',
  5779. smalltalk.method({
  5780. selector: 'at:put:',
  5781. fn: function (aString, anObject){
  5782. var self=this;
  5783. self['@jsObject'][aString] = anObject;
  5784. return self;}
  5785. }),
  5786. smalltalk.JSObjectProxy);
  5787. smalltalk.addMethod(
  5788. '_on_',
  5789. smalltalk.method({
  5790. selector: 'on:',
  5791. fn: function (aJSObject){
  5792. var self=this;
  5793. return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5794. return self;}
  5795. }),
  5796. smalltalk.JSObjectProxy.klass);
  5797. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel');
  5798. smalltalk.addMethod(
  5799. '_add_',
  5800. smalltalk.method({
  5801. selector: 'add:',
  5802. fn: function (anObject){
  5803. var self=this;
  5804. var found;
  5805. for(var i in self['@elements']) {
  5806. if(anObject == self['@elements'][i]) {
  5807. found = true;
  5808. break;
  5809. }
  5810. }
  5811. if(!found) {self['@elements'].push(anObject)}
  5812. ;
  5813. return self;}
  5814. }),
  5815. smalltalk.Set);
  5816. smalltalk.addMethod(
  5817. '_remove_',
  5818. smalltalk.method({
  5819. selector: 'remove:',
  5820. fn: function (anObject){
  5821. var self=this;
  5822. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  5823. return self;}
  5824. }),
  5825. smalltalk.Set);
  5826. smalltalk.addMethod(
  5827. '_initialize',
  5828. smalltalk.method({
  5829. selector: 'initialize',
  5830. fn: function (){
  5831. var self=this;
  5832. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  5833. self['@elements']=[];
  5834. return self;}
  5835. }),
  5836. smalltalk.Set);
  5837. smalltalk.addMethod(
  5838. '_size',
  5839. smalltalk.method({
  5840. selector: 'size',
  5841. fn: function (){
  5842. var self=this;
  5843. return smalltalk.send(self['@elements'], "_size", []);
  5844. return self;}
  5845. }),
  5846. smalltalk.Set);
  5847. smalltalk.addMethod(
  5848. '_asArray',
  5849. smalltalk.method({
  5850. selector: 'asArray',
  5851. fn: function (){
  5852. var self=this;
  5853. return smalltalk.send(self['@elements'], "_copy", []);
  5854. return self;}
  5855. }),
  5856. smalltalk.Set);
  5857. smalltalk.addMethod(
  5858. '_detect_ifNone_',
  5859. smalltalk.method({
  5860. selector: 'detect:ifNone:',
  5861. fn: function (aBlock, anotherBlock){
  5862. var self=this;
  5863. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  5864. return self;}
  5865. }),
  5866. smalltalk.Set);
  5867. smalltalk.addMethod(
  5868. '_do_',
  5869. smalltalk.method({
  5870. selector: 'do:',
  5871. fn: function (aBlock){
  5872. var self=this;
  5873. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  5874. return self;}
  5875. }),
  5876. smalltalk.Set);
  5877. smalltalk.addMethod(
  5878. '_includes_',
  5879. smalltalk.method({
  5880. selector: 'includes:',
  5881. fn: function (anObject){
  5882. var self=this;
  5883. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  5884. return self;}
  5885. }),
  5886. smalltalk.Set);
  5887. smalltalk.addMethod(
  5888. '__eq',
  5889. smalltalk.method({
  5890. selector: '=',
  5891. fn: function (aCollection){
  5892. var self=this;
  5893. 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", [])]);})]);
  5894. return self;}
  5895. }),
  5896. smalltalk.Set);
  5897. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel');
  5898. smalltalk.Transcript.klass.iVarNames = ['current'];
  5899. smalltalk.addMethod(
  5900. '_open',
  5901. smalltalk.method({
  5902. selector: 'open',
  5903. fn: function (){
  5904. var self=this;
  5905. smalltalk.send(smalltalk.send(self, "_current", []), "_open", []);
  5906. return self;}
  5907. }),
  5908. smalltalk.Transcript.klass);
  5909. smalltalk.addMethod(
  5910. '_new',
  5911. smalltalk.method({
  5912. selector: 'new',
  5913. fn: function (){
  5914. var self=this;
  5915. smalltalk.send(self, "_shouldNotImplement", []);
  5916. return self;}
  5917. }),
  5918. smalltalk.Transcript.klass);
  5919. smalltalk.addMethod(
  5920. '_current',
  5921. smalltalk.method({
  5922. selector: 'current',
  5923. fn: function (){
  5924. var self=this;
  5925. return self['@current'];
  5926. return self;}
  5927. }),
  5928. smalltalk.Transcript.klass);
  5929. smalltalk.addMethod(
  5930. '_show_',
  5931. smalltalk.method({
  5932. selector: 'show:',
  5933. fn: function (anObject){
  5934. var self=this;
  5935. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [anObject]);
  5936. return self;}
  5937. }),
  5938. smalltalk.Transcript.klass);
  5939. smalltalk.addMethod(
  5940. '_cr',
  5941. smalltalk.method({
  5942. selector: 'cr',
  5943. fn: function (){
  5944. var self=this;
  5945. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  5946. return self;}
  5947. }),
  5948. smalltalk.Transcript.klass);
  5949. smalltalk.addMethod(
  5950. '_clear',
  5951. smalltalk.method({
  5952. selector: 'clear',
  5953. fn: function (){
  5954. var self=this;
  5955. smalltalk.send(smalltalk.send(self, "_current", []), "_clear", []);
  5956. return self;}
  5957. }),
  5958. smalltalk.Transcript.klass);
  5959. smalltalk.addMethod(
  5960. '_register_',
  5961. smalltalk.method({
  5962. selector: 'register:',
  5963. fn: function (aTranscript){
  5964. var self=this;
  5965. self['@current']=aTranscript;
  5966. return self;}
  5967. }),
  5968. smalltalk.Transcript.klass);
  5969. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel');
  5970. smalltalk.addMethod(
  5971. '_clear',
  5972. smalltalk.method({
  5973. selector: 'clear',
  5974. fn: function (){
  5975. var self=this;
  5976. return self;}
  5977. }),
  5978. smalltalk.ConsoleTranscript);
  5979. smalltalk.addMethod(
  5980. '_cr',
  5981. smalltalk.method({
  5982. selector: 'cr',
  5983. fn: function (){
  5984. var self=this;
  5985. return self;}
  5986. }),
  5987. smalltalk.ConsoleTranscript);
  5988. smalltalk.addMethod(
  5989. '_show_',
  5990. smalltalk.method({
  5991. selector: 'show:',
  5992. fn: function (anObject){
  5993. var self=this;
  5994. var string=nil;
  5995. string=smalltalk.send(anObject, "_asString", []);
  5996. console.log(String(string));
  5997. return self;}
  5998. }),
  5999. smalltalk.ConsoleTranscript);
  6000. smalltalk.addMethod(
  6001. '_open',
  6002. smalltalk.method({
  6003. selector: 'open',
  6004. fn: function (){
  6005. var self=this;
  6006. return self;}
  6007. }),
  6008. smalltalk.ConsoleTranscript);
  6009. smalltalk.addMethod(
  6010. '_initialize',
  6011. smalltalk.method({
  6012. selector: 'initialize',
  6013. fn: function (){
  6014. var self=this;
  6015. smalltalk.send((smalltalk.Transcript || Transcript), "_register_", [smalltalk.send(self, "_new", [])]);
  6016. return self;}
  6017. }),
  6018. smalltalk.ConsoleTranscript.klass);
  6019. smalltalk.addClass('Dictionary2', smalltalk.Dictionary, ['keys'], 'Kernel');
  6020. smalltalk.addMethod(
  6021. '__eq',
  6022. smalltalk.method({
  6023. selector: '=',
  6024. fn: function (aDictionary){
  6025. var self=this;
  6026. 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}})})();})]));
  6027. ((($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}})})();})]));
  6028. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
  6029. return self;
  6030. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  6031. }),
  6032. smalltalk.Dictionary2);
  6033. smalltalk.addMethod(
  6034. '_shallowCopy',
  6035. smalltalk.method({
  6036. selector: 'shallowCopy',
  6037. fn: function (){
  6038. var self=this;
  6039. var copy=nil;
  6040. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  6041. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  6042. return copy;
  6043. return self;}
  6044. }),
  6045. smalltalk.Dictionary2);
  6046. smalltalk.addMethod(
  6047. '_initialize',
  6048. smalltalk.method({
  6049. selector: 'initialize',
  6050. fn: function (){
  6051. var self=this;
  6052. smalltalk.send(self, "_initialize", [], smalltalk.Dictionary);
  6053. self['@keys']=[];
  6054. return self;}
  6055. }),
  6056. smalltalk.Dictionary2);
  6057. smalltalk.addMethod(
  6058. '_size',
  6059. smalltalk.method({
  6060. selector: 'size',
  6061. fn: function (){
  6062. var self=this;
  6063. return smalltalk.send(self['@keys'], "_size", []);
  6064. return self;}
  6065. }),
  6066. smalltalk.Dictionary2);
  6067. smalltalk.addMethod(
  6068. '_associations',
  6069. smalltalk.method({
  6070. selector: 'associations',
  6071. fn: function (){
  6072. var self=this;
  6073. var associations=nil;
  6074. associations=[];
  6075. 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])])]);})]);
  6076. return associations;
  6077. return self;}
  6078. }),
  6079. smalltalk.Dictionary2);
  6080. smalltalk.addMethod(
  6081. '_keys',
  6082. smalltalk.method({
  6083. selector: 'keys',
  6084. fn: function (){
  6085. var self=this;
  6086. return smalltalk.send(self['@keys'], "_copy", []);
  6087. return self;}
  6088. }),
  6089. smalltalk.Dictionary2);
  6090. smalltalk.addMethod(
  6091. '_values',
  6092. smalltalk.method({
  6093. selector: 'values',
  6094. fn: function (){
  6095. var self=this;
  6096. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  6097. return self;}
  6098. }),
  6099. smalltalk.Dictionary2);
  6100. smalltalk.addMethod(
  6101. '_at_put_',
  6102. smalltalk.method({
  6103. selector: 'at:put:',
  6104. fn: function (aKey, aValue){
  6105. var self=this;
  6106. ((($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]);})]));
  6107. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  6108. return self;}
  6109. }),
  6110. smalltalk.Dictionary2);
  6111. smalltalk.addMethod(
  6112. '_at_ifAbsent_',
  6113. smalltalk.method({
  6114. selector: 'at:ifAbsent:',
  6115. fn: function (aKey, aBlock){
  6116. var self=this;
  6117. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  6118. return self;}
  6119. }),
  6120. smalltalk.Dictionary2);
  6121. smalltalk.addMethod(
  6122. '_at_ifAbsentPut_',
  6123. smalltalk.method({
  6124. selector: 'at:ifAbsentPut:',
  6125. fn: function (aKey, aBlock){
  6126. var self=this;
  6127. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  6128. return self;}
  6129. }),
  6130. smalltalk.Dictionary2);
  6131. smalltalk.addMethod(
  6132. '_at_ifPresent_',
  6133. smalltalk.method({
  6134. selector: 'at:ifPresent:',
  6135. fn: function (aKey, aBlock){
  6136. var self=this;
  6137. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  6138. return self;}
  6139. }),
  6140. smalltalk.Dictionary2);
  6141. smalltalk.addMethod(
  6142. '_at_ifPresent_ifAbsent_',
  6143. smalltalk.method({
  6144. selector: 'at:ifPresent:ifAbsent:',
  6145. fn: function (aKey, aBlock, anotherBlock){
  6146. var self=this;
  6147. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  6148. return self;}
  6149. }),
  6150. smalltalk.Dictionary2);
  6151. smalltalk.addMethod(
  6152. '_add_',
  6153. smalltalk.method({
  6154. selector: 'add:',
  6155. fn: function (anAssociation){
  6156. var self=this;
  6157. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  6158. return self;}
  6159. }),
  6160. smalltalk.Dictionary2);
  6161. smalltalk.addMethod(
  6162. '_addAll_',
  6163. smalltalk.method({
  6164. selector: 'addAll:',
  6165. fn: function (aDictionary){
  6166. var self=this;
  6167. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Dictionary);
  6168. return aDictionary;
  6169. return self;}
  6170. }),
  6171. smalltalk.Dictionary2);
  6172. smalltalk.addMethod(
  6173. '__comma',
  6174. smalltalk.method({
  6175. selector: ',',
  6176. fn: function (aCollection){
  6177. var self=this;
  6178. smalltalk.send(self, "_shouldNotImplement", []);
  6179. return self;}
  6180. }),
  6181. smalltalk.Dictionary2);
  6182. smalltalk.addMethod(
  6183. '_copyFrom_to_',
  6184. smalltalk.method({
  6185. selector: 'copyFrom:to:',
  6186. fn: function (anIndex, anotherIndex){
  6187. var self=this;
  6188. smalltalk.send(self, "_shouldNotImplement", []);
  6189. return self;}
  6190. }),
  6191. smalltalk.Dictionary2);
  6192. smalltalk.addMethod(
  6193. '_associationsDo_',
  6194. smalltalk.method({
  6195. selector: 'associationsDo:',
  6196. fn: function (aBlock){
  6197. var self=this;
  6198. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  6199. return self;}
  6200. }),
  6201. smalltalk.Dictionary2);
  6202. smalltalk.addMethod(
  6203. '_keysAndValuesDo_',
  6204. smalltalk.method({
  6205. selector: 'keysAndValuesDo:',
  6206. fn: function (aBlock){
  6207. var self=this;
  6208. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  6209. return self;}
  6210. }),
  6211. smalltalk.Dictionary2);
  6212. smalltalk.addMethod(
  6213. '_do_',
  6214. smalltalk.method({
  6215. selector: 'do:',
  6216. fn: function (aBlock){
  6217. var self=this;
  6218. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  6219. return self;}
  6220. }),
  6221. smalltalk.Dictionary2);
  6222. smalltalk.addMethod(
  6223. '_select_',
  6224. smalltalk.method({
  6225. selector: 'select:',
  6226. fn: function (aBlock){
  6227. var self=this;
  6228. var newDict=nil;
  6229. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  6230. 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]);})]));})]);
  6231. return newDict;
  6232. return self;}
  6233. }),
  6234. smalltalk.Dictionary2);
  6235. smalltalk.addMethod(
  6236. '_collect_',
  6237. smalltalk.method({
  6238. selector: 'collect:',
  6239. fn: function (aBlock){
  6240. var self=this;
  6241. var newDict=nil;
  6242. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  6243. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  6244. return newDict;
  6245. return self;}
  6246. }),
  6247. smalltalk.Dictionary2);
  6248. smalltalk.addMethod(
  6249. '_detect_ifNone_',
  6250. smalltalk.method({
  6251. selector: 'detect:ifNone:',
  6252. fn: function (aBlock, anotherBlock){
  6253. var self=this;
  6254. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  6255. return self;}
  6256. }),
  6257. smalltalk.Dictionary2);
  6258. smalltalk.addMethod(
  6259. '_includes_',
  6260. smalltalk.method({
  6261. selector: 'includes:',
  6262. fn: function (anObject){
  6263. var self=this;
  6264. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  6265. return self;}
  6266. }),
  6267. smalltalk.Dictionary2);
  6268. smalltalk.addMethod(
  6269. '_remove_',
  6270. smalltalk.method({
  6271. selector: 'remove:',
  6272. fn: function (aKey){
  6273. var self=this;
  6274. smalltalk.send(self, "_removeKey_", [aKey]);
  6275. return self;}
  6276. }),
  6277. smalltalk.Dictionary2);
  6278. smalltalk.addMethod(
  6279. '_removeKey_',
  6280. smalltalk.method({
  6281. selector: 'removeKey:',
  6282. fn: function (aKey){
  6283. var self=this;
  6284. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  6285. return self;}
  6286. }),
  6287. smalltalk.Dictionary2);
  6288. smalltalk.addMethod(
  6289. '_at_',
  6290. smalltalk.method({
  6291. selector: 'at:',
  6292. fn: function (aKey){
  6293. var self=this;
  6294. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  6295. return self;}
  6296. }),
  6297. smalltalk.Dictionary2);
  6298. smalltalk.addMethod(
  6299. '_asJSONObject',
  6300. smalltalk.method({
  6301. selector: 'asJSONObject',
  6302. fn: function (){
  6303. var self=this;
  6304. var object=nil;
  6305. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  6306. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  6307. return object;
  6308. return self;}
  6309. }),
  6310. smalltalk.Dictionary2);
  6311. smalltalk.addMethod(
  6312. '_printString',
  6313. smalltalk.method({
  6314. selector: 'printString',
  6315. fn: function (){
  6316. var self=this;
  6317. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Dictionary)]);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")]);})]);
  6318. return self;}
  6319. }),
  6320. smalltalk.Dictionary2);
  6321. smalltalk.addMethod(
  6322. '_storeOn_',
  6323. smalltalk.method({
  6324. selector: 'storeOn:',
  6325. fn: function (aStream){
  6326. var self=this;
  6327. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  6328. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  6329. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  6330. return self;}
  6331. }),
  6332. smalltalk.Dictionary2);