Kernel.deploy.js 110 KB

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