Kernel.deploy.js 123 KB

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