1
0

Kernel.deploy.js 164 KB

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