Kernel.deploy.js 121 KB

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