Kernel.deploy.js 152 KB

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