Kernel.deploy.js 144 KB

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