Kernel.deploy.js 132 KB

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