Kernel.deploy.js 147 KB

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