Kernel.deploy.js 164 KB

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