Kernel.deploy.js 148 KB

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