1
0

Kernel.deploy.js 114 KB

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