1
0

Kernel.deploy.js 165 KB

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