Kernel.deploy.js 166 KB

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