Kernel.deploy.js 161 KB

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