Kernel.deploy.js 159 KB

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