Kernel.deploy.js 114 KB

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