Kernel.deploy.js 114 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614
  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. '_modulo_',
  1418. smalltalk.method({
  1419. selector: 'modulo:',
  1420. fn: function (aNumber){
  1421. var self=this;
  1422. return self % aNumber;
  1423. return self;}
  1424. ]
  1425. }),
  1426. smalltalk.Number);
  1427. smalltalk.addMethod(
  1428. '_even',
  1429. smalltalk.method({
  1430. selector: 'even',
  1431. fn: function (){
  1432. var self=this;
  1433. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_modulo_", [(2)])]);
  1434. return self;}
  1435. ]
  1436. }),
  1437. smalltalk.Number);
  1438. smalltalk.addMethod(
  1439. '_odd',
  1440. smalltalk.method({
  1441. selector: 'odd',
  1442. fn: function (){
  1443. var self=this;
  1444. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1445. return self;}
  1446. ]
  1447. }),
  1448. smalltalk.Number);
  1449. smalltalk.addMethod(
  1450. '_pi',
  1451. smalltalk.method({
  1452. selector: 'pi',
  1453. fn: function (){
  1454. var self=this;
  1455. return Math.PI;
  1456. return self;}
  1457. ]
  1458. }),
  1459. smalltalk.Number.klass);
  1460. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1461. smalltalk.addMethod(
  1462. '_compiledSource',
  1463. smalltalk.method({
  1464. selector: 'compiledSource',
  1465. fn: function (){
  1466. var self=this;
  1467. return self.toString();
  1468. return self;}
  1469. ]
  1470. }),
  1471. smalltalk.BlockClosure);
  1472. smalltalk.addMethod(
  1473. '_whileTrue_',
  1474. smalltalk.method({
  1475. selector: 'whileTrue:',
  1476. fn: function (aBlock){
  1477. var self=this;
  1478. while(self()) {aBlock()};
  1479. return self;}
  1480. ]
  1481. }),
  1482. smalltalk.BlockClosure);
  1483. smalltalk.addMethod(
  1484. '_whileFalse_',
  1485. smalltalk.method({
  1486. selector: 'whileFalse:',
  1487. fn: function (aBlock){
  1488. var self=this;
  1489. while(!self()) {aBlock()};
  1490. return self;}
  1491. ]
  1492. }),
  1493. smalltalk.BlockClosure);
  1494. smalltalk.addMethod(
  1495. '_value',
  1496. smalltalk.method({
  1497. selector: 'value',
  1498. fn: function (){
  1499. var self=this;
  1500. return self();;
  1501. return self;}
  1502. ]
  1503. }),
  1504. smalltalk.BlockClosure);
  1505. smalltalk.addMethod(
  1506. '_value_',
  1507. smalltalk.method({
  1508. selector: 'value:',
  1509. fn: function (anArg){
  1510. var self=this;
  1511. return self(anArg);;
  1512. return self;}
  1513. ]
  1514. }),
  1515. smalltalk.BlockClosure);
  1516. smalltalk.addMethod(
  1517. '_value_value_',
  1518. smalltalk.method({
  1519. selector: 'value:value:',
  1520. fn: function (firstArg, secondArg){
  1521. var self=this;
  1522. return self(firstArg, secondArg);;
  1523. return self;}
  1524. ]
  1525. }),
  1526. smalltalk.BlockClosure);
  1527. smalltalk.addMethod(
  1528. '_value_value_value_',
  1529. smalltalk.method({
  1530. selector: 'value:value:value:',
  1531. fn: function (firstArg, secondArg, thirdArg){
  1532. var self=this;
  1533. return self(firstArg, secondArg, thirdArg);;
  1534. return self;}
  1535. ]
  1536. }),
  1537. smalltalk.BlockClosure);
  1538. smalltalk.addMethod(
  1539. '_valueWithPossibleArguments_',
  1540. smalltalk.method({
  1541. selector: 'valueWithPossibleArguments:',
  1542. fn: function (aCollection){
  1543. var self=this;
  1544. return self.apply(null, aCollection);;
  1545. return self;}
  1546. ]
  1547. }),
  1548. smalltalk.BlockClosure);
  1549. smalltalk.addMethod(
  1550. '_on_do_',
  1551. smalltalk.method({
  1552. selector: 'on:do:',
  1553. fn: function (anErrorClass, aBlock){
  1554. var self=this;
  1555. 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", []);})]);})]);
  1556. return self;}
  1557. ]
  1558. }),
  1559. smalltalk.BlockClosure);
  1560. smalltalk.addMethod(
  1561. '_valueWithTimeout_',
  1562. smalltalk.method({
  1563. selector: 'valueWithTimeout:',
  1564. fn: function (aNumber){
  1565. var self=this;
  1566. return setTimeout(self, aNumber);
  1567. return self;}
  1568. ]
  1569. }),
  1570. smalltalk.BlockClosure);
  1571. smalltalk.addMethod(
  1572. '_valueWithInterval_',
  1573. smalltalk.method({
  1574. selector: 'valueWithInterval:',
  1575. fn: function (aNumber){
  1576. var self=this;
  1577. return setInterval(self, aNumber);
  1578. return self;}
  1579. ]
  1580. }),
  1581. smalltalk.BlockClosure);
  1582. smalltalk.addMethod(
  1583. '_printString',
  1584. smalltalk.method({
  1585. selector: 'printString',
  1586. fn: function (){
  1587. var self=this;
  1588. return smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_compiledSource", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);return smalltalk.send($rec, "_cr", []);})(aStream);})]);
  1589. return self;}
  1590. ]
  1591. }),
  1592. smalltalk.BlockClosure);
  1593. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  1594. smalltalk.addMethod(
  1595. '__eq',
  1596. smalltalk.method({
  1597. selector: '=',
  1598. fn: function (aBoolean){
  1599. var self=this;
  1600. return Boolean(self == true) == aBoolean;
  1601. return self;}
  1602. ]
  1603. }),
  1604. smalltalk.Boolean);
  1605. smalltalk.addMethod(
  1606. '_shallowCopy',
  1607. smalltalk.method({
  1608. selector: 'shallowCopy',
  1609. fn: function (){
  1610. var self=this;
  1611. return self;
  1612. return self;}
  1613. ]
  1614. }),
  1615. smalltalk.Boolean);
  1616. smalltalk.addMethod(
  1617. '_deepCopy',
  1618. smalltalk.method({
  1619. selector: 'deepCopy',
  1620. fn: function (){
  1621. var self=this;
  1622. return self;
  1623. return self;}
  1624. ]
  1625. }),
  1626. smalltalk.Boolean);
  1627. smalltalk.addMethod(
  1628. '_ifTrue_',
  1629. smalltalk.method({
  1630. selector: 'ifTrue:',
  1631. fn: function (aBlock){
  1632. var self=this;
  1633. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  1634. return self;}
  1635. ]
  1636. }),
  1637. smalltalk.Boolean);
  1638. smalltalk.addMethod(
  1639. '_ifFalse_',
  1640. smalltalk.method({
  1641. selector: 'ifFalse:',
  1642. fn: function (aBlock){
  1643. var self=this;
  1644. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  1645. return self;}
  1646. ]
  1647. }),
  1648. smalltalk.Boolean);
  1649. smalltalk.addMethod(
  1650. '_ifFalse_ifTrue_',
  1651. smalltalk.method({
  1652. selector: 'ifFalse:ifTrue:',
  1653. fn: function (aBlock, anotherBlock){
  1654. var self=this;
  1655. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1656. return self;}
  1657. ]
  1658. }),
  1659. smalltalk.Boolean);
  1660. smalltalk.addMethod(
  1661. '_ifTrue_ifFalse_',
  1662. smalltalk.method({
  1663. selector: 'ifTrue:ifFalse:',
  1664. fn: function (aBlock, anotherBlock){
  1665. var self=this;
  1666. if(self == true) {
  1667. return aBlock();
  1668. } else {
  1669. return anotherBlock();
  1670. }
  1671. ;
  1672. return self;}
  1673. ]
  1674. }),
  1675. smalltalk.Boolean);
  1676. smalltalk.addMethod(
  1677. '_and_',
  1678. smalltalk.method({
  1679. selector: 'and:',
  1680. fn: function (aBlock){
  1681. var self=this;
  1682. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  1683. return self;}
  1684. ]
  1685. }),
  1686. smalltalk.Boolean);
  1687. smalltalk.addMethod(
  1688. '_or_',
  1689. smalltalk.method({
  1690. selector: 'or:',
  1691. fn: function (aBlock){
  1692. var self=this;
  1693. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  1694. return self;}
  1695. ]
  1696. }),
  1697. smalltalk.Boolean);
  1698. smalltalk.addMethod(
  1699. '_not',
  1700. smalltalk.method({
  1701. selector: 'not',
  1702. fn: function (){
  1703. var self=this;
  1704. return smalltalk.send(self, "__eq", [false]);
  1705. return self;}
  1706. ]
  1707. }),
  1708. smalltalk.Boolean);
  1709. smalltalk.addMethod(
  1710. '_printString',
  1711. smalltalk.method({
  1712. selector: 'printString',
  1713. fn: function (){
  1714. var self=this;
  1715. return self.toString();
  1716. return self;}
  1717. ]
  1718. }),
  1719. smalltalk.Boolean);
  1720. smalltalk.addMethod(
  1721. '_asJSONObject',
  1722. smalltalk.method({
  1723. selector: 'asJSONObject',
  1724. fn: function (){
  1725. var self=this;
  1726. return self;
  1727. return self;}
  1728. ]
  1729. }),
  1730. smalltalk.Boolean);
  1731. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  1732. smalltalk.addMethod(
  1733. '_year',
  1734. smalltalk.method({
  1735. selector: 'year',
  1736. fn: function (){
  1737. var self=this;
  1738. return self.getFullYear();
  1739. return self;}
  1740. ]
  1741. }),
  1742. smalltalk.Date);
  1743. smalltalk.addMethod(
  1744. '_month',
  1745. smalltalk.method({
  1746. selector: 'month',
  1747. fn: function (){
  1748. var self=this;
  1749. return self.getMonth() + 1;
  1750. return self;}
  1751. ]
  1752. }),
  1753. smalltalk.Date);
  1754. smalltalk.addMethod(
  1755. '_month_',
  1756. smalltalk.method({
  1757. selector: 'month:',
  1758. fn: function (aNumber){
  1759. var self=this;
  1760. self.setMonth(aNumber - 1);
  1761. return self;}
  1762. ]
  1763. }),
  1764. smalltalk.Date);
  1765. smalltalk.addMethod(
  1766. '_day',
  1767. smalltalk.method({
  1768. selector: 'day',
  1769. fn: function (){
  1770. var self=this;
  1771. return smalltalk.send(self, "_dayOfWeek", []);
  1772. return self;}
  1773. ]
  1774. }),
  1775. smalltalk.Date);
  1776. smalltalk.addMethod(
  1777. '_dayOfWeek',
  1778. smalltalk.method({
  1779. selector: 'dayOfWeek',
  1780. fn: function (){
  1781. var self=this;
  1782. return self.getDay() + 1;
  1783. return self;}
  1784. ]
  1785. }),
  1786. smalltalk.Date);
  1787. smalltalk.addMethod(
  1788. '_dayOfWeek_',
  1789. smalltalk.method({
  1790. selector: 'dayOfWeek:',
  1791. fn: function (aNumber){
  1792. var self=this;
  1793. return self.setDay(aNumber - 1);
  1794. return self;}
  1795. ]
  1796. }),
  1797. smalltalk.Date);
  1798. smalltalk.addMethod(
  1799. '_day_',
  1800. smalltalk.method({
  1801. selector: 'day:',
  1802. fn: function (aNumber){
  1803. var self=this;
  1804. smalltalk.send(self, "_day_", [aNumber]);
  1805. return self;}
  1806. ]
  1807. }),
  1808. smalltalk.Date);
  1809. smalltalk.addMethod(
  1810. '_year_',
  1811. smalltalk.method({
  1812. selector: 'year:',
  1813. fn: function (aNumber){
  1814. var self=this;
  1815. self.setFullYear(aNumber);
  1816. return self;}
  1817. ]
  1818. }),
  1819. smalltalk.Date);
  1820. smalltalk.addMethod(
  1821. '_dayOfMonth',
  1822. smalltalk.method({
  1823. selector: 'dayOfMonth',
  1824. fn: function (){
  1825. var self=this;
  1826. return self.getDate();
  1827. return self;}
  1828. ]
  1829. }),
  1830. smalltalk.Date);
  1831. smalltalk.addMethod(
  1832. '_dayOfMonth_',
  1833. smalltalk.method({
  1834. selector: 'dayOfMonth:',
  1835. fn: function (aNumber){
  1836. var self=this;
  1837. self.setDate(aNumber);
  1838. return self;}
  1839. ]
  1840. }),
  1841. smalltalk.Date);
  1842. smalltalk.addMethod(
  1843. '_asString',
  1844. smalltalk.method({
  1845. selector: 'asString',
  1846. fn: function (){
  1847. var self=this;
  1848. return self.toString();
  1849. return self;}
  1850. ]
  1851. }),
  1852. smalltalk.Date);
  1853. smalltalk.addMethod(
  1854. '_printString',
  1855. smalltalk.method({
  1856. selector: 'printString',
  1857. fn: function (){
  1858. var self=this;
  1859. return smalltalk.send(self, "_asString", []);
  1860. return self;}
  1861. ]
  1862. }),
  1863. smalltalk.Date);
  1864. smalltalk.addMethod(
  1865. '_asMilliseconds',
  1866. smalltalk.method({
  1867. selector: 'asMilliseconds',
  1868. fn: function (){
  1869. var self=this;
  1870. return smalltalk.send(self, "_time", []);
  1871. return self;}
  1872. ]
  1873. }),
  1874. smalltalk.Date);
  1875. smalltalk.addMethod(
  1876. '_time',
  1877. smalltalk.method({
  1878. selector: 'time',
  1879. fn: function (){
  1880. var self=this;
  1881. return self.getTime();
  1882. return self;}
  1883. ]
  1884. }),
  1885. smalltalk.Date);
  1886. smalltalk.addMethod(
  1887. '_time_',
  1888. smalltalk.method({
  1889. selector: 'time:',
  1890. fn: function (aNumber){
  1891. var self=this;
  1892. self.setTime(aNumber);
  1893. return self;}
  1894. ]
  1895. }),
  1896. smalltalk.Date);
  1897. smalltalk.addMethod(
  1898. '_asDateString',
  1899. smalltalk.method({
  1900. selector: 'asDateString',
  1901. fn: function (){
  1902. var self=this;
  1903. return self.toDateString();
  1904. return self;}
  1905. ]
  1906. }),
  1907. smalltalk.Date);
  1908. smalltalk.addMethod(
  1909. '_asTimeString',
  1910. smalltalk.method({
  1911. selector: 'asTimeString',
  1912. fn: function (){
  1913. var self=this;
  1914. return self.toTimeString();
  1915. return self;}
  1916. ]
  1917. }),
  1918. smalltalk.Date);
  1919. smalltalk.addMethod(
  1920. '_asLocaleString',
  1921. smalltalk.method({
  1922. selector: 'asLocaleString',
  1923. fn: function (){
  1924. var self=this;
  1925. return self.toLocaleString();
  1926. return self;}
  1927. ]
  1928. }),
  1929. smalltalk.Date);
  1930. smalltalk.addMethod(
  1931. '_asNumber',
  1932. smalltalk.method({
  1933. selector: 'asNumber',
  1934. fn: function (){
  1935. var self=this;
  1936. return smalltalk.send(self, "_asMilliseconds", []);
  1937. return self;}
  1938. ]
  1939. }),
  1940. smalltalk.Date);
  1941. smalltalk.addMethod(
  1942. '_hours_',
  1943. smalltalk.method({
  1944. selector: 'hours:',
  1945. fn: function (aNumber){
  1946. var self=this;
  1947. self.setHours(aNumber);
  1948. return self;}
  1949. ]
  1950. }),
  1951. smalltalk.Date);
  1952. smalltalk.addMethod(
  1953. '_minutes_',
  1954. smalltalk.method({
  1955. selector: 'minutes:',
  1956. fn: function (aNumber){
  1957. var self=this;
  1958. self.setMinutes(aNumber);
  1959. return self;}
  1960. ]
  1961. }),
  1962. smalltalk.Date);
  1963. smalltalk.addMethod(
  1964. '_seconds_',
  1965. smalltalk.method({
  1966. selector: 'seconds:',
  1967. fn: function (aNumber){
  1968. var self=this;
  1969. self.setSeconds(aNumber);
  1970. return self;}
  1971. ]
  1972. }),
  1973. smalltalk.Date);
  1974. smalltalk.addMethod(
  1975. '_milliseconds_',
  1976. smalltalk.method({
  1977. selector: 'milliseconds:',
  1978. fn: function (aNumber){
  1979. var self=this;
  1980. self.setMilliseconds(aNumber);
  1981. return self;}
  1982. ]
  1983. }),
  1984. smalltalk.Date);
  1985. smalltalk.addMethod(
  1986. '_hours',
  1987. smalltalk.method({
  1988. selector: 'hours',
  1989. fn: function (){
  1990. var self=this;
  1991. return self.getHours();
  1992. return self;}
  1993. ]
  1994. }),
  1995. smalltalk.Date);
  1996. smalltalk.addMethod(
  1997. '_minutes',
  1998. smalltalk.method({
  1999. selector: 'minutes',
  2000. fn: function (){
  2001. var self=this;
  2002. return self.getMinutes();
  2003. return self;}
  2004. ]
  2005. }),
  2006. smalltalk.Date);
  2007. smalltalk.addMethod(
  2008. '_seconds',
  2009. smalltalk.method({
  2010. selector: 'seconds',
  2011. fn: function (){
  2012. var self=this;
  2013. return self.getSeconds();
  2014. return self;}
  2015. ]
  2016. }),
  2017. smalltalk.Date);
  2018. smalltalk.addMethod(
  2019. '_milliseconds',
  2020. smalltalk.method({
  2021. selector: 'milliseconds',
  2022. fn: function (){
  2023. var self=this;
  2024. return self.getMilliseconds();
  2025. return self;}
  2026. ]
  2027. }),
  2028. smalltalk.Date);
  2029. smalltalk.addMethod(
  2030. '__lt',
  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. '__gt',
  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. '__lt_eq',
  2053. smalltalk.method({
  2054. selector: '<=',
  2055. fn: function (aDate){
  2056. var self=this;
  2057. self <= aDate;
  2058. return self;}
  2059. ]
  2060. }),
  2061. smalltalk.Date);
  2062. smalltalk.addMethod(
  2063. '__gt_eq',
  2064. smalltalk.method({
  2065. selector: '>=',
  2066. fn: function (aDate){
  2067. var self=this;
  2068. self >= aDate;
  2069. return self;}
  2070. ]
  2071. }),
  2072. smalltalk.Date);
  2073. smalltalk.addMethod(
  2074. '__minus',
  2075. smalltalk.method({
  2076. selector: '-',
  2077. fn: function (aDate){
  2078. var self=this;
  2079. return self - aDate;
  2080. return self;}
  2081. ]
  2082. }),
  2083. smalltalk.Date);
  2084. smalltalk.addMethod(
  2085. '__plus',
  2086. smalltalk.method({
  2087. selector: '+',
  2088. fn: function (aDate){
  2089. var self=this;
  2090. return self + aDate;
  2091. return self;}
  2092. ]
  2093. }),
  2094. smalltalk.Date);
  2095. smalltalk.addMethod(
  2096. '_asJSONObject',
  2097. smalltalk.method({
  2098. selector: 'asJSONObject',
  2099. fn: function (){
  2100. var self=this;
  2101. return self;
  2102. return self;}
  2103. ]
  2104. }),
  2105. smalltalk.Date);
  2106. smalltalk.addMethod(
  2107. '_new_',
  2108. smalltalk.method({
  2109. selector: 'new:',
  2110. fn: function (anObject){
  2111. var self=this;
  2112. return new Date(anObject);
  2113. return self;}
  2114. ]
  2115. }),
  2116. smalltalk.Date.klass);
  2117. smalltalk.addMethod(
  2118. '_fromString_',
  2119. smalltalk.method({
  2120. selector: 'fromString:',
  2121. fn: function (aString){
  2122. var self=this;
  2123. return smalltalk.send(self, "_new_", [aString]);
  2124. return self;}
  2125. ]
  2126. }),
  2127. smalltalk.Date.klass);
  2128. smalltalk.addMethod(
  2129. '_fromSeconds_',
  2130. smalltalk.method({
  2131. selector: 'fromSeconds:',
  2132. fn: function (aNumber){
  2133. var self=this;
  2134. return smalltalk.send(self, "_fromMilliseconds_", [smalltalk.send(aNumber, "__star", [(1000)])]);
  2135. return self;}
  2136. ]
  2137. }),
  2138. smalltalk.Date.klass);
  2139. smalltalk.addMethod(
  2140. '_fromMilliseconds_',
  2141. smalltalk.method({
  2142. selector: 'fromMilliseconds:',
  2143. fn: function (aNumber){
  2144. var self=this;
  2145. return smalltalk.send(self, "_new_", [aNumber]);
  2146. return self;}
  2147. ]
  2148. }),
  2149. smalltalk.Date.klass);
  2150. smalltalk.addMethod(
  2151. '_today',
  2152. smalltalk.method({
  2153. selector: 'today',
  2154. fn: function (){
  2155. var self=this;
  2156. return smalltalk.send(self, "_new", []);
  2157. return self;}
  2158. ]
  2159. }),
  2160. smalltalk.Date.klass);
  2161. smalltalk.addMethod(
  2162. '_now',
  2163. smalltalk.method({
  2164. selector: 'now',
  2165. fn: function (){
  2166. var self=this;
  2167. return smalltalk.send(self, "_today", []);
  2168. return self;}
  2169. ]
  2170. }),
  2171. smalltalk.Date.klass);
  2172. smalltalk.addMethod(
  2173. '_millisecondsToRun_',
  2174. smalltalk.method({
  2175. selector: 'millisecondsToRun:',
  2176. fn: function (aBlock){
  2177. var self=this;
  2178. var t=nil;
  2179. t=smalltalk.send(smalltalk.Date, "_now", []);
  2180. smalltalk.send(aBlock, "_value", []);
  2181. return smalltalk.send(smalltalk.send(smalltalk.Date, "_now", []), "__minus", [t]);
  2182. return self;}
  2183. ]
  2184. }),
  2185. smalltalk.Date.klass);
  2186. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2187. smalltalk.addMethod(
  2188. '_subclass_instanceVariableNames_',
  2189. smalltalk.method({
  2190. selector: 'subclass:instanceVariableNames:',
  2191. fn: function (aString, anotherString){
  2192. var self=this;
  2193. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  2194. return self;}
  2195. ]
  2196. }),
  2197. smalltalk.UndefinedObject);
  2198. smalltalk.addMethod(
  2199. '_subclass_instanceVariableNames_category_',
  2200. smalltalk.method({
  2201. selector: 'subclass:instanceVariableNames:category:',
  2202. fn: function (aString, aString2, aString3){
  2203. var self=this;
  2204. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  2205. return self;}
  2206. ]
  2207. }),
  2208. smalltalk.UndefinedObject);
  2209. smalltalk.addMethod(
  2210. '_shallowCopy',
  2211. smalltalk.method({
  2212. selector: 'shallowCopy',
  2213. fn: function (){
  2214. var self=this;
  2215. return self;
  2216. return self;}
  2217. ]
  2218. }),
  2219. smalltalk.UndefinedObject);
  2220. smalltalk.addMethod(
  2221. '_deepCopy',
  2222. smalltalk.method({
  2223. selector: 'deepCopy',
  2224. fn: function (){
  2225. var self=this;
  2226. return self;
  2227. return self;}
  2228. ]
  2229. }),
  2230. smalltalk.UndefinedObject);
  2231. smalltalk.addMethod(
  2232. '_ifNil_',
  2233. smalltalk.method({
  2234. selector: 'ifNil:',
  2235. fn: function (aBlock){
  2236. var self=this;
  2237. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2238. return self;}
  2239. ]
  2240. }),
  2241. smalltalk.UndefinedObject);
  2242. smalltalk.addMethod(
  2243. '_ifNotNil_',
  2244. smalltalk.method({
  2245. selector: 'ifNotNil:',
  2246. fn: function (aBlock){
  2247. var self=this;
  2248. return self;
  2249. return self;}
  2250. ]
  2251. }),
  2252. smalltalk.UndefinedObject);
  2253. smalltalk.addMethod(
  2254. '_ifNil_ifNotNil_',
  2255. smalltalk.method({
  2256. selector: 'ifNil:ifNotNil:',
  2257. fn: function (aBlock, anotherBlock){
  2258. var self=this;
  2259. return smalltalk.send(aBlock, "_value", []);
  2260. return self;}
  2261. ]
  2262. }),
  2263. smalltalk.UndefinedObject);
  2264. smalltalk.addMethod(
  2265. '_ifNotNil_ifNil_',
  2266. smalltalk.method({
  2267. selector: 'ifNotNil:ifNil:',
  2268. fn: function (aBlock, anotherBlock){
  2269. var self=this;
  2270. return smalltalk.send(anotherBlock, "_value", []);
  2271. return self;}
  2272. ]
  2273. }),
  2274. smalltalk.UndefinedObject);
  2275. smalltalk.addMethod(
  2276. '_isNil',
  2277. smalltalk.method({
  2278. selector: 'isNil',
  2279. fn: function (){
  2280. var self=this;
  2281. return true;
  2282. return self;}
  2283. ]
  2284. }),
  2285. smalltalk.UndefinedObject);
  2286. smalltalk.addMethod(
  2287. '_notNil',
  2288. smalltalk.method({
  2289. selector: 'notNil',
  2290. fn: function (){
  2291. var self=this;
  2292. return false;
  2293. return self;}
  2294. ]
  2295. }),
  2296. smalltalk.UndefinedObject);
  2297. smalltalk.addMethod(
  2298. '_printString',
  2299. smalltalk.method({
  2300. selector: 'printString',
  2301. fn: function (){
  2302. var self=this;
  2303. return "nil";
  2304. return self;}
  2305. ]
  2306. }),
  2307. smalltalk.UndefinedObject);
  2308. smalltalk.addMethod(
  2309. '_new',
  2310. smalltalk.method({
  2311. selector: 'new',
  2312. fn: function (){
  2313. var self=this;
  2314. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2315. return self;}
  2316. ]
  2317. }),
  2318. smalltalk.UndefinedObject.klass);
  2319. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  2320. smalltalk.addMethod(
  2321. '_size',
  2322. smalltalk.method({
  2323. selector: 'size',
  2324. fn: function (){
  2325. var self=this;
  2326. smalltalk.send(self, "_subclassResponsibility", []);
  2327. return self;}
  2328. ]
  2329. }),
  2330. smalltalk.Collection);
  2331. smalltalk.addMethod(
  2332. '_readStream',
  2333. smalltalk.method({
  2334. selector: 'readStream',
  2335. fn: function (){
  2336. var self=this;
  2337. return smalltalk.send(self, "_stream", []);
  2338. return self;}
  2339. ]
  2340. }),
  2341. smalltalk.Collection);
  2342. smalltalk.addMethod(
  2343. '_writeStream',
  2344. smalltalk.method({
  2345. selector: 'writeStream',
  2346. fn: function (){
  2347. var self=this;
  2348. return smalltalk.send(self, "_stream", []);
  2349. return self;}
  2350. ]
  2351. }),
  2352. smalltalk.Collection);
  2353. smalltalk.addMethod(
  2354. '_stream',
  2355. smalltalk.method({
  2356. selector: 'stream',
  2357. fn: function (){
  2358. var self=this;
  2359. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  2360. return self;}
  2361. ]
  2362. }),
  2363. smalltalk.Collection);
  2364. smalltalk.addMethod(
  2365. '_streamClass',
  2366. smalltalk.method({
  2367. selector: 'streamClass',
  2368. fn: function (){
  2369. var self=this;
  2370. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  2371. return self;}
  2372. ]
  2373. }),
  2374. smalltalk.Collection);
  2375. smalltalk.addMethod(
  2376. '_add_',
  2377. smalltalk.method({
  2378. selector: 'add:',
  2379. fn: function (anObject){
  2380. var self=this;
  2381. smalltalk.send(self, "_subclassResponsibility", []);
  2382. return self;}
  2383. ]
  2384. }),
  2385. smalltalk.Collection);
  2386. smalltalk.addMethod(
  2387. '_addAll_',
  2388. smalltalk.method({
  2389. selector: 'addAll:',
  2390. fn: function (aCollection){
  2391. var self=this;
  2392. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  2393. return aCollection;
  2394. return self;}
  2395. ]
  2396. }),
  2397. smalltalk.Collection);
  2398. smalltalk.addMethod(
  2399. '__comma',
  2400. smalltalk.method({
  2401. selector: ',',
  2402. fn: function (aCollection){
  2403. var self=this;
  2404. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2405. return self;}
  2406. ]
  2407. }),
  2408. smalltalk.Collection);
  2409. smalltalk.addMethod(
  2410. '_copyWith_',
  2411. smalltalk.method({
  2412. selector: 'copyWith:',
  2413. fn: function (anObject){
  2414. var self=this;
  2415. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2416. return self;}
  2417. ]
  2418. }),
  2419. smalltalk.Collection);
  2420. smalltalk.addMethod(
  2421. '_copyWithAll_',
  2422. smalltalk.method({
  2423. selector: 'copyWithAll:',
  2424. fn: function (aCollection){
  2425. var self=this;
  2426. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2427. return self;}
  2428. ]
  2429. }),
  2430. smalltalk.Collection);
  2431. smalltalk.addMethod(
  2432. '_asArray',
  2433. smalltalk.method({
  2434. selector: 'asArray',
  2435. fn: function (){
  2436. var self=this;
  2437. var array=nil;
  2438. var index=nil;
  2439. array=smalltalk.send(smalltalk.Array, "_new", []);
  2440. index=(0);
  2441. smalltalk.send(self, "_do_", [(function(each){index=smalltalk.send(index, "__plus", [(1)]);return smalltalk.send(array, "_at_put_", [index, each]);})]);
  2442. return array;
  2443. return self;}
  2444. ]
  2445. }),
  2446. smalltalk.Collection);
  2447. smalltalk.addMethod(
  2448. '_do_',
  2449. smalltalk.method({
  2450. selector: 'do:',
  2451. fn: function (aBlock){
  2452. var self=this;
  2453. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  2454. return self;}
  2455. ]
  2456. }),
  2457. smalltalk.Collection);
  2458. smalltalk.addMethod(
  2459. '_collect_',
  2460. smalltalk.method({
  2461. selector: 'collect:',
  2462. fn: function (aBlock){
  2463. var self=this;
  2464. var newCollection=nil;
  2465. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2466. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  2467. return newCollection;
  2468. return self;}
  2469. ]
  2470. }),
  2471. smalltalk.Collection);
  2472. smalltalk.addMethod(
  2473. '_detect_',
  2474. smalltalk.method({
  2475. selector: 'detect:',
  2476. fn: function (aBlock){
  2477. var self=this;
  2478. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2479. return self;}
  2480. ]
  2481. }),
  2482. smalltalk.Collection);
  2483. smalltalk.addMethod(
  2484. '_detect_ifNone_',
  2485. smalltalk.method({
  2486. selector: 'detect:ifNone:',
  2487. fn: function (aBlock, anotherBlock){
  2488. var self=this;
  2489. for(var i = 0; i < self.length; i++)
  2490. if(aBlock(self[i]))
  2491. return self[i];
  2492. return anotherBlock();
  2493. ;
  2494. return self;}
  2495. ]
  2496. }),
  2497. smalltalk.Collection);
  2498. smalltalk.addMethod(
  2499. '_do_separatedBy_',
  2500. smalltalk.method({
  2501. selector: 'do:separatedBy:',
  2502. fn: function (aBlock, anotherBlock){
  2503. var self=this;
  2504. var first=nil;
  2505. first=true;
  2506. 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]);})]);
  2507. return self;}
  2508. ]
  2509. }),
  2510. smalltalk.Collection);
  2511. smalltalk.addMethod(
  2512. '_inject_into_',
  2513. smalltalk.method({
  2514. selector: 'inject:into:',
  2515. fn: function (anObject, aBlock){
  2516. var self=this;
  2517. var result=nil;
  2518. result=anObject;
  2519. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  2520. return result;
  2521. return self;}
  2522. ]
  2523. }),
  2524. smalltalk.Collection);
  2525. smalltalk.addMethod(
  2526. '_reject_',
  2527. smalltalk.method({
  2528. selector: 'reject:',
  2529. fn: function (aBlock){
  2530. var self=this;
  2531. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  2532. return self;}
  2533. ]
  2534. }),
  2535. smalltalk.Collection);
  2536. smalltalk.addMethod(
  2537. '_select_',
  2538. smalltalk.method({
  2539. selector: 'select:',
  2540. fn: function (aBlock){
  2541. var self=this;
  2542. var stream=nil;
  2543. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  2544. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]);})]);
  2545. return smalltalk.send(stream, "_contents", []);
  2546. return self;}
  2547. ]
  2548. }),
  2549. smalltalk.Collection);
  2550. smalltalk.addMethod(
  2551. '_errorNotFound',
  2552. smalltalk.method({
  2553. selector: 'errorNotFound',
  2554. fn: function (){
  2555. var self=this;
  2556. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  2557. return self;}
  2558. ]
  2559. }),
  2560. smalltalk.Collection);
  2561. smalltalk.addMethod(
  2562. '_includes_',
  2563. smalltalk.method({
  2564. selector: 'includes:',
  2565. fn: function (anObject){
  2566. var self=this;
  2567. var i = self.length;
  2568. while (i--) {
  2569. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  2570. }
  2571. return false
  2572. ;
  2573. return self;}
  2574. ]
  2575. }),
  2576. smalltalk.Collection);
  2577. smalltalk.addMethod(
  2578. '_notEmpty',
  2579. smalltalk.method({
  2580. selector: 'notEmpty',
  2581. fn: function (){
  2582. var self=this;
  2583. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  2584. return self;}
  2585. ]
  2586. }),
  2587. smalltalk.Collection);
  2588. smalltalk.addMethod(
  2589. '_isEmpty',
  2590. smalltalk.method({
  2591. selector: 'isEmpty',
  2592. fn: function (){
  2593. var self=this;
  2594. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  2595. return self;}
  2596. ]
  2597. }),
  2598. smalltalk.Collection);
  2599. smalltalk.addMethod(
  2600. '_remove_',
  2601. smalltalk.method({
  2602. selector: 'remove:',
  2603. fn: function (anObject){
  2604. var self=this;
  2605. smalltalk.send(self, "_subclassResponsibility", []);
  2606. return self;}
  2607. ]
  2608. }),
  2609. smalltalk.Collection);
  2610. smalltalk.addMethod(
  2611. '_streamClass',
  2612. smalltalk.method({
  2613. selector: 'streamClass',
  2614. fn: function (){
  2615. var self=this;
  2616. return smalltalk.Stream;
  2617. return self;}
  2618. ]
  2619. }),
  2620. smalltalk.Collection.klass);
  2621. smalltalk.addMethod(
  2622. '_with_',
  2623. smalltalk.method({
  2624. selector: 'with:',
  2625. fn: function (anObject){
  2626. var self=this;
  2627. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2628. return self;}
  2629. ]
  2630. }),
  2631. smalltalk.Collection.klass);
  2632. smalltalk.addMethod(
  2633. '_with_with_',
  2634. smalltalk.method({
  2635. selector: 'with:with:',
  2636. fn: function (anObject, anotherObject){
  2637. var self=this;
  2638. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2639. return self;}
  2640. ]
  2641. }),
  2642. smalltalk.Collection.klass);
  2643. smalltalk.addMethod(
  2644. '_with_with_with_',
  2645. smalltalk.method({
  2646. selector: 'with:with:with:',
  2647. fn: function (firstObject, secondObject, thirdObject){
  2648. var self=this;
  2649. 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", []));
  2650. return self;}
  2651. ]
  2652. }),
  2653. smalltalk.Collection.klass);
  2654. smalltalk.addMethod(
  2655. '_withAll_',
  2656. smalltalk.method({
  2657. selector: 'withAll:',
  2658. fn: function (aCollection){
  2659. var self=this;
  2660. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2661. return self;}
  2662. ]
  2663. }),
  2664. smalltalk.Collection.klass);
  2665. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  2666. smalltalk.addMethod(
  2667. '_at_',
  2668. smalltalk.method({
  2669. selector: 'at:',
  2670. fn: function (anIndex){
  2671. var self=this;
  2672. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2673. return self;}
  2674. ]
  2675. }),
  2676. smalltalk.SequenceableCollection);
  2677. smalltalk.addMethod(
  2678. '_at_ifAbsent_',
  2679. smalltalk.method({
  2680. selector: 'at:ifAbsent:',
  2681. fn: function (anIndex, aBlock){
  2682. var self=this;
  2683. smalltalk.send(self, "_subclassResponsibility", []);
  2684. return self;}
  2685. ]
  2686. }),
  2687. smalltalk.SequenceableCollection);
  2688. smalltalk.addMethod(
  2689. '_at_put_',
  2690. smalltalk.method({
  2691. selector: 'at:put:',
  2692. fn: function (anIndex, anObject){
  2693. var self=this;
  2694. smalltalk.send(self, "_subclassResponsibility", []);
  2695. return self;}
  2696. ]
  2697. }),
  2698. smalltalk.SequenceableCollection);
  2699. smalltalk.addMethod(
  2700. '_copyFrom_to_',
  2701. smalltalk.method({
  2702. selector: 'copyFrom:to:',
  2703. fn: function (anIndex, anotherIndex){
  2704. var self=this;
  2705. smalltalk.send(self, "_subclassResponsibility", []);
  2706. return self;}
  2707. ]
  2708. }),
  2709. smalltalk.SequenceableCollection);
  2710. smalltalk.addMethod(
  2711. '_first',
  2712. smalltalk.method({
  2713. selector: 'first',
  2714. fn: function (){
  2715. var self=this;
  2716. return smalltalk.send(self, "_at_", [(1)]);
  2717. return self;}
  2718. ]
  2719. }),
  2720. smalltalk.SequenceableCollection);
  2721. smalltalk.addMethod(
  2722. '_fourth',
  2723. smalltalk.method({
  2724. selector: 'fourth',
  2725. fn: function (){
  2726. var self=this;
  2727. return smalltalk.send(self, "_at_", [(4)]);
  2728. return self;}
  2729. ]
  2730. }),
  2731. smalltalk.SequenceableCollection);
  2732. smalltalk.addMethod(
  2733. '_last',
  2734. smalltalk.method({
  2735. selector: 'last',
  2736. fn: function (){
  2737. var self=this;
  2738. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  2739. return self;}
  2740. ]
  2741. }),
  2742. smalltalk.SequenceableCollection);
  2743. smalltalk.addMethod(
  2744. '_second',
  2745. smalltalk.method({
  2746. selector: 'second',
  2747. fn: function (){
  2748. var self=this;
  2749. return smalltalk.send(self, "_at_", [(2)]);
  2750. return self;}
  2751. ]
  2752. }),
  2753. smalltalk.SequenceableCollection);
  2754. smalltalk.addMethod(
  2755. '_third',
  2756. smalltalk.method({
  2757. selector: 'third',
  2758. fn: function (){
  2759. var self=this;
  2760. return smalltalk.send(self, "_at_", [(3)]);
  2761. return self;}
  2762. ]
  2763. }),
  2764. smalltalk.SequenceableCollection);
  2765. smalltalk.addMethod(
  2766. '_removeLast',
  2767. smalltalk.method({
  2768. selector: 'removeLast',
  2769. fn: function (){
  2770. var self=this;
  2771. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  2772. return self;}
  2773. ]
  2774. }),
  2775. smalltalk.SequenceableCollection);
  2776. smalltalk.addMethod(
  2777. '_addLast_',
  2778. smalltalk.method({
  2779. selector: 'addLast:',
  2780. fn: function (anObject){
  2781. var self=this;
  2782. smalltalk.send(self, "_add_", [anObject]);
  2783. return self;}
  2784. ]
  2785. }),
  2786. smalltalk.SequenceableCollection);
  2787. smalltalk.addMethod(
  2788. '_withIndexDo_',
  2789. smalltalk.method({
  2790. selector: 'withIndexDo:',
  2791. fn: function (aBlock){
  2792. var self=this;
  2793. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  2794. return self;}
  2795. ]
  2796. }),
  2797. smalltalk.SequenceableCollection);
  2798. smalltalk.addMethod(
  2799. '_allButFirst',
  2800. smalltalk.method({
  2801. selector: 'allButFirst',
  2802. fn: function (){
  2803. var self=this;
  2804. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  2805. return self;}
  2806. ]
  2807. }),
  2808. smalltalk.SequenceableCollection);
  2809. smalltalk.addMethod(
  2810. '_allButLast',
  2811. smalltalk.method({
  2812. selector: 'allButLast',
  2813. fn: function (){
  2814. var self=this;
  2815. return smalltalk.send(self, "_copyFrom_to_", [(1), smalltalk.send(smalltalk.send(self, "_size", []), "__minus", [(1)])]);
  2816. return self;}
  2817. ]
  2818. }),
  2819. smalltalk.SequenceableCollection);
  2820. smalltalk.addMethod(
  2821. '_indexOf_',
  2822. smalltalk.method({
  2823. selector: 'indexOf:',
  2824. fn: function (anObject){
  2825. var self=this;
  2826. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2827. return self;}
  2828. ]
  2829. }),
  2830. smalltalk.SequenceableCollection);
  2831. smalltalk.addMethod(
  2832. '_indexOf_ifAbsent_',
  2833. smalltalk.method({
  2834. selector: 'indexOf:ifAbsent:',
  2835. fn: function (anObject, aBlock){
  2836. var self=this;
  2837. for(var i=0;i<self.length;i++){
  2838. if(self[i].__eq(anObject)) {return i+1}
  2839. }
  2840. return aBlock();
  2841. ;
  2842. return self;}
  2843. ]
  2844. }),
  2845. smalltalk.SequenceableCollection);
  2846. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  2847. smalltalk.addMethod(
  2848. '__eq',
  2849. smalltalk.method({
  2850. selector: '=',
  2851. fn: function (aString){
  2852. var self=this;
  2853. return String(self) == aString;
  2854. return self;}
  2855. ]
  2856. }),
  2857. smalltalk.String);
  2858. smalltalk.addMethod(
  2859. '_size',
  2860. smalltalk.method({
  2861. selector: 'size',
  2862. fn: function (){
  2863. var self=this;
  2864. return self.length;
  2865. return self;}
  2866. ]
  2867. }),
  2868. smalltalk.String);
  2869. smalltalk.addMethod(
  2870. '_at_',
  2871. smalltalk.method({
  2872. selector: 'at:',
  2873. fn: function (anIndex){
  2874. var self=this;
  2875. return self[anIndex - 1];
  2876. return self;}
  2877. ]
  2878. }),
  2879. smalltalk.String);
  2880. smalltalk.addMethod(
  2881. '_at_put_',
  2882. smalltalk.method({
  2883. selector: 'at:put:',
  2884. fn: function (anIndex, anObject){
  2885. var self=this;
  2886. smalltalk.send(self, "_errorReadOnly", []);
  2887. return self;}
  2888. ]
  2889. }),
  2890. smalltalk.String);
  2891. smalltalk.addMethod(
  2892. '_at_ifAbsent_',
  2893. smalltalk.method({
  2894. selector: 'at:ifAbsent:',
  2895. fn: function (anIndex, aBlock){
  2896. var self=this;
  2897. smalltalk.send(smalltalk.send(self, "_at_", [anIndex]), "_ifNil_", [(function(){return aBlock;})]);
  2898. return self;}
  2899. ]
  2900. }),
  2901. smalltalk.String);
  2902. smalltalk.addMethod(
  2903. '_escaped',
  2904. smalltalk.method({
  2905. selector: 'escaped',
  2906. fn: function (){
  2907. var self=this;
  2908. return escape(self);
  2909. return self;}
  2910. ]
  2911. }),
  2912. smalltalk.String);
  2913. smalltalk.addMethod(
  2914. '_unescaped',
  2915. smalltalk.method({
  2916. selector: 'unescaped',
  2917. fn: function (){
  2918. var self=this;
  2919. return unescape(self);
  2920. return self;}
  2921. ]
  2922. }),
  2923. smalltalk.String);
  2924. smalltalk.addMethod(
  2925. '_add_',
  2926. smalltalk.method({
  2927. selector: 'add:',
  2928. fn: function (anObject){
  2929. var self=this;
  2930. smalltalk.send(self, "_errorReadOnly", []);
  2931. return self;}
  2932. ]
  2933. }),
  2934. smalltalk.String);
  2935. smalltalk.addMethod(
  2936. '__comma',
  2937. smalltalk.method({
  2938. selector: ',',
  2939. fn: function (aString){
  2940. var self=this;
  2941. return self + aString;
  2942. return self;}
  2943. ]
  2944. }),
  2945. smalltalk.String);
  2946. smalltalk.addMethod(
  2947. '_copyFrom_to_',
  2948. smalltalk.method({
  2949. selector: 'copyFrom:to:',
  2950. fn: function (anIndex, anotherIndex){
  2951. var self=this;
  2952. return self.substring(anIndex - 1, anotherIndex);
  2953. return self;}
  2954. ]
  2955. }),
  2956. smalltalk.String);
  2957. smalltalk.addMethod(
  2958. '_shallowCopy',
  2959. smalltalk.method({
  2960. selector: 'shallowCopy',
  2961. fn: function (){
  2962. var self=this;
  2963. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  2964. return self;}
  2965. ]
  2966. }),
  2967. smalltalk.String);
  2968. smalltalk.addMethod(
  2969. '_deepCopy',
  2970. smalltalk.method({
  2971. selector: 'deepCopy',
  2972. fn: function (){
  2973. var self=this;
  2974. return smalltalk.send(self, "_shallowCopy", []);
  2975. return self;}
  2976. ]
  2977. }),
  2978. smalltalk.String);
  2979. smalltalk.addMethod(
  2980. '_asSelector',
  2981. smalltalk.method({
  2982. selector: 'asSelector',
  2983. fn: function (){
  2984. var self=this;
  2985. var selector=nil;
  2986. selector=smalltalk.send("_", "__comma", [self]);
  2987. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  2988. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  2989. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  2990. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  2991. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  2992. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  2993. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  2994. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  2995. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  2996. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  2997. return selector;
  2998. return self;}
  2999. ]
  3000. }),
  3001. smalltalk.String);
  3002. smalltalk.addMethod(
  3003. '_asJavascript',
  3004. smalltalk.method({
  3005. selector: 'asJavascript',
  3006. fn: function (){
  3007. var self=this;
  3008. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  3009. return "unescape(\"" + escape(self) + "\")";
  3010. else
  3011. return "\"" + self + "\"";
  3012. ;
  3013. return self;}
  3014. ]
  3015. }),
  3016. smalltalk.String);
  3017. smalltalk.addMethod(
  3018. '_replace_with_',
  3019. smalltalk.method({
  3020. selector: 'replace:with:',
  3021. fn: function (aString, anotherString){
  3022. var self=this;
  3023. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [aString, "g"]), anotherString]);
  3024. return self;}
  3025. ]
  3026. }),
  3027. smalltalk.String);
  3028. smalltalk.addMethod(
  3029. '_replaceRegexp_with_',
  3030. smalltalk.method({
  3031. selector: 'replaceRegexp:with:',
  3032. fn: function (aRegexp, aString){
  3033. var self=this;
  3034. return self.replace(aRegexp, aString);
  3035. return self;}
  3036. ]
  3037. }),
  3038. smalltalk.String);
  3039. smalltalk.addMethod(
  3040. '_tokenize_',
  3041. smalltalk.method({
  3042. selector: 'tokenize:',
  3043. fn: function (aString){
  3044. var self=this;
  3045. return self.split(aString);
  3046. return self;}
  3047. ]
  3048. }),
  3049. smalltalk.String);
  3050. smalltalk.addMethod(
  3051. '_match_',
  3052. smalltalk.method({
  3053. selector: 'match:',
  3054. fn: function (aRegexp){
  3055. var self=this;
  3056. return self.search(aRegexp) != -1;
  3057. return self;}
  3058. ]
  3059. }),
  3060. smalltalk.String);
  3061. smalltalk.addMethod(
  3062. '_asString',
  3063. smalltalk.method({
  3064. selector: 'asString',
  3065. fn: function (){
  3066. var self=this;
  3067. return self;
  3068. return self;}
  3069. ]
  3070. }),
  3071. smalltalk.String);
  3072. smalltalk.addMethod(
  3073. '_asNumber',
  3074. smalltalk.method({
  3075. selector: 'asNumber',
  3076. fn: function (){
  3077. var self=this;
  3078. return Number(self);
  3079. return self;}
  3080. ]
  3081. }),
  3082. smalltalk.String);
  3083. smalltalk.addMethod(
  3084. '_asParser',
  3085. smalltalk.method({
  3086. selector: 'asParser',
  3087. fn: function (){
  3088. var self=this;
  3089. return smalltalk.send(smalltalk.send(smalltalk.PPStringParser, "_new", []), "_string_", [self]);
  3090. return self;}
  3091. ]
  3092. }),
  3093. smalltalk.String);
  3094. smalltalk.addMethod(
  3095. '_asChoiceParser',
  3096. smalltalk.method({
  3097. selector: 'asChoiceParser',
  3098. fn: function (){
  3099. var self=this;
  3100. return smalltalk.send(smalltalk.PPChoiceParser, "_withAll_", [smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asParser", []);})])]);
  3101. return self;}
  3102. ]
  3103. }),
  3104. smalltalk.String);
  3105. smalltalk.addMethod(
  3106. '_asCharacterParser',
  3107. smalltalk.method({
  3108. selector: 'asCharacterParser',
  3109. fn: function (){
  3110. var self=this;
  3111. return smalltalk.send(smalltalk.send(smalltalk.PPCharacterParser, "_new", []), "_string_", [self]);
  3112. return self;}
  3113. ]
  3114. }),
  3115. smalltalk.String);
  3116. smalltalk.addMethod(
  3117. '_errorReadOnly',
  3118. smalltalk.method({
  3119. selector: 'errorReadOnly',
  3120. fn: function (){
  3121. var self=this;
  3122. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  3123. return self;}
  3124. ]
  3125. }),
  3126. smalltalk.String);
  3127. smalltalk.addMethod(
  3128. '_printString',
  3129. smalltalk.method({
  3130. selector: 'printString',
  3131. fn: function (){
  3132. var self=this;
  3133. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  3134. return self;}
  3135. ]
  3136. }),
  3137. smalltalk.String);
  3138. smalltalk.addMethod(
  3139. '_printNl',
  3140. smalltalk.method({
  3141. selector: 'printNl',
  3142. fn: function (){
  3143. var self=this;
  3144. console.log(self);
  3145. return self;}
  3146. ]
  3147. }),
  3148. smalltalk.String);
  3149. smalltalk.addMethod(
  3150. '_isString',
  3151. smalltalk.method({
  3152. selector: 'isString',
  3153. fn: function (){
  3154. var self=this;
  3155. return true;
  3156. return self;}
  3157. ]
  3158. }),
  3159. smalltalk.String);
  3160. smalltalk.addMethod(
  3161. '__gt',
  3162. smalltalk.method({
  3163. selector: '>',
  3164. fn: function (aString){
  3165. var self=this;
  3166. return String(self) > aString;
  3167. return self;}
  3168. ]
  3169. }),
  3170. smalltalk.String);
  3171. smalltalk.addMethod(
  3172. '__lt',
  3173. smalltalk.method({
  3174. selector: '<',
  3175. fn: function (aString){
  3176. var self=this;
  3177. return String(self) < aString;
  3178. return self;}
  3179. ]
  3180. }),
  3181. smalltalk.String);
  3182. smalltalk.addMethod(
  3183. '__gt_eq',
  3184. smalltalk.method({
  3185. selector: '>=',
  3186. fn: function (aString){
  3187. var self=this;
  3188. return String(self) >= aString;
  3189. return self;}
  3190. ]
  3191. }),
  3192. smalltalk.String);
  3193. smalltalk.addMethod(
  3194. '__lt_eq',
  3195. smalltalk.method({
  3196. selector: '<=',
  3197. fn: function (aString){
  3198. var self=this;
  3199. return String(self) <= aString;
  3200. return self;}
  3201. ]
  3202. }),
  3203. smalltalk.String);
  3204. smalltalk.addMethod(
  3205. '_remove_',
  3206. smalltalk.method({
  3207. selector: 'remove:',
  3208. fn: function (anObject){
  3209. var self=this;
  3210. smalltalk.send(self, "_errorReadOnly", []);
  3211. return self;}
  3212. ]
  3213. }),
  3214. smalltalk.String);
  3215. smalltalk.addMethod(
  3216. '_asJSONObject',
  3217. smalltalk.method({
  3218. selector: 'asJSONObject',
  3219. fn: function (){
  3220. var self=this;
  3221. return self;
  3222. return self;}
  3223. ]
  3224. }),
  3225. smalltalk.String);
  3226. smalltalk.addMethod(
  3227. '_trimLeft_',
  3228. smalltalk.method({
  3229. selector: 'trimLeft:',
  3230. fn: function (separators){
  3231. var self=this;
  3232. 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"]), ""]);
  3233. return self;}
  3234. ]
  3235. }),
  3236. smalltalk.String);
  3237. smalltalk.addMethod(
  3238. '_trimRight_',
  3239. smalltalk.method({
  3240. selector: 'trimRight:',
  3241. fn: function (separators){
  3242. var self=this;
  3243. 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"]), ""]);
  3244. return self;}
  3245. ]
  3246. }),
  3247. smalltalk.String);
  3248. smalltalk.addMethod(
  3249. '_trimLeft',
  3250. smalltalk.method({
  3251. selector: 'trimLeft',
  3252. fn: function (){
  3253. var self=this;
  3254. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  3255. return self;}
  3256. ]
  3257. }),
  3258. smalltalk.String);
  3259. smalltalk.addMethod(
  3260. '_trimRight',
  3261. smalltalk.method({
  3262. selector: 'trimRight',
  3263. fn: function (){
  3264. var self=this;
  3265. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  3266. return self;}
  3267. ]
  3268. }),
  3269. smalltalk.String);
  3270. smalltalk.addMethod(
  3271. '_trimBoth',
  3272. smalltalk.method({
  3273. selector: 'trimBoth',
  3274. fn: function (){
  3275. var self=this;
  3276. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  3277. return self;}
  3278. ]
  3279. }),
  3280. smalltalk.String);
  3281. smalltalk.addMethod(
  3282. '_trimBoth_',
  3283. smalltalk.method({
  3284. selector: 'trimBoth:',
  3285. fn: function (separators){
  3286. var self=this;
  3287. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  3288. return self;}
  3289. ]
  3290. }),
  3291. smalltalk.String);
  3292. smalltalk.addMethod(
  3293. '_asLowercase',
  3294. smalltalk.method({
  3295. selector: 'asLowercase',
  3296. fn: function (){
  3297. var self=this;
  3298. return self.toLowerCase();
  3299. return self;}
  3300. ]
  3301. }),
  3302. smalltalk.String);
  3303. smalltalk.addMethod(
  3304. '_asUppercase',
  3305. smalltalk.method({
  3306. selector: 'asUppercase',
  3307. fn: function (){
  3308. var self=this;
  3309. return self.toUpperCase();
  3310. return self;}
  3311. ]
  3312. }),
  3313. smalltalk.String);
  3314. smalltalk.addMethod(
  3315. '_join_',
  3316. smalltalk.method({
  3317. selector: 'join:',
  3318. fn: function (aCollection){
  3319. var self=this;
  3320. return smalltalk.send(smalltalk.String, "_streamContents_", [(function(stream){return smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(each, "_asString", [])]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [self]);})]);})]);
  3321. return self;}
  3322. ]
  3323. }),
  3324. smalltalk.String);
  3325. smalltalk.addMethod(
  3326. '_includesSubString_',
  3327. smalltalk.method({
  3328. selector: 'includesSubString:',
  3329. fn: function (subString){
  3330. var self=this;
  3331. return self.indexOf(subString) != -1 ;
  3332. return self;}
  3333. ]
  3334. }),
  3335. smalltalk.String);
  3336. smalltalk.addMethod(
  3337. '_streamClass',
  3338. smalltalk.method({
  3339. selector: 'streamClass',
  3340. fn: function (){
  3341. var self=this;
  3342. return smalltalk.StringStream;
  3343. return self;}
  3344. ]
  3345. }),
  3346. smalltalk.String.klass);
  3347. smalltalk.addMethod(
  3348. '_fromString_',
  3349. smalltalk.method({
  3350. selector: 'fromString:',
  3351. fn: function (aString){
  3352. var self=this;
  3353. return new self.fn(aString);
  3354. return self;}
  3355. ]
  3356. }),
  3357. smalltalk.String.klass);
  3358. smalltalk.addMethod(
  3359. '_cr',
  3360. smalltalk.method({
  3361. selector: 'cr',
  3362. fn: function (){
  3363. var self=this;
  3364. return '\r';
  3365. return self;}
  3366. ]
  3367. }),
  3368. smalltalk.String.klass);
  3369. smalltalk.addMethod(
  3370. '_lf',
  3371. smalltalk.method({
  3372. selector: 'lf',
  3373. fn: function (){
  3374. var self=this;
  3375. return '\n';
  3376. return self;}
  3377. ]
  3378. }),
  3379. smalltalk.String.klass);
  3380. smalltalk.addMethod(
  3381. '_space',
  3382. smalltalk.method({
  3383. selector: 'space',
  3384. fn: function (){
  3385. var self=this;
  3386. return ' ';
  3387. return self;}
  3388. ]
  3389. }),
  3390. smalltalk.String.klass);
  3391. smalltalk.addMethod(
  3392. '_tab',
  3393. smalltalk.method({
  3394. selector: 'tab',
  3395. fn: function (){
  3396. var self=this;
  3397. return '\t';
  3398. return self;}
  3399. ]
  3400. }),
  3401. smalltalk.String.klass);
  3402. smalltalk.addMethod(
  3403. '_crlf',
  3404. smalltalk.method({
  3405. selector: 'crlf',
  3406. fn: function (){
  3407. var self=this;
  3408. return '\r\n';
  3409. return self;}
  3410. ]
  3411. }),
  3412. smalltalk.String.klass);
  3413. smalltalk.addMethod(
  3414. '_streamContents_',
  3415. smalltalk.method({
  3416. selector: 'streamContents:',
  3417. fn: function (blockWithArg){
  3418. var self=this;
  3419. var stream=nil;
  3420. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send(smalltalk.String, "_new", [])]);
  3421. smalltalk.send(blockWithArg, "_value_", [stream]);
  3422. return smalltalk.send(stream, "_contents", []);
  3423. return self;}
  3424. ]
  3425. }),
  3426. smalltalk.String.klass);
  3427. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  3428. smalltalk.addMethod(
  3429. '_size',
  3430. smalltalk.method({
  3431. selector: 'size',
  3432. fn: function (){
  3433. var self=this;
  3434. return self.length;
  3435. return self;}
  3436. ]
  3437. }),
  3438. smalltalk.Array);
  3439. smalltalk.addMethod(
  3440. '_at_put_',
  3441. smalltalk.method({
  3442. selector: 'at:put:',
  3443. fn: function (anIndex, anObject){
  3444. var self=this;
  3445. return self[anIndex - 1] = anObject;
  3446. return self;}
  3447. ]
  3448. }),
  3449. smalltalk.Array);
  3450. smalltalk.addMethod(
  3451. '_at_ifAbsent_',
  3452. smalltalk.method({
  3453. selector: 'at:ifAbsent:',
  3454. fn: function (anIndex, aBlock){
  3455. var self=this;
  3456. var value = self[anIndex - 1];
  3457. if(value === undefined) {
  3458. return aBlock();
  3459. } else {
  3460. return value;
  3461. }
  3462. ;
  3463. return self;}
  3464. ]
  3465. }),
  3466. smalltalk.Array);
  3467. smalltalk.addMethod(
  3468. '_add_',
  3469. smalltalk.method({
  3470. selector: 'add:',
  3471. fn: function (anObject){
  3472. var self=this;
  3473. self.push(anObject); return anObject;;
  3474. return self;}
  3475. ]
  3476. }),
  3477. smalltalk.Array);
  3478. smalltalk.addMethod(
  3479. '_shallowCopy',
  3480. smalltalk.method({
  3481. selector: 'shallowCopy',
  3482. fn: function (){
  3483. var self=this;
  3484. var newCollection=nil;
  3485. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3486. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  3487. return newCollection;
  3488. return self;}
  3489. ]
  3490. }),
  3491. smalltalk.Array);
  3492. smalltalk.addMethod(
  3493. '_deepCopy',
  3494. smalltalk.method({
  3495. selector: 'deepCopy',
  3496. fn: function (){
  3497. var self=this;
  3498. var newCollection=nil;
  3499. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3500. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  3501. return newCollection;
  3502. return self;}
  3503. ]
  3504. }),
  3505. smalltalk.Array);
  3506. smalltalk.addMethod(
  3507. '_copyFrom_to_',
  3508. smalltalk.method({
  3509. selector: 'copyFrom:to:',
  3510. fn: function (anIndex, anotherIndex){
  3511. var self=this;
  3512. var array=nil;
  3513. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3514. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  3515. return array;
  3516. return self;}
  3517. ]
  3518. }),
  3519. smalltalk.Array);
  3520. smalltalk.addMethod(
  3521. '_join_',
  3522. smalltalk.method({
  3523. selector: 'join:',
  3524. fn: function (aString){
  3525. var self=this;
  3526. return self.join(aString);
  3527. return self;}
  3528. ]
  3529. }),
  3530. smalltalk.Array);
  3531. smalltalk.addMethod(
  3532. '_asJavascript',
  3533. smalltalk.method({
  3534. selector: 'asJavascript',
  3535. fn: function (){
  3536. var self=this;
  3537. 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")]);
  3538. return self;}
  3539. ]
  3540. }),
  3541. smalltalk.Array);
  3542. smalltalk.addMethod(
  3543. '_sort',
  3544. smalltalk.method({
  3545. selector: 'sort',
  3546. fn: function (){
  3547. var self=this;
  3548. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  3549. return self;}
  3550. ]
  3551. }),
  3552. smalltalk.Array);
  3553. smalltalk.addMethod(
  3554. '_sort_',
  3555. smalltalk.method({
  3556. selector: 'sort:',
  3557. fn: function (aBlock){
  3558. var self=this;
  3559. return self.sort(function(a, b) {
  3560. if(aBlock(a,b)) {return 1} else {return -1}
  3561. })
  3562. ;
  3563. return self;}
  3564. ]
  3565. }),
  3566. smalltalk.Array);
  3567. smalltalk.addMethod(
  3568. '_remove_',
  3569. smalltalk.method({
  3570. selector: 'remove:',
  3571. fn: function (anObject){
  3572. var self=this;
  3573. for(var i=0;i<self.length;i++) {
  3574. if(self[i] == anObject) {
  3575. self.splice(i,1);
  3576. break;
  3577. }
  3578. }
  3579. ;
  3580. return self;}
  3581. ]
  3582. }),
  3583. smalltalk.Array);
  3584. smalltalk.addMethod(
  3585. '_sorted',
  3586. smalltalk.method({
  3587. selector: 'sorted',
  3588. fn: function (){
  3589. var self=this;
  3590. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  3591. return self;}
  3592. ]
  3593. }),
  3594. smalltalk.Array);
  3595. smalltalk.addMethod(
  3596. '_sorted_',
  3597. smalltalk.method({
  3598. selector: 'sorted:',
  3599. fn: function (aBlock){
  3600. var self=this;
  3601. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sorted_", [aBlock]);
  3602. return self;}
  3603. ]
  3604. }),
  3605. smalltalk.Array);
  3606. smalltalk.addMethod(
  3607. '_asJSONObject',
  3608. smalltalk.method({
  3609. selector: 'asJSONObject',
  3610. fn: function (){
  3611. var self=this;
  3612. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  3613. return self;}
  3614. ]
  3615. }),
  3616. smalltalk.Array);
  3617. smalltalk.addMethod(
  3618. '_removeFrom_to_',
  3619. smalltalk.method({
  3620. selector: 'removeFrom:to:',
  3621. fn: function (aNumber, anotherNumber){
  3622. var self=this;
  3623. self.splice(aNumber - 1,anotherNumber - 1);
  3624. return self;}
  3625. ]
  3626. }),
  3627. smalltalk.Array);
  3628. smalltalk.addMethod(
  3629. '_printString',
  3630. smalltalk.method({
  3631. selector: 'printString',
  3632. fn: function (){
  3633. var self=this;
  3634. var str=nil;
  3635. str=smalltalk.send("", "_writeStream", []);
  3636. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  3637. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  3638. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  3639. return smalltalk.send(str, "_contents", []);
  3640. return self;}
  3641. ]
  3642. }),
  3643. smalltalk.Array);
  3644. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  3645. smalltalk.addMethod(
  3646. '_compile_',
  3647. smalltalk.method({
  3648. selector: 'compile:',
  3649. fn: function (aString){
  3650. var self=this;
  3651. return self.compile(aString);
  3652. return self;}
  3653. ]
  3654. }),
  3655. smalltalk.RegularExpression);
  3656. smalltalk.addMethod(
  3657. '_exec_',
  3658. smalltalk.method({
  3659. selector: 'exec:',
  3660. fn: function (aString){
  3661. var self=this;
  3662. return self.exec(aString) || nil;
  3663. return self;}
  3664. ]
  3665. }),
  3666. smalltalk.RegularExpression);
  3667. smalltalk.addMethod(
  3668. '_test_',
  3669. smalltalk.method({
  3670. selector: 'test:',
  3671. fn: function (aString){
  3672. var self=this;
  3673. return self.test(aString);
  3674. return self;}
  3675. ]
  3676. }),
  3677. smalltalk.RegularExpression);
  3678. smalltalk.addMethod(
  3679. '_fromString_flag_',
  3680. smalltalk.method({
  3681. selector: 'fromString:flag:',
  3682. fn: function (aString, anotherString){
  3683. var self=this;
  3684. return new RegExp(aString, anotherString);
  3685. return self;}
  3686. ]
  3687. }),
  3688. smalltalk.RegularExpression.klass);
  3689. smalltalk.addMethod(
  3690. '_fromString_',
  3691. smalltalk.method({
  3692. selector: 'fromString:',
  3693. fn: function (aString){
  3694. var self=this;
  3695. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  3696. return self;}
  3697. ]
  3698. }),
  3699. smalltalk.RegularExpression.klass);
  3700. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  3701. smalltalk.addMethod(
  3702. '_messageText',
  3703. smalltalk.method({
  3704. selector: 'messageText',
  3705. fn: function (){
  3706. var self=this;
  3707. return self['@messageText'];
  3708. return self;}
  3709. ]
  3710. }),
  3711. smalltalk.Error);
  3712. smalltalk.addMethod(
  3713. '_messageText_',
  3714. smalltalk.method({
  3715. selector: 'messageText:',
  3716. fn: function (aString){
  3717. var self=this;
  3718. self['@messageText']=aString;
  3719. return self;}
  3720. ]
  3721. }),
  3722. smalltalk.Error);
  3723. smalltalk.addMethod(
  3724. '_signal',
  3725. smalltalk.method({
  3726. selector: 'signal',
  3727. fn: function (){
  3728. var self=this;
  3729. self.context = thisContext; self.smalltalkError = true; throw(self);
  3730. return self;}
  3731. ]
  3732. }),
  3733. smalltalk.Error);
  3734. smalltalk.addMethod(
  3735. '_context',
  3736. smalltalk.method({
  3737. selector: 'context',
  3738. fn: function (){
  3739. var self=this;
  3740. return self.context;
  3741. return self;}
  3742. ]
  3743. }),
  3744. smalltalk.Error);
  3745. smalltalk.addMethod(
  3746. '_signal_',
  3747. smalltalk.method({
  3748. selector: 'signal:',
  3749. fn: function (aString){
  3750. var self=this;
  3751. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  3752. return self;}
  3753. ]
  3754. }),
  3755. smalltalk.Error.klass);
  3756. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel');
  3757. smalltalk.addMethod(
  3758. '_receiver',
  3759. smalltalk.method({
  3760. selector: 'receiver',
  3761. fn: function (){
  3762. var self=this;
  3763. return self.receiver;
  3764. return self;}
  3765. ]
  3766. }),
  3767. smalltalk.MethodContext);
  3768. smalltalk.addMethod(
  3769. '_selector',
  3770. smalltalk.method({
  3771. selector: 'selector',
  3772. fn: function (){
  3773. var self=this;
  3774. return smalltalk.convertSelector(self.selector);
  3775. return self;}
  3776. ]
  3777. }),
  3778. smalltalk.MethodContext);
  3779. smalltalk.addMethod(
  3780. '_home',
  3781. smalltalk.method({
  3782. selector: 'home',
  3783. fn: function (){
  3784. var self=this;
  3785. return self.homeContext;
  3786. return self;}
  3787. ]
  3788. }),
  3789. smalltalk.MethodContext);
  3790. smalltalk.addMethod(
  3791. '_temps',
  3792. smalltalk.method({
  3793. selector: 'temps',
  3794. fn: function (){
  3795. var self=this;
  3796. return self.temps;
  3797. return self;}
  3798. ]
  3799. }),
  3800. smalltalk.MethodContext);
  3801. smalltalk.addMethod(
  3802. '_printString',
  3803. smalltalk.method({
  3804. selector: 'printString',
  3805. fn: function (){
  3806. var self=this;
  3807. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  3808. return self;}
  3809. ]
  3810. }),
  3811. smalltalk.MethodContext);
  3812. smalltalk.addMethod(
  3813. '_asString',
  3814. smalltalk.method({
  3815. selector: 'asString',
  3816. fn: function (){
  3817. var self=this;
  3818. 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", [])]);
  3819. return self;}
  3820. ]
  3821. }),
  3822. smalltalk.MethodContext);
  3823. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  3824. smalltalk.addMethod(
  3825. '__eq',
  3826. smalltalk.method({
  3827. selector: '=',
  3828. fn: function (anAssociation){
  3829. var self=this;
  3830. 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", [])]);})]);})]);
  3831. return self;}
  3832. ]
  3833. }),
  3834. smalltalk.Association);
  3835. smalltalk.addMethod(
  3836. '_key_',
  3837. smalltalk.method({
  3838. selector: 'key:',
  3839. fn: function (aKey){
  3840. var self=this;
  3841. self['@key']=aKey;
  3842. return self;}
  3843. ]
  3844. }),
  3845. smalltalk.Association);
  3846. smalltalk.addMethod(
  3847. '_key',
  3848. smalltalk.method({
  3849. selector: 'key',
  3850. fn: function (){
  3851. var self=this;
  3852. return self['@key'];
  3853. return self;}
  3854. ]
  3855. }),
  3856. smalltalk.Association);
  3857. smalltalk.addMethod(
  3858. '_value_',
  3859. smalltalk.method({
  3860. selector: 'value:',
  3861. fn: function (aValue){
  3862. var self=this;
  3863. self['@value']=aValue;
  3864. return self;}
  3865. ]
  3866. }),
  3867. smalltalk.Association);
  3868. smalltalk.addMethod(
  3869. '_value',
  3870. smalltalk.method({
  3871. selector: 'value',
  3872. fn: function (){
  3873. var self=this;
  3874. return self['@value'];
  3875. return self;}
  3876. ]
  3877. }),
  3878. smalltalk.Association);
  3879. smalltalk.addMethod(
  3880. '_key_value_',
  3881. smalltalk.method({
  3882. selector: 'key:value:',
  3883. fn: function (aKey, aValue){
  3884. var self=this;
  3885. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3886. return self;}
  3887. ]
  3888. }),
  3889. smalltalk.Association.klass);
  3890. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  3891. smalltalk.addMethod(
  3892. '__eq',
  3893. smalltalk.method({
  3894. selector: '=',
  3895. fn: function (aDictionary){
  3896. var self=this;
  3897. 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}})})();})]);
  3898. 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}})})();})]);})]);
  3899. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  3900. return self;
  3901. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  3902. ]
  3903. }),
  3904. smalltalk.Dictionary);
  3905. smalltalk.addMethod(
  3906. '_shallowCopy',
  3907. smalltalk.method({
  3908. selector: 'shallowCopy',
  3909. fn: function (){
  3910. var self=this;
  3911. var copy=nil;
  3912. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3913. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  3914. return copy;
  3915. return self;}
  3916. ]
  3917. }),
  3918. smalltalk.Dictionary);
  3919. smalltalk.addMethod(
  3920. '_initialize',
  3921. smalltalk.method({
  3922. selector: 'initialize',
  3923. fn: function (){
  3924. var self=this;
  3925. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  3926. self['@keys']=[];
  3927. return self;}
  3928. ]
  3929. }),
  3930. smalltalk.Dictionary);
  3931. smalltalk.addMethod(
  3932. '_size',
  3933. smalltalk.method({
  3934. selector: 'size',
  3935. fn: function (){
  3936. var self=this;
  3937. return smalltalk.send(self['@keys'], "_size", []);
  3938. return self;}
  3939. ]
  3940. }),
  3941. smalltalk.Dictionary);
  3942. smalltalk.addMethod(
  3943. '_associations',
  3944. smalltalk.method({
  3945. selector: 'associations',
  3946. fn: function (){
  3947. var self=this;
  3948. var associations=nil;
  3949. associations=[];
  3950. smalltalk.send(self['@keys'], "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send(smalltalk.Association, "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
  3951. return associations;
  3952. return self;}
  3953. ]
  3954. }),
  3955. smalltalk.Dictionary);
  3956. smalltalk.addMethod(
  3957. '_keys',
  3958. smalltalk.method({
  3959. selector: 'keys',
  3960. fn: function (){
  3961. var self=this;
  3962. return smalltalk.send(self['@keys'], "_copy", []);
  3963. return self;}
  3964. ]
  3965. }),
  3966. smalltalk.Dictionary);
  3967. smalltalk.addMethod(
  3968. '_values',
  3969. smalltalk.method({
  3970. selector: 'values',
  3971. fn: function (){
  3972. var self=this;
  3973. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  3974. return self;}
  3975. ]
  3976. }),
  3977. smalltalk.Dictionary);
  3978. smalltalk.addMethod(
  3979. '_at_put_',
  3980. smalltalk.method({
  3981. selector: 'at:put:',
  3982. fn: function (aKey, aValue){
  3983. var self=this;
  3984. smalltalk.send(smalltalk.send(self['@keys'], "_includes_", [aKey]), "_ifFalse_", [(function(){return smalltalk.send(self['@keys'], "_add_", [aKey]);})]);
  3985. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  3986. return self;}
  3987. ]
  3988. }),
  3989. smalltalk.Dictionary);
  3990. smalltalk.addMethod(
  3991. '_at_ifAbsent_',
  3992. smalltalk.method({
  3993. selector: 'at:ifAbsent:',
  3994. fn: function (aKey, aBlock){
  3995. var self=this;
  3996. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  3997. return self;}
  3998. ]
  3999. }),
  4000. smalltalk.Dictionary);
  4001. smalltalk.addMethod(
  4002. '_at_ifAbsentPut_',
  4003. smalltalk.method({
  4004. selector: 'at:ifAbsentPut:',
  4005. fn: function (aKey, aBlock){
  4006. var self=this;
  4007. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  4008. return self;}
  4009. ]
  4010. }),
  4011. smalltalk.Dictionary);
  4012. smalltalk.addMethod(
  4013. '_at_ifPresent_',
  4014. smalltalk.method({
  4015. selector: 'at:ifPresent:',
  4016. fn: function (aKey, aBlock){
  4017. var self=this;
  4018. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNotNil_", [(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  4019. return self;}
  4020. ]
  4021. }),
  4022. smalltalk.Dictionary);
  4023. smalltalk.addMethod(
  4024. '_at_ifPresent_ifAbsent_',
  4025. smalltalk.method({
  4026. selector: 'at:ifPresent:ifAbsent:',
  4027. fn: function (aKey, aBlock, anotherBlock){
  4028. var self=this;
  4029. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  4030. return self;}
  4031. ]
  4032. }),
  4033. smalltalk.Dictionary);
  4034. smalltalk.addMethod(
  4035. '_add_',
  4036. smalltalk.method({
  4037. selector: 'add:',
  4038. fn: function (anAssociation){
  4039. var self=this;
  4040. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  4041. return self;}
  4042. ]
  4043. }),
  4044. smalltalk.Dictionary);
  4045. smalltalk.addMethod(
  4046. '_addAll_',
  4047. smalltalk.method({
  4048. selector: 'addAll:',
  4049. fn: function (aDictionary){
  4050. var self=this;
  4051. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  4052. return aDictionary;
  4053. return self;}
  4054. ]
  4055. }),
  4056. smalltalk.Dictionary);
  4057. smalltalk.addMethod(
  4058. '__comma',
  4059. smalltalk.method({
  4060. selector: ',',
  4061. fn: function (aCollection){
  4062. var self=this;
  4063. smalltalk.send(self, "_shouldNotImplement", []);
  4064. return self;}
  4065. ]
  4066. }),
  4067. smalltalk.Dictionary);
  4068. smalltalk.addMethod(
  4069. '_copyFrom_to_',
  4070. smalltalk.method({
  4071. selector: 'copyFrom:to:',
  4072. fn: function (anIndex, anotherIndex){
  4073. var self=this;
  4074. smalltalk.send(self, "_shouldNotImplement", []);
  4075. return self;}
  4076. ]
  4077. }),
  4078. smalltalk.Dictionary);
  4079. smalltalk.addMethod(
  4080. '_associationsDo_',
  4081. smalltalk.method({
  4082. selector: 'associationsDo:',
  4083. fn: function (aBlock){
  4084. var self=this;
  4085. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  4086. return self;}
  4087. ]
  4088. }),
  4089. smalltalk.Dictionary);
  4090. smalltalk.addMethod(
  4091. '_keysAndValuesDo_',
  4092. smalltalk.method({
  4093. selector: 'keysAndValuesDo:',
  4094. fn: function (aBlock){
  4095. var self=this;
  4096. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4097. return self;}
  4098. ]
  4099. }),
  4100. smalltalk.Dictionary);
  4101. smalltalk.addMethod(
  4102. '_do_',
  4103. smalltalk.method({
  4104. selector: 'do:',
  4105. fn: function (aBlock){
  4106. var self=this;
  4107. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  4108. return self;}
  4109. ]
  4110. }),
  4111. smalltalk.Dictionary);
  4112. smalltalk.addMethod(
  4113. '_select_',
  4114. smalltalk.method({
  4115. selector: 'select:',
  4116. fn: function (aBlock){
  4117. var self=this;
  4118. var newDict=nil;
  4119. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4120. 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]);})]);})]);
  4121. return newDict;
  4122. return self;}
  4123. ]
  4124. }),
  4125. smalltalk.Dictionary);
  4126. smalltalk.addMethod(
  4127. '_collect_',
  4128. smalltalk.method({
  4129. selector: 'collect:',
  4130. fn: function (aBlock){
  4131. var self=this;
  4132. var newDict=nil;
  4133. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4134. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  4135. return newDict;
  4136. return self;}
  4137. ]
  4138. }),
  4139. smalltalk.Dictionary);
  4140. smalltalk.addMethod(
  4141. '_detect_ifNone_',
  4142. smalltalk.method({
  4143. selector: 'detect:ifNone:',
  4144. fn: function (aBlock, anotherBlock){
  4145. var self=this;
  4146. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  4147. return self;}
  4148. ]
  4149. }),
  4150. smalltalk.Dictionary);
  4151. smalltalk.addMethod(
  4152. '_includes_',
  4153. smalltalk.method({
  4154. selector: 'includes:',
  4155. fn: function (anObject){
  4156. var self=this;
  4157. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  4158. return self;}
  4159. ]
  4160. }),
  4161. smalltalk.Dictionary);
  4162. smalltalk.addMethod(
  4163. '_remove_',
  4164. smalltalk.method({
  4165. selector: 'remove:',
  4166. fn: function (aKey){
  4167. var self=this;
  4168. smalltalk.send(self, "_removeKey_", [aKey]);
  4169. return self;}
  4170. ]
  4171. }),
  4172. smalltalk.Dictionary);
  4173. smalltalk.addMethod(
  4174. '_removeKey_',
  4175. smalltalk.method({
  4176. selector: 'removeKey:',
  4177. fn: function (aKey){
  4178. var self=this;
  4179. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  4180. return self;}
  4181. ]
  4182. }),
  4183. smalltalk.Dictionary);
  4184. smalltalk.addMethod(
  4185. '_at_',
  4186. smalltalk.method({
  4187. selector: 'at:',
  4188. fn: function (aKey){
  4189. var self=this;
  4190. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  4191. return self;}
  4192. ]
  4193. }),
  4194. smalltalk.Dictionary);
  4195. smalltalk.addMethod(
  4196. '_asJSONObject',
  4197. smalltalk.method({
  4198. selector: 'asJSONObject',
  4199. fn: function (){
  4200. var self=this;
  4201. var object=nil;
  4202. object=smalltalk.send(smalltalk.Object, "_new", []);
  4203. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  4204. return object;
  4205. return self;}
  4206. ]
  4207. }),
  4208. smalltalk.Dictionary);
  4209. smalltalk.addMethod(
  4210. '_printString',
  4211. smalltalk.method({
  4212. selector: 'printString',
  4213. fn: function (){
  4214. var self=this;
  4215. return smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Collection)]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);})(aStream);smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(anAssociation){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_key", []), "_printString", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%20-%3E%20")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_value", []), "_printString", [])]);})(aStream);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%20%2C%20")]);})]);return smalltalk.send(aStream, "_nextPutAll_", [unescape("%29")]);})]);
  4216. return self;}
  4217. ]
  4218. }),
  4219. smalltalk.Dictionary);
  4220. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  4221. smalltalk.addMethod(
  4222. '_superclass_subclass_',
  4223. smalltalk.method({
  4224. selector: 'superclass:subclass:',
  4225. fn: function (aClass, aString){
  4226. var self=this;
  4227. smalltalk.send(self, "_superclass_subclass_instanceVariableNames_category_", [aClass, aString, "", nil]);
  4228. return self;}
  4229. ]
  4230. }),
  4231. smalltalk.ClassBuilder);
  4232. smalltalk.addMethod(
  4233. '_superclass_subclass_instanceVariableNames_category_',
  4234. smalltalk.method({
  4235. selector: 'superclass:subclass:instanceVariableNames:category:',
  4236. fn: function (aClass, aString, aString2, aString3){
  4237. var self=this;
  4238. var newClass=nil;
  4239. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2])]);
  4240. smalltalk.send(self, "_setupClass_", [newClass]);
  4241. smalltalk.send(newClass, "_category_", [smalltalk.send(aString3, "_ifNil_", [(function(){return "unclassified";})])]);
  4242. return self;}
  4243. ]
  4244. }),
  4245. smalltalk.ClassBuilder);
  4246. smalltalk.addMethod(
  4247. '_class_instanceVariableNames_',
  4248. smalltalk.method({
  4249. selector: 'class:instanceVariableNames:',
  4250. fn: function (aClass, aString){
  4251. var self=this;
  4252. smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]);
  4253. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  4254. smalltalk.send(self, "_setupClass_", [aClass]);
  4255. return self;}
  4256. ]
  4257. }),
  4258. smalltalk.ClassBuilder);
  4259. smalltalk.addMethod(
  4260. '_instanceVariableNamesFor_',
  4261. smalltalk.method({
  4262. selector: 'instanceVariableNamesFor:',
  4263. fn: function (aString){
  4264. var self=this;
  4265. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  4266. return self;}
  4267. ]
  4268. }),
  4269. smalltalk.ClassBuilder);
  4270. smalltalk.addMethod(
  4271. '_addSubclassOf_named_instanceVariableNames_',
  4272. smalltalk.method({
  4273. selector: 'addSubclassOf:named:instanceVariableNames:',
  4274. fn: function (aClass, aString, aCollection){
  4275. var self=this;
  4276. smalltalk.addClass(aString, aClass, aCollection);
  4277. return smalltalk[aString];
  4278. return self;}
  4279. ]
  4280. }),
  4281. smalltalk.ClassBuilder);
  4282. smalltalk.addMethod(
  4283. '_setupClass_',
  4284. smalltalk.method({
  4285. selector: 'setupClass:',
  4286. fn: function (aClass){
  4287. var self=this;
  4288. smalltalk.init(aClass);;
  4289. return self;}
  4290. ]
  4291. }),
  4292. smalltalk.ClassBuilder);
  4293. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  4294. smalltalk.addMethod(
  4295. '_initialize',
  4296. smalltalk.method({
  4297. selector: 'initialize',
  4298. fn: function (){
  4299. var self=this;
  4300. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4301. self['@chunkParser']=smalltalk.send(smalltalk.ChunkParser, "_new", []);
  4302. return self;}
  4303. ]
  4304. }),
  4305. smalltalk.ClassCategoryReader);
  4306. smalltalk.addMethod(
  4307. '_class_category_',
  4308. smalltalk.method({
  4309. selector: 'class:category:',
  4310. fn: function (aClass, aString){
  4311. var self=this;
  4312. self['@class']=aClass;
  4313. self['@category']=aString;
  4314. return self;}
  4315. ]
  4316. }),
  4317. smalltalk.ClassCategoryReader);
  4318. smalltalk.addMethod(
  4319. '_scanFrom_',
  4320. smalltalk.method({
  4321. selector: 'scanFrom:',
  4322. fn: function (aStream){
  4323. var self=this;
  4324. var nextChunk=nil;
  4325. nextChunk=smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  4326. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [(function(){smalltalk.send(self, "_compileMethod_", [smalltalk.send(nextChunk, "_contents", [])]);return smalltalk.send(self, "_scanFrom_", [aStream]);})]);
  4327. return self;}
  4328. ]
  4329. }),
  4330. smalltalk.ClassCategoryReader);
  4331. smalltalk.addMethod(
  4332. '_compileMethod_',
  4333. smalltalk.method({
  4334. selector: 'compileMethod:',
  4335. fn: function (aString){
  4336. var self=this;
  4337. var method=nil;
  4338. method=smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_load_forClass_", [aString, self['@class']]);
  4339. smalltalk.send(method, "_category_", [self['@category']]);
  4340. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  4341. return self;}
  4342. ]
  4343. }),
  4344. smalltalk.ClassCategoryReader);
  4345. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  4346. smalltalk.addMethod(
  4347. '_collection',
  4348. smalltalk.method({
  4349. selector: 'collection',
  4350. fn: function (){
  4351. var self=this;
  4352. return self['@collection'];
  4353. return self;}
  4354. ]
  4355. }),
  4356. smalltalk.Stream);
  4357. smalltalk.addMethod(
  4358. '_setCollection_',
  4359. smalltalk.method({
  4360. selector: 'setCollection:',
  4361. fn: function (aCollection){
  4362. var self=this;
  4363. self['@collection']=aCollection;
  4364. return self;}
  4365. ]
  4366. }),
  4367. smalltalk.Stream);
  4368. smalltalk.addMethod(
  4369. '_position',
  4370. smalltalk.method({
  4371. selector: 'position',
  4372. fn: function (){
  4373. var self=this;
  4374. return smalltalk.send(self['@position'], "_ifNil_", [(function(){return self['@position']=(0);})]);
  4375. return self;}
  4376. ]
  4377. }),
  4378. smalltalk.Stream);
  4379. smalltalk.addMethod(
  4380. '_position_',
  4381. smalltalk.method({
  4382. selector: 'position:',
  4383. fn: function (anInteger){
  4384. var self=this;
  4385. self['@position']=anInteger;
  4386. return self;}
  4387. ]
  4388. }),
  4389. smalltalk.Stream);
  4390. smalltalk.addMethod(
  4391. '_streamSize',
  4392. smalltalk.method({
  4393. selector: 'streamSize',
  4394. fn: function (){
  4395. var self=this;
  4396. return self['@streamSize'];
  4397. return self;}
  4398. ]
  4399. }),
  4400. smalltalk.Stream);
  4401. smalltalk.addMethod(
  4402. '_setStreamSize_',
  4403. smalltalk.method({
  4404. selector: 'setStreamSize:',
  4405. fn: function (anInteger){
  4406. var self=this;
  4407. self['@streamSize']=anInteger;
  4408. return self;}
  4409. ]
  4410. }),
  4411. smalltalk.Stream);
  4412. smalltalk.addMethod(
  4413. '_contents',
  4414. smalltalk.method({
  4415. selector: 'contents',
  4416. fn: function (){
  4417. var self=this;
  4418. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  4419. return self;}
  4420. ]
  4421. }),
  4422. smalltalk.Stream);
  4423. smalltalk.addMethod(
  4424. '_size',
  4425. smalltalk.method({
  4426. selector: 'size',
  4427. fn: function (){
  4428. var self=this;
  4429. return smalltalk.send(self, "_streamSize", []);
  4430. return self;}
  4431. ]
  4432. }),
  4433. smalltalk.Stream);
  4434. smalltalk.addMethod(
  4435. '_reset',
  4436. smalltalk.method({
  4437. selector: 'reset',
  4438. fn: function (){
  4439. var self=this;
  4440. smalltalk.send(self, "_position_", [(0)]);
  4441. return self;}
  4442. ]
  4443. }),
  4444. smalltalk.Stream);
  4445. smalltalk.addMethod(
  4446. '_close',
  4447. smalltalk.method({
  4448. selector: 'close',
  4449. fn: function (){
  4450. var self=this;
  4451. return self;}
  4452. ]
  4453. }),
  4454. smalltalk.Stream);
  4455. smalltalk.addMethod(
  4456. '_flush',
  4457. smalltalk.method({
  4458. selector: 'flush',
  4459. fn: function (){
  4460. var self=this;
  4461. return self;}
  4462. ]
  4463. }),
  4464. smalltalk.Stream);
  4465. smalltalk.addMethod(
  4466. '_resetContents',
  4467. smalltalk.method({
  4468. selector: 'resetContents',
  4469. fn: function (){
  4470. var self=this;
  4471. smalltalk.send(self, "_reset", []);
  4472. smalltalk.send(self, "_setStreamSize_", [(0)]);
  4473. return self;}
  4474. ]
  4475. }),
  4476. smalltalk.Stream);
  4477. smalltalk.addMethod(
  4478. '_do_',
  4479. smalltalk.method({
  4480. selector: 'do:',
  4481. fn: function (aBlock){
  4482. var self=this;
  4483. smalltalk.send((function(){return smalltalk.send(self, "_atEnd", []);}), "_whileFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})]);
  4484. return self;}
  4485. ]
  4486. }),
  4487. smalltalk.Stream);
  4488. smalltalk.addMethod(
  4489. '_setToEnd',
  4490. smalltalk.method({
  4491. selector: 'setToEnd',
  4492. fn: function (){
  4493. var self=this;
  4494. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  4495. return self;}
  4496. ]
  4497. }),
  4498. smalltalk.Stream);
  4499. smalltalk.addMethod(
  4500. '_skip_',
  4501. smalltalk.method({
  4502. selector: 'skip:',
  4503. fn: function (anInteger){
  4504. var self=this;
  4505. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [anInteger]), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
  4506. return self;}
  4507. ]
  4508. }),
  4509. smalltalk.Stream);
  4510. smalltalk.addMethod(
  4511. '_next',
  4512. smalltalk.method({
  4513. selector: 'next',
  4514. fn: function (){
  4515. var self=this;
  4516. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);
  4517. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  4518. return self;}
  4519. ]
  4520. }),
  4521. smalltalk.Stream);
  4522. smalltalk.addMethod(
  4523. '_next_',
  4524. smalltalk.method({
  4525. selector: 'next:',
  4526. fn: function (anInteger){
  4527. var self=this;
  4528. var tempCollection=nil;
  4529. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4530. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]);})]);
  4531. return tempCollection;
  4532. return self;}
  4533. ]
  4534. }),
  4535. smalltalk.Stream);
  4536. smalltalk.addMethod(
  4537. '_nextPut_',
  4538. smalltalk.method({
  4539. selector: 'nextPut:',
  4540. fn: function (anObject){
  4541. var self=this;
  4542. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [(1)])]);
  4543. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  4544. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4545. return self;}
  4546. ]
  4547. }),
  4548. smalltalk.Stream);
  4549. smalltalk.addMethod(
  4550. '_nextPutAll_',
  4551. smalltalk.method({
  4552. selector: 'nextPutAll:',
  4553. fn: function (aCollection){
  4554. var self=this;
  4555. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  4556. return self;}
  4557. ]
  4558. }),
  4559. smalltalk.Stream);
  4560. smalltalk.addMethod(
  4561. '_peek',
  4562. smalltalk.method({
  4563. selector: 'peek',
  4564. fn: function (){
  4565. var self=this;
  4566. 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)])]);})]);
  4567. return self;}
  4568. ]
  4569. }),
  4570. smalltalk.Stream);
  4571. smalltalk.addMethod(
  4572. '_atEnd',
  4573. smalltalk.method({
  4574. selector: 'atEnd',
  4575. fn: function (){
  4576. var self=this;
  4577. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  4578. return self;}
  4579. ]
  4580. }),
  4581. smalltalk.Stream);
  4582. smalltalk.addMethod(
  4583. '_atStart',
  4584. smalltalk.method({
  4585. selector: 'atStart',
  4586. fn: function (){
  4587. var self=this;
  4588. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  4589. return self;}
  4590. ]
  4591. }),
  4592. smalltalk.Stream);
  4593. smalltalk.addMethod(
  4594. '_isEmpty',
  4595. smalltalk.method({
  4596. selector: 'isEmpty',
  4597. fn: function (){
  4598. var self=this;
  4599. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  4600. return self;}
  4601. ]
  4602. }),
  4603. smalltalk.Stream);
  4604. smalltalk.addMethod(
  4605. '_on_',
  4606. smalltalk.method({
  4607. selector: 'on:',
  4608. fn: function (aCollection){
  4609. var self=this;
  4610. 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", []));
  4611. return self;}
  4612. ]
  4613. }),
  4614. smalltalk.Stream.klass);
  4615. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  4616. smalltalk.addMethod(
  4617. '_next_',
  4618. smalltalk.method({
  4619. selector: 'next:',
  4620. fn: function (anInteger){
  4621. var self=this;
  4622. var tempCollection=nil;
  4623. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4624. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [(function(){return tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);})]);})]);
  4625. return tempCollection;
  4626. return self;}
  4627. ]
  4628. }),
  4629. smalltalk.StringStream);
  4630. smalltalk.addMethod(
  4631. '_nextPut_',
  4632. smalltalk.method({
  4633. selector: 'nextPut:',
  4634. fn: function (aString){
  4635. var self=this;
  4636. smalltalk.send(self, "_nextPutAll_", [aString]);
  4637. return self;}
  4638. ]
  4639. }),
  4640. smalltalk.StringStream);
  4641. smalltalk.addMethod(
  4642. '_nextPutAll_',
  4643. smalltalk.method({
  4644. selector: 'nextPutAll:',
  4645. fn: function (aString){
  4646. var self=this;
  4647. 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", [])])])]);
  4648. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [smalltalk.send(aString, "_size", [])])]);
  4649. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4650. return self;}
  4651. ]
  4652. }),
  4653. smalltalk.StringStream);
  4654. smalltalk.addMethod(
  4655. '_cr',
  4656. smalltalk.method({
  4657. selector: 'cr',
  4658. fn: function (){
  4659. var self=this;
  4660. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  4661. return self;}
  4662. ]
  4663. }),
  4664. smalltalk.StringStream);
  4665. smalltalk.addMethod(
  4666. '_crlf',
  4667. smalltalk.method({
  4668. selector: 'crlf',
  4669. fn: function (){
  4670. var self=this;
  4671. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_crlf", [])]);
  4672. return self;}
  4673. ]
  4674. }),
  4675. smalltalk.StringStream);
  4676. smalltalk.addMethod(
  4677. '_lf',
  4678. smalltalk.method({
  4679. selector: 'lf',
  4680. fn: function (){
  4681. var self=this;
  4682. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_lf", [])]);
  4683. return self;}
  4684. ]
  4685. }),
  4686. smalltalk.StringStream);
  4687. smalltalk.addMethod(
  4688. '_space',
  4689. smalltalk.method({
  4690. selector: 'space',
  4691. fn: function (){
  4692. var self=this;
  4693. smalltalk.send(self, "_nextPut_", [" "]);
  4694. return self;}
  4695. ]
  4696. }),
  4697. smalltalk.StringStream);
  4698. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  4699. smalltalk.addMethod(
  4700. '_class_',
  4701. smalltalk.method({
  4702. selector: 'class:',
  4703. fn: function (aClass){
  4704. var self=this;
  4705. self['@class']=aClass;
  4706. return self;}
  4707. ]
  4708. }),
  4709. smalltalk.ClassCommentReader);
  4710. smalltalk.addMethod(
  4711. '_scanFrom_',
  4712. smalltalk.method({
  4713. selector: 'scanFrom:',
  4714. fn: function (aStream){
  4715. var self=this;
  4716. var nextChunk=nil;
  4717. nextChunk=smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  4718. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_setComment_", [smalltalk.send(nextChunk, "_contents", [])]);})]);
  4719. return self;}
  4720. ]
  4721. }),
  4722. smalltalk.ClassCommentReader);
  4723. smalltalk.addMethod(
  4724. '_initialize',
  4725. smalltalk.method({
  4726. selector: 'initialize',
  4727. fn: function (){
  4728. var self=this;
  4729. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4730. self['@chunkParser']=smalltalk.send(smalltalk.ChunkParser, "_new", []);
  4731. return self;}
  4732. ]
  4733. }),
  4734. smalltalk.ClassCommentReader);
  4735. smalltalk.addMethod(
  4736. '_setComment_',
  4737. smalltalk.method({
  4738. selector: 'setComment:',
  4739. fn: function (aString){
  4740. var self=this;
  4741. smalltalk.send(self['@class'], "_comment_", [aString]);
  4742. return self;}
  4743. ]
  4744. }),
  4745. smalltalk.ClassCommentReader);
  4746. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  4747. smalltalk.addMethod(
  4748. '_next',
  4749. smalltalk.method({
  4750. selector: 'next',
  4751. fn: function (){
  4752. var self=this;
  4753. return Math.random();
  4754. return self;}
  4755. ]
  4756. }),
  4757. smalltalk.Random);
  4758. smalltalk.addMethod(
  4759. '_next_',
  4760. smalltalk.method({
  4761. selector: 'next:',
  4762. fn: function (anInteger){
  4763. var self=this;
  4764. return smalltalk.send((1), "_to_collect_", [anInteger, (function(each){return smalltalk.send(self, "_next", []);})]);
  4765. return self;}
  4766. ]
  4767. }),
  4768. smalltalk.Random);
  4769. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  4770. smalltalk.addMethod(
  4771. '_x',
  4772. smalltalk.method({
  4773. selector: 'x',
  4774. fn: function (){
  4775. var self=this;
  4776. return self['@x'];
  4777. return self;}
  4778. ]
  4779. }),
  4780. smalltalk.Point);
  4781. smalltalk.addMethod(
  4782. '_y',
  4783. smalltalk.method({
  4784. selector: 'y',
  4785. fn: function (){
  4786. var self=this;
  4787. return self['@y'];
  4788. return self;}
  4789. ]
  4790. }),
  4791. smalltalk.Point);
  4792. smalltalk.addMethod(
  4793. '_y_',
  4794. smalltalk.method({
  4795. selector: 'y:',
  4796. fn: function (aNumber){
  4797. var self=this;
  4798. self['@y']=aNumber;
  4799. return self;}
  4800. ]
  4801. }),
  4802. smalltalk.Point);
  4803. smalltalk.addMethod(
  4804. '_x_',
  4805. smalltalk.method({
  4806. selector: 'x:',
  4807. fn: function (aNumber){
  4808. var self=this;
  4809. self['@x']=aNumber;
  4810. return self;}
  4811. ]
  4812. }),
  4813. smalltalk.Point);
  4814. smalltalk.addMethod(
  4815. '__star',
  4816. smalltalk.method({
  4817. selector: '*',
  4818. fn: function (aPoint){
  4819. var self=this;
  4820. 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", [])])]);
  4821. return self;}
  4822. ]
  4823. }),
  4824. smalltalk.Point);
  4825. smalltalk.addMethod(
  4826. '__plus',
  4827. smalltalk.method({
  4828. selector: '+',
  4829. fn: function (aPoint){
  4830. var self=this;
  4831. 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", [])])]);
  4832. return self;}
  4833. ]
  4834. }),
  4835. smalltalk.Point);
  4836. smalltalk.addMethod(
  4837. '__minus',
  4838. smalltalk.method({
  4839. selector: '-',
  4840. fn: function (aPoint){
  4841. var self=this;
  4842. 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", [])])]);
  4843. return self;}
  4844. ]
  4845. }),
  4846. smalltalk.Point);
  4847. smalltalk.addMethod(
  4848. '__slash',
  4849. smalltalk.method({
  4850. selector: '/',
  4851. fn: function (aPoint){
  4852. var self=this;
  4853. 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", [])])]);
  4854. return self;}
  4855. ]
  4856. }),
  4857. smalltalk.Point);
  4858. smalltalk.addMethod(
  4859. '_asPoint',
  4860. smalltalk.method({
  4861. selector: 'asPoint',
  4862. fn: function (){
  4863. var self=this;
  4864. return self;
  4865. return self;}
  4866. ]
  4867. }),
  4868. smalltalk.Point);
  4869. smalltalk.addMethod(
  4870. '_x_y_',
  4871. smalltalk.method({
  4872. selector: 'x:y:',
  4873. fn: function (aNumber, anotherNumber){
  4874. var self=this;
  4875. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4876. return self;}
  4877. ]
  4878. }),
  4879. smalltalk.Point.klass);
  4880. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  4881. smalltalk.addMethod(
  4882. '_selector',
  4883. smalltalk.method({
  4884. selector: 'selector',
  4885. fn: function (){
  4886. var self=this;
  4887. return self['@selector'];
  4888. return self;}
  4889. ]
  4890. }),
  4891. smalltalk.Message);
  4892. smalltalk.addMethod(
  4893. '_selector_',
  4894. smalltalk.method({
  4895. selector: 'selector:',
  4896. fn: function (aString){
  4897. var self=this;
  4898. self['@selector']=aString;
  4899. return self;}
  4900. ]
  4901. }),
  4902. smalltalk.Message);
  4903. smalltalk.addMethod(
  4904. '_arguments_',
  4905. smalltalk.method({
  4906. selector: 'arguments:',
  4907. fn: function (anArray){
  4908. var self=this;
  4909. self['@arguments']=anArray;
  4910. return self;}
  4911. ]
  4912. }),
  4913. smalltalk.Message);
  4914. smalltalk.addMethod(
  4915. '_arguments',
  4916. smalltalk.method({
  4917. selector: 'arguments',
  4918. fn: function (){
  4919. var self=this;
  4920. return self['@arguments'];
  4921. return self;}
  4922. ]
  4923. }),
  4924. smalltalk.Message);
  4925. smalltalk.addMethod(
  4926. '_selector_arguments_',
  4927. smalltalk.method({
  4928. selector: 'selector:arguments:',
  4929. fn: function (aString, anArray){
  4930. var self=this;
  4931. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4932. return self;}
  4933. ]
  4934. }),
  4935. smalltalk.Message.klass);
  4936. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  4937. smalltalk.addMethod(
  4938. '_message',
  4939. smalltalk.method({
  4940. selector: 'message',
  4941. fn: function (){
  4942. var self=this;
  4943. return self['@message'];
  4944. return self;}
  4945. ]
  4946. }),
  4947. smalltalk.MessageNotUnderstood);
  4948. smalltalk.addMethod(
  4949. '_message_',
  4950. smalltalk.method({
  4951. selector: 'message:',
  4952. fn: function (aMessage){
  4953. var self=this;
  4954. self['@message']=aMessage;
  4955. return self;}
  4956. ]
  4957. }),
  4958. smalltalk.MessageNotUnderstood);
  4959. smalltalk.addMethod(
  4960. '_receiver',
  4961. smalltalk.method({
  4962. selector: 'receiver',
  4963. fn: function (){
  4964. var self=this;
  4965. return self['@receiver'];
  4966. return self;}
  4967. ]
  4968. }),
  4969. smalltalk.MessageNotUnderstood);
  4970. smalltalk.addMethod(
  4971. '_receiver_',
  4972. smalltalk.method({
  4973. selector: 'receiver:',
  4974. fn: function (anObject){
  4975. var self=this;
  4976. self['@receiver']=anObject;
  4977. return self;}
  4978. ]
  4979. }),
  4980. smalltalk.MessageNotUnderstood);
  4981. smalltalk.addMethod(
  4982. '_messageText',
  4983. smalltalk.method({
  4984. selector: 'messageText',
  4985. fn: function (){
  4986. var self=this;
  4987. 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", [])]);
  4988. return self;}
  4989. ]
  4990. }),
  4991. smalltalk.MessageNotUnderstood);
  4992. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel');
  4993. smalltalk.addMethod(
  4994. '_handleError_',
  4995. smalltalk.method({
  4996. selector: 'handleError:',
  4997. fn: function (anError){
  4998. var self=this;
  4999. smalltalk.send(smalltalk.send(anError, "_context", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})]);
  5000. smalltalk.send(self, "_logError_", [anError]);
  5001. return self;}
  5002. ]
  5003. }),
  5004. smalltalk.ErrorHandler);
  5005. smalltalk.addMethod(
  5006. '_logContext_',
  5007. smalltalk.method({
  5008. selector: 'logContext:',
  5009. fn: function (aContext){
  5010. var self=this;
  5011. smalltalk.send(smalltalk.send(aContext, "_home", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})]);
  5012. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  5013. return self;}
  5014. ]
  5015. }),
  5016. smalltalk.ErrorHandler);
  5017. smalltalk.addMethod(
  5018. '_logErrorContext_',
  5019. smalltalk.method({
  5020. selector: 'logErrorContext:',
  5021. fn: function (aContext){
  5022. var self=this;
  5023. smalltalk.send(aContext, "_ifNotNil_", [(function(){return smalltalk.send(smalltalk.send(aContext, "_home", []), "_ifNotNil_", [(function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})]);})]);
  5024. return self;}
  5025. ]
  5026. }),
  5027. smalltalk.ErrorHandler);
  5028. smalltalk.addMethod(
  5029. '_logError_',
  5030. smalltalk.method({
  5031. selector: 'logError:',
  5032. fn: function (anError){
  5033. var self=this;
  5034. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  5035. return self;}
  5036. ]
  5037. }),
  5038. smalltalk.ErrorHandler);
  5039. smalltalk.addMethod(
  5040. '_log_',
  5041. smalltalk.method({
  5042. selector: 'log:',
  5043. fn: function (aString){
  5044. var self=this;
  5045. smalltalk.send(console, "_log_", [aString]);
  5046. return self;}
  5047. ]
  5048. }),
  5049. smalltalk.ErrorHandler);
  5050. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  5051. smalltalk.addMethod(
  5052. '_current',
  5053. smalltalk.method({
  5054. selector: 'current',
  5055. fn: function (){
  5056. var self=this;
  5057. return self['@current'];
  5058. return self;}
  5059. ]
  5060. }),
  5061. smalltalk.ErrorHandler.klass);
  5062. smalltalk.addMethod(
  5063. '_initialize',
  5064. smalltalk.method({
  5065. selector: 'initialize',
  5066. fn: function (){
  5067. var self=this;
  5068. smalltalk.send(self, "_register", []);
  5069. return self;}
  5070. ]
  5071. }),
  5072. smalltalk.ErrorHandler.klass);
  5073. smalltalk.addMethod(
  5074. '_register',
  5075. smalltalk.method({
  5076. selector: 'register',
  5077. fn: function (){
  5078. var self=this;
  5079. smalltalk.send(smalltalk.ErrorHandler, "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  5080. return self;}
  5081. ]
  5082. }),
  5083. smalltalk.ErrorHandler.klass);
  5084. smalltalk.addMethod(
  5085. '_setCurrent_',
  5086. smalltalk.method({
  5087. selector: 'setCurrent:',
  5088. fn: function (anHandler){
  5089. var self=this;
  5090. self['@current']=anHandler;
  5091. return self;}
  5092. ]
  5093. }),
  5094. smalltalk.ErrorHandler.klass);