Kernel.deploy.js 144 KB

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