Kernel.deploy.js 137 KB

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