amber.js 980 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325
  1. /* ====================================================================
  2. |
  3. | Amber Smalltalk
  4. | http://amber-lang.net
  5. |
  6. ======================================================================
  7. ======================================================================
  8. |
  9. | Copyright (c) 2010-2011
  10. | Nicolas Petton <petton.nicolas@gmail.com>
  11. |
  12. | Amber is released under the MIT license
  13. |
  14. | Permission is hereby granted, free of charge, to any person obtaining
  15. | a copy of this software and associated documentation files (the
  16. | 'Software'), to deal in the Software without restriction, including
  17. | without limitation the rights to use, copy, modify, merge, publish,
  18. | distribute, sublicense, and/or sell copies of the Software, and to
  19. | permit persons to whom the Software is furnished to do so, subject to
  20. | the following conditions:
  21. |
  22. | The above copyright notice and this permission notice shall be
  23. | included in all copies or substantial portions of the Software.
  24. |
  25. | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  26. | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  28. | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  29. | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  30. | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  31. | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. |
  33. ==================================================================== */
  34. /* Make sure that console is defined */
  35. if(typeof console === "undefined") {
  36. this.console = {
  37. log: function() {},
  38. warn: function() {},
  39. info: function() {},
  40. debug: function() {},
  41. error: function() {}
  42. };
  43. }
  44. /* Array extensions */
  45. Array.prototype.addElement = function(el) {
  46. if(typeof el === 'undefined') { return; }
  47. if(this.indexOf(el) == -1) {
  48. this.push(el);
  49. }
  50. };
  51. Array.prototype.removeElement = function(el) {
  52. var i = this.indexOf(el);
  53. if (i !== -1) { this.splice(i, 1); }
  54. };
  55. /* Smalltalk constructors definition */
  56. function SmalltalkObject() {}
  57. function SmalltalkBehavior() {}
  58. function SmalltalkClass() {}
  59. function SmalltalkMetaclass() {
  60. this.meta = true;
  61. }
  62. function SmalltalkPackage() {}
  63. function SmalltalkMethod() {}
  64. function SmalltalkNil() {}
  65. function SmalltalkSymbol(string) {
  66. this.value = string;
  67. }
  68. function SmalltalkOrganizer() {
  69. this.elements = [];
  70. }
  71. function inherits(child, parent) {
  72. child.prototype = Object.create(parent.prototype, {
  73. constructor: { value: child,
  74. enumerable: false, configurable: true, writable: true }
  75. });
  76. }
  77. inherits(SmalltalkBehavior, SmalltalkObject);
  78. inherits(SmalltalkClass, SmalltalkBehavior);
  79. inherits(SmalltalkMetaclass, SmalltalkBehavior);
  80. inherits(SmalltalkNil, SmalltalkObject);
  81. inherits(SmalltalkMethod, SmalltalkObject);
  82. inherits(SmalltalkPackage, SmalltalkObject);
  83. inherits(SmalltalkOrganizer, SmalltalkObject);
  84. function Smalltalk() {
  85. var st = this;
  86. /* This is the current call context object. While it is publicly available,
  87. Use smalltalk.getThisContext() instead which will answer a safe copy of
  88. the current context */
  89. st.thisContext = undefined;
  90. /* List of all reserved words in JavaScript. They may not be used as variables
  91. in Smalltalk. */
  92. // list of reserved JavaScript keywords as of
  93. // http://es5.github.com/#x7.6.1.1
  94. // and
  95. // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.6.1
  96. st.reservedWords = ['break', 'case', 'catch', 'continue', 'debugger',
  97. 'default', 'delete', 'do', 'else', 'finally', 'for', 'function',
  98. 'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw',
  99. 'try', 'typeof', 'var', 'void', 'while', 'with',
  100. // ES5: future use: http://es5.github.com/#x7.6.1.2
  101. 'class', 'const', 'enum', 'export', 'extends', 'import', 'super',
  102. // ES5: future use in strict mode
  103. 'implements', 'interface', 'let', 'package', 'private', 'protected',
  104. 'public', 'static', 'yield'];
  105. var initialized = false;
  106. /* Smalltalk classes */
  107. var classes = [];
  108. var wrappedClasses = [];
  109. /* Method not implemented handlers */
  110. var dnu = {
  111. methods: [],
  112. selectors: [],
  113. get: function (string) {
  114. var index = this.selectors.indexOf(string);
  115. if(index !== -1) {
  116. return this.methods[index];
  117. }
  118. this.selectors.push(string);
  119. var selector = st.selector(string);
  120. var method = {jsSelector: selector, fn: this.createHandler(selector)};
  121. this.methods.push(method);
  122. return method;
  123. },
  124. /* Dnu handler method */
  125. createHandler: function (selector) {
  126. return function () {
  127. var args = Array.prototype.slice.call(arguments);
  128. return messageNotUnderstood(this, selector, args);
  129. };
  130. }
  131. };
  132. /* The symbol table ensures symbol unicity */
  133. var symbolTable = {};
  134. st.symbolFor = function(string) {
  135. if(symbolTable[string] === undefined) {
  136. symbolTable[string] = new SmalltalkSymbol(string);
  137. }
  138. return symbolTable[string];
  139. };
  140. /* Unique ID number generator */
  141. var oid = 0;
  142. st.nextId = function() {
  143. oid += 1;
  144. return oid;
  145. };
  146. /* We hold all Packages in a separate Object */
  147. st.packages = {};
  148. /* Smalltalk package creation. To add a Package, use smalltalk.addPackage() */
  149. function pkg(spec) {
  150. var that = new SmalltalkPackage();
  151. that.pkgName = spec.pkgName;
  152. that.organization = new SmalltalkOrganizer();
  153. that.properties = spec.properties || {};
  154. return that;
  155. }
  156. /* Smalltalk class creation. A class is an instance of an automatically
  157. created metaclass object. Newly created classes (not their metaclass)
  158. should be added to the smalltalk object, see smalltalk.addClass().
  159. Superclass linking is *not* handled here, see smalltalk.init() */
  160. function klass(spec) {
  161. spec = spec || {};
  162. var meta = metaclass(spec);
  163. var that = meta.instanceClass;
  164. that.fn = spec.fn || function() {};
  165. setupClass(that, spec);
  166. that.className = spec.className;
  167. that.wrapped = spec.wrapped || false;
  168. meta.className = spec.className + ' class';
  169. if(spec.superclass) {
  170. that.superclass = spec.superclass;
  171. meta.superclass = spec.superclass.klass;
  172. }
  173. return that;
  174. }
  175. function metaclass(spec) {
  176. spec = spec || {};
  177. var that = new SmalltalkMetaclass();
  178. inherits(
  179. that.fn = function() {},
  180. spec.superclass ? spec.superclass.klass.fn : SmalltalkClass
  181. );
  182. that.instanceClass = new that.fn();
  183. setupClass(that);
  184. return that;
  185. }
  186. function setupClass(klass, spec) {
  187. spec = spec || {};
  188. klass.iVarNames = spec.iVarNames || [];
  189. klass.pkg = spec.pkg;
  190. Object.defineProperty(klass, "toString", {
  191. value: function() { return 'Smalltalk ' + this.className; },
  192. enumerable:false, configurable: true, writable: false
  193. });
  194. klass.organization = new SmalltalkOrganizer();
  195. Object.defineProperty(klass, "methods", {
  196. value: {},
  197. enumerable: false, configurable: true, writable: true
  198. });
  199. wireKlass(klass);
  200. }
  201. /* Smalltalk method object. To add a method to a class,
  202. use smalltalk.addMethod() */
  203. st.method = function(spec) {
  204. var that = new SmalltalkMethod();
  205. that.selector = spec.selector;
  206. that.jsSelector = spec.jsSelector;
  207. that.args = spec.args || {};
  208. that.category = spec.category;
  209. that.source = spec.source;
  210. that.messageSends = spec.messageSends || [];
  211. that.referencedClasses = spec.referencedClasses || [];
  212. that.fn = spec.fn;
  213. return that;
  214. };
  215. /* Initialize a class in its class hierarchy. Handle both classes and
  216. metaclasses. */
  217. st.init = function(klass) {
  218. st.initClass(klass);
  219. if(klass.klass && !klass.meta) {
  220. st.initClass(klass.klass);
  221. }
  222. };
  223. st.initClass = function(klass) {
  224. if(klass.wrapped) {
  225. copySuperclass(klass);
  226. }
  227. else {
  228. installSuperclass(klass);
  229. }
  230. if(klass === st.Object || klass.wrapped) {
  231. installDnuHandlers(klass);
  232. }
  233. };
  234. function wireKlass(klass) {
  235. Object.defineProperty(klass.fn.prototype, "klass", {
  236. value: klass,
  237. enumerable: false, configurable: true, writable: true
  238. });
  239. }
  240. function installSuperclass(klass) {
  241. // only if the klass has not been initialized yet.
  242. if(klass.fn.prototype._yourself) { return; }
  243. if(klass.superclass && klass.superclass !== nil) {
  244. inherits(klass.fn, klass.superclass.fn);
  245. wireKlass(klass);
  246. reinstallMethods(klass);
  247. }
  248. }
  249. function copySuperclass(klass, superclass) {
  250. for (superclass = superclass || klass.superclass;
  251. superclass && superclass !== nil;
  252. superclass = superclass.superclass) {
  253. for (var keys = Object.keys(superclass.methods), i = 0; i < keys.length; i++) {
  254. installMethodIfAbsent(superclass.methods[keys[i]], klass);
  255. }
  256. }
  257. }
  258. function installMethod(method, klass) {
  259. Object.defineProperty(klass.fn.prototype, method.jsSelector, {
  260. value: method.fn,
  261. enumerable: false, configurable: true, writable: true
  262. });
  263. }
  264. function installMethodIfAbsent(method, klass) {
  265. if(!klass.fn.prototype[method.jsSelector]) {
  266. installMethod(method, klass);
  267. }
  268. }
  269. function reinstallMethods(klass) {
  270. for(var keys = Object.keys(klass.methods), i=0; i<keys.length; i++) {
  271. installMethod(klass.methods[keys[i]], klass);
  272. }
  273. }
  274. function installDnuHandlers(klass) {
  275. var m = dnu.methods;
  276. for(var i=0; i<m.length; i++) {
  277. installMethodIfAbsent(m[i], klass);
  278. }
  279. }
  280. function installNewDnuHandler(newHandler) {
  281. installMethodIfAbsent(newHandler, st.Object);
  282. for(var i = 0; i < wrappedClasses.length; i++) {
  283. installMethodIfAbsent(newHandler, wrappedClasses[i]);
  284. }
  285. }
  286. /* Answer all registered Packages as Array */
  287. // TODO: Remove this hack
  288. st.packages.all = function() {
  289. var packages = [];
  290. for(var i in st.packages) {
  291. if(!st.packages.hasOwnProperty(i) || typeof(st.packages[i]) === "function") continue;
  292. packages.push(st.packages[i]);
  293. }
  294. return packages
  295. };
  296. /* Answer all registered Smalltalk classes */
  297. //TODO: remove the function and make smalltalk.classes an array
  298. st.classes = function() {
  299. return classes;
  300. };
  301. st.wrappedClasses = function() {
  302. return wrappedClasses;
  303. };
  304. /* Answer the direct subclasses of klass. */
  305. st.subclasses = function(klass) {
  306. var subclasses = [];
  307. var classes = st.classes();
  308. for(var i=0; i < classes.length; i++) {
  309. var c = classes[i];
  310. if(c.fn) {
  311. //Classes
  312. if(c.superclass === klass) {
  313. subclasses.push(c);
  314. }
  315. c = c.klass;
  316. //Metaclasses
  317. if(c && c.superclass === klass) {
  318. subclasses.push(c);
  319. }
  320. }
  321. }
  322. return subclasses;
  323. };
  324. /* Create a new class wrapping a JavaScript constructor, and add it to the
  325. global smalltalk object. Package is lazily created if it does not exist with given name. */
  326. st.wrapClassName = function(className, pkgName, fn, superclass, wrapped) {
  327. if(wrapped !== false) {
  328. wrapped = true;
  329. }
  330. var pkg = st.addPackage(pkgName);
  331. st[className] = klass({
  332. className: className,
  333. superclass: superclass,
  334. pkg: pkg,
  335. fn: fn,
  336. wrapped: wrapped
  337. });
  338. classes.addElement(st[className]);
  339. if(wrapped) {wrappedClasses.addElement(st[className])}
  340. pkg.organization.elements.addElement(st[className]);
  341. };
  342. /* Create an alias for an existing class */
  343. st.alias = function(klass, alias) {
  344. st[alias] = klass;
  345. };
  346. /* Add a package to the smalltalk.packages object, creating a new one if needed.
  347. If pkgName is null or empty we return nil, which is an allowed package for a class.
  348. If package already exists we still update the properties of it. */
  349. st.addPackage = function(pkgName, properties) {
  350. if(!pkgName) {return nil;}
  351. if(!(st.packages[pkgName])) {
  352. st.packages[pkgName] = pkg({
  353. pkgName: pkgName,
  354. properties: properties
  355. });
  356. } else {
  357. if(properties) {
  358. st.packages[pkgName].properties = properties;
  359. }
  360. }
  361. return st.packages[pkgName];
  362. };
  363. /* Add a class to the smalltalk object, creating a new one if needed.
  364. A Package is lazily created if it does not exist with given name. */
  365. st.addClass = function(className, superclass, iVarNames, pkgName) {
  366. var pkg = st.addPackage(pkgName);
  367. if (superclass == nil) { superclass = null; }
  368. if(st[className] && st[className].superclass == superclass) {
  369. st[className].superclass = superclass;
  370. st[className].iVarNames = iVarNames;
  371. st[className].pkg = pkg || st[className].pkg;
  372. } else {
  373. if(st[className]) {
  374. st.removeClass(st[className]);
  375. }
  376. st[className] = klass({
  377. className: className,
  378. superclass: superclass,
  379. pkg: pkg,
  380. iVarNames: iVarNames
  381. });
  382. }
  383. classes.addElement(st[className]);
  384. pkg.organization.elements.addElement(st[className]);
  385. };
  386. st.removeClass = function(klass) {
  387. klass.pkg.organization.elements.removeElement(klass);
  388. classes.removeElement(klass);
  389. delete st[klass.className];
  390. };
  391. /* Add/remove a method to/from a class */
  392. st.addMethod = function(jsSelector, method, klass) {
  393. method.jsSelector = jsSelector;
  394. installMethod(method, klass);
  395. klass.methods[method.selector] = method;
  396. method.methodClass = klass;
  397. klass.organization.elements.addElement(method.category);
  398. for(var i=0; i<method.messageSends.length; i++) {
  399. var dnuHandler = dnu.get(method.messageSends[i]);
  400. if(initialized) {
  401. installNewDnuHandler(dnuHandler);
  402. }
  403. }
  404. };
  405. st.removeMethod = function(method) {
  406. var protocol = method.category;
  407. var klass = method.methodClass;
  408. delete klass.fn.prototype[st.selector(method.selector)];
  409. delete klass.methods[method.selector];
  410. var selectors = Object.keys(klass.methods);
  411. var shouldDeleteProtocol = true;
  412. for(var i = 0, l = selectors.length; i<l; i++) {
  413. if(klass.methods[selectors[i]].category === protocol) {
  414. shouldDeleteProtocol = false;
  415. break;
  416. };
  417. };
  418. if(shouldDeleteProtocol) {
  419. klass.organization.elements.removeElement(protocol)
  420. };
  421. };
  422. /* Handles unhandled errors during message sends */
  423. // simply send the message and handle #dnu:
  424. st.send = function(receiver, selector, args, klass) {
  425. var method;
  426. if(receiver == null) {
  427. receiver = nil;
  428. }
  429. method = klass ? klass.fn.prototype[selector] : receiver.klass && receiver[selector];
  430. if(method) {
  431. return method.apply(receiver, args);
  432. } else {
  433. return messageNotUnderstood(receiver, selector, args);
  434. }
  435. }
  436. st.withContext = function(worker, setup) {
  437. if(st.thisContext) {
  438. st.thisContext.pc++;
  439. return inContext(worker, setup);
  440. } else {
  441. try {return inContext(worker, setup)}
  442. catch(error) {
  443. if(error.smalltalkError) {
  444. handleError(error);
  445. } else {
  446. var errorWrapper = st.JavaScriptException._on_(error);
  447. try {errorWrapper._signal()} catch(ex) {}
  448. errorWrapper._context_(st.getThisContext());
  449. handleError(errorWrapper);
  450. }
  451. // Reset the context stack in any case
  452. st.thisContext = undefined;
  453. // Throw the exception anyway, as we want to stop
  454. // the execution to avoid infinite loops
  455. throw error;
  456. }
  457. }
  458. };
  459. function inContext(worker, setup) {
  460. var context = pushContext(setup);
  461. var result = worker(context);
  462. popContext(context);
  463. return result;
  464. }
  465. /* Handles Smalltalk errors. Triggers the registered ErrorHandler
  466. (See the Smalltalk class ErrorHandler and its subclasses */
  467. function handleError(error) {
  468. st.ErrorHandler._current()._handleError_(error);
  469. }
  470. /* Handles #dnu: *and* JavaScript method calls.
  471. if the receiver has no klass, we consider it a JS object (outside of the
  472. Amber system). Else assume that the receiver understands #doesNotUnderstand: */
  473. function messageNotUnderstood(receiver, selector, args) {
  474. /* Handles JS method calls. */
  475. if(receiver.klass === undefined || receiver.allowJavaScriptCalls) {
  476. return callJavaScriptMethod(receiver, selector, args);
  477. }
  478. /* Handles not understood messages. Also see the Amber counter-part
  479. Object>>doesNotUnderstand: */
  480. return receiver._doesNotUnderstand_(
  481. st.Message._new()
  482. ._selector_(st.convertSelector(selector))
  483. ._arguments_(args)
  484. );
  485. }
  486. /* Call a method of a JS object, or answer a property if it exists.
  487. Else try wrapping a JSObjectProxy around the receiver.
  488. If the object property is a function, then call it, except if it starts with
  489. an uppercase character (we probably want to answer the function itself in this
  490. case and send it #new from Amber).
  491. Converts keyword-based selectors by using the first
  492. keyword only, but keeping all message arguments.
  493. Example:
  494. "self do: aBlock with: anObject" -> "self.do(aBlock, anObject)" */
  495. function callJavaScriptMethod(receiver, selector, args) {
  496. var jsSelector = selector._asJavaScriptSelector();
  497. var jsProperty = receiver[jsSelector];
  498. if(typeof jsProperty === "function" && !/^[A-Z]/.test(jsSelector)) {
  499. return jsProperty.apply(receiver, args);
  500. } else if(jsProperty !== undefined) {
  501. if(args[0]) {
  502. receiver[jsSelector] = args[0];
  503. return nil;
  504. } else {
  505. return jsProperty;
  506. }
  507. }
  508. return st.send(st.JSObjectProxy._on_(receiver), selector, args);
  509. }
  510. /* Handle thisContext pseudo variable */
  511. st.getThisContext = function() {
  512. if(st.thisContext) {
  513. st.thisContext.init();
  514. return st.thisContext;
  515. } else {
  516. return nil;
  517. }
  518. };
  519. function pushContext(setup) {
  520. return st.thisContext = new SmalltalkMethodContext(smalltalk.thisContext, setup);
  521. }
  522. function popContext(context) {
  523. st.thisContext = context.homeContext;
  524. }
  525. /* Convert a Smalltalk selector into a JS selector */
  526. st.selector = function(string) {
  527. var selector = '_' + string;
  528. selector = selector.replace(/:/g, '_');
  529. selector = selector.replace(/[\&]/g, '_and');
  530. selector = selector.replace(/[\|]/g, '_or');
  531. selector = selector.replace(/[+]/g, '_plus');
  532. selector = selector.replace(/-/g, '_minus');
  533. selector = selector.replace(/[*]/g ,'_star');
  534. selector = selector.replace(/[\/]/g ,'_slash');
  535. selector = selector.replace(/[\\]/g ,'_backslash');
  536. selector = selector.replace(/[\~]/g ,'_tild');
  537. selector = selector.replace(/>/g ,'_gt');
  538. selector = selector.replace(/</g ,'_lt');
  539. selector = selector.replace(/=/g ,'_eq');
  540. selector = selector.replace(/,/g ,'_comma');
  541. selector = selector.replace(/[@]/g ,'_at');
  542. return selector
  543. };
  544. /* Convert a string to a valid smalltalk selector.
  545. if you modify the following functions, also change String>>asSelector
  546. accordingly */
  547. st.convertSelector = function(selector) {
  548. if(selector.match(/__/)) {
  549. return convertBinarySelector(selector);
  550. } else {
  551. return convertKeywordSelector(selector);
  552. }
  553. };
  554. function convertKeywordSelector(selector) {
  555. return selector.replace(/^_/, '').replace(/_/g, ':');
  556. }
  557. function convertBinarySelector(selector) {
  558. return selector
  559. .replace(/^_/, '')
  560. .replace(/_and/g, '&')
  561. .replace(/_or/g, '|')
  562. .replace(/_plus/g, '+')
  563. .replace(/_minus/g, '-')
  564. .replace(/_star/g, '*')
  565. .replace(/_slash/g, '/')
  566. .replace(/_backslash/g, '\\')
  567. .replace(/_tild/g, '~')
  568. .replace(/_gt/g, '>')
  569. .replace(/_lt/g, '<')
  570. .replace(/_eq/g, '=')
  571. .replace(/_comma/g, ',')
  572. .replace(/_at/g, '@')
  573. }
  574. /* Converts a JavaScript object to valid Smalltalk Object */
  575. st.readJSObject = function(js) {
  576. var object = js;
  577. var readObject = (js.constructor === Object);
  578. var readArray = (js.constructor === Array);
  579. if(readObject) {
  580. object = st.Dictionary._new();
  581. }
  582. for(var i in js) {
  583. if(readObject) {
  584. object._at_put_(i, st.readJSObject(js[i]));
  585. }
  586. if(readArray) {
  587. object[i] = st.readJSObject(js[i]);
  588. }
  589. }
  590. return object;
  591. };
  592. /* Boolean assertion */
  593. st.assert = function(shouldBeBoolean) {
  594. if ((undefined !== shouldBeBoolean) && (shouldBeBoolean.klass === smalltalk.Boolean)) {
  595. return shouldBeBoolean == true;
  596. } else {
  597. smalltalk.NonBooleanReceiver._new()._object_(shouldBeBoolean)._signal();
  598. }
  599. };
  600. /* Smalltalk initialization. Called on page load */
  601. st.initialize = function() {
  602. if(initialized) { return; }
  603. classes.forEach(function(klass) {
  604. st.init(klass);
  605. });
  606. classes.forEach(function(klass) {
  607. klass._initialize();
  608. });
  609. initialized = true;
  610. };
  611. }
  612. inherits(Smalltalk, SmalltalkObject);
  613. function SmalltalkMethodContext(home, setup) {
  614. this.homeContext = home;
  615. this.setup = setup || function() {};
  616. this.pc = 0;
  617. }
  618. // Fallbacks
  619. SmalltalkMethodContext.prototype.locals = {};
  620. SmalltalkMethodContext.prototype.receiver = null;
  621. SmalltalkMethodContext.prototype.selector = null;
  622. SmalltalkMethodContext.prototype.lookupClass = null;
  623. inherits(SmalltalkMethodContext, SmalltalkObject);
  624. SmalltalkMethodContext.prototype.fill = function(receiver, selector, locals, lookupClass) {
  625. this.receiver = receiver;
  626. this.selector = selector;
  627. this.locals = locals || {};
  628. this.lookupClass = lookupClass;
  629. };
  630. SmalltalkMethodContext.prototype.fillBlock = function(locals, ctx) {
  631. this.locals = locals || {};
  632. this.methodContext = ctx;
  633. };
  634. SmalltalkMethodContext.prototype.init = function() {
  635. var home = this.homeContext;
  636. if(home) {home = home.init()}
  637. this.setup(this);
  638. };
  639. SmalltalkMethodContext.prototype.method = function() {
  640. var method;
  641. var lookup = this.lookupClass || this.receiver.klass;
  642. while(!method && lookup) {
  643. method = lookup.methods[smalltalk.convertSelector(this.selector)];
  644. lookup = lookup.superclass
  645. }
  646. return method;
  647. };
  648. // TODO: this is just wrong :)
  649. SmalltalkMethodContext.prototype.resume = function() {
  650. //Brutally set the receiver as thisContext, then re-enter the function
  651. smalltalk.thisContext = this;
  652. return this.method.apply(receiver, temps);
  653. };
  654. /* Global Smalltalk objects. */
  655. var nil = new SmalltalkNil();
  656. var smalltalk = new Smalltalk();
  657. if(this.jQuery) {
  658. this.jQuery.allowJavaScriptCalls = true;
  659. }
  660. /*
  661. * Answer the smalltalk representation of o.
  662. * Used in message sends
  663. */
  664. var _st = function(o) {
  665. if(o == null) {return nil}
  666. if(o.klass) {return o}
  667. return smalltalk.JSObjectProxy._on_(o);
  668. };
  669. /***************************************** BOOTSTRAP ******************************************/
  670. smalltalk.wrapClassName("Object", "Kernel-Objects", SmalltalkObject, undefined, false);
  671. smalltalk.wrapClassName("Behavior", "Kernel-Classes", SmalltalkBehavior, smalltalk.Object, false);
  672. smalltalk.wrapClassName("Metaclass", "Kernel-Classes", SmalltalkMetaclass, smalltalk.Behavior, false);
  673. smalltalk.wrapClassName("Class", "Kernel-Classes", SmalltalkClass, smalltalk.Behavior, false);
  674. smalltalk.Object.klass.superclass = smalltalk.Class;
  675. smalltalk.wrapClassName("Smalltalk", "Kernel-Objects", Smalltalk, smalltalk.Object, false);
  676. smalltalk.wrapClassName("Package", "Kernel-Objects", SmalltalkPackage, smalltalk.Object, false);
  677. smalltalk.wrapClassName("CompiledMethod", "Kernel-Methods", SmalltalkMethod, smalltalk.Object, false);
  678. smalltalk.wrapClassName("Organizer", "Kernel-Objects", SmalltalkOrganizer, smalltalk.Object, false);
  679. smalltalk.wrapClassName("Number", "Kernel", Number, smalltalk.Object);
  680. smalltalk.wrapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
  681. smalltalk.wrapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
  682. smalltalk.wrapClassName("Date", "Kernel", Date, smalltalk.Object);
  683. smalltalk.wrapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object, false);
  684. smalltalk.addClass("Collection", smalltalk.Object, null, "Kernel");
  685. smalltalk.addClass("SequenceableCollection", smalltalk.Collection, null, "Kernel");
  686. smalltalk.addClass("CharacterArray", smalltalk.SequenceableCollection, null, "Kernel");
  687. smalltalk.wrapClassName("String", "Kernel", String, smalltalk.CharacterArray);
  688. smalltalk.wrapClassName("Symbol", "Kernel", SmalltalkSymbol, smalltalk.CharacterArray, false);
  689. smalltalk.wrapClassName("Array", "Kernel", Array, smalltalk.SequenceableCollection);
  690. smalltalk.wrapClassName("RegularExpression", "Kernel", RegExp, smalltalk.Object);
  691. smalltalk.wrapClassName("Error", "Kernel", Error, smalltalk.Object);
  692. smalltalk.wrapClassName("MethodContext", "Kernel", SmalltalkMethodContext, smalltalk.Object, false);
  693. /* Alias definitions */
  694. smalltalk.alias(smalltalk.Array, "OrderedCollection");
  695. smalltalk.alias(smalltalk.Date, "Time");
  696. smalltalk.addPackage('Kernel-Objects', {});
  697. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
  698. smalltalk.Object.comment="*Object is the root of the Smalltalk class system*. All classes in the system are subclasses of Object.\x0a\x0aObject provides default behavior common to all normal objects, such as: \x0a\x0a- access\x0a- copying\x0a- comparison\x0a- error handling\x0a- message sending\x0a- reflection\x0a\x0aAlso utility messages that all objects should respond to are defined here.\x0a\x0aObject has no instance variable.\x0a\x0a##Access\x0a\x0aInstance variables can be accessed with `#instVarAt:` and `#instVarAt:put:`. `Object >> instanceVariableNames` answers a collection of all instance variable names.\x0aAccessing JavaScript properties of an object is done through `#basicAt:`, `#basicAt:put:` and `basicDelete:`.\x0a\x0a##Copying\x0a\x0aCopying an object is handled by `#copy` and `#deepCopy`. The first one performs a shallow copy of the receiver, while the second one performs a deep copy.\x0aThe hook method `#postCopy` can be overriden in subclasses to copy fields as necessary to complete the full copy. It will be sent by the copy of the receiver.\x0a\x0a##Comparison\x0a\x0aObjects understand equality `#=` and identity `#==` comparison.\x0a\x0a##Error handling\x0a\x0a- `#halt` is the typical message to use for inserting breakpoints during debugging.\x0a- `#error:` throws a generic error exception\x0a- `#doesNotUnderstand:` handles the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message.\x0a Overriding this message can be useful to implement proxies for example."
  699. smalltalk.addMethod(
  700. "__minus_gt",
  701. smalltalk.method({
  702. selector: "->",
  703. category: 'converting',
  704. fn: function (anObject){
  705. var self=this;
  706. return smalltalk.withContext(function($ctx1) { var $1;
  707. $1=_st((smalltalk.Association || Association))._key_value_(self,anObject);
  708. return $1;
  709. }, function($ctx1) {$ctx1.fill(self,"->",{anObject:anObject}, smalltalk.Object)})},
  710. args: ["anObject"],
  711. source: "-> anObject\x0a\x09^Association key: self value: anObject",
  712. messageSends: ["key:value:"],
  713. referencedClasses: ["Association"]
  714. }),
  715. smalltalk.Object);
  716. smalltalk.addMethod(
  717. "__eq",
  718. smalltalk.method({
  719. selector: "=",
  720. category: 'comparing',
  721. fn: function (anObject){
  722. var self=this;
  723. return smalltalk.withContext(function($ctx1) { var $1;
  724. $1=_st(self).__eq_eq(anObject);
  725. return $1;
  726. }, function($ctx1) {$ctx1.fill(self,"=",{anObject:anObject}, smalltalk.Object)})},
  727. args: ["anObject"],
  728. source: "= anObject\x0a\x09^self == anObject",
  729. messageSends: ["=="],
  730. referencedClasses: []
  731. }),
  732. smalltalk.Object);
  733. smalltalk.addMethod(
  734. "__eq_eq",
  735. smalltalk.method({
  736. selector: "==",
  737. category: 'comparing',
  738. fn: function (anObject){
  739. var self=this;
  740. return smalltalk.withContext(function($ctx1) { var $1;
  741. $1=_st(_st(self)._identityHash()).__eq(_st(anObject)._identityHash());
  742. return $1;
  743. }, function($ctx1) {$ctx1.fill(self,"==",{anObject:anObject}, smalltalk.Object)})},
  744. args: ["anObject"],
  745. source: "== anObject\x0a\x09^self identityHash = anObject identityHash",
  746. messageSends: ["=", "identityHash"],
  747. referencedClasses: []
  748. }),
  749. smalltalk.Object);
  750. smalltalk.addMethod(
  751. "_asJSON",
  752. smalltalk.method({
  753. selector: "asJSON",
  754. category: 'converting',
  755. fn: function (){
  756. var self=this;
  757. var variables;
  758. return smalltalk.withContext(function($ctx1) { var $1;
  759. variables=_st((smalltalk.HashedCollection || HashedCollection))._new();
  760. _st(_st(_st(self)._class())._allInstanceVariableNames())._do_((function(each){
  761. return smalltalk.withContext(function($ctx2) { return _st(variables)._at_put_(each,_st(_st(self)._instVarAt_(each))._asJSON());
  762. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  763. $1=variables;
  764. return $1;
  765. }, function($ctx1) {$ctx1.fill(self,"asJSON",{variables:variables}, smalltalk.Object)})},
  766. args: [],
  767. source: "asJSON\x0a\x09| variables |\x0a\x09variables := HashedCollection new.\x0a\x09self class allInstanceVariableNames do: [:each |\x0a\x09\x09variables at: each put: (self instVarAt: each) asJSON].\x0a\x09^variables",
  768. messageSends: ["new", "do:", "at:put:", "asJSON", "instVarAt:", "allInstanceVariableNames", "class"],
  769. referencedClasses: ["HashedCollection"]
  770. }),
  771. smalltalk.Object);
  772. smalltalk.addMethod(
  773. "_asJSONString",
  774. smalltalk.method({
  775. selector: "asJSONString",
  776. category: 'converting',
  777. fn: function (){
  778. var self=this;
  779. return smalltalk.withContext(function($ctx1) { var $1;
  780. $1=_st((smalltalk.JSON || JSON))._stringify_(_st(self)._asJSON());
  781. return $1;
  782. }, function($ctx1) {$ctx1.fill(self,"asJSONString",{}, smalltalk.Object)})},
  783. args: [],
  784. source: "asJSONString\x0a\x09^JSON stringify: self asJSON",
  785. messageSends: ["stringify:", "asJSON"],
  786. referencedClasses: ["JSON"]
  787. }),
  788. smalltalk.Object);
  789. smalltalk.addMethod(
  790. "_asJavascript",
  791. smalltalk.method({
  792. selector: "asJavascript",
  793. category: 'converting',
  794. fn: function (){
  795. var self=this;
  796. return smalltalk.withContext(function($ctx1) { var $1;
  797. $1=_st(self)._asString();
  798. return $1;
  799. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Object)})},
  800. args: [],
  801. source: "asJavascript\x0a\x09^self asString",
  802. messageSends: ["asString"],
  803. referencedClasses: []
  804. }),
  805. smalltalk.Object);
  806. smalltalk.addMethod(
  807. "_asString",
  808. smalltalk.method({
  809. selector: "asString",
  810. category: 'converting',
  811. fn: function (){
  812. var self=this;
  813. return smalltalk.withContext(function($ctx1) { var $1;
  814. $1=_st(self)._printString();
  815. return $1;
  816. }, function($ctx1) {$ctx1.fill(self,"asString",{}, smalltalk.Object)})},
  817. args: [],
  818. source: "asString\x0a\x09^self printString",
  819. messageSends: ["printString"],
  820. referencedClasses: []
  821. }),
  822. smalltalk.Object);
  823. smalltalk.addMethod(
  824. "_basicAt_",
  825. smalltalk.method({
  826. selector: "basicAt:",
  827. category: 'accessing',
  828. fn: function (aString){
  829. var self=this;
  830. return smalltalk.withContext(function($ctx1) { return self[aString];
  831. return self}, function($ctx1) {$ctx1.fill(self,"basicAt:",{aString:aString}, smalltalk.Object)})},
  832. args: ["aString"],
  833. source: "basicAt: aString\x0a\x09<return self[aString]>",
  834. messageSends: [],
  835. referencedClasses: []
  836. }),
  837. smalltalk.Object);
  838. smalltalk.addMethod(
  839. "_basicAt_put_",
  840. smalltalk.method({
  841. selector: "basicAt:put:",
  842. category: 'accessing',
  843. fn: function (aString,anObject){
  844. var self=this;
  845. return smalltalk.withContext(function($ctx1) { return self[aString] = anObject;
  846. return self}, function($ctx1) {$ctx1.fill(self,"basicAt:put:",{aString:aString,anObject:anObject}, smalltalk.Object)})},
  847. args: ["aString", "anObject"],
  848. source: "basicAt: aString put: anObject\x0a\x09<return self[aString] = anObject>",
  849. messageSends: [],
  850. referencedClasses: []
  851. }),
  852. smalltalk.Object);
  853. smalltalk.addMethod(
  854. "_basicDelete_",
  855. smalltalk.method({
  856. selector: "basicDelete:",
  857. category: 'accessing',
  858. fn: function (aString){
  859. var self=this;
  860. return smalltalk.withContext(function($ctx1) { delete self[aString]; return aString;
  861. return self}, function($ctx1) {$ctx1.fill(self,"basicDelete:",{aString:aString}, smalltalk.Object)})},
  862. args: ["aString"],
  863. source: "basicDelete: aString\x0a <delete self[aString]; return aString>",
  864. messageSends: [],
  865. referencedClasses: []
  866. }),
  867. smalltalk.Object);
  868. smalltalk.addMethod(
  869. "_basicPerform_",
  870. smalltalk.method({
  871. selector: "basicPerform:",
  872. category: 'message handling',
  873. fn: function (aSymbol){
  874. var self=this;
  875. return smalltalk.withContext(function($ctx1) { var $1;
  876. $1=_st(self)._basicPerform_withArguments_(aSymbol,[]);
  877. return $1;
  878. }, function($ctx1) {$ctx1.fill(self,"basicPerform:",{aSymbol:aSymbol}, smalltalk.Object)})},
  879. args: ["aSymbol"],
  880. source: "basicPerform: aSymbol \x0a\x09^self basicPerform: aSymbol withArguments: #()",
  881. messageSends: ["basicPerform:withArguments:"],
  882. referencedClasses: []
  883. }),
  884. smalltalk.Object);
  885. smalltalk.addMethod(
  886. "_basicPerform_withArguments_",
  887. smalltalk.method({
  888. selector: "basicPerform:withArguments:",
  889. category: 'message handling',
  890. fn: function (aSymbol,aCollection){
  891. var self=this;
  892. return smalltalk.withContext(function($ctx1) { return self[aSymbol].apply(self, aCollection);;
  893. return self}, function($ctx1) {$ctx1.fill(self,"basicPerform:withArguments:",{aSymbol:aSymbol,aCollection:aCollection}, smalltalk.Object)})},
  894. args: ["aSymbol", "aCollection"],
  895. source: "basicPerform: aSymbol withArguments: aCollection\x0a\x09<return self[aSymbol].apply(self, aCollection);>",
  896. messageSends: [],
  897. referencedClasses: []
  898. }),
  899. smalltalk.Object);
  900. smalltalk.addMethod(
  901. "_class",
  902. smalltalk.method({
  903. selector: "class",
  904. category: 'accessing',
  905. fn: function (){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) { return self.klass;
  908. return self}, function($ctx1) {$ctx1.fill(self,"class",{}, smalltalk.Object)})},
  909. args: [],
  910. source: "class\x0a\x09<return self.klass>",
  911. messageSends: [],
  912. referencedClasses: []
  913. }),
  914. smalltalk.Object);
  915. smalltalk.addMethod(
  916. "_copy",
  917. smalltalk.method({
  918. selector: "copy",
  919. category: 'copying',
  920. fn: function (){
  921. var self=this;
  922. return smalltalk.withContext(function($ctx1) { var $1;
  923. $1=_st(_st(self)._shallowCopy())._postCopy();
  924. return $1;
  925. }, function($ctx1) {$ctx1.fill(self,"copy",{}, smalltalk.Object)})},
  926. args: [],
  927. source: "copy\x0a\x09^self shallowCopy postCopy",
  928. messageSends: ["postCopy", "shallowCopy"],
  929. referencedClasses: []
  930. }),
  931. smalltalk.Object);
  932. smalltalk.addMethod(
  933. "_deepCopy",
  934. smalltalk.method({
  935. selector: "deepCopy",
  936. category: 'copying',
  937. fn: function (){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx1) {
  940. var copy = self.klass._new();
  941. for(var i in self) {
  942. if(/^@.+/.test(i)) {
  943. copy[i] = self[i]._deepCopy();
  944. }
  945. }
  946. return copy;
  947. ;
  948. return self}, function($ctx1) {$ctx1.fill(self,"deepCopy",{}, smalltalk.Object)})},
  949. args: [],
  950. source: "deepCopy\x0a\x09< \x0a\x09 var copy = self.klass._new();\x0a\x09 for(var i in self) {\x0a\x09\x09if(/^@.+/.test(i)) {\x0a\x09\x09 copy[i] = self[i]._deepCopy();\x0a\x09\x09}\x0a\x09 }\x0a\x09 return copy;\x0a\x09>",
  951. messageSends: [],
  952. referencedClasses: []
  953. }),
  954. smalltalk.Object);
  955. smalltalk.addMethod(
  956. "_deprecatedAPI",
  957. smalltalk.method({
  958. selector: "deprecatedAPI",
  959. category: 'error handling',
  960. fn: function (){
  961. var self=this;
  962. return smalltalk.withContext(function($ctx1) { _st(console)._warn_(_st(_st(_st(_st(_st(smalltalk.getThisContext())._home())._asString()).__comma(" is deprecated! (in ")).__comma(_st(_st(_st(smalltalk.getThisContext())._home())._home())._asString())).__comma(")"));
  963. return self}, function($ctx1) {$ctx1.fill(self,"deprecatedAPI",{}, smalltalk.Object)})},
  964. args: [],
  965. source: "deprecatedAPI\x0a\x09\x22Just a simple way to deprecate methods.\x0a\x09#deprecatedAPI is in the 'error handling' protocol even if it doesn't throw an error,\x0a\x09but it could in the future.\x22\x0a\x09console warn: thisContext home asString, ' is deprecated! (in ', thisContext home home asString, ')'",
  966. messageSends: ["warn:", ",", "asString", "home"],
  967. referencedClasses: []
  968. }),
  969. smalltalk.Object);
  970. smalltalk.addMethod(
  971. "_doesNotUnderstand_",
  972. smalltalk.method({
  973. selector: "doesNotUnderstand:",
  974. category: 'error handling',
  975. fn: function (aMessage){
  976. var self=this;
  977. return smalltalk.withContext(function($ctx1) { var $1,$2;
  978. $1=_st((smalltalk.MessageNotUnderstood || MessageNotUnderstood))._new();
  979. _st($1)._receiver_(self);
  980. _st($1)._message_(aMessage);
  981. $2=_st($1)._signal();
  982. return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage}, smalltalk.Object)})},
  983. args: ["aMessage"],
  984. source: "doesNotUnderstand: aMessage\x0a\x09MessageNotUnderstood new\x0a\x09\x09receiver: self;\x0a\x09\x09message: aMessage;\x0a\x09\x09signal",
  985. messageSends: ["receiver:", "new", "message:", "signal"],
  986. referencedClasses: ["MessageNotUnderstood"]
  987. }),
  988. smalltalk.Object);
  989. smalltalk.addMethod(
  990. "_error_",
  991. smalltalk.method({
  992. selector: "error:",
  993. category: 'error handling',
  994. fn: function (aString){
  995. var self=this;
  996. return smalltalk.withContext(function($ctx1) { _st((smalltalk.Error || Error))._signal_(aString);
  997. return self}, function($ctx1) {$ctx1.fill(self,"error:",{aString:aString}, smalltalk.Object)})},
  998. args: ["aString"],
  999. source: "error: aString\x0a\x09Error signal: aString",
  1000. messageSends: ["signal:"],
  1001. referencedClasses: ["Error"]
  1002. }),
  1003. smalltalk.Object);
  1004. smalltalk.addMethod(
  1005. "_halt",
  1006. smalltalk.method({
  1007. selector: "halt",
  1008. category: 'error handling',
  1009. fn: function (){
  1010. var self=this;
  1011. return smalltalk.withContext(function($ctx1) { _st(self)._error_("Halt encountered");
  1012. return self}, function($ctx1) {$ctx1.fill(self,"halt",{}, smalltalk.Object)})},
  1013. args: [],
  1014. source: "halt\x0a\x09self error: 'Halt encountered'",
  1015. messageSends: ["error:"],
  1016. referencedClasses: []
  1017. }),
  1018. smalltalk.Object);
  1019. smalltalk.addMethod(
  1020. "_identityHash",
  1021. smalltalk.method({
  1022. selector: "identityHash",
  1023. category: 'accessing',
  1024. fn: function (){
  1025. var self=this;
  1026. return smalltalk.withContext(function($ctx1) {
  1027. var hash=self.identityHash;
  1028. if (hash) return hash;
  1029. hash=smalltalk.nextId();
  1030. Object.defineProperty(self, 'identityHash', {value:hash});
  1031. return hash;
  1032. ;
  1033. return self}, function($ctx1) {$ctx1.fill(self,"identityHash",{}, smalltalk.Object)})},
  1034. args: [],
  1035. source: "identityHash\x0a\x09<\x0a\x09var hash=self.identityHash;\x0a\x09if (hash) return hash;\x0a\x09hash=smalltalk.nextId();\x0a\x09Object.defineProperty(self, 'identityHash', {value:hash});\x0a\x09return hash;\x0a\x09>",
  1036. messageSends: [],
  1037. referencedClasses: []
  1038. }),
  1039. smalltalk.Object);
  1040. smalltalk.addMethod(
  1041. "_ifNil_",
  1042. smalltalk.method({
  1043. selector: "ifNil:",
  1044. category: 'testing',
  1045. fn: function (aBlock){
  1046. var self=this;
  1047. return smalltalk.withContext(function($ctx1) { var $1;
  1048. $1=self;
  1049. return $1;
  1050. }, function($ctx1) {$ctx1.fill(self,"ifNil:",{aBlock:aBlock}, smalltalk.Object)})},
  1051. args: ["aBlock"],
  1052. source: "ifNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self",
  1053. messageSends: [],
  1054. referencedClasses: []
  1055. }),
  1056. smalltalk.Object);
  1057. smalltalk.addMethod(
  1058. "_ifNil_ifNotNil_",
  1059. smalltalk.method({
  1060. selector: "ifNil:ifNotNil:",
  1061. category: 'testing',
  1062. fn: function (aBlock,anotherBlock){
  1063. var self=this;
  1064. return smalltalk.withContext(function($ctx1) { var $1;
  1065. $1=_st(anotherBlock)._value();
  1066. return $1;
  1067. }, function($ctx1) {$ctx1.fill(self,"ifNil:ifNotNil:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.Object)})},
  1068. args: ["aBlock", "anotherBlock"],
  1069. source: "ifNil: aBlock ifNotNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^anotherBlock value",
  1070. messageSends: ["value"],
  1071. referencedClasses: []
  1072. }),
  1073. smalltalk.Object);
  1074. smalltalk.addMethod(
  1075. "_ifNotNil_",
  1076. smalltalk.method({
  1077. selector: "ifNotNil:",
  1078. category: 'testing',
  1079. fn: function (aBlock){
  1080. var self=this;
  1081. return smalltalk.withContext(function($ctx1) { var $1;
  1082. $1=_st(aBlock)._value();
  1083. return $1;
  1084. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:",{aBlock:aBlock}, smalltalk.Object)})},
  1085. args: ["aBlock"],
  1086. source: "ifNotNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^aBlock value",
  1087. messageSends: ["value"],
  1088. referencedClasses: []
  1089. }),
  1090. smalltalk.Object);
  1091. smalltalk.addMethod(
  1092. "_ifNotNil_ifNil_",
  1093. smalltalk.method({
  1094. selector: "ifNotNil:ifNil:",
  1095. category: 'testing',
  1096. fn: function (aBlock,anotherBlock){
  1097. var self=this;
  1098. return smalltalk.withContext(function($ctx1) { var $1;
  1099. $1=_st(aBlock)._value();
  1100. return $1;
  1101. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:ifNil:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.Object)})},
  1102. args: ["aBlock", "anotherBlock"],
  1103. source: "ifNotNil: aBlock ifNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^aBlock value",
  1104. messageSends: ["value"],
  1105. referencedClasses: []
  1106. }),
  1107. smalltalk.Object);
  1108. smalltalk.addMethod(
  1109. "_initialize",
  1110. smalltalk.method({
  1111. selector: "initialize",
  1112. category: 'initialization',
  1113. fn: function (){
  1114. var self=this;
  1115. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Object)})},
  1116. args: [],
  1117. source: "initialize",
  1118. messageSends: [],
  1119. referencedClasses: []
  1120. }),
  1121. smalltalk.Object);
  1122. smalltalk.addMethod(
  1123. "_instVarAt_",
  1124. smalltalk.method({
  1125. selector: "instVarAt:",
  1126. category: 'accessing',
  1127. fn: function (aSymbol){
  1128. var self=this;
  1129. return smalltalk.withContext(function($ctx1) { return self['@'+aSymbol._asString()];
  1130. return self}, function($ctx1) {$ctx1.fill(self,"instVarAt:",{aSymbol:aSymbol}, smalltalk.Object)})},
  1131. args: ["aSymbol"],
  1132. source: "instVarAt: aSymbol\x0a\x09<return self['@'+aSymbol._asString()]>",
  1133. messageSends: [],
  1134. referencedClasses: []
  1135. }),
  1136. smalltalk.Object);
  1137. smalltalk.addMethod(
  1138. "_instVarAt_put_",
  1139. smalltalk.method({
  1140. selector: "instVarAt:put:",
  1141. category: 'accessing',
  1142. fn: function (aSymbol,anObject){
  1143. var self=this;
  1144. return smalltalk.withContext(function($ctx1) { self['@' + aSymbol._asString()] = anObject;
  1145. return self}, function($ctx1) {$ctx1.fill(self,"instVarAt:put:",{aSymbol:aSymbol,anObject:anObject}, smalltalk.Object)})},
  1146. args: ["aSymbol", "anObject"],
  1147. source: "instVarAt: aSymbol put: anObject\x0a\x09<self['@' + aSymbol._asString()] = anObject>",
  1148. messageSends: [],
  1149. referencedClasses: []
  1150. }),
  1151. smalltalk.Object);
  1152. smalltalk.addMethod(
  1153. "_isBoolean",
  1154. smalltalk.method({
  1155. selector: "isBoolean",
  1156. category: 'testing',
  1157. fn: function (){
  1158. var self=this;
  1159. return smalltalk.withContext(function($ctx1) { return false;
  1160. }, function($ctx1) {$ctx1.fill(self,"isBoolean",{}, smalltalk.Object)})},
  1161. args: [],
  1162. source: "isBoolean\x0a\x09^ false",
  1163. messageSends: [],
  1164. referencedClasses: []
  1165. }),
  1166. smalltalk.Object);
  1167. smalltalk.addMethod(
  1168. "_isClass",
  1169. smalltalk.method({
  1170. selector: "isClass",
  1171. category: 'testing',
  1172. fn: function (){
  1173. var self=this;
  1174. return smalltalk.withContext(function($ctx1) { return false;
  1175. }, function($ctx1) {$ctx1.fill(self,"isClass",{}, smalltalk.Object)})},
  1176. args: [],
  1177. source: "isClass\x0a\x09^false",
  1178. messageSends: [],
  1179. referencedClasses: []
  1180. }),
  1181. smalltalk.Object);
  1182. smalltalk.addMethod(
  1183. "_isKindOf_",
  1184. smalltalk.method({
  1185. selector: "isKindOf:",
  1186. category: 'testing',
  1187. fn: function (aClass){
  1188. var self=this;
  1189. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1190. $2=_st(self)._isMemberOf_(aClass);
  1191. if(smalltalk.assert($2)){
  1192. $1=true;
  1193. } else {
  1194. $1=_st(_st(self)._class())._inheritsFrom_(aClass);
  1195. };
  1196. return $1;
  1197. }, function($ctx1) {$ctx1.fill(self,"isKindOf:",{aClass:aClass}, smalltalk.Object)})},
  1198. args: ["aClass"],
  1199. source: "isKindOf: aClass\x0a\x09^(self isMemberOf: aClass)\x0a\x09 ifTrue: [true]\x0a\x09 ifFalse: [self class inheritsFrom: aClass]",
  1200. messageSends: ["ifTrue:ifFalse:", "inheritsFrom:", "class", "isMemberOf:"],
  1201. referencedClasses: []
  1202. }),
  1203. smalltalk.Object);
  1204. smalltalk.addMethod(
  1205. "_isMemberOf_",
  1206. smalltalk.method({
  1207. selector: "isMemberOf:",
  1208. category: 'testing',
  1209. fn: function (aClass){
  1210. var self=this;
  1211. return smalltalk.withContext(function($ctx1) { var $1;
  1212. $1=_st(_st(self)._class()).__eq(aClass);
  1213. return $1;
  1214. }, function($ctx1) {$ctx1.fill(self,"isMemberOf:",{aClass:aClass}, smalltalk.Object)})},
  1215. args: ["aClass"],
  1216. source: "isMemberOf: aClass\x0a\x09^self class = aClass",
  1217. messageSends: ["=", "class"],
  1218. referencedClasses: []
  1219. }),
  1220. smalltalk.Object);
  1221. smalltalk.addMethod(
  1222. "_isMetaclass",
  1223. smalltalk.method({
  1224. selector: "isMetaclass",
  1225. category: 'testing',
  1226. fn: function (){
  1227. var self=this;
  1228. return smalltalk.withContext(function($ctx1) { return false;
  1229. }, function($ctx1) {$ctx1.fill(self,"isMetaclass",{}, smalltalk.Object)})},
  1230. args: [],
  1231. source: "isMetaclass\x0a\x09^false",
  1232. messageSends: [],
  1233. referencedClasses: []
  1234. }),
  1235. smalltalk.Object);
  1236. smalltalk.addMethod(
  1237. "_isNil",
  1238. smalltalk.method({
  1239. selector: "isNil",
  1240. category: 'testing',
  1241. fn: function (){
  1242. var self=this;
  1243. return smalltalk.withContext(function($ctx1) { return false;
  1244. }, function($ctx1) {$ctx1.fill(self,"isNil",{}, smalltalk.Object)})},
  1245. args: [],
  1246. source: "isNil\x0a\x09^false",
  1247. messageSends: [],
  1248. referencedClasses: []
  1249. }),
  1250. smalltalk.Object);
  1251. smalltalk.addMethod(
  1252. "_isNumber",
  1253. smalltalk.method({
  1254. selector: "isNumber",
  1255. category: 'testing',
  1256. fn: function (){
  1257. var self=this;
  1258. return smalltalk.withContext(function($ctx1) { return false;
  1259. }, function($ctx1) {$ctx1.fill(self,"isNumber",{}, smalltalk.Object)})},
  1260. args: [],
  1261. source: "isNumber\x0a\x09^false",
  1262. messageSends: [],
  1263. referencedClasses: []
  1264. }),
  1265. smalltalk.Object);
  1266. smalltalk.addMethod(
  1267. "_isParseFailure",
  1268. smalltalk.method({
  1269. selector: "isParseFailure",
  1270. category: 'testing',
  1271. fn: function (){
  1272. var self=this;
  1273. return smalltalk.withContext(function($ctx1) { return false;
  1274. }, function($ctx1) {$ctx1.fill(self,"isParseFailure",{}, smalltalk.Object)})},
  1275. args: [],
  1276. source: "isParseFailure\x0a\x09^false",
  1277. messageSends: [],
  1278. referencedClasses: []
  1279. }),
  1280. smalltalk.Object);
  1281. smalltalk.addMethod(
  1282. "_isString",
  1283. smalltalk.method({
  1284. selector: "isString",
  1285. category: 'testing',
  1286. fn: function (){
  1287. var self=this;
  1288. return smalltalk.withContext(function($ctx1) { return false;
  1289. }, function($ctx1) {$ctx1.fill(self,"isString",{}, smalltalk.Object)})},
  1290. args: [],
  1291. source: "isString\x0a\x09^false",
  1292. messageSends: [],
  1293. referencedClasses: []
  1294. }),
  1295. smalltalk.Object);
  1296. smalltalk.addMethod(
  1297. "_isSymbol",
  1298. smalltalk.method({
  1299. selector: "isSymbol",
  1300. category: 'testing',
  1301. fn: function (){
  1302. var self=this;
  1303. return smalltalk.withContext(function($ctx1) { return false;
  1304. }, function($ctx1) {$ctx1.fill(self,"isSymbol",{}, smalltalk.Object)})},
  1305. args: [],
  1306. source: "isSymbol\x0a\x09^false",
  1307. messageSends: [],
  1308. referencedClasses: []
  1309. }),
  1310. smalltalk.Object);
  1311. smalltalk.addMethod(
  1312. "_log_block_",
  1313. smalltalk.method({
  1314. selector: "log:block:",
  1315. category: 'printing',
  1316. fn: function (aString,aBlock){
  1317. var self=this;
  1318. var result;
  1319. return smalltalk.withContext(function($ctx1) { var $1;
  1320. _st(console)._log_(_st(_st(aString).__comma(" time: ")).__comma(_st(_st((smalltalk.Date || Date))._millisecondsToRun_((function(){
  1321. return smalltalk.withContext(function($ctx2) { result=_st(aBlock)._value();
  1322. return result;
  1323. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._printString()));
  1324. $1=result;
  1325. return $1;
  1326. }, function($ctx1) {$ctx1.fill(self,"log:block:",{aString:aString,aBlock:aBlock,result:result}, smalltalk.Object)})},
  1327. args: ["aString", "aBlock"],
  1328. source: "log: aString block: aBlock\x0a\x0a\x09| result |\x0a\x09console log: aString, ' time: ', (Date millisecondsToRun: [result := aBlock value]) printString.\x0a\x09^result",
  1329. messageSends: ["log:", ",", "printString", "millisecondsToRun:", "value"],
  1330. referencedClasses: ["Date"]
  1331. }),
  1332. smalltalk.Object);
  1333. smalltalk.addMethod(
  1334. "_notNil",
  1335. smalltalk.method({
  1336. selector: "notNil",
  1337. category: 'testing',
  1338. fn: function (){
  1339. var self=this;
  1340. return smalltalk.withContext(function($ctx1) { var $1;
  1341. $1=_st(_st(self)._isNil())._not();
  1342. return $1;
  1343. }, function($ctx1) {$ctx1.fill(self,"notNil",{}, smalltalk.Object)})},
  1344. args: [],
  1345. source: "notNil\x0a\x09^self isNil not",
  1346. messageSends: ["not", "isNil"],
  1347. referencedClasses: []
  1348. }),
  1349. smalltalk.Object);
  1350. smalltalk.addMethod(
  1351. "_perform_",
  1352. smalltalk.method({
  1353. selector: "perform:",
  1354. category: 'message handling',
  1355. fn: function (aSymbol){
  1356. var self=this;
  1357. return smalltalk.withContext(function($ctx1) { var $1;
  1358. $1=_st(self)._perform_withArguments_(aSymbol,[]);
  1359. return $1;
  1360. }, function($ctx1) {$ctx1.fill(self,"perform:",{aSymbol:aSymbol}, smalltalk.Object)})},
  1361. args: ["aSymbol"],
  1362. source: "perform: aSymbol\x0a\x09^self perform: aSymbol withArguments: #()",
  1363. messageSends: ["perform:withArguments:"],
  1364. referencedClasses: []
  1365. }),
  1366. smalltalk.Object);
  1367. smalltalk.addMethod(
  1368. "_perform_withArguments_",
  1369. smalltalk.method({
  1370. selector: "perform:withArguments:",
  1371. category: 'message handling',
  1372. fn: function (aSymbol,aCollection){
  1373. var self=this;
  1374. return smalltalk.withContext(function($ctx1) { return smalltalk.send(self, aSymbol._asSelector(), aCollection);
  1375. return self}, function($ctx1) {$ctx1.fill(self,"perform:withArguments:",{aSymbol:aSymbol,aCollection:aCollection}, smalltalk.Object)})},
  1376. args: ["aSymbol", "aCollection"],
  1377. source: "perform: aSymbol withArguments: aCollection\x0a\x09<return smalltalk.send(self, aSymbol._asSelector(), aCollection)>",
  1378. messageSends: [],
  1379. referencedClasses: []
  1380. }),
  1381. smalltalk.Object);
  1382. smalltalk.addMethod(
  1383. "_postCopy",
  1384. smalltalk.method({
  1385. selector: "postCopy",
  1386. category: 'copying',
  1387. fn: function (){
  1388. var self=this;
  1389. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"postCopy",{}, smalltalk.Object)})},
  1390. args: [],
  1391. source: "postCopy",
  1392. messageSends: [],
  1393. referencedClasses: []
  1394. }),
  1395. smalltalk.Object);
  1396. smalltalk.addMethod(
  1397. "_printNl",
  1398. smalltalk.method({
  1399. selector: "printNl",
  1400. category: 'printing',
  1401. fn: function (){
  1402. var self=this;
  1403. return smalltalk.withContext(function($ctx1) { console.log(self);
  1404. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{}, smalltalk.Object)})},
  1405. args: [],
  1406. source: "printNl\x0a\x09<console.log(self)>",
  1407. messageSends: [],
  1408. referencedClasses: []
  1409. }),
  1410. smalltalk.Object);
  1411. smalltalk.addMethod(
  1412. "_printString",
  1413. smalltalk.method({
  1414. selector: "printString",
  1415. category: 'printing',
  1416. fn: function (){
  1417. var self=this;
  1418. return smalltalk.withContext(function($ctx1) { var $1;
  1419. $1=_st("a ").__comma(_st(_st(self)._class())._name());
  1420. return $1;
  1421. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Object)})},
  1422. args: [],
  1423. source: "printString\x0a\x09^'a ', self class name",
  1424. messageSends: [",", "name", "class"],
  1425. referencedClasses: []
  1426. }),
  1427. smalltalk.Object);
  1428. smalltalk.addMethod(
  1429. "_respondsTo_",
  1430. smalltalk.method({
  1431. selector: "respondsTo:",
  1432. category: 'testing',
  1433. fn: function (aSelector){
  1434. var self=this;
  1435. return smalltalk.withContext(function($ctx1) { var $1;
  1436. $1=_st(_st(self)._class())._canUnderstand_(aSelector);
  1437. return $1;
  1438. }, function($ctx1) {$ctx1.fill(self,"respondsTo:",{aSelector:aSelector}, smalltalk.Object)})},
  1439. args: ["aSelector"],
  1440. source: "respondsTo: aSelector\x0a\x09^self class canUnderstand: aSelector",
  1441. messageSends: ["canUnderstand:", "class"],
  1442. referencedClasses: []
  1443. }),
  1444. smalltalk.Object);
  1445. smalltalk.addMethod(
  1446. "_shallowCopy",
  1447. smalltalk.method({
  1448. selector: "shallowCopy",
  1449. category: 'copying',
  1450. fn: function (){
  1451. var self=this;
  1452. return smalltalk.withContext(function($ctx1) {
  1453. var copy = self.klass._new();
  1454. for(var i in self) {
  1455. if(/^@.+/.test(i)) {
  1456. copy[i] = self[i];
  1457. }
  1458. }
  1459. return copy;
  1460. ;
  1461. return self}, function($ctx1) {$ctx1.fill(self,"shallowCopy",{}, smalltalk.Object)})},
  1462. args: [],
  1463. source: "shallowCopy\x0a\x09<\x0a\x09 var copy = self.klass._new();\x0a\x09 for(var i in self) {\x0a\x09\x09if(/^@.+/.test(i)) {\x0a\x09\x09 copy[i] = self[i];\x0a\x09\x09}\x0a\x09 }\x0a\x09 return copy;\x0a\x09>",
  1464. messageSends: [],
  1465. referencedClasses: []
  1466. }),
  1467. smalltalk.Object);
  1468. smalltalk.addMethod(
  1469. "_shouldNotImplement",
  1470. smalltalk.method({
  1471. selector: "shouldNotImplement",
  1472. category: 'error handling',
  1473. fn: function (){
  1474. var self=this;
  1475. return smalltalk.withContext(function($ctx1) { _st(self)._error_(_st("This method should not be implemented in ").__comma(_st(_st(self)._class())._name()));
  1476. return self}, function($ctx1) {$ctx1.fill(self,"shouldNotImplement",{}, smalltalk.Object)})},
  1477. args: [],
  1478. source: "shouldNotImplement\x0a\x09self error: 'This method should not be implemented in ', self class name",
  1479. messageSends: ["error:", ",", "name", "class"],
  1480. referencedClasses: []
  1481. }),
  1482. smalltalk.Object);
  1483. smalltalk.addMethod(
  1484. "_size",
  1485. smalltalk.method({
  1486. selector: "size",
  1487. category: 'accessing',
  1488. fn: function (){
  1489. var self=this;
  1490. return smalltalk.withContext(function($ctx1) { _st(self)._error_("Object not indexable");
  1491. return self}, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Object)})},
  1492. args: [],
  1493. source: "size\x0a\x09self error: 'Object not indexable'",
  1494. messageSends: ["error:"],
  1495. referencedClasses: []
  1496. }),
  1497. smalltalk.Object);
  1498. smalltalk.addMethod(
  1499. "_storeOn_",
  1500. smalltalk.method({
  1501. selector: "storeOn:",
  1502. category: 'printing',
  1503. fn: function (aStream){
  1504. var self=this;
  1505. return smalltalk.withContext(function($ctx1) { _st(aStream)._nextPutAll_(_st(self)._printString());
  1506. return self}, function($ctx1) {$ctx1.fill(self,"storeOn:",{aStream:aStream}, smalltalk.Object)})},
  1507. args: ["aStream"],
  1508. source: "storeOn: aStream\x0a\x09aStream nextPutAll: self printString",
  1509. messageSends: ["nextPutAll:", "printString"],
  1510. referencedClasses: []
  1511. }),
  1512. smalltalk.Object);
  1513. smalltalk.addMethod(
  1514. "_storeString",
  1515. smalltalk.method({
  1516. selector: "storeString",
  1517. category: 'printing',
  1518. fn: function (){
  1519. var self=this;
  1520. return smalltalk.withContext(function($ctx1) { var $1;
  1521. $1=_st((smalltalk.String || String))._streamContents_((function(s){
  1522. return smalltalk.withContext(function($ctx2) { return _st(self)._storeOn_(s);
  1523. }, function($ctx2) {$ctx2.fillBlock({s:s},$ctx1)})}));
  1524. return $1;
  1525. }, function($ctx1) {$ctx1.fill(self,"storeString",{}, smalltalk.Object)})},
  1526. args: [],
  1527. source: "storeString\x0a\x09\x22Answer a String representation of the receiver from which the receiver \x0a\x09can be reconstructed.\x22\x0a\x0a\x09^ String streamContents: [:s | self storeOn: s]",
  1528. messageSends: ["streamContents:", "storeOn:"],
  1529. referencedClasses: ["String"]
  1530. }),
  1531. smalltalk.Object);
  1532. smalltalk.addMethod(
  1533. "_subclassResponsibility",
  1534. smalltalk.method({
  1535. selector: "subclassResponsibility",
  1536. category: 'error handling',
  1537. fn: function (){
  1538. var self=this;
  1539. return smalltalk.withContext(function($ctx1) { _st(self)._error_("This method is a responsibility of a subclass");
  1540. return self}, function($ctx1) {$ctx1.fill(self,"subclassResponsibility",{}, smalltalk.Object)})},
  1541. args: [],
  1542. source: "subclassResponsibility\x0a\x09self error: 'This method is a responsibility of a subclass'",
  1543. messageSends: ["error:"],
  1544. referencedClasses: []
  1545. }),
  1546. smalltalk.Object);
  1547. smalltalk.addMethod(
  1548. "_test",
  1549. smalltalk.method({
  1550. selector: "test",
  1551. category: 'converting',
  1552. fn: function (){
  1553. var self=this;
  1554. var a;
  1555. return smalltalk.withContext(function($ctx1) { a=(1);
  1556. _st(self)._halt();
  1557. return self}, function($ctx1) {$ctx1.fill(self,"test",{a:a}, smalltalk.Object)})},
  1558. args: [],
  1559. source: "test\x0a\x09| a |\x0a a := 1.\x0a self halt",
  1560. messageSends: ["halt"],
  1561. referencedClasses: []
  1562. }),
  1563. smalltalk.Object);
  1564. smalltalk.addMethod(
  1565. "_throw_",
  1566. smalltalk.method({
  1567. selector: "throw:",
  1568. category: 'error handling',
  1569. fn: function (anObject){
  1570. var self=this;
  1571. return smalltalk.withContext(function($ctx1) { throw anObject ;
  1572. return self}, function($ctx1) {$ctx1.fill(self,"throw:",{anObject:anObject}, smalltalk.Object)})},
  1573. args: ["anObject"],
  1574. source: "throw: anObject\x0a\x09< throw anObject >",
  1575. messageSends: [],
  1576. referencedClasses: []
  1577. }),
  1578. smalltalk.Object);
  1579. smalltalk.addMethod(
  1580. "_try_catch_",
  1581. smalltalk.method({
  1582. selector: "try:catch:",
  1583. category: 'error handling',
  1584. fn: function (aBlock,anotherBlock){
  1585. var self=this;
  1586. return smalltalk.withContext(function($ctx1) { try{return aBlock()} catch(e) {return anotherBlock(e)};
  1587. return self}, function($ctx1) {$ctx1.fill(self,"try:catch:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.Object)})},
  1588. args: ["aBlock", "anotherBlock"],
  1589. source: "try: aBlock catch: anotherBlock\x0a\x09<try{return aBlock()} catch(e) {return anotherBlock(e)}>",
  1590. messageSends: [],
  1591. referencedClasses: []
  1592. }),
  1593. smalltalk.Object);
  1594. smalltalk.addMethod(
  1595. "_value",
  1596. smalltalk.method({
  1597. selector: "value",
  1598. category: 'accessing',
  1599. fn: function (){
  1600. var self=this;
  1601. return smalltalk.withContext(function($ctx1) { return self.valueOf();
  1602. return self}, function($ctx1) {$ctx1.fill(self,"value",{}, smalltalk.Object)})},
  1603. args: [],
  1604. source: "value\x0a\x09<return self.valueOf()>",
  1605. messageSends: [],
  1606. referencedClasses: []
  1607. }),
  1608. smalltalk.Object);
  1609. smalltalk.addMethod(
  1610. "_yourself",
  1611. smalltalk.method({
  1612. selector: "yourself",
  1613. category: 'accessing',
  1614. fn: function (){
  1615. var self=this;
  1616. return smalltalk.withContext(function($ctx1) { var $1;
  1617. $1=self;
  1618. return $1;
  1619. }, function($ctx1) {$ctx1.fill(self,"yourself",{}, smalltalk.Object)})},
  1620. args: [],
  1621. source: "yourself\x0a\x09^self",
  1622. messageSends: [],
  1623. referencedClasses: []
  1624. }),
  1625. smalltalk.Object);
  1626. smalltalk.addMethod(
  1627. "__tild_eq",
  1628. smalltalk.method({
  1629. selector: "~=",
  1630. category: 'comparing',
  1631. fn: function (anObject){
  1632. var self=this;
  1633. return smalltalk.withContext(function($ctx1) { var $1;
  1634. $1=_st(_st(self).__eq(anObject)).__eq(false);
  1635. return $1;
  1636. }, function($ctx1) {$ctx1.fill(self,"~=",{anObject:anObject}, smalltalk.Object)})},
  1637. args: ["anObject"],
  1638. source: "~= anObject\x0a\x09^(self = anObject) = false",
  1639. messageSends: ["="],
  1640. referencedClasses: []
  1641. }),
  1642. smalltalk.Object);
  1643. smalltalk.addMethod(
  1644. "__tild_tild",
  1645. smalltalk.method({
  1646. selector: "~~",
  1647. category: 'comparing',
  1648. fn: function (anObject){
  1649. var self=this;
  1650. return smalltalk.withContext(function($ctx1) { var $1;
  1651. $1=_st(_st(self).__eq_eq(anObject)).__eq(false);
  1652. return $1;
  1653. }, function($ctx1) {$ctx1.fill(self,"~~",{anObject:anObject}, smalltalk.Object)})},
  1654. args: ["anObject"],
  1655. source: "~~ anObject\x0a\x09^(self == anObject) = false",
  1656. messageSends: ["=", "=="],
  1657. referencedClasses: []
  1658. }),
  1659. smalltalk.Object);
  1660. smalltalk.addMethod(
  1661. "_initialize",
  1662. smalltalk.method({
  1663. selector: "initialize",
  1664. category: 'initialization',
  1665. fn: function (){
  1666. var self=this;
  1667. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Object.klass)})},
  1668. args: [],
  1669. source: "initialize\x0a\x09\x22no op\x22",
  1670. messageSends: [],
  1671. referencedClasses: []
  1672. }),
  1673. smalltalk.Object.klass);
  1674. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  1675. smalltalk.Boolean.comment="Boolean wraps the JavaScript `Boolean()` constructor. The `true` and `false` objects are the JavaScript boolean objects.\x0a\x0aBoolean defines the protocol for logic testing operations and conditional control structures for the logical values.\x0aBoolean instances are weither `true` or `false`."
  1676. smalltalk.addMethod(
  1677. "__and",
  1678. smalltalk.method({
  1679. selector: "&",
  1680. category: 'controlling',
  1681. fn: function (aBoolean){
  1682. var self=this;
  1683. return smalltalk.withContext(function($ctx1) {
  1684. if(self == true) {
  1685. return aBoolean;
  1686. } else {
  1687. return false;
  1688. }
  1689. ;
  1690. return self}, function($ctx1) {$ctx1.fill(self,"&",{aBoolean:aBoolean}, smalltalk.Boolean)})},
  1691. args: ["aBoolean"],
  1692. source: "& aBoolean\x0a\x09<\x0a\x09 if(self == true) {\x0a\x09\x09return aBoolean;\x0a\x09 } else {\x0a\x09\x09return false;\x0a\x09 }\x0a\x09>",
  1693. messageSends: [],
  1694. referencedClasses: []
  1695. }),
  1696. smalltalk.Boolean);
  1697. smalltalk.addMethod(
  1698. "__eq",
  1699. smalltalk.method({
  1700. selector: "=",
  1701. category: 'comparing',
  1702. fn: function (aBoolean){
  1703. var self=this;
  1704. return smalltalk.withContext(function($ctx1) {
  1705. if(! aBoolean._isBoolean || ! aBoolean._isBoolean()) {
  1706. return false;
  1707. }
  1708. return Boolean(self == true) == aBoolean
  1709. ;
  1710. return self}, function($ctx1) {$ctx1.fill(self,"=",{aBoolean:aBoolean}, smalltalk.Boolean)})},
  1711. args: ["aBoolean"],
  1712. source: "= aBoolean\x0a\x09<\x0a \x09if(! aBoolean._isBoolean || ! aBoolean._isBoolean()) {\x0a \x09return false;\x0a }\x0a \x09return Boolean(self == true) == aBoolean\x0a >",
  1713. messageSends: [],
  1714. referencedClasses: []
  1715. }),
  1716. smalltalk.Boolean);
  1717. smalltalk.addMethod(
  1718. "__eq_eq",
  1719. smalltalk.method({
  1720. selector: "==",
  1721. category: 'comparing',
  1722. fn: function (aBoolean){
  1723. var self=this;
  1724. return smalltalk.withContext(function($ctx1) { var $1;
  1725. $1=_st(self).__eq(aBoolean);
  1726. return $1;
  1727. }, function($ctx1) {$ctx1.fill(self,"==",{aBoolean:aBoolean}, smalltalk.Boolean)})},
  1728. args: ["aBoolean"],
  1729. source: "== aBoolean\x0a\x09^self = aBoolean",
  1730. messageSends: ["="],
  1731. referencedClasses: []
  1732. }),
  1733. smalltalk.Boolean);
  1734. smalltalk.addMethod(
  1735. "_and_",
  1736. smalltalk.method({
  1737. selector: "and:",
  1738. category: 'controlling',
  1739. fn: function (aBlock){
  1740. var self=this;
  1741. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1742. $2=_st(self).__eq(true);
  1743. $1=_st($2)._ifTrue_ifFalse_(aBlock,(function(){
  1744. return smalltalk.withContext(function($ctx2) { return false;
  1745. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1746. return $1;
  1747. }, function($ctx1) {$ctx1.fill(self,"and:",{aBlock:aBlock}, smalltalk.Boolean)})},
  1748. args: ["aBlock"],
  1749. source: "and: aBlock\x0a\x09^self = true\x0a\x09 ifTrue: aBlock\x0a\x09 ifFalse: [false]",
  1750. messageSends: ["ifTrue:ifFalse:", "="],
  1751. referencedClasses: []
  1752. }),
  1753. smalltalk.Boolean);
  1754. smalltalk.addMethod(
  1755. "_asJSON",
  1756. smalltalk.method({
  1757. selector: "asJSON",
  1758. category: 'converting',
  1759. fn: function (){
  1760. var self=this;
  1761. return smalltalk.withContext(function($ctx1) { var $1;
  1762. $1=self;
  1763. return $1;
  1764. }, function($ctx1) {$ctx1.fill(self,"asJSON",{}, smalltalk.Boolean)})},
  1765. args: [],
  1766. source: "asJSON\x0a\x09^self",
  1767. messageSends: [],
  1768. referencedClasses: []
  1769. }),
  1770. smalltalk.Boolean);
  1771. smalltalk.addMethod(
  1772. "_deepCopy",
  1773. smalltalk.method({
  1774. selector: "deepCopy",
  1775. category: 'copying',
  1776. fn: function (){
  1777. var self=this;
  1778. return smalltalk.withContext(function($ctx1) { var $1;
  1779. $1=self;
  1780. return $1;
  1781. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{}, smalltalk.Boolean)})},
  1782. args: [],
  1783. source: "deepCopy\x0a\x09^self",
  1784. messageSends: [],
  1785. referencedClasses: []
  1786. }),
  1787. smalltalk.Boolean);
  1788. smalltalk.addMethod(
  1789. "_ifFalse_",
  1790. smalltalk.method({
  1791. selector: "ifFalse:",
  1792. category: 'controlling',
  1793. fn: function (aBlock){
  1794. var self=this;
  1795. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1796. $2=self;
  1797. $1=_st($2)._ifTrue_ifFalse_((function(){
  1798. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),aBlock);
  1799. return $1;
  1800. }, function($ctx1) {$ctx1.fill(self,"ifFalse:",{aBlock:aBlock}, smalltalk.Boolean)})},
  1801. args: ["aBlock"],
  1802. source: "ifFalse: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifTrue: [] ifFalse: aBlock",
  1803. messageSends: ["ifTrue:ifFalse:"],
  1804. referencedClasses: []
  1805. }),
  1806. smalltalk.Boolean);
  1807. smalltalk.addMethod(
  1808. "_ifFalse_ifTrue_",
  1809. smalltalk.method({
  1810. selector: "ifFalse:ifTrue:",
  1811. category: 'controlling',
  1812. fn: function (aBlock,anotherBlock){
  1813. var self=this;
  1814. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1815. $2=self;
  1816. $1=_st($2)._ifTrue_ifFalse_(anotherBlock,aBlock);
  1817. return $1;
  1818. }, function($ctx1) {$ctx1.fill(self,"ifFalse:ifTrue:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.Boolean)})},
  1819. args: ["aBlock", "anotherBlock"],
  1820. source: "ifFalse: aBlock ifTrue: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifTrue: anotherBlock ifFalse: aBlock",
  1821. messageSends: ["ifTrue:ifFalse:"],
  1822. referencedClasses: []
  1823. }),
  1824. smalltalk.Boolean);
  1825. smalltalk.addMethod(
  1826. "_ifTrue_",
  1827. smalltalk.method({
  1828. selector: "ifTrue:",
  1829. category: 'controlling',
  1830. fn: function (aBlock){
  1831. var self=this;
  1832. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1833. $2=self;
  1834. $1=_st($2)._ifTrue_ifFalse_(aBlock,(function(){
  1835. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1836. return $1;
  1837. }, function($ctx1) {$ctx1.fill(self,"ifTrue:",{aBlock:aBlock}, smalltalk.Boolean)})},
  1838. args: ["aBlock"],
  1839. source: "ifTrue: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifTrue: aBlock ifFalse: []",
  1840. messageSends: ["ifTrue:ifFalse:"],
  1841. referencedClasses: []
  1842. }),
  1843. smalltalk.Boolean);
  1844. smalltalk.addMethod(
  1845. "_ifTrue_ifFalse_",
  1846. smalltalk.method({
  1847. selector: "ifTrue:ifFalse:",
  1848. category: 'controlling',
  1849. fn: function (aBlock,anotherBlock){
  1850. var self=this;
  1851. return smalltalk.withContext(function($ctx1) {
  1852. if(self == true) {
  1853. return aBlock();
  1854. } else {
  1855. return anotherBlock();
  1856. }
  1857. ;
  1858. return self}, function($ctx1) {$ctx1.fill(self,"ifTrue:ifFalse:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.Boolean)})},
  1859. args: ["aBlock", "anotherBlock"],
  1860. source: "ifTrue: aBlock ifFalse: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<\x0a\x09 if(self == true) {\x0a\x09\x09return aBlock();\x0a\x09 } else {\x0a\x09\x09return anotherBlock();\x0a\x09 }\x0a\x09>",
  1861. messageSends: [],
  1862. referencedClasses: []
  1863. }),
  1864. smalltalk.Boolean);
  1865. smalltalk.addMethod(
  1866. "_isBoolean",
  1867. smalltalk.method({
  1868. selector: "isBoolean",
  1869. category: 'testing',
  1870. fn: function (){
  1871. var self=this;
  1872. return smalltalk.withContext(function($ctx1) { return true;
  1873. }, function($ctx1) {$ctx1.fill(self,"isBoolean",{}, smalltalk.Boolean)})},
  1874. args: [],
  1875. source: "isBoolean\x0a\x09^ true",
  1876. messageSends: [],
  1877. referencedClasses: []
  1878. }),
  1879. smalltalk.Boolean);
  1880. smalltalk.addMethod(
  1881. "_not",
  1882. smalltalk.method({
  1883. selector: "not",
  1884. category: 'controlling',
  1885. fn: function (){
  1886. var self=this;
  1887. return smalltalk.withContext(function($ctx1) { var $1;
  1888. $1=_st(self).__eq(false);
  1889. return $1;
  1890. }, function($ctx1) {$ctx1.fill(self,"not",{}, smalltalk.Boolean)})},
  1891. args: [],
  1892. source: "not\x0a\x09^self = false",
  1893. messageSends: ["="],
  1894. referencedClasses: []
  1895. }),
  1896. smalltalk.Boolean);
  1897. smalltalk.addMethod(
  1898. "_or_",
  1899. smalltalk.method({
  1900. selector: "or:",
  1901. category: 'controlling',
  1902. fn: function (aBlock){
  1903. var self=this;
  1904. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1905. $2=_st(self).__eq(true);
  1906. $1=_st($2)._ifTrue_ifFalse_((function(){
  1907. return smalltalk.withContext(function($ctx2) { return true;
  1908. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),aBlock);
  1909. return $1;
  1910. }, function($ctx1) {$ctx1.fill(self,"or:",{aBlock:aBlock}, smalltalk.Boolean)})},
  1911. args: ["aBlock"],
  1912. source: "or: aBlock\x0a\x09^self = true\x0a\x09 ifTrue: [true]\x0a\x09 ifFalse: aBlock",
  1913. messageSends: ["ifTrue:ifFalse:", "="],
  1914. referencedClasses: []
  1915. }),
  1916. smalltalk.Boolean);
  1917. smalltalk.addMethod(
  1918. "_printString",
  1919. smalltalk.method({
  1920. selector: "printString",
  1921. category: 'printing',
  1922. fn: function (){
  1923. var self=this;
  1924. return smalltalk.withContext(function($ctx1) { return self.toString();
  1925. return self}, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Boolean)})},
  1926. args: [],
  1927. source: "printString\x0a\x09<return self.toString()>",
  1928. messageSends: [],
  1929. referencedClasses: []
  1930. }),
  1931. smalltalk.Boolean);
  1932. smalltalk.addMethod(
  1933. "_shallowCopy",
  1934. smalltalk.method({
  1935. selector: "shallowCopy",
  1936. category: 'copying',
  1937. fn: function (){
  1938. var self=this;
  1939. return smalltalk.withContext(function($ctx1) { var $1;
  1940. $1=self;
  1941. return $1;
  1942. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{}, smalltalk.Boolean)})},
  1943. args: [],
  1944. source: "shallowCopy\x0a\x09^self",
  1945. messageSends: [],
  1946. referencedClasses: []
  1947. }),
  1948. smalltalk.Boolean);
  1949. smalltalk.addMethod(
  1950. "__or",
  1951. smalltalk.method({
  1952. selector: "|",
  1953. category: 'controlling',
  1954. fn: function (aBoolean){
  1955. var self=this;
  1956. return smalltalk.withContext(function($ctx1) {
  1957. if(self == true) {
  1958. return true;
  1959. } else {
  1960. return aBoolean;
  1961. }
  1962. ;
  1963. return self}, function($ctx1) {$ctx1.fill(self,"|",{aBoolean:aBoolean}, smalltalk.Boolean)})},
  1964. args: ["aBoolean"],
  1965. source: "| aBoolean\x0a\x09<\x0a\x09 if(self == true) {\x0a\x09\x09return true;\x0a\x09 } else {\x0a\x09\x09return aBoolean;\x0a\x09 }\x0a\x09>",
  1966. messageSends: [],
  1967. referencedClasses: []
  1968. }),
  1969. smalltalk.Boolean);
  1970. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  1971. smalltalk.Date.comment="The Date class is used to work with dates and times. Therefore `Date today` and `Date now` are both valid in\x0aAmber and answer the same date object.\x0a\x0aDate wraps the `Date()` JavaScript constructor, and Smalltalk date objects are JavaScript date objects."
  1972. smalltalk.addMethod(
  1973. "__plus",
  1974. smalltalk.method({
  1975. selector: "+",
  1976. category: 'arithmetic',
  1977. fn: function (aDate){
  1978. var self=this;
  1979. return smalltalk.withContext(function($ctx1) { return self + aDate;
  1980. return self}, function($ctx1) {$ctx1.fill(self,"+",{aDate:aDate}, smalltalk.Date)})},
  1981. args: ["aDate"],
  1982. source: "+ aDate\x0a\x09<return self + aDate>",
  1983. messageSends: [],
  1984. referencedClasses: []
  1985. }),
  1986. smalltalk.Date);
  1987. smalltalk.addMethod(
  1988. "__minus",
  1989. smalltalk.method({
  1990. selector: "-",
  1991. category: 'arithmetic',
  1992. fn: function (aDate){
  1993. var self=this;
  1994. return smalltalk.withContext(function($ctx1) { return self - aDate;
  1995. return self}, function($ctx1) {$ctx1.fill(self,"-",{aDate:aDate}, smalltalk.Date)})},
  1996. args: ["aDate"],
  1997. source: "- aDate\x0a\x09<return self - aDate>",
  1998. messageSends: [],
  1999. referencedClasses: []
  2000. }),
  2001. smalltalk.Date);
  2002. smalltalk.addMethod(
  2003. "__lt",
  2004. smalltalk.method({
  2005. selector: "<",
  2006. category: 'comparing',
  2007. fn: function (aDate){
  2008. var self=this;
  2009. return smalltalk.withContext(function($ctx1) { return self < aDate;
  2010. return self}, function($ctx1) {$ctx1.fill(self,"<",{aDate:aDate}, smalltalk.Date)})},
  2011. args: ["aDate"],
  2012. source: "< aDate\x0a\x09<return self < aDate>",
  2013. messageSends: [],
  2014. referencedClasses: []
  2015. }),
  2016. smalltalk.Date);
  2017. smalltalk.addMethod(
  2018. "__lt_eq",
  2019. smalltalk.method({
  2020. selector: "<=",
  2021. category: 'comparing',
  2022. fn: function (aDate){
  2023. var self=this;
  2024. return smalltalk.withContext(function($ctx1) { return self <= aDate;
  2025. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aDate:aDate}, smalltalk.Date)})},
  2026. args: ["aDate"],
  2027. source: "<= aDate\x0a\x09<return self <= aDate>",
  2028. messageSends: [],
  2029. referencedClasses: []
  2030. }),
  2031. smalltalk.Date);
  2032. smalltalk.addMethod(
  2033. "__gt",
  2034. smalltalk.method({
  2035. selector: ">",
  2036. category: 'comparing',
  2037. fn: function (aDate){
  2038. var self=this;
  2039. return smalltalk.withContext(function($ctx1) { return self > aDate;
  2040. return self}, function($ctx1) {$ctx1.fill(self,">",{aDate:aDate}, smalltalk.Date)})},
  2041. args: ["aDate"],
  2042. source: "> aDate\x0a\x09<return self >> aDate>",
  2043. messageSends: [],
  2044. referencedClasses: []
  2045. }),
  2046. smalltalk.Date);
  2047. smalltalk.addMethod(
  2048. "__gt_eq",
  2049. smalltalk.method({
  2050. selector: ">=",
  2051. category: 'comparing',
  2052. fn: function (aDate){
  2053. var self=this;
  2054. return smalltalk.withContext(function($ctx1) { return self >= aDate;
  2055. return self}, function($ctx1) {$ctx1.fill(self,">=",{aDate:aDate}, smalltalk.Date)})},
  2056. args: ["aDate"],
  2057. source: ">= aDate\x0a\x09<return self >>= aDate>",
  2058. messageSends: [],
  2059. referencedClasses: []
  2060. }),
  2061. smalltalk.Date);
  2062. smalltalk.addMethod(
  2063. "_asDateString",
  2064. smalltalk.method({
  2065. selector: "asDateString",
  2066. category: 'converting',
  2067. fn: function (){
  2068. var self=this;
  2069. return smalltalk.withContext(function($ctx1) { return self.toDateString();
  2070. return self}, function($ctx1) {$ctx1.fill(self,"asDateString",{}, smalltalk.Date)})},
  2071. args: [],
  2072. source: "asDateString\x0a\x09<return self.toDateString()>",
  2073. messageSends: [],
  2074. referencedClasses: []
  2075. }),
  2076. smalltalk.Date);
  2077. smalltalk.addMethod(
  2078. "_asLocaleString",
  2079. smalltalk.method({
  2080. selector: "asLocaleString",
  2081. category: 'converting',
  2082. fn: function (){
  2083. var self=this;
  2084. return smalltalk.withContext(function($ctx1) { return self.toLocaleString();
  2085. return self}, function($ctx1) {$ctx1.fill(self,"asLocaleString",{}, smalltalk.Date)})},
  2086. args: [],
  2087. source: "asLocaleString\x0a\x09<return self.toLocaleString()>",
  2088. messageSends: [],
  2089. referencedClasses: []
  2090. }),
  2091. smalltalk.Date);
  2092. smalltalk.addMethod(
  2093. "_asMilliseconds",
  2094. smalltalk.method({
  2095. selector: "asMilliseconds",
  2096. category: 'converting',
  2097. fn: function (){
  2098. var self=this;
  2099. return smalltalk.withContext(function($ctx1) { var $1;
  2100. $1=_st(self)._time();
  2101. return $1;
  2102. }, function($ctx1) {$ctx1.fill(self,"asMilliseconds",{}, smalltalk.Date)})},
  2103. args: [],
  2104. source: "asMilliseconds\x0a\x09^self time",
  2105. messageSends: ["time"],
  2106. referencedClasses: []
  2107. }),
  2108. smalltalk.Date);
  2109. smalltalk.addMethod(
  2110. "_asNumber",
  2111. smalltalk.method({
  2112. selector: "asNumber",
  2113. category: 'converting',
  2114. fn: function (){
  2115. var self=this;
  2116. return smalltalk.withContext(function($ctx1) { var $1;
  2117. $1=_st(self)._asMilliseconds();
  2118. return $1;
  2119. }, function($ctx1) {$ctx1.fill(self,"asNumber",{}, smalltalk.Date)})},
  2120. args: [],
  2121. source: "asNumber\x0a\x09^self asMilliseconds",
  2122. messageSends: ["asMilliseconds"],
  2123. referencedClasses: []
  2124. }),
  2125. smalltalk.Date);
  2126. smalltalk.addMethod(
  2127. "_asString",
  2128. smalltalk.method({
  2129. selector: "asString",
  2130. category: 'converting',
  2131. fn: function (){
  2132. var self=this;
  2133. return smalltalk.withContext(function($ctx1) { return self.toString();
  2134. return self}, function($ctx1) {$ctx1.fill(self,"asString",{}, smalltalk.Date)})},
  2135. args: [],
  2136. source: "asString\x0a\x09<return self.toString()>",
  2137. messageSends: [],
  2138. referencedClasses: []
  2139. }),
  2140. smalltalk.Date);
  2141. smalltalk.addMethod(
  2142. "_asTimeString",
  2143. smalltalk.method({
  2144. selector: "asTimeString",
  2145. category: 'converting',
  2146. fn: function (){
  2147. var self=this;
  2148. return smalltalk.withContext(function($ctx1) { return self.toTimeString();
  2149. return self}, function($ctx1) {$ctx1.fill(self,"asTimeString",{}, smalltalk.Date)})},
  2150. args: [],
  2151. source: "asTimeString\x0a\x09<return self.toTimeString()>",
  2152. messageSends: [],
  2153. referencedClasses: []
  2154. }),
  2155. smalltalk.Date);
  2156. smalltalk.addMethod(
  2157. "_day",
  2158. smalltalk.method({
  2159. selector: "day",
  2160. category: 'accessing',
  2161. fn: function (){
  2162. var self=this;
  2163. return smalltalk.withContext(function($ctx1) { var $1;
  2164. $1=_st(self)._dayOfWeek();
  2165. return $1;
  2166. }, function($ctx1) {$ctx1.fill(self,"day",{}, smalltalk.Date)})},
  2167. args: [],
  2168. source: "day\x0a\x09^self dayOfWeek",
  2169. messageSends: ["dayOfWeek"],
  2170. referencedClasses: []
  2171. }),
  2172. smalltalk.Date);
  2173. smalltalk.addMethod(
  2174. "_day_",
  2175. smalltalk.method({
  2176. selector: "day:",
  2177. category: 'accessing',
  2178. fn: function (aNumber){
  2179. var self=this;
  2180. return smalltalk.withContext(function($ctx1) { _st(self)._dayOfWeek_(aNumber);
  2181. return self}, function($ctx1) {$ctx1.fill(self,"day:",{aNumber:aNumber}, smalltalk.Date)})},
  2182. args: ["aNumber"],
  2183. source: "day: aNumber\x0a\x09self dayOfWeek: aNumber",
  2184. messageSends: ["dayOfWeek:"],
  2185. referencedClasses: []
  2186. }),
  2187. smalltalk.Date);
  2188. smalltalk.addMethod(
  2189. "_dayOfMonth",
  2190. smalltalk.method({
  2191. selector: "dayOfMonth",
  2192. category: 'accessing',
  2193. fn: function (){
  2194. var self=this;
  2195. return smalltalk.withContext(function($ctx1) { return self.getDate();
  2196. return self}, function($ctx1) {$ctx1.fill(self,"dayOfMonth",{}, smalltalk.Date)})},
  2197. args: [],
  2198. source: "dayOfMonth\x0a\x09<return self.getDate()>",
  2199. messageSends: [],
  2200. referencedClasses: []
  2201. }),
  2202. smalltalk.Date);
  2203. smalltalk.addMethod(
  2204. "_dayOfMonth_",
  2205. smalltalk.method({
  2206. selector: "dayOfMonth:",
  2207. category: 'accessing',
  2208. fn: function (aNumber){
  2209. var self=this;
  2210. return smalltalk.withContext(function($ctx1) { self.setDate(aNumber);
  2211. return self}, function($ctx1) {$ctx1.fill(self,"dayOfMonth:",{aNumber:aNumber}, smalltalk.Date)})},
  2212. args: ["aNumber"],
  2213. source: "dayOfMonth: aNumber\x0a\x09<self.setDate(aNumber)>",
  2214. messageSends: [],
  2215. referencedClasses: []
  2216. }),
  2217. smalltalk.Date);
  2218. smalltalk.addMethod(
  2219. "_dayOfWeek",
  2220. smalltalk.method({
  2221. selector: "dayOfWeek",
  2222. category: 'accessing',
  2223. fn: function (){
  2224. var self=this;
  2225. return smalltalk.withContext(function($ctx1) { return self.getDay() + 1;
  2226. return self}, function($ctx1) {$ctx1.fill(self,"dayOfWeek",{}, smalltalk.Date)})},
  2227. args: [],
  2228. source: "dayOfWeek\x0a\x09<return self.getDay() + 1>",
  2229. messageSends: [],
  2230. referencedClasses: []
  2231. }),
  2232. smalltalk.Date);
  2233. smalltalk.addMethod(
  2234. "_dayOfWeek_",
  2235. smalltalk.method({
  2236. selector: "dayOfWeek:",
  2237. category: 'accessing',
  2238. fn: function (aNumber){
  2239. var self=this;
  2240. return smalltalk.withContext(function($ctx1) { return self.setDay(aNumber - 1);
  2241. return self}, function($ctx1) {$ctx1.fill(self,"dayOfWeek:",{aNumber:aNumber}, smalltalk.Date)})},
  2242. args: ["aNumber"],
  2243. source: "dayOfWeek: aNumber\x0a\x09<return self.setDay(aNumber - 1)>",
  2244. messageSends: [],
  2245. referencedClasses: []
  2246. }),
  2247. smalltalk.Date);
  2248. smalltalk.addMethod(
  2249. "_hours",
  2250. smalltalk.method({
  2251. selector: "hours",
  2252. category: 'accessing',
  2253. fn: function (){
  2254. var self=this;
  2255. return smalltalk.withContext(function($ctx1) { return self.getHours();
  2256. return self}, function($ctx1) {$ctx1.fill(self,"hours",{}, smalltalk.Date)})},
  2257. args: [],
  2258. source: "hours\x0a\x09<return self.getHours()>",
  2259. messageSends: [],
  2260. referencedClasses: []
  2261. }),
  2262. smalltalk.Date);
  2263. smalltalk.addMethod(
  2264. "_hours_",
  2265. smalltalk.method({
  2266. selector: "hours:",
  2267. category: 'accessing',
  2268. fn: function (aNumber){
  2269. var self=this;
  2270. return smalltalk.withContext(function($ctx1) { self.setHours(aNumber);
  2271. return self}, function($ctx1) {$ctx1.fill(self,"hours:",{aNumber:aNumber}, smalltalk.Date)})},
  2272. args: ["aNumber"],
  2273. source: "hours: aNumber\x0a\x09<self.setHours(aNumber)>",
  2274. messageSends: [],
  2275. referencedClasses: []
  2276. }),
  2277. smalltalk.Date);
  2278. smalltalk.addMethod(
  2279. "_milliseconds",
  2280. smalltalk.method({
  2281. selector: "milliseconds",
  2282. category: 'accessing',
  2283. fn: function (){
  2284. var self=this;
  2285. return smalltalk.withContext(function($ctx1) { return self.getMilliseconds();
  2286. return self}, function($ctx1) {$ctx1.fill(self,"milliseconds",{}, smalltalk.Date)})},
  2287. args: [],
  2288. source: "milliseconds\x0a\x09<return self.getMilliseconds()>",
  2289. messageSends: [],
  2290. referencedClasses: []
  2291. }),
  2292. smalltalk.Date);
  2293. smalltalk.addMethod(
  2294. "_milliseconds_",
  2295. smalltalk.method({
  2296. selector: "milliseconds:",
  2297. category: 'accessing',
  2298. fn: function (aNumber){
  2299. var self=this;
  2300. return smalltalk.withContext(function($ctx1) { self.setMilliseconds(aNumber);
  2301. return self}, function($ctx1) {$ctx1.fill(self,"milliseconds:",{aNumber:aNumber}, smalltalk.Date)})},
  2302. args: ["aNumber"],
  2303. source: "milliseconds: aNumber\x0a\x09<self.setMilliseconds(aNumber)>",
  2304. messageSends: [],
  2305. referencedClasses: []
  2306. }),
  2307. smalltalk.Date);
  2308. smalltalk.addMethod(
  2309. "_minutes",
  2310. smalltalk.method({
  2311. selector: "minutes",
  2312. category: 'accessing',
  2313. fn: function (){
  2314. var self=this;
  2315. return smalltalk.withContext(function($ctx1) { return self.getMinutes();
  2316. return self}, function($ctx1) {$ctx1.fill(self,"minutes",{}, smalltalk.Date)})},
  2317. args: [],
  2318. source: "minutes\x0a\x09<return self.getMinutes()>",
  2319. messageSends: [],
  2320. referencedClasses: []
  2321. }),
  2322. smalltalk.Date);
  2323. smalltalk.addMethod(
  2324. "_minutes_",
  2325. smalltalk.method({
  2326. selector: "minutes:",
  2327. category: 'accessing',
  2328. fn: function (aNumber){
  2329. var self=this;
  2330. return smalltalk.withContext(function($ctx1) { self.setMinutes(aNumber);
  2331. return self}, function($ctx1) {$ctx1.fill(self,"minutes:",{aNumber:aNumber}, smalltalk.Date)})},
  2332. args: ["aNumber"],
  2333. source: "minutes: aNumber\x0a\x09<self.setMinutes(aNumber)>",
  2334. messageSends: [],
  2335. referencedClasses: []
  2336. }),
  2337. smalltalk.Date);
  2338. smalltalk.addMethod(
  2339. "_month",
  2340. smalltalk.method({
  2341. selector: "month",
  2342. category: 'accessing',
  2343. fn: function (){
  2344. var self=this;
  2345. return smalltalk.withContext(function($ctx1) { return self.getMonth() + 1;
  2346. return self}, function($ctx1) {$ctx1.fill(self,"month",{}, smalltalk.Date)})},
  2347. args: [],
  2348. source: "month\x0a\x09<return self.getMonth() + 1>",
  2349. messageSends: [],
  2350. referencedClasses: []
  2351. }),
  2352. smalltalk.Date);
  2353. smalltalk.addMethod(
  2354. "_month_",
  2355. smalltalk.method({
  2356. selector: "month:",
  2357. category: 'accessing',
  2358. fn: function (aNumber){
  2359. var self=this;
  2360. return smalltalk.withContext(function($ctx1) { self.setMonth(aNumber - 1);
  2361. return self}, function($ctx1) {$ctx1.fill(self,"month:",{aNumber:aNumber}, smalltalk.Date)})},
  2362. args: ["aNumber"],
  2363. source: "month: aNumber\x0a\x09<self.setMonth(aNumber - 1)>",
  2364. messageSends: [],
  2365. referencedClasses: []
  2366. }),
  2367. smalltalk.Date);
  2368. smalltalk.addMethod(
  2369. "_printString",
  2370. smalltalk.method({
  2371. selector: "printString",
  2372. category: 'printing',
  2373. fn: function (){
  2374. var self=this;
  2375. return smalltalk.withContext(function($ctx1) { var $1;
  2376. $1=_st(self)._asString();
  2377. return $1;
  2378. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Date)})},
  2379. args: [],
  2380. source: "printString\x0a\x09^self asString",
  2381. messageSends: ["asString"],
  2382. referencedClasses: []
  2383. }),
  2384. smalltalk.Date);
  2385. smalltalk.addMethod(
  2386. "_seconds",
  2387. smalltalk.method({
  2388. selector: "seconds",
  2389. category: 'accessing',
  2390. fn: function (){
  2391. var self=this;
  2392. return smalltalk.withContext(function($ctx1) { return self.getSeconds();
  2393. return self}, function($ctx1) {$ctx1.fill(self,"seconds",{}, smalltalk.Date)})},
  2394. args: [],
  2395. source: "seconds\x0a\x09<return self.getSeconds()>",
  2396. messageSends: [],
  2397. referencedClasses: []
  2398. }),
  2399. smalltalk.Date);
  2400. smalltalk.addMethod(
  2401. "_seconds_",
  2402. smalltalk.method({
  2403. selector: "seconds:",
  2404. category: 'accessing',
  2405. fn: function (aNumber){
  2406. var self=this;
  2407. return smalltalk.withContext(function($ctx1) { self.setSeconds(aNumber);
  2408. return self}, function($ctx1) {$ctx1.fill(self,"seconds:",{aNumber:aNumber}, smalltalk.Date)})},
  2409. args: ["aNumber"],
  2410. source: "seconds: aNumber\x0a\x09<self.setSeconds(aNumber)>",
  2411. messageSends: [],
  2412. referencedClasses: []
  2413. }),
  2414. smalltalk.Date);
  2415. smalltalk.addMethod(
  2416. "_time",
  2417. smalltalk.method({
  2418. selector: "time",
  2419. category: 'accessing',
  2420. fn: function (){
  2421. var self=this;
  2422. return smalltalk.withContext(function($ctx1) { return self.getTime();
  2423. return self}, function($ctx1) {$ctx1.fill(self,"time",{}, smalltalk.Date)})},
  2424. args: [],
  2425. source: "time\x0a\x09<return self.getTime()>",
  2426. messageSends: [],
  2427. referencedClasses: []
  2428. }),
  2429. smalltalk.Date);
  2430. smalltalk.addMethod(
  2431. "_time_",
  2432. smalltalk.method({
  2433. selector: "time:",
  2434. category: 'accessing',
  2435. fn: function (aNumber){
  2436. var self=this;
  2437. return smalltalk.withContext(function($ctx1) { self.setTime(aNumber);
  2438. return self}, function($ctx1) {$ctx1.fill(self,"time:",{aNumber:aNumber}, smalltalk.Date)})},
  2439. args: ["aNumber"],
  2440. source: "time: aNumber\x0a\x09<self.setTime(aNumber)>",
  2441. messageSends: [],
  2442. referencedClasses: []
  2443. }),
  2444. smalltalk.Date);
  2445. smalltalk.addMethod(
  2446. "_year",
  2447. smalltalk.method({
  2448. selector: "year",
  2449. category: 'accessing',
  2450. fn: function (){
  2451. var self=this;
  2452. return smalltalk.withContext(function($ctx1) { return self.getFullYear();
  2453. return self}, function($ctx1) {$ctx1.fill(self,"year",{}, smalltalk.Date)})},
  2454. args: [],
  2455. source: "year\x0a\x09<return self.getFullYear()>",
  2456. messageSends: [],
  2457. referencedClasses: []
  2458. }),
  2459. smalltalk.Date);
  2460. smalltalk.addMethod(
  2461. "_year_",
  2462. smalltalk.method({
  2463. selector: "year:",
  2464. category: 'accessing',
  2465. fn: function (aNumber){
  2466. var self=this;
  2467. return smalltalk.withContext(function($ctx1) { self.setFullYear(aNumber);
  2468. return self}, function($ctx1) {$ctx1.fill(self,"year:",{aNumber:aNumber}, smalltalk.Date)})},
  2469. args: ["aNumber"],
  2470. source: "year: aNumber\x0a\x09<self.setFullYear(aNumber)>",
  2471. messageSends: [],
  2472. referencedClasses: []
  2473. }),
  2474. smalltalk.Date);
  2475. smalltalk.addMethod(
  2476. "_fromMilliseconds_",
  2477. smalltalk.method({
  2478. selector: "fromMilliseconds:",
  2479. category: 'instance creation',
  2480. fn: function (aNumber){
  2481. var self=this;
  2482. return smalltalk.withContext(function($ctx1) { var $1;
  2483. $1=_st(self)._new_(aNumber);
  2484. return $1;
  2485. }, function($ctx1) {$ctx1.fill(self,"fromMilliseconds:",{aNumber:aNumber}, smalltalk.Date.klass)})},
  2486. args: ["aNumber"],
  2487. source: "fromMilliseconds: aNumber\x0a\x09^self new: aNumber",
  2488. messageSends: ["new:"],
  2489. referencedClasses: []
  2490. }),
  2491. smalltalk.Date.klass);
  2492. smalltalk.addMethod(
  2493. "_fromSeconds_",
  2494. smalltalk.method({
  2495. selector: "fromSeconds:",
  2496. category: 'instance creation',
  2497. fn: function (aNumber){
  2498. var self=this;
  2499. return smalltalk.withContext(function($ctx1) { var $1;
  2500. $1=_st(self)._fromMilliseconds_(_st(aNumber).__star((1000)));
  2501. return $1;
  2502. }, function($ctx1) {$ctx1.fill(self,"fromSeconds:",{aNumber:aNumber}, smalltalk.Date.klass)})},
  2503. args: ["aNumber"],
  2504. source: "fromSeconds: aNumber\x0a\x09^self fromMilliseconds: aNumber * 1000",
  2505. messageSends: ["fromMilliseconds:", "*"],
  2506. referencedClasses: []
  2507. }),
  2508. smalltalk.Date.klass);
  2509. smalltalk.addMethod(
  2510. "_fromString_",
  2511. smalltalk.method({
  2512. selector: "fromString:",
  2513. category: 'instance creation',
  2514. fn: function (aString){
  2515. var self=this;
  2516. return smalltalk.withContext(function($ctx1) { var $1;
  2517. $1=_st(self)._new_(aString);
  2518. return $1;
  2519. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString}, smalltalk.Date.klass)})},
  2520. args: ["aString"],
  2521. source: "fromString: aString\x0a\x09\x22Example: Date fromString('2011/04/15 00:00:00')\x22\x0a\x09^self new: aString",
  2522. messageSends: ["new:"],
  2523. referencedClasses: []
  2524. }),
  2525. smalltalk.Date.klass);
  2526. smalltalk.addMethod(
  2527. "_millisecondsToRun_",
  2528. smalltalk.method({
  2529. selector: "millisecondsToRun:",
  2530. category: 'instance creation',
  2531. fn: function (aBlock){
  2532. var self=this;
  2533. var t;
  2534. return smalltalk.withContext(function($ctx1) { var $1;
  2535. t=_st((smalltalk.Date || Date))._now();
  2536. _st(aBlock)._value();
  2537. $1=_st(_st((smalltalk.Date || Date))._now()).__minus(t);
  2538. return $1;
  2539. }, function($ctx1) {$ctx1.fill(self,"millisecondsToRun:",{aBlock:aBlock,t:t}, smalltalk.Date.klass)})},
  2540. args: ["aBlock"],
  2541. source: "millisecondsToRun: aBlock\x0a\x09| t |\x0a\x09t := Date now.\x0a\x09aBlock value.\x0a\x09^Date now - t",
  2542. messageSends: ["now", "value", "-"],
  2543. referencedClasses: ["Date"]
  2544. }),
  2545. smalltalk.Date.klass);
  2546. smalltalk.addMethod(
  2547. "_new_",
  2548. smalltalk.method({
  2549. selector: "new:",
  2550. category: 'instance creation',
  2551. fn: function (anObject){
  2552. var self=this;
  2553. return smalltalk.withContext(function($ctx1) { return new Date(anObject);
  2554. return self}, function($ctx1) {$ctx1.fill(self,"new:",{anObject:anObject}, smalltalk.Date.klass)})},
  2555. args: ["anObject"],
  2556. source: "new: anObject\x0a\x09<return new Date(anObject)>",
  2557. messageSends: [],
  2558. referencedClasses: []
  2559. }),
  2560. smalltalk.Date.klass);
  2561. smalltalk.addMethod(
  2562. "_now",
  2563. smalltalk.method({
  2564. selector: "now",
  2565. category: 'instance creation',
  2566. fn: function (){
  2567. var self=this;
  2568. return smalltalk.withContext(function($ctx1) { var $1;
  2569. $1=_st(self)._today();
  2570. return $1;
  2571. }, function($ctx1) {$ctx1.fill(self,"now",{}, smalltalk.Date.klass)})},
  2572. args: [],
  2573. source: "now\x0a\x09^self today",
  2574. messageSends: ["today"],
  2575. referencedClasses: []
  2576. }),
  2577. smalltalk.Date.klass);
  2578. smalltalk.addMethod(
  2579. "_today",
  2580. smalltalk.method({
  2581. selector: "today",
  2582. category: 'instance creation',
  2583. fn: function (){
  2584. var self=this;
  2585. return smalltalk.withContext(function($ctx1) { var $1;
  2586. $1=_st(self)._new();
  2587. return $1;
  2588. }, function($ctx1) {$ctx1.fill(self,"today",{}, smalltalk.Date.klass)})},
  2589. args: [],
  2590. source: "today\x0a\x09^self new",
  2591. messageSends: ["new"],
  2592. referencedClasses: []
  2593. }),
  2594. smalltalk.Date.klass);
  2595. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  2596. smalltalk.JSObjectProxy.comment="JSObjectProxy handles sending messages to JavaScript object, therefore accessing JavaScript objects from Amber is transparent.\x0aJSOjbectProxy makes intensive use of `#doesNotUnderstand:`.\x0a\x0a## Examples\x0a\x0aJSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.\x0a\x0a window alert: 'hello world'.\x0a window inspect.\x0a (window jQuery: 'body') append: 'hello world'\x0a\x0aSmalltalk messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown. \x0a\x0a## Message conversion rules\x0a\x0a- `someUser name` becomes `someUser.name`\x0a- `someUser name: 'John'` becomes `someUser name = \x22John\x22`\x0a- `console log: 'hello world'` becomes `console.log('hello world')`\x0a- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`\x0a\x0a__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`."
  2597. smalltalk.addMethod(
  2598. "_addObjectVariablesTo_",
  2599. smalltalk.method({
  2600. selector: "addObjectVariablesTo:",
  2601. category: 'proxy',
  2602. fn: function (aDictionary){
  2603. var self=this;
  2604. return smalltalk.withContext(function($ctx1) {
  2605. for(var i in self['@jsObject']) {
  2606. aDictionary._at_put_(i, self['@jsObject'][i]);
  2607. }
  2608. ;
  2609. return self}, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:",{aDictionary:aDictionary}, smalltalk.JSObjectProxy)})},
  2610. args: ["aDictionary"],
  2611. source: "addObjectVariablesTo: aDictionary\x0a\x09<\x0a \x09for(var i in self['@jsObject']) {\x0a\x09\x09\x09aDictionary._at_put_(i, self['@jsObject'][i]);\x0a\x09\x09}\x0a >",
  2612. messageSends: [],
  2613. referencedClasses: []
  2614. }),
  2615. smalltalk.JSObjectProxy);
  2616. smalltalk.addMethod(
  2617. "_at_",
  2618. smalltalk.method({
  2619. selector: "at:",
  2620. category: 'accessing',
  2621. fn: function (aSymbol){
  2622. var self=this;
  2623. return smalltalk.withContext(function($ctx1) { return self['@jsObject'][aSymbol._asString()];
  2624. return self}, function($ctx1) {$ctx1.fill(self,"at:",{aSymbol:aSymbol}, smalltalk.JSObjectProxy)})},
  2625. args: ["aSymbol"],
  2626. source: "at: aSymbol\x0a\x09<return self['@jsObject'][aSymbol._asString()]>",
  2627. messageSends: [],
  2628. referencedClasses: []
  2629. }),
  2630. smalltalk.JSObjectProxy);
  2631. smalltalk.addMethod(
  2632. "_at_ifAbsent_",
  2633. smalltalk.method({
  2634. selector: "at:ifAbsent:",
  2635. category: 'accessing',
  2636. fn: function (aSymbol,aBlock){
  2637. var self=this;
  2638. return smalltalk.withContext(function($ctx1) {
  2639. var obj = self['@jsObject'],
  2640. symbol = aSymbol._asString();
  2641. return symbol in obj ? obj[symbol] : aBlock();
  2642. ;
  2643. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aSymbol:aSymbol,aBlock:aBlock}, smalltalk.JSObjectProxy)})},
  2644. args: ["aSymbol", "aBlock"],
  2645. source: "at: aSymbol ifAbsent: aBlock\x0a\x09\x22return the aSymbol property or evaluate aBlock if the property is not defined on the object\x22\x0a\x09<\x0a \x09var obj = self['@jsObject'],\x0a \x09symbol = aSymbol._asString();\x0a\x09\x09return symbol in obj ? obj[symbol] : aBlock();\x0a\x09>",
  2646. messageSends: [],
  2647. referencedClasses: []
  2648. }),
  2649. smalltalk.JSObjectProxy);
  2650. smalltalk.addMethod(
  2651. "_at_put_",
  2652. smalltalk.method({
  2653. selector: "at:put:",
  2654. category: 'accessing',
  2655. fn: function (aSymbol,anObject){
  2656. var self=this;
  2657. return smalltalk.withContext(function($ctx1) { self['@jsObject'][aSymbol._asString()] = anObject;
  2658. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aSymbol:aSymbol,anObject:anObject}, smalltalk.JSObjectProxy)})},
  2659. args: ["aSymbol", "anObject"],
  2660. source: "at: aSymbol put: anObject\x0a\x09<self['@jsObject'][aSymbol._asString()] = anObject>",
  2661. messageSends: [],
  2662. referencedClasses: []
  2663. }),
  2664. smalltalk.JSObjectProxy);
  2665. smalltalk.addMethod(
  2666. "_canForwardMessage_",
  2667. smalltalk.method({
  2668. selector: "canForwardMessage:",
  2669. category: 'testing',
  2670. fn: function (aMessage){
  2671. var self=this;
  2672. return smalltalk.withContext(function($ctx1) {
  2673. var jsSelector = aMessage._selector()._asJavaScriptSelector();
  2674. if(jsSelector in self._jsObject()) {
  2675. return true
  2676. } else {
  2677. return false;
  2678. }
  2679. ;
  2680. return self}, function($ctx1) {$ctx1.fill(self,"canForwardMessage:",{aMessage:aMessage}, smalltalk.JSObjectProxy)})},
  2681. args: ["aMessage"],
  2682. source: "canForwardMessage: aMessage\x0a\x09<\x0a \x09var jsSelector = aMessage._selector()._asJavaScriptSelector();\x0a \x09if(jsSelector in self._jsObject()) {\x0a \x09return true\x0a } else {\x0a \x09return false;\x0a }\x0a >",
  2683. messageSends: [],
  2684. referencedClasses: []
  2685. }),
  2686. smalltalk.JSObjectProxy);
  2687. smalltalk.addMethod(
  2688. "_doesNotUnderstand_",
  2689. smalltalk.method({
  2690. selector: "doesNotUnderstand:",
  2691. category: 'proxy',
  2692. fn: function (aMessage){
  2693. var self=this;
  2694. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  2695. $2=_st(self)._canForwardMessage_(aMessage);
  2696. if(smalltalk.assert($2)){
  2697. $1=_st(self)._forwardMessage_(aMessage);
  2698. } else {
  2699. $3=smalltalk.Object.fn.prototype._doesNotUnderstand_.apply(_st(self), [aMessage]);
  2700. return $3;
  2701. };
  2702. return $1;
  2703. }, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage}, smalltalk.JSObjectProxy)})},
  2704. args: ["aMessage"],
  2705. source: "doesNotUnderstand: aMessage\x0a \x0a ^ (self canForwardMessage: aMessage) \x0a \x09ifTrue: [ self forwardMessage: aMessage ]\x0a ifFalse: [ ^ super doesNotUnderstand: aMessage ]",
  2706. messageSends: ["ifTrue:ifFalse:", "forwardMessage:", "doesNotUnderstand:", "canForwardMessage:"],
  2707. referencedClasses: []
  2708. }),
  2709. smalltalk.JSObjectProxy);
  2710. smalltalk.addMethod(
  2711. "_forwardMessage_",
  2712. smalltalk.method({
  2713. selector: "forwardMessage:",
  2714. category: 'proxy',
  2715. fn: function (aMessage){
  2716. var self=this;
  2717. return smalltalk.withContext(function($ctx1) {
  2718. return smalltalk.send(self._jsObject(), aMessage._selector()._asJavaScriptSelector(), aMessage._arguments());
  2719. ;
  2720. return self}, function($ctx1) {$ctx1.fill(self,"forwardMessage:",{aMessage:aMessage}, smalltalk.JSObjectProxy)})},
  2721. args: ["aMessage"],
  2722. source: "forwardMessage: aMessage\x0a\x09<\x0a \x09return smalltalk.send(self._jsObject(), aMessage._selector()._asJavaScriptSelector(), aMessage._arguments());\x0a >",
  2723. messageSends: [],
  2724. referencedClasses: []
  2725. }),
  2726. smalltalk.JSObjectProxy);
  2727. smalltalk.addMethod(
  2728. "_inspectOn_",
  2729. smalltalk.method({
  2730. selector: "inspectOn:",
  2731. category: 'proxy',
  2732. fn: function (anInspector){
  2733. var self=this;
  2734. var variables;
  2735. return smalltalk.withContext(function($ctx1) { variables=_st((smalltalk.Dictionary || Dictionary))._new();
  2736. _st(variables)._at_put_("#self",_st(self)._jsObject());
  2737. _st(anInspector)._setLabel_(_st(self)._printString());
  2738. _st(self)._addObjectVariablesTo_(variables);
  2739. _st(anInspector)._setVariables_(variables);
  2740. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables}, smalltalk.JSObjectProxy)})},
  2741. args: ["anInspector"],
  2742. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self jsObject.\x0a\x09anInspector setLabel: self printString.\x0a\x09self addObjectVariablesTo: variables.\x0a\x09anInspector setVariables: variables",
  2743. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:", "setVariables:"],
  2744. referencedClasses: ["Dictionary"]
  2745. }),
  2746. smalltalk.JSObjectProxy);
  2747. smalltalk.addMethod(
  2748. "_jsObject",
  2749. smalltalk.method({
  2750. selector: "jsObject",
  2751. category: 'accessing',
  2752. fn: function (){
  2753. var self=this;
  2754. return smalltalk.withContext(function($ctx1) { var $1;
  2755. $1=self["@jsObject"];
  2756. return $1;
  2757. }, function($ctx1) {$ctx1.fill(self,"jsObject",{}, smalltalk.JSObjectProxy)})},
  2758. args: [],
  2759. source: "jsObject\x0a\x09^jsObject",
  2760. messageSends: [],
  2761. referencedClasses: []
  2762. }),
  2763. smalltalk.JSObjectProxy);
  2764. smalltalk.addMethod(
  2765. "_jsObject_",
  2766. smalltalk.method({
  2767. selector: "jsObject:",
  2768. category: 'accessing',
  2769. fn: function (aJSObject){
  2770. var self=this;
  2771. return smalltalk.withContext(function($ctx1) { self["@jsObject"]=aJSObject;
  2772. return self}, function($ctx1) {$ctx1.fill(self,"jsObject:",{aJSObject:aJSObject}, smalltalk.JSObjectProxy)})},
  2773. args: ["aJSObject"],
  2774. source: "jsObject: aJSObject\x0a\x09jsObject := aJSObject",
  2775. messageSends: [],
  2776. referencedClasses: []
  2777. }),
  2778. smalltalk.JSObjectProxy);
  2779. smalltalk.addMethod(
  2780. "_keysAndValuesDo_",
  2781. smalltalk.method({
  2782. selector: "keysAndValuesDo:",
  2783. category: 'enumerating',
  2784. fn: function (aBlock){
  2785. var self=this;
  2786. return smalltalk.withContext(function($ctx1) {
  2787. var o = self['@jsObject'];
  2788. for(var i in o) {
  2789. aBlock(i, o[i]);
  2790. }
  2791. ;
  2792. return self}, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock}, smalltalk.JSObjectProxy)})},
  2793. args: ["aBlock"],
  2794. source: "keysAndValuesDo: aBlock\x0a\x09<\x0a \x09var o = self['@jsObject'];\x0a \x09for(var i in o) {\x0a\x09\x09\x09aBlock(i, o[i]);\x0a\x09\x09}\x0a >",
  2795. messageSends: [],
  2796. referencedClasses: []
  2797. }),
  2798. smalltalk.JSObjectProxy);
  2799. smalltalk.addMethod(
  2800. "_printString",
  2801. smalltalk.method({
  2802. selector: "printString",
  2803. category: 'proxy',
  2804. fn: function (){
  2805. var self=this;
  2806. return smalltalk.withContext(function($ctx1) { var $1;
  2807. $1=_st(_st(self)._jsObject())._toString();
  2808. return $1;
  2809. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.JSObjectProxy)})},
  2810. args: [],
  2811. source: "printString\x0a\x09^self jsObject toString",
  2812. messageSends: ["toString", "jsObject"],
  2813. referencedClasses: []
  2814. }),
  2815. smalltalk.JSObjectProxy);
  2816. smalltalk.addMethod(
  2817. "_value",
  2818. smalltalk.method({
  2819. selector: "value",
  2820. category: 'accessing',
  2821. fn: function (){
  2822. var self=this;
  2823. return smalltalk.withContext(function($ctx1) { var $1;
  2824. $1=_st(self)._at_ifAbsent_("value",(function(){
  2825. return smalltalk.withContext(function($ctx2) { return smalltalk.Object.fn.prototype._value.apply(_st(self), []);
  2826. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2827. return $1;
  2828. }, function($ctx1) {$ctx1.fill(self,"value",{}, smalltalk.JSObjectProxy)})},
  2829. args: [],
  2830. source: "value\x0a\x09\x22if attribute 'value' exists on the JS object return it,\x0a otherwise return the result of Object>>value.\x22\x0a\x09^ self at: 'value' ifAbsent: [super value]",
  2831. messageSends: ["at:ifAbsent:", "value"],
  2832. referencedClasses: []
  2833. }),
  2834. smalltalk.JSObjectProxy);
  2835. smalltalk.addMethod(
  2836. "_on_",
  2837. smalltalk.method({
  2838. selector: "on:",
  2839. category: 'instance creation',
  2840. fn: function (aJSObject){
  2841. var self=this;
  2842. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  2843. $2=_st(self)._new();
  2844. _st($2)._jsObject_(aJSObject);
  2845. $3=_st($2)._yourself();
  2846. $1=$3;
  2847. return $1;
  2848. }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject}, smalltalk.JSObjectProxy.klass)})},
  2849. args: ["aJSObject"],
  2850. source: "on: aJSObject\x0a\x09^self new\x0a\x09\x09jsObject: aJSObject;\x0a\x09\x09yourself",
  2851. messageSends: ["jsObject:", "new", "yourself"],
  2852. referencedClasses: []
  2853. }),
  2854. smalltalk.JSObjectProxy.klass);
  2855. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  2856. smalltalk.Number.comment="Number holds the most general methods for dealing with numbers. \x0aNumber is directly mapped to JavaScript Number.\x0a\x0aMost arithmetic methods like `#+` `#/` `#-` `#max:` are directly inlined into javascript. \x0a\x0a##Enumerating\x0aA Number can be used to evaluate a Block a fixed number of times:\x0a\x0a\x095 timesRepeat: [Transcript show: 'This will be printed 5 times'; cr].\x0a\x09\x0a\x091 to: 5 do: [:aNumber| Transcript show: aNumber asString; cr].\x0a\x09\x0a\x091 to: 10 by: 2 do: [:aNumber| Transcript show: aNumber asString; cr]."
  2857. smalltalk.addMethod(
  2858. "__and",
  2859. smalltalk.method({
  2860. selector: "&",
  2861. category: 'converting',
  2862. fn: function (aNumber){
  2863. var self=this;
  2864. return smalltalk.withContext(function($ctx1) { return self & aNumber;
  2865. return self}, function($ctx1) {$ctx1.fill(self,"&",{aNumber:aNumber}, smalltalk.Number)})},
  2866. args: ["aNumber"],
  2867. source: "& aNumber\x0a\x09<return self & aNumber>",
  2868. messageSends: [],
  2869. referencedClasses: []
  2870. }),
  2871. smalltalk.Number);
  2872. smalltalk.addMethod(
  2873. "__star",
  2874. smalltalk.method({
  2875. selector: "*",
  2876. category: 'arithmetic',
  2877. fn: function (aNumber){
  2878. var self=this;
  2879. return smalltalk.withContext(function($ctx1) { return self * aNumber;
  2880. return self}, function($ctx1) {$ctx1.fill(self,"*",{aNumber:aNumber}, smalltalk.Number)})},
  2881. args: ["aNumber"],
  2882. source: "* aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self * aNumber>",
  2883. messageSends: [],
  2884. referencedClasses: []
  2885. }),
  2886. smalltalk.Number);
  2887. smalltalk.addMethod(
  2888. "__plus",
  2889. smalltalk.method({
  2890. selector: "+",
  2891. category: 'arithmetic',
  2892. fn: function (aNumber){
  2893. var self=this;
  2894. return smalltalk.withContext(function($ctx1) { return self + aNumber;
  2895. return self}, function($ctx1) {$ctx1.fill(self,"+",{aNumber:aNumber}, smalltalk.Number)})},
  2896. args: ["aNumber"],
  2897. source: "+ aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self + aNumber>",
  2898. messageSends: [],
  2899. referencedClasses: []
  2900. }),
  2901. smalltalk.Number);
  2902. smalltalk.addMethod(
  2903. "__minus",
  2904. smalltalk.method({
  2905. selector: "-",
  2906. category: 'arithmetic',
  2907. fn: function (aNumber){
  2908. var self=this;
  2909. return smalltalk.withContext(function($ctx1) { return self - aNumber;
  2910. return self}, function($ctx1) {$ctx1.fill(self,"-",{aNumber:aNumber}, smalltalk.Number)})},
  2911. args: ["aNumber"],
  2912. source: "- aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self - aNumber>",
  2913. messageSends: [],
  2914. referencedClasses: []
  2915. }),
  2916. smalltalk.Number);
  2917. smalltalk.addMethod(
  2918. "__slash",
  2919. smalltalk.method({
  2920. selector: "/",
  2921. category: 'arithmetic',
  2922. fn: function (aNumber){
  2923. var self=this;
  2924. return smalltalk.withContext(function($ctx1) { return self / aNumber;
  2925. return self}, function($ctx1) {$ctx1.fill(self,"/",{aNumber:aNumber}, smalltalk.Number)})},
  2926. args: ["aNumber"],
  2927. source: "/ aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self / aNumber>",
  2928. messageSends: [],
  2929. referencedClasses: []
  2930. }),
  2931. smalltalk.Number);
  2932. smalltalk.addMethod(
  2933. "__lt",
  2934. smalltalk.method({
  2935. selector: "<",
  2936. category: 'comparing',
  2937. fn: function (aNumber){
  2938. var self=this;
  2939. return smalltalk.withContext(function($ctx1) { return self < aNumber;
  2940. return self}, function($ctx1) {$ctx1.fill(self,"<",{aNumber:aNumber}, smalltalk.Number)})},
  2941. args: ["aNumber"],
  2942. source: "< aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self < aNumber>",
  2943. messageSends: [],
  2944. referencedClasses: []
  2945. }),
  2946. smalltalk.Number);
  2947. smalltalk.addMethod(
  2948. "__lt_eq",
  2949. smalltalk.method({
  2950. selector: "<=",
  2951. category: 'comparing',
  2952. fn: function (aNumber){
  2953. var self=this;
  2954. return smalltalk.withContext(function($ctx1) { return self <= aNumber;
  2955. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aNumber:aNumber}, smalltalk.Number)})},
  2956. args: ["aNumber"],
  2957. source: "<= aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self <= aNumber>",
  2958. messageSends: [],
  2959. referencedClasses: []
  2960. }),
  2961. smalltalk.Number);
  2962. smalltalk.addMethod(
  2963. "__eq",
  2964. smalltalk.method({
  2965. selector: "=",
  2966. category: 'comparing',
  2967. fn: function (aNumber){
  2968. var self=this;
  2969. return smalltalk.withContext(function($ctx1) {
  2970. if(! aNumber._isNumber || ! aNumber._isNumber()) {
  2971. return false;
  2972. }
  2973. return Number(self) == aNumber
  2974. ;
  2975. return self}, function($ctx1) {$ctx1.fill(self,"=",{aNumber:aNumber}, smalltalk.Number)})},
  2976. args: ["aNumber"],
  2977. source: "= aNumber\x0a\x09<\x0a \x09if(! aNumber._isNumber || ! aNumber._isNumber()) {\x0a \x09return false;\x0a }\x0a \x09return Number(self) == aNumber\x0a >",
  2978. messageSends: [],
  2979. referencedClasses: []
  2980. }),
  2981. smalltalk.Number);
  2982. smalltalk.addMethod(
  2983. "__gt",
  2984. smalltalk.method({
  2985. selector: ">",
  2986. category: 'comparing',
  2987. fn: function (aNumber){
  2988. var self=this;
  2989. return smalltalk.withContext(function($ctx1) { return self > aNumber;
  2990. return self}, function($ctx1) {$ctx1.fill(self,">",{aNumber:aNumber}, smalltalk.Number)})},
  2991. args: ["aNumber"],
  2992. source: "> aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self >> aNumber>",
  2993. messageSends: [],
  2994. referencedClasses: []
  2995. }),
  2996. smalltalk.Number);
  2997. smalltalk.addMethod(
  2998. "__gt_eq",
  2999. smalltalk.method({
  3000. selector: ">=",
  3001. category: 'comparing',
  3002. fn: function (aNumber){
  3003. var self=this;
  3004. return smalltalk.withContext(function($ctx1) { return self >= aNumber;
  3005. return self}, function($ctx1) {$ctx1.fill(self,">=",{aNumber:aNumber}, smalltalk.Number)})},
  3006. args: ["aNumber"],
  3007. source: ">= aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self >>= aNumber>",
  3008. messageSends: [],
  3009. referencedClasses: []
  3010. }),
  3011. smalltalk.Number);
  3012. smalltalk.addMethod(
  3013. "__at",
  3014. smalltalk.method({
  3015. selector: "@",
  3016. category: 'converting',
  3017. fn: function (aNumber){
  3018. var self=this;
  3019. return smalltalk.withContext(function($ctx1) { var $1;
  3020. $1=_st((smalltalk.Point || Point))._x_y_(self,aNumber);
  3021. return $1;
  3022. }, function($ctx1) {$ctx1.fill(self,"@",{aNumber:aNumber}, smalltalk.Number)})},
  3023. args: ["aNumber"],
  3024. source: "@ aNumber\x0a\x09^Point x: self y: aNumber",
  3025. messageSends: ["x:y:"],
  3026. referencedClasses: ["Point"]
  3027. }),
  3028. smalltalk.Number);
  3029. smalltalk.addMethod(
  3030. "__backslash",
  3031. smalltalk.method({
  3032. selector: "\x5c",
  3033. category: 'arithmetic',
  3034. fn: function (aNumber){
  3035. var self=this;
  3036. return smalltalk.withContext(function($ctx1) { return self % aNumber;
  3037. return self}, function($ctx1) {$ctx1.fill(self,"\x5c\x5c",{aNumber:aNumber}, smalltalk.Number)})},
  3038. args: ["aNumber"],
  3039. source: "\x5c\x5c aNumber\x0a\x09<return self % aNumber>",
  3040. messageSends: [],
  3041. referencedClasses: []
  3042. }),
  3043. smalltalk.Number);
  3044. smalltalk.addMethod(
  3045. "__backslash_backslash",
  3046. smalltalk.method({
  3047. selector: "\x5c\x5c",
  3048. category: 'arithmetic',
  3049. fn: function (aNumber) {
  3050. var self = this;
  3051. return self % aNumber;
  3052. return self;
  3053. },
  3054. args: ["aNumber"],
  3055. source: "\x5c\x5c aNumber\x0a\x09<return self % aNumber>",
  3056. messageSends: [],
  3057. referencedClasses: []
  3058. }),
  3059. smalltalk.Number);
  3060. smalltalk.addMethod(
  3061. "_abs",
  3062. smalltalk.method({
  3063. selector: "abs",
  3064. category: 'arithmetic',
  3065. fn: function (){
  3066. var self=this;
  3067. return smalltalk.withContext(function($ctx1) { return Math.abs(self);;
  3068. return self}, function($ctx1) {$ctx1.fill(self,"abs",{}, smalltalk.Number)})},
  3069. args: [],
  3070. source: "abs\x0a\x09<return Math.abs(self);>",
  3071. messageSends: [],
  3072. referencedClasses: []
  3073. }),
  3074. smalltalk.Number);
  3075. smalltalk.addMethod(
  3076. "_asJSON",
  3077. smalltalk.method({
  3078. selector: "asJSON",
  3079. category: 'converting',
  3080. fn: function (){
  3081. var self=this;
  3082. return smalltalk.withContext(function($ctx1) { var $1;
  3083. $1=self;
  3084. return $1;
  3085. }, function($ctx1) {$ctx1.fill(self,"asJSON",{}, smalltalk.Number)})},
  3086. args: [],
  3087. source: "asJSON\x0a\x09^self",
  3088. messageSends: [],
  3089. referencedClasses: []
  3090. }),
  3091. smalltalk.Number);
  3092. smalltalk.addMethod(
  3093. "_asJavascript",
  3094. smalltalk.method({
  3095. selector: "asJavascript",
  3096. category: 'converting',
  3097. fn: function (){
  3098. var self=this;
  3099. return smalltalk.withContext(function($ctx1) { var $1;
  3100. $1=_st(_st("(").__comma(_st(self)._printString())).__comma(")");
  3101. return $1;
  3102. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Number)})},
  3103. args: [],
  3104. source: "asJavascript\x0a\x09^'(', self printString, ')'",
  3105. messageSends: [",", "printString"],
  3106. referencedClasses: []
  3107. }),
  3108. smalltalk.Number);
  3109. smalltalk.addMethod(
  3110. "_asPoint",
  3111. smalltalk.method({
  3112. selector: "asPoint",
  3113. category: 'converting',
  3114. fn: function (){
  3115. var self=this;
  3116. return smalltalk.withContext(function($ctx1) { var $1;
  3117. $1=_st((smalltalk.Point || Point))._x_y_(self,self);
  3118. return $1;
  3119. }, function($ctx1) {$ctx1.fill(self,"asPoint",{}, smalltalk.Number)})},
  3120. args: [],
  3121. source: "asPoint\x0a\x09^Point x: self y: self",
  3122. messageSends: ["x:y:"],
  3123. referencedClasses: ["Point"]
  3124. }),
  3125. smalltalk.Number);
  3126. smalltalk.addMethod(
  3127. "_asString",
  3128. smalltalk.method({
  3129. selector: "asString",
  3130. category: 'converting',
  3131. fn: function (){
  3132. var self=this;
  3133. return smalltalk.withContext(function($ctx1) { var $1;
  3134. $1=_st(self)._printString();
  3135. return $1;
  3136. }, function($ctx1) {$ctx1.fill(self,"asString",{}, smalltalk.Number)})},
  3137. args: [],
  3138. source: "asString\x0a\x09^self printString",
  3139. messageSends: ["printString"],
  3140. referencedClasses: []
  3141. }),
  3142. smalltalk.Number);
  3143. smalltalk.addMethod(
  3144. "_atRandom",
  3145. smalltalk.method({
  3146. selector: "atRandom",
  3147. category: 'converting',
  3148. fn: function (){
  3149. var self=this;
  3150. return smalltalk.withContext(function($ctx1) { var $1;
  3151. $1=_st(_st(_st(_st(_st((smalltalk.Random || Random))._new())._next()).__star(self))._truncated()).__plus((1));
  3152. return $1;
  3153. }, function($ctx1) {$ctx1.fill(self,"atRandom",{}, smalltalk.Number)})},
  3154. args: [],
  3155. source: "atRandom\x0a ^(Random new next * self) truncated + 1",
  3156. messageSends: ["+", "truncated", "*", "next", "new"],
  3157. referencedClasses: ["Random"]
  3158. }),
  3159. smalltalk.Number);
  3160. smalltalk.addMethod(
  3161. "_copy",
  3162. smalltalk.method({
  3163. selector: "copy",
  3164. category: 'copying',
  3165. fn: function (){
  3166. var self=this;
  3167. return smalltalk.withContext(function($ctx1) { var $1;
  3168. $1=self;
  3169. return $1;
  3170. }, function($ctx1) {$ctx1.fill(self,"copy",{}, smalltalk.Number)})},
  3171. args: [],
  3172. source: "copy\x0a\x09^self",
  3173. messageSends: [],
  3174. referencedClasses: []
  3175. }),
  3176. smalltalk.Number);
  3177. smalltalk.addMethod(
  3178. "_deepCopy",
  3179. smalltalk.method({
  3180. selector: "deepCopy",
  3181. category: 'copying',
  3182. fn: function (){
  3183. var self=this;
  3184. return smalltalk.withContext(function($ctx1) { var $1;
  3185. $1=_st(self)._copy();
  3186. return $1;
  3187. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{}, smalltalk.Number)})},
  3188. args: [],
  3189. source: "deepCopy\x0a\x09^self copy",
  3190. messageSends: ["copy"],
  3191. referencedClasses: []
  3192. }),
  3193. smalltalk.Number);
  3194. smalltalk.addMethod(
  3195. "_even",
  3196. smalltalk.method({
  3197. selector: "even",
  3198. category: 'testing',
  3199. fn: function (){
  3200. var self=this;
  3201. return smalltalk.withContext(function($ctx1) { var $1;
  3202. $1=_st((0)).__eq(_st(self).__backslash_backslash((2)));
  3203. return $1;
  3204. }, function($ctx1) {$ctx1.fill(self,"even",{}, smalltalk.Number)})},
  3205. args: [],
  3206. source: "even\x0a\x09^ 0 = (self \x5c\x5c 2)",
  3207. messageSends: ["=", "\x5c\x5c"],
  3208. referencedClasses: []
  3209. }),
  3210. smalltalk.Number);
  3211. smalltalk.addMethod(
  3212. "_identityHash",
  3213. smalltalk.method({
  3214. selector: "identityHash",
  3215. category: 'accessing',
  3216. fn: function (){
  3217. var self=this;
  3218. return smalltalk.withContext(function($ctx1) { var $1;
  3219. $1=_st(_st(self)._asString()).__comma("n");
  3220. return $1;
  3221. }, function($ctx1) {$ctx1.fill(self,"identityHash",{}, smalltalk.Number)})},
  3222. args: [],
  3223. source: "identityHash\x0a\x09^self asString, 'n'",
  3224. messageSends: [",", "asString"],
  3225. referencedClasses: []
  3226. }),
  3227. smalltalk.Number);
  3228. smalltalk.addMethod(
  3229. "_isNumber",
  3230. smalltalk.method({
  3231. selector: "isNumber",
  3232. category: 'testing',
  3233. fn: function (){
  3234. var self=this;
  3235. return smalltalk.withContext(function($ctx1) { return true;
  3236. }, function($ctx1) {$ctx1.fill(self,"isNumber",{}, smalltalk.Number)})},
  3237. args: [],
  3238. source: "isNumber\x0a\x09^true",
  3239. messageSends: [],
  3240. referencedClasses: []
  3241. }),
  3242. smalltalk.Number);
  3243. smalltalk.addMethod(
  3244. "_isZero",
  3245. smalltalk.method({
  3246. selector: "isZero",
  3247. category: 'testing',
  3248. fn: function (){
  3249. var self=this;
  3250. return smalltalk.withContext(function($ctx1) { var $1;
  3251. $1=_st(self).__eq((0));
  3252. return $1;
  3253. }, function($ctx1) {$ctx1.fill(self,"isZero",{}, smalltalk.Number)})},
  3254. args: [],
  3255. source: "isZero\x0a\x09^self = 0",
  3256. messageSends: ["="],
  3257. referencedClasses: []
  3258. }),
  3259. smalltalk.Number);
  3260. smalltalk.addMethod(
  3261. "_max_",
  3262. smalltalk.method({
  3263. selector: "max:",
  3264. category: 'arithmetic',
  3265. fn: function (aNumber){
  3266. var self=this;
  3267. return smalltalk.withContext(function($ctx1) { return Math.max(self, aNumber);;
  3268. return self}, function($ctx1) {$ctx1.fill(self,"max:",{aNumber:aNumber}, smalltalk.Number)})},
  3269. args: ["aNumber"],
  3270. source: "max: aNumber\x0a\x09<return Math.max(self, aNumber);>",
  3271. messageSends: [],
  3272. referencedClasses: []
  3273. }),
  3274. smalltalk.Number);
  3275. smalltalk.addMethod(
  3276. "_min_",
  3277. smalltalk.method({
  3278. selector: "min:",
  3279. category: 'arithmetic',
  3280. fn: function (aNumber){
  3281. var self=this;
  3282. return smalltalk.withContext(function($ctx1) { return Math.min(self, aNumber);;
  3283. return self}, function($ctx1) {$ctx1.fill(self,"min:",{aNumber:aNumber}, smalltalk.Number)})},
  3284. args: ["aNumber"],
  3285. source: "min: aNumber\x0a\x09<return Math.min(self, aNumber);>",
  3286. messageSends: [],
  3287. referencedClasses: []
  3288. }),
  3289. smalltalk.Number);
  3290. smalltalk.addMethod(
  3291. "_negated",
  3292. smalltalk.method({
  3293. selector: "negated",
  3294. category: 'arithmetic',
  3295. fn: function (){
  3296. var self=this;
  3297. return smalltalk.withContext(function($ctx1) { var $1;
  3298. $1=_st((0)).__minus(self);
  3299. return $1;
  3300. }, function($ctx1) {$ctx1.fill(self,"negated",{}, smalltalk.Number)})},
  3301. args: [],
  3302. source: "negated\x0a\x09^0 - self",
  3303. messageSends: ["-"],
  3304. referencedClasses: []
  3305. }),
  3306. smalltalk.Number);
  3307. smalltalk.addMethod(
  3308. "_negative",
  3309. smalltalk.method({
  3310. selector: "negative",
  3311. category: 'testing',
  3312. fn: function (){
  3313. var self=this;
  3314. return smalltalk.withContext(function($ctx1) { var $1;
  3315. $1=_st(self).__lt((0));
  3316. return $1;
  3317. }, function($ctx1) {$ctx1.fill(self,"negative",{}, smalltalk.Number)})},
  3318. args: [],
  3319. source: "negative\x0a\x09\x22Answer whether the receiver is mathematically negative.\x22\x0a\x0a\x09^ self < 0",
  3320. messageSends: ["<"],
  3321. referencedClasses: []
  3322. }),
  3323. smalltalk.Number);
  3324. smalltalk.addMethod(
  3325. "_odd",
  3326. smalltalk.method({
  3327. selector: "odd",
  3328. category: 'testing',
  3329. fn: function (){
  3330. var self=this;
  3331. return smalltalk.withContext(function($ctx1) { var $1;
  3332. $1=_st(_st(self)._even())._not();
  3333. return $1;
  3334. }, function($ctx1) {$ctx1.fill(self,"odd",{}, smalltalk.Number)})},
  3335. args: [],
  3336. source: "odd\x0a\x09^ self even not",
  3337. messageSends: ["not", "even"],
  3338. referencedClasses: []
  3339. }),
  3340. smalltalk.Number);
  3341. smalltalk.addMethod(
  3342. "_positive",
  3343. smalltalk.method({
  3344. selector: "positive",
  3345. category: 'testing',
  3346. fn: function (){
  3347. var self=this;
  3348. return smalltalk.withContext(function($ctx1) { var $1;
  3349. $1=_st(self).__gt_eq((0));
  3350. return $1;
  3351. }, function($ctx1) {$ctx1.fill(self,"positive",{}, smalltalk.Number)})},
  3352. args: [],
  3353. source: "positive\x0a\x09\x22Answer whether the receiver is positive or equal to 0. (ST-80 protocol).\x22\x0a\x0a\x09^ self >= 0",
  3354. messageSends: [">="],
  3355. referencedClasses: []
  3356. }),
  3357. smalltalk.Number);
  3358. smalltalk.addMethod(
  3359. "_printShowingDecimalPlaces_",
  3360. smalltalk.method({
  3361. selector: "printShowingDecimalPlaces:",
  3362. category: 'printing',
  3363. fn: function (placesDesired){
  3364. var self=this;
  3365. return smalltalk.withContext(function($ctx1) { return self.toFixed(placesDesired);
  3366. return self}, function($ctx1) {$ctx1.fill(self,"printShowingDecimalPlaces:",{placesDesired:placesDesired}, smalltalk.Number)})},
  3367. args: ["placesDesired"],
  3368. source: "printShowingDecimalPlaces: placesDesired\x0a\x09<return self.toFixed(placesDesired)>",
  3369. messageSends: [],
  3370. referencedClasses: []
  3371. }),
  3372. smalltalk.Number);
  3373. smalltalk.addMethod(
  3374. "_printString",
  3375. smalltalk.method({
  3376. selector: "printString",
  3377. category: 'printing',
  3378. fn: function (){
  3379. var self=this;
  3380. return smalltalk.withContext(function($ctx1) { return String(self);
  3381. return self}, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Number)})},
  3382. args: [],
  3383. source: "printString\x0a\x09<return String(self)>",
  3384. messageSends: [],
  3385. referencedClasses: []
  3386. }),
  3387. smalltalk.Number);
  3388. smalltalk.addMethod(
  3389. "_rounded",
  3390. smalltalk.method({
  3391. selector: "rounded",
  3392. category: 'converting',
  3393. fn: function (){
  3394. var self=this;
  3395. return smalltalk.withContext(function($ctx1) { return Math.round(self);;
  3396. return self}, function($ctx1) {$ctx1.fill(self,"rounded",{}, smalltalk.Number)})},
  3397. args: [],
  3398. source: "rounded\x0a\x09<return Math.round(self);>",
  3399. messageSends: [],
  3400. referencedClasses: []
  3401. }),
  3402. smalltalk.Number);
  3403. smalltalk.addMethod(
  3404. "_sqrt",
  3405. smalltalk.method({
  3406. selector: "sqrt",
  3407. category: 'arithmetic',
  3408. fn: function (){
  3409. var self=this;
  3410. return smalltalk.withContext(function($ctx1) { return Math.sqrt(self);
  3411. return self}, function($ctx1) {$ctx1.fill(self,"sqrt",{}, smalltalk.Number)})},
  3412. args: [],
  3413. source: "sqrt\x0a\x09<return Math.sqrt(self)>",
  3414. messageSends: [],
  3415. referencedClasses: []
  3416. }),
  3417. smalltalk.Number);
  3418. smalltalk.addMethod(
  3419. "_squared",
  3420. smalltalk.method({
  3421. selector: "squared",
  3422. category: 'arithmetic',
  3423. fn: function (){
  3424. var self=this;
  3425. return smalltalk.withContext(function($ctx1) { var $1;
  3426. $1=_st(self).__star(self);
  3427. return $1;
  3428. }, function($ctx1) {$ctx1.fill(self,"squared",{}, smalltalk.Number)})},
  3429. args: [],
  3430. source: "squared\x0a\x09^self * self",
  3431. messageSends: ["*"],
  3432. referencedClasses: []
  3433. }),
  3434. smalltalk.Number);
  3435. smalltalk.addMethod(
  3436. "_timesRepeat_",
  3437. smalltalk.method({
  3438. selector: "timesRepeat:",
  3439. category: 'enumerating',
  3440. fn: function (aBlock){
  3441. var self=this;
  3442. var count;
  3443. return smalltalk.withContext(function($ctx1) { count=(1);
  3444. _st((function(){
  3445. return smalltalk.withContext(function($ctx2) { return _st(count).__gt(self);
  3446. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3447. return smalltalk.withContext(function($ctx2) { _st(aBlock)._value();
  3448. count=_st(count).__plus((1));
  3449. return count;
  3450. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3451. return self}, function($ctx1) {$ctx1.fill(self,"timesRepeat:",{aBlock:aBlock,count:count}, smalltalk.Number)})},
  3452. args: ["aBlock"],
  3453. source: "timesRepeat: aBlock\x0a\x09| count |\x0a\x09count := 1.\x0a\x09[count > self] whileFalse: [\x0a\x09 aBlock value.\x0a\x09 count := count + 1]",
  3454. messageSends: ["whileFalse:", "value", "+", ">"],
  3455. referencedClasses: []
  3456. }),
  3457. smalltalk.Number);
  3458. smalltalk.addMethod(
  3459. "_to_",
  3460. smalltalk.method({
  3461. selector: "to:",
  3462. category: 'converting',
  3463. fn: function (aNumber){
  3464. var self=this;
  3465. var array,first,last,count;
  3466. return smalltalk.withContext(function($ctx1) { var $1;
  3467. first=_st(self)._truncated();
  3468. last=_st(_st(aNumber)._truncated()).__plus((1));
  3469. count=(1);
  3470. array=_st((smalltalk.Array || Array))._new();
  3471. _st(_st(last).__minus(first))._timesRepeat_((function(){
  3472. return smalltalk.withContext(function($ctx2) { _st(array)._at_put_(count,first);
  3473. count=_st(count).__plus((1));
  3474. count;
  3475. first=_st(first).__plus((1));
  3476. return first;
  3477. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3478. $1=array;
  3479. return $1;
  3480. }, function($ctx1) {$ctx1.fill(self,"to:",{aNumber:aNumber,array:array,first:first,last:last,count:count}, smalltalk.Number)})},
  3481. args: ["aNumber"],
  3482. source: "to: aNumber\x0a\x09| array first last count |\x0a\x09first := self truncated.\x0a\x09last := aNumber truncated + 1.\x0a\x09count := 1.\x0a\x09array := Array new.\x0a\x09(last - first) timesRepeat: [\x0a\x09 array at: count put: first.\x0a\x09 count := count + 1.\x0a\x09 first := first + 1].\x0a\x09^array",
  3483. messageSends: ["truncated", "+", "new", "timesRepeat:", "at:put:", "-"],
  3484. referencedClasses: ["Array"]
  3485. }),
  3486. smalltalk.Number);
  3487. smalltalk.addMethod(
  3488. "_to_by_",
  3489. smalltalk.method({
  3490. selector: "to:by:",
  3491. category: 'converting',
  3492. fn: function (stop,step){
  3493. var self=this;
  3494. var array,value,pos;
  3495. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  3496. value=self;
  3497. array=_st((smalltalk.Array || Array))._new();
  3498. pos=(1);
  3499. $1=_st(step).__eq((0));
  3500. if(smalltalk.assert($1)){
  3501. _st(self)._error_("step must be non-zero");
  3502. };
  3503. $2=_st(step).__lt((0));
  3504. if(smalltalk.assert($2)){
  3505. _st((function(){
  3506. return smalltalk.withContext(function($ctx2) { return _st(value).__gt_eq(stop);
  3507. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  3508. return smalltalk.withContext(function($ctx2) { _st(array)._at_put_(pos,value);
  3509. pos=_st(pos).__plus((1));
  3510. pos;
  3511. value=_st(value).__plus(step);
  3512. return value;
  3513. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3514. } else {
  3515. _st((function(){
  3516. return smalltalk.withContext(function($ctx2) { return _st(value).__lt_eq(stop);
  3517. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  3518. return smalltalk.withContext(function($ctx2) { _st(array)._at_put_(pos,value);
  3519. pos=_st(pos).__plus((1));
  3520. pos;
  3521. value=_st(value).__plus(step);
  3522. return value;
  3523. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3524. };
  3525. $3=array;
  3526. return $3;
  3527. }, function($ctx1) {$ctx1.fill(self,"to:by:",{stop:stop,step:step,array:array,value:value,pos:pos}, smalltalk.Number)})},
  3528. args: ["stop", "step"],
  3529. source: "to: stop by: step\x0a\x09| array value pos |\x0a\x09value := self.\x0a\x09array := Array new.\x0a\x09pos := 1.\x0a\x09step = 0 ifTrue: [self error: 'step must be non-zero'].\x0a\x09step < 0\x0a\x09\x09ifTrue: [[ value >= stop ] whileTrue: [\x0a\x09 \x09\x09\x09array at: pos put: value.\x0a\x09 \x09\x09\x09pos := pos + 1.\x0a\x09 \x09\x09\x09value := value + step]]\x0a\x09\x09ifFalse: [[ value <= stop ] whileTrue: [\x0a\x09 \x09\x09\x09array at: pos put: value.\x0a\x09 \x09\x09\x09pos := pos + 1.\x0a\x09 \x09\x09\x09value := value + step]].\x0a\x09^array",
  3530. messageSends: ["new", "ifTrue:", "error:", "=", "ifTrue:ifFalse:", "whileTrue:", "at:put:", "+", ">=", "<=", "<"],
  3531. referencedClasses: ["Array"]
  3532. }),
  3533. smalltalk.Number);
  3534. smalltalk.addMethod(
  3535. "_to_by_do_",
  3536. smalltalk.method({
  3537. selector: "to:by:do:",
  3538. category: 'enumerating',
  3539. fn: function (stop,step,aBlock){
  3540. var self=this;
  3541. var value;
  3542. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3543. value=self;
  3544. $1=_st(step).__eq((0));
  3545. if(smalltalk.assert($1)){
  3546. _st(self)._error_("step must be non-zero");
  3547. };
  3548. $2=_st(step).__lt((0));
  3549. if(smalltalk.assert($2)){
  3550. _st((function(){
  3551. return smalltalk.withContext(function($ctx2) { return _st(value).__gt_eq(stop);
  3552. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  3553. return smalltalk.withContext(function($ctx2) { _st(aBlock)._value_(value);
  3554. value=_st(value).__plus(step);
  3555. return value;
  3556. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3557. } else {
  3558. _st((function(){
  3559. return smalltalk.withContext(function($ctx2) { return _st(value).__lt_eq(stop);
  3560. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  3561. return smalltalk.withContext(function($ctx2) { _st(aBlock)._value_(value);
  3562. value=_st(value).__plus(step);
  3563. return value;
  3564. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3565. };
  3566. return self}, function($ctx1) {$ctx1.fill(self,"to:by:do:",{stop:stop,step:step,aBlock:aBlock,value:value}, smalltalk.Number)})},
  3567. args: ["stop", "step", "aBlock"],
  3568. source: "to: stop by: step do: aBlock\x0a\x09| value |\x0a\x09value := self.\x0a\x09step = 0 ifTrue: [self error: 'step must be non-zero'].\x0a\x09step < 0\x0a\x09\x09ifTrue: [[ value >= stop ] whileTrue: [\x0a\x09 \x09\x09\x09aBlock value: value.\x0a\x09 \x09\x09\x09value := value + step]]\x0a\x09\x09ifFalse: [[ value <= stop ] whileTrue: [\x0a\x09 \x09\x09\x09aBlock value: value.\x0a\x09 \x09\x09\x09value := value + step]]",
  3569. messageSends: ["ifTrue:", "error:", "=", "ifTrue:ifFalse:", "whileTrue:", "value:", "+", ">=", "<=", "<"],
  3570. referencedClasses: []
  3571. }),
  3572. smalltalk.Number);
  3573. smalltalk.addMethod(
  3574. "_to_do_",
  3575. smalltalk.method({
  3576. selector: "to:do:",
  3577. category: 'enumerating',
  3578. fn: function (stop,aBlock){
  3579. var self=this;
  3580. var nextValue;
  3581. return smalltalk.withContext(function($ctx1) { nextValue=self;
  3582. _st((function(){
  3583. return smalltalk.withContext(function($ctx2) { return _st(nextValue).__lt_eq(stop);
  3584. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  3585. return smalltalk.withContext(function($ctx2) { _st(aBlock)._value_(nextValue);
  3586. nextValue=_st(nextValue).__plus((1));
  3587. return nextValue;
  3588. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3589. return self}, function($ctx1) {$ctx1.fill(self,"to:do:",{stop:stop,aBlock:aBlock,nextValue:nextValue}, smalltalk.Number)})},
  3590. args: ["stop", "aBlock"],
  3591. source: "to: stop do: aBlock\x0a\x09\x22Evaluate aBlock for each number from self to aNumber.\x22\x0a\x09| nextValue |\x0a\x09nextValue := self.\x0a\x09[nextValue <= stop]\x0a\x09\x09whileTrue: \x0a\x09\x09\x09[aBlock value: nextValue.\x0a\x09\x09\x09nextValue := nextValue + 1]",
  3592. messageSends: ["whileTrue:", "value:", "+", "<="],
  3593. referencedClasses: []
  3594. }),
  3595. smalltalk.Number);
  3596. smalltalk.addMethod(
  3597. "_truncated",
  3598. smalltalk.method({
  3599. selector: "truncated",
  3600. category: 'converting',
  3601. fn: function (){
  3602. var self=this;
  3603. return smalltalk.withContext(function($ctx1) {
  3604. if(self >= 0) {
  3605. return Math.floor(self);
  3606. } else {
  3607. return Math.floor(self * (-1)) * (-1);
  3608. };
  3609. ;
  3610. return self}, function($ctx1) {$ctx1.fill(self,"truncated",{}, smalltalk.Number)})},
  3611. args: [],
  3612. source: "truncated\x0a\x09<\x0a \x09if(self >>= 0) {\x0a \x09return Math.floor(self);\x0a } else {\x0a \x09return Math.floor(self * (-1)) * (-1);\x0a };\x0a >",
  3613. messageSends: [],
  3614. referencedClasses: []
  3615. }),
  3616. smalltalk.Number);
  3617. smalltalk.addMethod(
  3618. "__or",
  3619. smalltalk.method({
  3620. selector: "|",
  3621. category: 'converting',
  3622. fn: function (aNumber){
  3623. var self=this;
  3624. return smalltalk.withContext(function($ctx1) { return self | aNumber;
  3625. return self}, function($ctx1) {$ctx1.fill(self,"|",{aNumber:aNumber}, smalltalk.Number)})},
  3626. args: ["aNumber"],
  3627. source: "| aNumber\x0a\x09<return self | aNumber>",
  3628. messageSends: [],
  3629. referencedClasses: []
  3630. }),
  3631. smalltalk.Number);
  3632. smalltalk.addMethod(
  3633. "_pi",
  3634. smalltalk.method({
  3635. selector: "pi",
  3636. category: 'instance creation',
  3637. fn: function (){
  3638. var self=this;
  3639. return smalltalk.withContext(function($ctx1) { return Math.PI;
  3640. return self}, function($ctx1) {$ctx1.fill(self,"pi",{}, smalltalk.Number.klass)})},
  3641. args: [],
  3642. source: "pi\x0a\x09<return Math.PI>",
  3643. messageSends: [],
  3644. referencedClasses: []
  3645. }),
  3646. smalltalk.Number.klass);
  3647. smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Objects');
  3648. smalltalk.addMethod(
  3649. "_addElement_",
  3650. smalltalk.method({
  3651. selector: "addElement:",
  3652. category: 'accessing',
  3653. fn: function (anObject){
  3654. var self=this;
  3655. return smalltalk.withContext(function($ctx1) { self.elements.addElement(anObject);
  3656. return self}, function($ctx1) {$ctx1.fill(self,"addElement:",{anObject:anObject}, smalltalk.Organizer)})},
  3657. args: ["anObject"],
  3658. source: "addElement: anObject\x0a\x09<self.elements.addElement(anObject)>",
  3659. messageSends: [],
  3660. referencedClasses: []
  3661. }),
  3662. smalltalk.Organizer);
  3663. smalltalk.addMethod(
  3664. "_elements",
  3665. smalltalk.method({
  3666. selector: "elements",
  3667. category: 'accessing',
  3668. fn: function (){
  3669. var self=this;
  3670. return smalltalk.withContext(function($ctx1) { var $1;
  3671. $1=_st(_st(self)._basicAt_("elements"))._copy();
  3672. return $1;
  3673. }, function($ctx1) {$ctx1.fill(self,"elements",{}, smalltalk.Organizer)})},
  3674. args: [],
  3675. source: "elements\x0a\x09^ (self basicAt: 'elements') copy",
  3676. messageSends: ["copy", "basicAt:"],
  3677. referencedClasses: []
  3678. }),
  3679. smalltalk.Organizer);
  3680. smalltalk.addMethod(
  3681. "_removeElement_",
  3682. smalltalk.method({
  3683. selector: "removeElement:",
  3684. category: 'accessing',
  3685. fn: function (anObject){
  3686. var self=this;
  3687. return smalltalk.withContext(function($ctx1) { self.elements.removeElement(anObject);
  3688. return self}, function($ctx1) {$ctx1.fill(self,"removeElement:",{anObject:anObject}, smalltalk.Organizer)})},
  3689. args: ["anObject"],
  3690. source: "removeElement: anObject\x0a\x09<self.elements.removeElement(anObject)>",
  3691. messageSends: [],
  3692. referencedClasses: []
  3693. }),
  3694. smalltalk.Organizer);
  3695. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  3696. smalltalk.Package.comment="A Package is similar to a \x22class category\x22 typically found in other Smalltalks like Pharo or Squeak. Amber does not have class categories anymore, it had in the beginning but now each class in the system knows which package it belongs to.\x0a\x0aA Package has a name, an Array of \x22requires\x22, a comment and a Dictionary with other optional key value attributes. A Package can also be queried for its classes, but it will then resort to a reverse scan of all classes to find them.\x0aPackages are manipulated through \x22Smalltalk current\x22, like for example finding one based on a name:\x0a\x0a\x09Smalltalk current packageAt: 'Kernel'\x0a\x0a...but you can also use:\x0a\x0a\x09Package named: 'Kernel'\x0a\x0aA Package differs slightly from a Monticello package which can span multiple class categories using a naming convention based on hyphenation. But just as in Monticello a Package supports \x22class extensions\x22 so a Package\x0acan define behaviors in foreign classes using a naming convention for method categories where the category starts with an asterisk and then the name of the owning package follows. This can easily be seen in for example class\x0aString where the method category \x22*IDE\x22 defines #inspectOn: which thus is a method belonging to the IDE package.\x0a\x0aYou can fetch a package from the server:\x0a\x0a\x09Package fetch: 'Additional-Examples'"
  3697. smalltalk.addMethod(
  3698. "_classes",
  3699. smalltalk.method({
  3700. selector: "classes",
  3701. category: 'classes',
  3702. fn: function (){
  3703. var self=this;
  3704. return smalltalk.withContext(function($ctx1) { var $1;
  3705. $1=_st(_st(self)._organization())._elements();
  3706. return $1;
  3707. }, function($ctx1) {$ctx1.fill(self,"classes",{}, smalltalk.Package)})},
  3708. args: [],
  3709. source: "classes\x0a\x09^ self organization elements",
  3710. messageSends: ["elements", "organization"],
  3711. referencedClasses: []
  3712. }),
  3713. smalltalk.Package);
  3714. smalltalk.addMethod(
  3715. "_commitPathJs",
  3716. smalltalk.method({
  3717. selector: "commitPathJs",
  3718. category: 'accessing',
  3719. fn: function (){
  3720. var self=this;
  3721. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3722. $2=self["@commitPathJs"];
  3723. if(($receiver = $2) == nil || $receiver == undefined){
  3724. $1=_st(_st(self)._class())._defaultCommitPathJs();
  3725. } else {
  3726. $1=$2;
  3727. };
  3728. return $1;
  3729. }, function($ctx1) {$ctx1.fill(self,"commitPathJs",{}, smalltalk.Package)})},
  3730. args: [],
  3731. source: "commitPathJs\x0a\x09^ commitPathJs ifNil: [self class defaultCommitPathJs]",
  3732. messageSends: ["ifNil:", "defaultCommitPathJs", "class"],
  3733. referencedClasses: []
  3734. }),
  3735. smalltalk.Package);
  3736. smalltalk.addMethod(
  3737. "_commitPathJs_",
  3738. smalltalk.method({
  3739. selector: "commitPathJs:",
  3740. category: 'accessing',
  3741. fn: function (aString){
  3742. var self=this;
  3743. return smalltalk.withContext(function($ctx1) { self["@commitPathJs"]=aString;
  3744. return self}, function($ctx1) {$ctx1.fill(self,"commitPathJs:",{aString:aString}, smalltalk.Package)})},
  3745. args: ["aString"],
  3746. source: "commitPathJs: aString\x0a\x09commitPathJs := aString",
  3747. messageSends: [],
  3748. referencedClasses: []
  3749. }),
  3750. smalltalk.Package);
  3751. smalltalk.addMethod(
  3752. "_commitPathSt",
  3753. smalltalk.method({
  3754. selector: "commitPathSt",
  3755. category: 'accessing',
  3756. fn: function (){
  3757. var self=this;
  3758. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3759. $2=self["@commitPathSt"];
  3760. if(($receiver = $2) == nil || $receiver == undefined){
  3761. $1=_st(_st(self)._class())._defaultCommitPathSt();
  3762. } else {
  3763. $1=$2;
  3764. };
  3765. return $1;
  3766. }, function($ctx1) {$ctx1.fill(self,"commitPathSt",{}, smalltalk.Package)})},
  3767. args: [],
  3768. source: "commitPathSt\x0a\x09^ commitPathSt ifNil: [self class defaultCommitPathSt]",
  3769. messageSends: ["ifNil:", "defaultCommitPathSt", "class"],
  3770. referencedClasses: []
  3771. }),
  3772. smalltalk.Package);
  3773. smalltalk.addMethod(
  3774. "_commitPathSt_",
  3775. smalltalk.method({
  3776. selector: "commitPathSt:",
  3777. category: 'accessing',
  3778. fn: function (aString){
  3779. var self=this;
  3780. return smalltalk.withContext(function($ctx1) { self["@commitPathSt"]=aString;
  3781. return self}, function($ctx1) {$ctx1.fill(self,"commitPathSt:",{aString:aString}, smalltalk.Package)})},
  3782. args: ["aString"],
  3783. source: "commitPathSt: aString\x0a\x09commitPathSt := aString",
  3784. messageSends: [],
  3785. referencedClasses: []
  3786. }),
  3787. smalltalk.Package);
  3788. smalltalk.addMethod(
  3789. "_dependencies",
  3790. smalltalk.method({
  3791. selector: "dependencies",
  3792. category: 'accessing',
  3793. fn: function (){
  3794. var self=this;
  3795. return smalltalk.withContext(function($ctx1) { var $1;
  3796. $1=_st(self)._propertyAt_ifAbsent_("dependencies",(function(){
  3797. return smalltalk.withContext(function($ctx2) { return [];
  3798. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3799. return $1;
  3800. }, function($ctx1) {$ctx1.fill(self,"dependencies",{}, smalltalk.Package)})},
  3801. args: [],
  3802. source: "dependencies\x0a\x09^self propertyAt: 'dependencies' ifAbsent: [#()]",
  3803. messageSends: ["propertyAt:ifAbsent:"],
  3804. referencedClasses: []
  3805. }),
  3806. smalltalk.Package);
  3807. smalltalk.addMethod(
  3808. "_dependencies_",
  3809. smalltalk.method({
  3810. selector: "dependencies:",
  3811. category: 'accessing',
  3812. fn: function (anArray){
  3813. var self=this;
  3814. return smalltalk.withContext(function($ctx1) { var $1;
  3815. $1=_st(self)._propertyAt_put_("dependencies",anArray);
  3816. return $1;
  3817. }, function($ctx1) {$ctx1.fill(self,"dependencies:",{anArray:anArray}, smalltalk.Package)})},
  3818. args: ["anArray"],
  3819. source: "dependencies: anArray\x0a\x09^self propertyAt: 'dependencies' put: anArray",
  3820. messageSends: ["propertyAt:put:"],
  3821. referencedClasses: []
  3822. }),
  3823. smalltalk.Package);
  3824. smalltalk.addMethod(
  3825. "_jsProperties",
  3826. smalltalk.method({
  3827. selector: "jsProperties",
  3828. category: 'private',
  3829. fn: function (){
  3830. var self=this;
  3831. return smalltalk.withContext(function($ctx1) { return self.properties;
  3832. return self}, function($ctx1) {$ctx1.fill(self,"jsProperties",{}, smalltalk.Package)})},
  3833. args: [],
  3834. source: "jsProperties\x0a\x09<return self.properties>",
  3835. messageSends: [],
  3836. referencedClasses: []
  3837. }),
  3838. smalltalk.Package);
  3839. smalltalk.addMethod(
  3840. "_jsProperties_",
  3841. smalltalk.method({
  3842. selector: "jsProperties:",
  3843. category: 'private',
  3844. fn: function (aJSObject){
  3845. var self=this;
  3846. return smalltalk.withContext(function($ctx1) { return self.properties = aJSObject;
  3847. return self}, function($ctx1) {$ctx1.fill(self,"jsProperties:",{aJSObject:aJSObject}, smalltalk.Package)})},
  3848. args: ["aJSObject"],
  3849. source: "jsProperties: aJSObject\x0a\x09<return self.properties = aJSObject>",
  3850. messageSends: [],
  3851. referencedClasses: []
  3852. }),
  3853. smalltalk.Package);
  3854. smalltalk.addMethod(
  3855. "_name",
  3856. smalltalk.method({
  3857. selector: "name",
  3858. category: 'accessing',
  3859. fn: function (){
  3860. var self=this;
  3861. return smalltalk.withContext(function($ctx1) { return self.pkgName;
  3862. return self}, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.Package)})},
  3863. args: [],
  3864. source: "name\x0a\x09<return self.pkgName>",
  3865. messageSends: [],
  3866. referencedClasses: []
  3867. }),
  3868. smalltalk.Package);
  3869. smalltalk.addMethod(
  3870. "_name_",
  3871. smalltalk.method({
  3872. selector: "name:",
  3873. category: 'accessing',
  3874. fn: function (aString){
  3875. var self=this;
  3876. return smalltalk.withContext(function($ctx1) { self.pkgName = aString;
  3877. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString}, smalltalk.Package)})},
  3878. args: ["aString"],
  3879. source: "name: aString\x0a\x09<self.pkgName = aString>",
  3880. messageSends: [],
  3881. referencedClasses: []
  3882. }),
  3883. smalltalk.Package);
  3884. smalltalk.addMethod(
  3885. "_organization",
  3886. smalltalk.method({
  3887. selector: "organization",
  3888. category: 'accessing',
  3889. fn: function (){
  3890. var self=this;
  3891. return smalltalk.withContext(function($ctx1) { var $1;
  3892. $1=_st(self)._basicAt_("organization");
  3893. return $1;
  3894. }, function($ctx1) {$ctx1.fill(self,"organization",{}, smalltalk.Package)})},
  3895. args: [],
  3896. source: "organization\x0a\x09^ self basicAt: 'organization'",
  3897. messageSends: ["basicAt:"],
  3898. referencedClasses: []
  3899. }),
  3900. smalltalk.Package);
  3901. smalltalk.addMethod(
  3902. "_printString",
  3903. smalltalk.method({
  3904. selector: "printString",
  3905. category: 'printing',
  3906. fn: function (){
  3907. var self=this;
  3908. return smalltalk.withContext(function($ctx1) { var $1;
  3909. $1=_st(self)._name();
  3910. return $1;
  3911. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Package)})},
  3912. args: [],
  3913. source: "printString\x0a\x09^self name",
  3914. messageSends: ["name"],
  3915. referencedClasses: []
  3916. }),
  3917. smalltalk.Package);
  3918. smalltalk.addMethod(
  3919. "_properties",
  3920. smalltalk.method({
  3921. selector: "properties",
  3922. category: 'accessing',
  3923. fn: function (){
  3924. var self=this;
  3925. return smalltalk.withContext(function($ctx1) { var $1;
  3926. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._readJSObject_(_st(self)._basicAt_("properties"));
  3927. return $1;
  3928. }, function($ctx1) {$ctx1.fill(self,"properties",{}, smalltalk.Package)})},
  3929. args: [],
  3930. source: "properties\x0a\x09^Smalltalk current readJSObject: (self basicAt: 'properties')",
  3931. messageSends: ["readJSObject:", "basicAt:", "current"],
  3932. referencedClasses: ["Smalltalk"]
  3933. }),
  3934. smalltalk.Package);
  3935. smalltalk.addMethod(
  3936. "_propertiesAsJSON",
  3937. smalltalk.method({
  3938. selector: "propertiesAsJSON",
  3939. category: 'private',
  3940. fn: function (){
  3941. var self=this;
  3942. return smalltalk.withContext(function($ctx1) { return JSON.stringify(self.properties);
  3943. return self}, function($ctx1) {$ctx1.fill(self,"propertiesAsJSON",{}, smalltalk.Package)})},
  3944. args: [],
  3945. source: "propertiesAsJSON\x0a\x09<return JSON.stringify(self.properties)>",
  3946. messageSends: [],
  3947. referencedClasses: []
  3948. }),
  3949. smalltalk.Package);
  3950. smalltalk.addMethod(
  3951. "_propertyAt_",
  3952. smalltalk.method({
  3953. selector: "propertyAt:",
  3954. category: 'properties',
  3955. fn: function (key){
  3956. var self=this;
  3957. return smalltalk.withContext(function($ctx1) { return self.properties[key];
  3958. return self}, function($ctx1) {$ctx1.fill(self,"propertyAt:",{key:key}, smalltalk.Package)})},
  3959. args: ["key"],
  3960. source: "propertyAt: key\x0a\x0a\x09<return self.properties[key]>",
  3961. messageSends: [],
  3962. referencedClasses: []
  3963. }),
  3964. smalltalk.Package);
  3965. smalltalk.addMethod(
  3966. "_propertyAt_ifAbsent_",
  3967. smalltalk.method({
  3968. selector: "propertyAt:ifAbsent:",
  3969. category: 'properties',
  3970. fn: function (key,block){
  3971. var self=this;
  3972. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3973. $2=_st(self)._propertyAt_(key);
  3974. if(($receiver = $2) == nil || $receiver == undefined){
  3975. $1=_st(block)._value();
  3976. } else {
  3977. $1=$2;
  3978. };
  3979. return $1;
  3980. }, function($ctx1) {$ctx1.fill(self,"propertyAt:ifAbsent:",{key:key,block:block}, smalltalk.Package)})},
  3981. args: ["key", "block"],
  3982. source: "propertyAt: key ifAbsent: block\x0a\x0a\x09^(self propertyAt: key) ifNil: [block value]",
  3983. messageSends: ["ifNil:", "value", "propertyAt:"],
  3984. referencedClasses: []
  3985. }),
  3986. smalltalk.Package);
  3987. smalltalk.addMethod(
  3988. "_propertyAt_put_",
  3989. smalltalk.method({
  3990. selector: "propertyAt:put:",
  3991. category: 'properties',
  3992. fn: function (key,value){
  3993. var self=this;
  3994. return smalltalk.withContext(function($ctx1) { return self.properties[key] = value;
  3995. return self}, function($ctx1) {$ctx1.fill(self,"propertyAt:put:",{key:key,value:value}, smalltalk.Package)})},
  3996. args: ["key", "value"],
  3997. source: "propertyAt: key put: value\x0a\x0a\x09<return self.properties[key] = value>",
  3998. messageSends: [],
  3999. referencedClasses: []
  4000. }),
  4001. smalltalk.Package);
  4002. smalltalk.addMethod(
  4003. "_setupClasses",
  4004. smalltalk.method({
  4005. selector: "setupClasses",
  4006. category: 'classes',
  4007. fn: function (){
  4008. var self=this;
  4009. return smalltalk.withContext(function($ctx1) { var $1,$2;
  4010. $1=_st(self)._classes();
  4011. _st($1)._do_((function(each){
  4012. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._setupClass_(each);
  4013. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4014. $2=_st($1)._do_((function(each){
  4015. return smalltalk.withContext(function($ctx2) { return _st(each)._initialize();
  4016. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4017. return self}, function($ctx1) {$ctx1.fill(self,"setupClasses",{}, smalltalk.Package)})},
  4018. args: [],
  4019. source: "setupClasses\x0a\x09self classes\x0a\x09\x09do: [ :each | ClassBuilder new setupClass: each ];\x0a\x09\x09do: [ :each | each initialize ]",
  4020. messageSends: ["do:", "setupClass:", "new", "classes", "initialize"],
  4021. referencedClasses: ["ClassBuilder"]
  4022. }),
  4023. smalltalk.Package);
  4024. smalltalk.addMethod(
  4025. "_sortedClasses",
  4026. smalltalk.method({
  4027. selector: "sortedClasses",
  4028. category: 'classes',
  4029. fn: function (){
  4030. var self=this;
  4031. return smalltalk.withContext(function($ctx1) { var $1;
  4032. $1=_st(_st(self)._class())._sortedClasses_(_st(self)._classes());
  4033. return $1;
  4034. }, function($ctx1) {$ctx1.fill(self,"sortedClasses",{}, smalltalk.Package)})},
  4035. args: [],
  4036. source: "sortedClasses\x0a\x09\x22Answer all classes in the receiver, sorted by superclass/subclasses and by class name for common subclasses (Issue #143).\x22\x0a\x0a\x09^self class sortedClasses: self classes",
  4037. messageSends: ["sortedClasses:", "classes", "class"],
  4038. referencedClasses: []
  4039. }),
  4040. smalltalk.Package);
  4041. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  4042. smalltalk.addMethod(
  4043. "_commitPathsFromLoader",
  4044. smalltalk.method({
  4045. selector: "commitPathsFromLoader",
  4046. category: 'commit paths',
  4047. fn: function (){
  4048. var self=this;
  4049. return smalltalk.withContext(function($ctx1) {
  4050. var cp = smalltalk['@@commitPath'];
  4051. if (!cp) return;
  4052. if (cp.js) self._defaultCommitPathJs_(cp.js);
  4053. if (cp.st) self._defaultCommitPathSt_(cp.st);
  4054. ;
  4055. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{}, smalltalk.Package.klass)})},
  4056. args: [],
  4057. source: "commitPathsFromLoader\x0a <\x0a var cp = smalltalk['@@commitPath'];\x0a if (!cp) return;\x0a if (cp.js) self._defaultCommitPathJs_(cp.js);\x0a if (cp.st) self._defaultCommitPathSt_(cp.st);\x0a >",
  4058. messageSends: [],
  4059. referencedClasses: []
  4060. }),
  4061. smalltalk.Package.klass);
  4062. smalltalk.addMethod(
  4063. "_defaultCommitPathJs",
  4064. smalltalk.method({
  4065. selector: "defaultCommitPathJs",
  4066. category: 'commit paths',
  4067. fn: function (){
  4068. var self=this;
  4069. return smalltalk.withContext(function($ctx1) { var $2,$1;
  4070. $2=self["@defaultCommitPathJs"];
  4071. if(($receiver = $2) == nil || $receiver == undefined){
  4072. self["@defaultCommitPathJs"]="js";
  4073. $1=self["@defaultCommitPathJs"];
  4074. } else {
  4075. $1=$2;
  4076. };
  4077. return $1;
  4078. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs",{}, smalltalk.Package.klass)})},
  4079. args: [],
  4080. source: "defaultCommitPathJs\x0a\x09^ defaultCommitPathJs ifNil: [ defaultCommitPathJs := 'js']",
  4081. messageSends: ["ifNil:"],
  4082. referencedClasses: []
  4083. }),
  4084. smalltalk.Package.klass);
  4085. smalltalk.addMethod(
  4086. "_defaultCommitPathJs_",
  4087. smalltalk.method({
  4088. selector: "defaultCommitPathJs:",
  4089. category: 'commit paths',
  4090. fn: function (aString){
  4091. var self=this;
  4092. return smalltalk.withContext(function($ctx1) { self["@defaultCommitPathJs"]=aString;
  4093. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs:",{aString:aString}, smalltalk.Package.klass)})},
  4094. args: ["aString"],
  4095. source: "defaultCommitPathJs: aString\x0a\x09defaultCommitPathJs := aString",
  4096. messageSends: [],
  4097. referencedClasses: []
  4098. }),
  4099. smalltalk.Package.klass);
  4100. smalltalk.addMethod(
  4101. "_defaultCommitPathSt",
  4102. smalltalk.method({
  4103. selector: "defaultCommitPathSt",
  4104. category: 'commit paths',
  4105. fn: function (){
  4106. var self=this;
  4107. return smalltalk.withContext(function($ctx1) { var $2,$1;
  4108. $2=self["@defaultCommitPathSt"];
  4109. if(($receiver = $2) == nil || $receiver == undefined){
  4110. self["@defaultCommitPathSt"]="st";
  4111. $1=self["@defaultCommitPathSt"];
  4112. } else {
  4113. $1=$2;
  4114. };
  4115. return $1;
  4116. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt",{}, smalltalk.Package.klass)})},
  4117. args: [],
  4118. source: "defaultCommitPathSt\x0a\x09^ defaultCommitPathSt ifNil: [ defaultCommitPathSt := 'st']",
  4119. messageSends: ["ifNil:"],
  4120. referencedClasses: []
  4121. }),
  4122. smalltalk.Package.klass);
  4123. smalltalk.addMethod(
  4124. "_defaultCommitPathSt_",
  4125. smalltalk.method({
  4126. selector: "defaultCommitPathSt:",
  4127. category: 'commit paths',
  4128. fn: function (aString){
  4129. var self=this;
  4130. return smalltalk.withContext(function($ctx1) { self["@defaultCommitPathSt"]=aString;
  4131. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt:",{aString:aString}, smalltalk.Package.klass)})},
  4132. args: ["aString"],
  4133. source: "defaultCommitPathSt: aString\x0a\x09defaultCommitPathSt := aString",
  4134. messageSends: [],
  4135. referencedClasses: []
  4136. }),
  4137. smalltalk.Package.klass);
  4138. smalltalk.addMethod(
  4139. "_fetch_",
  4140. smalltalk.method({
  4141. selector: "fetch:",
  4142. category: 'loading-storing',
  4143. fn: function (aPackageName){
  4144. var self=this;
  4145. return smalltalk.withContext(function($ctx1) { _st(self)._fetch_prefix_(aPackageName,_st(_st(self)._defaultCommitPathJs()).__comma("/"));
  4146. return self}, function($ctx1) {$ctx1.fill(self,"fetch:",{aPackageName:aPackageName}, smalltalk.Package.klass)})},
  4147. args: ["aPackageName"],
  4148. source: "fetch: aPackageName\x0a\x09self fetch: aPackageName prefix: self defaultCommitPathJs, '/'",
  4149. messageSends: ["fetch:prefix:", ",", "defaultCommitPathJs"],
  4150. referencedClasses: []
  4151. }),
  4152. smalltalk.Package.klass);
  4153. smalltalk.addMethod(
  4154. "_fetch_prefix_",
  4155. smalltalk.method({
  4156. selector: "fetch:prefix:",
  4157. category: 'loading-storing',
  4158. fn: function (aPackageName,aPrefix){
  4159. var self=this;
  4160. return smalltalk.withContext(function($ctx1) { _st(jQuery)._getScript_onSuccess_(_st(_st(aPrefix).__comma(aPackageName)).__comma(".js"),(function(){
  4161. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Package || Package))._named_(aPackageName))._setupClasses();
  4162. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4163. return self}, function($ctx1) {$ctx1.fill(self,"fetch:prefix:",{aPackageName:aPackageName,aPrefix:aPrefix}, smalltalk.Package.klass)})},
  4164. args: ["aPackageName", "aPrefix"],
  4165. source: "fetch: aPackageName prefix: aPrefix\x0a\x09jQuery \x0a \x09getScript: (aPrefix , aPackageName , '.js') \x0a onSuccess: [ \x0a \x09(Package named: aPackageName) setupClasses ]",
  4166. messageSends: ["getScript:onSuccess:", ",", "setupClasses", "named:"],
  4167. referencedClasses: ["Package"]
  4168. }),
  4169. smalltalk.Package.klass);
  4170. smalltalk.addMethod(
  4171. "_initialize",
  4172. smalltalk.method({
  4173. selector: "initialize",
  4174. category: 'initialization',
  4175. fn: function (){
  4176. var self=this;
  4177. return smalltalk.withContext(function($ctx1) { smalltalk.Object.klass.fn.prototype._initialize.apply(_st(self), []);
  4178. _st(self)._commitPathsFromLoader();
  4179. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Package.klass)})},
  4180. args: [],
  4181. source: "initialize\x0a\x09super initialize.\x0a self commitPathsFromLoader",
  4182. messageSends: ["initialize", "commitPathsFromLoader"],
  4183. referencedClasses: []
  4184. }),
  4185. smalltalk.Package.klass);
  4186. smalltalk.addMethod(
  4187. "_named_",
  4188. smalltalk.method({
  4189. selector: "named:",
  4190. category: 'accessing',
  4191. fn: function (aPackageName){
  4192. var self=this;
  4193. return smalltalk.withContext(function($ctx1) { var $1;
  4194. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_(aPackageName);
  4195. return $1;
  4196. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName}, smalltalk.Package.klass)})},
  4197. args: ["aPackageName"],
  4198. source: "named: aPackageName\x0a\x0a\x09^Smalltalk current packageAt: aPackageName",
  4199. messageSends: ["packageAt:", "current"],
  4200. referencedClasses: ["Smalltalk"]
  4201. }),
  4202. smalltalk.Package.klass);
  4203. smalltalk.addMethod(
  4204. "_named_ifAbsent_",
  4205. smalltalk.method({
  4206. selector: "named:ifAbsent:",
  4207. category: 'accessing',
  4208. fn: function (aPackageName,aBlock){
  4209. var self=this;
  4210. return smalltalk.withContext(function($ctx1) { var $1;
  4211. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_ifAbsent_(aPackageName,aBlock);
  4212. return $1;
  4213. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock}, smalltalk.Package.klass)})},
  4214. args: ["aPackageName", "aBlock"],
  4215. source: "named: aPackageName ifAbsent: aBlock\x0a\x0a\x09^Smalltalk current packageAt: aPackageName ifAbsent: aBlock",
  4216. messageSends: ["packageAt:ifAbsent:", "current"],
  4217. referencedClasses: ["Smalltalk"]
  4218. }),
  4219. smalltalk.Package.klass);
  4220. smalltalk.addMethod(
  4221. "_resetCommitPaths",
  4222. smalltalk.method({
  4223. selector: "resetCommitPaths",
  4224. category: 'commit paths',
  4225. fn: function (){
  4226. var self=this;
  4227. return smalltalk.withContext(function($ctx1) { self["@defaultCommitPathJs"]=nil;
  4228. self["@defaultCommitPathSt"]=nil;
  4229. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{}, smalltalk.Package.klass)})},
  4230. args: [],
  4231. source: "resetCommitPaths\x0a defaultCommitPathJs := nil.\x0a defaultCommitPathSt := nil.",
  4232. messageSends: [],
  4233. referencedClasses: []
  4234. }),
  4235. smalltalk.Package.klass);
  4236. smalltalk.addMethod(
  4237. "_sortedClasses_",
  4238. smalltalk.method({
  4239. selector: "sortedClasses:",
  4240. category: 'sorting',
  4241. fn: function (classes){
  4242. var self=this;
  4243. var children,others,nodes,expandedClasses;
  4244. return smalltalk.withContext(function($ctx1) { var $1,$2;
  4245. children=[];
  4246. others=[];
  4247. _st(classes)._do_((function(each){
  4248. return smalltalk.withContext(function($ctx2) { $1=_st(classes)._includes_(_st(each)._superclass());
  4249. if(smalltalk.assert($1)){
  4250. return _st(others)._add_(each);
  4251. } else {
  4252. return _st(children)._add_(each);
  4253. };
  4254. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4255. nodes=_st(children)._collect_((function(each){
  4256. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.ClassSorterNode || ClassSorterNode))._on_classes_level_(each,others,(0));
  4257. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4258. nodes=_st(nodes)._sorted_((function(a,b){
  4259. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  4260. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  4261. expandedClasses=_st((smalltalk.Array || Array))._new();
  4262. _st(nodes)._do_((function(aNode){
  4263. return smalltalk.withContext(function($ctx2) { return _st(aNode)._traverseClassesWith_(expandedClasses);
  4264. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  4265. $2=expandedClasses;
  4266. return $2;
  4267. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses}, smalltalk.Package.klass)})},
  4268. args: ["classes"],
  4269. source: "sortedClasses: classes\x0a\x09\x22Answer classes, sorted by superclass/subclasses and by class name for common subclasses (Issue #143)\x22\x0a\x0a\x09| children others nodes expandedClasses |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09classes do: [:each |\x0a\x09\x09(classes includes: each superclass)\x0a\x09\x09\x09ifFalse: [children add: each]\x0a\x09\x09\x09ifTrue: [others add: each]].\x0a\x09nodes := children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: 0].\x0a\x09nodes := nodes sorted: [:a :b | a theClass name <= b theClass name ].\x0a\x09expandedClasses := Array new.\x0a\x09nodes do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: expandedClasses].\x0a\x09^expandedClasses",
  4270. messageSends: ["do:", "ifFalse:ifTrue:", "add:", "includes:", "superclass", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"],
  4271. referencedClasses: ["ClassSorterNode", "Array"]
  4272. }),
  4273. smalltalk.Package.klass);
  4274. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  4275. smalltalk.Point.comment="A `Point` represents an x-y pair of numbers usually designating a geometric coordinate.\x0aPoints are traditionally created using the binary `#@` message to a number:\x0a\x0a\x09100@120\x0a\x0aPoints can then be arithmetically manipulated:\x0a\x0a\x09100@100 + (10@10)\x0a\x0a...or for example:\x0a\x0a\x09(100@100) * 2\x0a\x0a**NOTE:** Creating a Point with a negative y-value will need a space after `@` in order to avoid a parsing error:\x0a\x0a\x09100@ -100 \x22but 100@-100 would not parse\x22\x0a\x0aAmber does not have much behavior in this class out-of-the-box."
  4276. smalltalk.addMethod(
  4277. "__star",
  4278. smalltalk.method({
  4279. selector: "*",
  4280. category: 'arithmetic',
  4281. fn: function (aPoint){
  4282. var self=this;
  4283. return smalltalk.withContext(function($ctx1) { var $1;
  4284. $1=_st((smalltalk.Point || Point))._x_y_(_st(_st(self)._x()).__star(_st(_st(aPoint)._asPoint())._x()),_st(_st(self)._y()).__star(_st(_st(aPoint)._asPoint())._y()));
  4285. return $1;
  4286. }, function($ctx1) {$ctx1.fill(self,"*",{aPoint:aPoint}, smalltalk.Point)})},
  4287. args: ["aPoint"],
  4288. source: "* aPoint\x0a\x09^Point x: self x * aPoint asPoint x y: self y * aPoint asPoint y",
  4289. messageSends: ["x:y:", "*", "x", "asPoint", "y"],
  4290. referencedClasses: ["Point"]
  4291. }),
  4292. smalltalk.Point);
  4293. smalltalk.addMethod(
  4294. "__plus",
  4295. smalltalk.method({
  4296. selector: "+",
  4297. category: 'arithmetic',
  4298. fn: function (aPoint){
  4299. var self=this;
  4300. return smalltalk.withContext(function($ctx1) { var $1;
  4301. $1=_st((smalltalk.Point || Point))._x_y_(_st(_st(self)._x()).__plus(_st(_st(aPoint)._asPoint())._x()),_st(_st(self)._y()).__plus(_st(_st(aPoint)._asPoint())._y()));
  4302. return $1;
  4303. }, function($ctx1) {$ctx1.fill(self,"+",{aPoint:aPoint}, smalltalk.Point)})},
  4304. args: ["aPoint"],
  4305. source: "+ aPoint\x0a\x09^Point x: self x + aPoint asPoint x y: self y + aPoint asPoint y",
  4306. messageSends: ["x:y:", "+", "x", "asPoint", "y"],
  4307. referencedClasses: ["Point"]
  4308. }),
  4309. smalltalk.Point);
  4310. smalltalk.addMethod(
  4311. "__minus",
  4312. smalltalk.method({
  4313. selector: "-",
  4314. category: 'arithmetic',
  4315. fn: function (aPoint){
  4316. var self=this;
  4317. return smalltalk.withContext(function($ctx1) { var $1;
  4318. $1=_st((smalltalk.Point || Point))._x_y_(_st(_st(self)._x()).__minus(_st(_st(aPoint)._asPoint())._x()),_st(_st(self)._y()).__minus(_st(_st(aPoint)._asPoint())._y()));
  4319. return $1;
  4320. }, function($ctx1) {$ctx1.fill(self,"-",{aPoint:aPoint}, smalltalk.Point)})},
  4321. args: ["aPoint"],
  4322. source: "- aPoint\x0a\x09^Point x: self x - aPoint asPoint x y: self y - aPoint asPoint y",
  4323. messageSends: ["x:y:", "-", "x", "asPoint", "y"],
  4324. referencedClasses: ["Point"]
  4325. }),
  4326. smalltalk.Point);
  4327. smalltalk.addMethod(
  4328. "__slash",
  4329. smalltalk.method({
  4330. selector: "/",
  4331. category: 'arithmetic',
  4332. fn: function (aPoint){
  4333. var self=this;
  4334. return smalltalk.withContext(function($ctx1) { var $1;
  4335. $1=_st((smalltalk.Point || Point))._x_y_(_st(_st(self)._x()).__slash(_st(_st(aPoint)._asPoint())._x()),_st(_st(self)._y()).__slash(_st(_st(aPoint)._asPoint())._y()));
  4336. return $1;
  4337. }, function($ctx1) {$ctx1.fill(self,"/",{aPoint:aPoint}, smalltalk.Point)})},
  4338. args: ["aPoint"],
  4339. source: "/ aPoint\x0a\x09^Point x: self x / aPoint asPoint x y: self y / aPoint asPoint y",
  4340. messageSends: ["x:y:", "/", "x", "asPoint", "y"],
  4341. referencedClasses: ["Point"]
  4342. }),
  4343. smalltalk.Point);
  4344. smalltalk.addMethod(
  4345. "__eq",
  4346. smalltalk.method({
  4347. selector: "=",
  4348. category: 'arithmetic',
  4349. fn: function (aPoint){
  4350. var self=this;
  4351. return smalltalk.withContext(function($ctx1) { var $1;
  4352. $1=_st(_st(_st(aPoint)._class()).__eq(_st(self)._class()))._and_((function(){
  4353. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(aPoint)._x()).__eq(_st(self)._x())).__and(_st(_st(aPoint)._y()).__eq(_st(self)._y()));
  4354. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4355. return $1;
  4356. }, function($ctx1) {$ctx1.fill(self,"=",{aPoint:aPoint}, smalltalk.Point)})},
  4357. args: ["aPoint"],
  4358. source: "= aPoint\x0a\x09^aPoint class = self class and: [\x0a\x09\x09(aPoint x = self x) & (aPoint y = self y)]",
  4359. messageSends: ["and:", "&", "=", "y", "x", "class"],
  4360. referencedClasses: []
  4361. }),
  4362. smalltalk.Point);
  4363. smalltalk.addMethod(
  4364. "_asPoint",
  4365. smalltalk.method({
  4366. selector: "asPoint",
  4367. category: 'converting',
  4368. fn: function (){
  4369. var self=this;
  4370. return smalltalk.withContext(function($ctx1) { var $1;
  4371. $1=self;
  4372. return $1;
  4373. }, function($ctx1) {$ctx1.fill(self,"asPoint",{}, smalltalk.Point)})},
  4374. args: [],
  4375. source: "asPoint\x0a\x09^self",
  4376. messageSends: [],
  4377. referencedClasses: []
  4378. }),
  4379. smalltalk.Point);
  4380. smalltalk.addMethod(
  4381. "_printString",
  4382. smalltalk.method({
  4383. selector: "printString",
  4384. category: 'printing',
  4385. fn: function (){
  4386. var self=this;
  4387. return smalltalk.withContext(function($ctx1) { var $2,$1;
  4388. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  4389. return smalltalk.withContext(function($ctx2) { _st(stream)._nextPutAll_(_st(_st(self["@x"])._printString()).__comma("@"));
  4390. $2=_st(_st(self["@y"])._notNil())._and_((function(){
  4391. return smalltalk.withContext(function($ctx3) { return _st(self["@y"])._negative();
  4392. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  4393. if(smalltalk.assert($2)){
  4394. _st(stream)._space();
  4395. };
  4396. return _st(stream)._nextPutAll_(_st(self["@y"])._printString());
  4397. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  4398. return $1;
  4399. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Point)})},
  4400. args: [],
  4401. source: "printString\x0a\x09\x22Print receiver in classic x@y notation.\x22\x0a\x0a\x09^String streamContents: [:stream |\x0a\x09\x09stream nextPutAll: x printString, '@'.\x0a\x09\x09(y notNil and: [y negative])\x0a\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x22Avoid ambiguous @- construct\x22\x0a\x09\x09\x09\x09stream space].\x0a\x09\x09stream nextPutAll: y printString]",
  4402. messageSends: ["streamContents:", "nextPutAll:", ",", "printString", "ifTrue:", "space", "and:", "negative", "notNil"],
  4403. referencedClasses: ["String"]
  4404. }),
  4405. smalltalk.Point);
  4406. smalltalk.addMethod(
  4407. "_translateBy_",
  4408. smalltalk.method({
  4409. selector: "translateBy:",
  4410. category: 'transforming',
  4411. fn: function (delta){
  4412. var self=this;
  4413. return smalltalk.withContext(function($ctx1) { var $1;
  4414. $1=_st(_st(_st(delta)._x()).__plus(self["@x"])).__at(_st(_st(delta)._y()).__plus(self["@y"]));
  4415. return $1;
  4416. }, function($ctx1) {$ctx1.fill(self,"translateBy:",{delta:delta}, smalltalk.Point)})},
  4417. args: ["delta"],
  4418. source: "translateBy: delta \x0a\x09\x22Answer a Point translated by delta (an instance of Point).\x22\x0a\x09^(delta x + x) @ (delta y + y)",
  4419. messageSends: ["@", "+", "y", "x"],
  4420. referencedClasses: []
  4421. }),
  4422. smalltalk.Point);
  4423. smalltalk.addMethod(
  4424. "_x",
  4425. smalltalk.method({
  4426. selector: "x",
  4427. category: 'accessing',
  4428. fn: function (){
  4429. var self=this;
  4430. return smalltalk.withContext(function($ctx1) { var $1;
  4431. $1=self["@x"];
  4432. return $1;
  4433. }, function($ctx1) {$ctx1.fill(self,"x",{}, smalltalk.Point)})},
  4434. args: [],
  4435. source: "x\x0a\x09^x",
  4436. messageSends: [],
  4437. referencedClasses: []
  4438. }),
  4439. smalltalk.Point);
  4440. smalltalk.addMethod(
  4441. "_x_",
  4442. smalltalk.method({
  4443. selector: "x:",
  4444. category: 'accessing',
  4445. fn: function (aNumber){
  4446. var self=this;
  4447. return smalltalk.withContext(function($ctx1) { self["@x"]=aNumber;
  4448. return self}, function($ctx1) {$ctx1.fill(self,"x:",{aNumber:aNumber}, smalltalk.Point)})},
  4449. args: ["aNumber"],
  4450. source: "x: aNumber\x0a\x09x := aNumber",
  4451. messageSends: [],
  4452. referencedClasses: []
  4453. }),
  4454. smalltalk.Point);
  4455. smalltalk.addMethod(
  4456. "_y",
  4457. smalltalk.method({
  4458. selector: "y",
  4459. category: 'accessing',
  4460. fn: function (){
  4461. var self=this;
  4462. return smalltalk.withContext(function($ctx1) { var $1;
  4463. $1=self["@y"];
  4464. return $1;
  4465. }, function($ctx1) {$ctx1.fill(self,"y",{}, smalltalk.Point)})},
  4466. args: [],
  4467. source: "y\x0a\x09^y",
  4468. messageSends: [],
  4469. referencedClasses: []
  4470. }),
  4471. smalltalk.Point);
  4472. smalltalk.addMethod(
  4473. "_y_",
  4474. smalltalk.method({
  4475. selector: "y:",
  4476. category: 'accessing',
  4477. fn: function (aNumber){
  4478. var self=this;
  4479. return smalltalk.withContext(function($ctx1) { self["@y"]=aNumber;
  4480. return self}, function($ctx1) {$ctx1.fill(self,"y:",{aNumber:aNumber}, smalltalk.Point)})},
  4481. args: ["aNumber"],
  4482. source: "y: aNumber\x0a\x09y := aNumber",
  4483. messageSends: [],
  4484. referencedClasses: []
  4485. }),
  4486. smalltalk.Point);
  4487. smalltalk.addMethod(
  4488. "_x_y_",
  4489. smalltalk.method({
  4490. selector: "x:y:",
  4491. category: 'instance creation',
  4492. fn: function (aNumber,anotherNumber){
  4493. var self=this;
  4494. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  4495. $2=_st(self)._new();
  4496. _st($2)._x_(aNumber);
  4497. _st($2)._y_(anotherNumber);
  4498. $3=_st($2)._yourself();
  4499. $1=$3;
  4500. return $1;
  4501. }, function($ctx1) {$ctx1.fill(self,"x:y:",{aNumber:aNumber,anotherNumber:anotherNumber}, smalltalk.Point.klass)})},
  4502. args: ["aNumber", "anotherNumber"],
  4503. source: "x: aNumber y: anotherNumber\x0a\x09^self new\x0a\x09\x09x: aNumber;\x0a\x09\x09y: anotherNumber;\x0a\x09\x09yourself",
  4504. messageSends: ["x:", "new", "y:", "yourself"],
  4505. referencedClasses: []
  4506. }),
  4507. smalltalk.Point.klass);
  4508. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  4509. smalltalk.Random.comment="`Random` is a random number generator and is implemented as a trivial wrapper around javascript `Math.random()` and is used like this:\x0a\x0a\x09Random new next\x0a\x0aThis will return a float x where x < 1 and x > 0. If you want a random integer from 1 to 10 you can use `#atRandom`\x0a\x0a\x0910 atRandom\x0a\x0a...and if you want a random number in a specific interval this also works:\x0a\x0a\x09(3 to: 7) atRandom\x0a\x0a...but be aware that `#to:` does not create an Interval as in other Smalltalk implementations but in fact an `Array` of numbers, so it's better to use:\x0a\x0a\x095 atRandom + 2\x0a\x0aSince `#atRandom` is implemented in `SequencableCollection` you can easy pick an element at random:\x0a\x0a\x09#('a' 'b' 'c') atRandom\x0a\x0a...or perhaps a letter from a `String`:\x0a\x0a\x09'abc' atRandom\x0a\x0aSince Amber does not have Characters this will return a `String` of length 1 like for example `'b'`."
  4510. smalltalk.addMethod(
  4511. "_next",
  4512. smalltalk.method({
  4513. selector: "next",
  4514. category: 'accessing',
  4515. fn: function (){
  4516. var self=this;
  4517. return smalltalk.withContext(function($ctx1) { return Math.random();
  4518. return self}, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.Random)})},
  4519. args: [],
  4520. source: "next\x0a\x09<return Math.random()>",
  4521. messageSends: [],
  4522. referencedClasses: []
  4523. }),
  4524. smalltalk.Random);
  4525. smalltalk.addMethod(
  4526. "_next_",
  4527. smalltalk.method({
  4528. selector: "next:",
  4529. category: 'accessing',
  4530. fn: function (anInteger){
  4531. var self=this;
  4532. return smalltalk.withContext(function($ctx1) { var $1;
  4533. $1=_st(_st((1))._to_(anInteger))._collect_((function(each){
  4534. return smalltalk.withContext(function($ctx2) { return _st(self)._next();
  4535. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4536. return $1;
  4537. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger}, smalltalk.Random)})},
  4538. args: ["anInteger"],
  4539. source: "next: anInteger\x0a ^(1 to: anInteger) collect: [:each | self next]",
  4540. messageSends: ["collect:", "next", "to:"],
  4541. referencedClasses: []
  4542. }),
  4543. smalltalk.Random);
  4544. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  4545. smalltalk.Smalltalk.comment="Smalltalk has only one instance, accessed with `Smalltalk current`. \x0aIt represents the global JavaScript variable `smalltalk` declared in `js/boot.js`.\x0a\x0aThe `smalltalk` object holds all class and packages defined in the system.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#at:` answers a specific class of `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific class of `nil`\x0a\x0a__note:__ classes and packages are accessed using strings, not symbols\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Smalltalk source code. \x0aIt requires the `Compiler` package and the `js/parser.js` parser file in order to work"
  4546. smalltalk.addMethod(
  4547. "_asSmalltalkException_",
  4548. smalltalk.method({
  4549. selector: "asSmalltalkException:",
  4550. category: 'error handling',
  4551. fn: function (anObject){
  4552. var self=this;
  4553. return smalltalk.withContext(function($ctx1) { var $2,$1;
  4554. $2=_st(_st(self)._isSmalltalkObject_(anObject))._and_((function(){
  4555. return smalltalk.withContext(function($ctx2) { return _st(anObject)._isKindOf_((smalltalk.Error || Error));
  4556. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4557. if(smalltalk.assert($2)){
  4558. $1=anObject;
  4559. } else {
  4560. $1=_st((smalltalk.JavaScriptException || JavaScriptException))._on_(anObject);
  4561. };
  4562. return $1;
  4563. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject}, smalltalk.Smalltalk)})},
  4564. args: ["anObject"],
  4565. source: "asSmalltalkException: anObject\x0a\x09\x22A JavaScript exception may be thrown.\x0a We then need to convert it back to a Smalltalk object\x22\x0a \x0a ^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])\x0a \x09ifTrue: [ anObject ]\x0a \x09ifFalse: [ JavaScriptException on: anObject ]",
  4566. messageSends: ["ifTrue:ifFalse:", "on:", "and:", "isKindOf:", "isSmalltalkObject:"],
  4567. referencedClasses: ["JavaScriptException", "Error"]
  4568. }),
  4569. smalltalk.Smalltalk);
  4570. smalltalk.addMethod(
  4571. "_at_",
  4572. smalltalk.method({
  4573. selector: "at:",
  4574. category: 'accessing',
  4575. fn: function (aSymbol){
  4576. var self=this;
  4577. return smalltalk.withContext(function($ctx1) { return self[aSymbol._asString()];
  4578. return self}, function($ctx1) {$ctx1.fill(self,"at:",{aSymbol:aSymbol}, smalltalk.Smalltalk)})},
  4579. args: ["aSymbol"],
  4580. source: "at: aSymbol\x0a\x09<return self[aSymbol._asString()]>",
  4581. messageSends: [],
  4582. referencedClasses: []
  4583. }),
  4584. smalltalk.Smalltalk);
  4585. smalltalk.addMethod(
  4586. "_basicParse_",
  4587. smalltalk.method({
  4588. selector: "basicParse:",
  4589. category: 'private',
  4590. fn: function (aString){
  4591. var self=this;
  4592. return smalltalk.withContext(function($ctx1) { return smalltalk.parser.parse(aString);
  4593. return self}, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString}, smalltalk.Smalltalk)})},
  4594. args: ["aString"],
  4595. source: "basicParse: aString\x0a\x09<return smalltalk.parser.parse(aString)>",
  4596. messageSends: [],
  4597. referencedClasses: []
  4598. }),
  4599. smalltalk.Smalltalk);
  4600. smalltalk.addMethod(
  4601. "_classes",
  4602. smalltalk.method({
  4603. selector: "classes",
  4604. category: 'classes',
  4605. fn: function (){
  4606. var self=this;
  4607. return smalltalk.withContext(function($ctx1) { return self.classes();
  4608. return self}, function($ctx1) {$ctx1.fill(self,"classes",{}, smalltalk.Smalltalk)})},
  4609. args: [],
  4610. source: "classes\x0a\x09<return self.classes()>",
  4611. messageSends: [],
  4612. referencedClasses: []
  4613. }),
  4614. smalltalk.Smalltalk);
  4615. smalltalk.addMethod(
  4616. "_createPackage_",
  4617. smalltalk.method({
  4618. selector: "createPackage:",
  4619. category: 'packages',
  4620. fn: function (packageName){
  4621. var self=this;
  4622. return smalltalk.withContext(function($ctx1) { return smalltalk.addPackage(packageName);
  4623. return self}, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName}, smalltalk.Smalltalk)})},
  4624. args: ["packageName"],
  4625. source: "createPackage: packageName\x0a\x09\x22Create and bind a new package with given name and return it.\x22\x0a <return smalltalk.addPackage(packageName)>",
  4626. messageSends: [],
  4627. referencedClasses: []
  4628. }),
  4629. smalltalk.Smalltalk);
  4630. smalltalk.addMethod(
  4631. "_createPackage_properties_",
  4632. smalltalk.method({
  4633. selector: "createPackage:properties:",
  4634. category: 'private',
  4635. fn: function (packageName,aDict){
  4636. var self=this;
  4637. return smalltalk.withContext(function($ctx1) { var $1,$2;
  4638. _st(self)._deprecatedAPI();
  4639. $1=_st(aDict)._isEmpty();
  4640. if(! smalltalk.assert($1)){
  4641. _st(self)._error_("createPackage:properties: called with nonempty properties");
  4642. };
  4643. $2=_st(self)._createPackage_(packageName);
  4644. return $2;
  4645. }, function($ctx1) {$ctx1.fill(self,"createPackage:properties:",{packageName:packageName,aDict:aDict}, smalltalk.Smalltalk)})},
  4646. args: ["packageName", "aDict"],
  4647. source: "createPackage: packageName properties: aDict\x0a \x22Needed to import .st files: they begin with this call.\x22\x0a self deprecatedAPI.\x0a \x0a aDict isEmpty ifFalse: [ self error: 'createPackage:properties: called with nonempty properties' ].\x0a ^ self createPackage: packageName",
  4648. messageSends: ["deprecatedAPI", "ifFalse:", "error:", "isEmpty", "createPackage:"],
  4649. referencedClasses: []
  4650. }),
  4651. smalltalk.Smalltalk);
  4652. smalltalk.addMethod(
  4653. "_deleteClass_",
  4654. smalltalk.method({
  4655. selector: "deleteClass:",
  4656. category: 'classes',
  4657. fn: function (aClass){
  4658. var self=this;
  4659. return smalltalk.withContext(function($ctx1) { self.removeClass(aClass);
  4660. return self}, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass}, smalltalk.Smalltalk)})},
  4661. args: ["aClass"],
  4662. source: "deleteClass: aClass\x0a\x09\x22Deletes a class by deleting its binding only. Use #removeClass instead\x22\x0a \x0a\x09<self.removeClass(aClass)>",
  4663. messageSends: [],
  4664. referencedClasses: []
  4665. }),
  4666. smalltalk.Smalltalk);
  4667. smalltalk.addMethod(
  4668. "_deletePackage_",
  4669. smalltalk.method({
  4670. selector: "deletePackage:",
  4671. category: 'packages',
  4672. fn: function (packageName){
  4673. var self=this;
  4674. return smalltalk.withContext(function($ctx1) { delete smalltalk.packages[packageName];
  4675. return self}, function($ctx1) {$ctx1.fill(self,"deletePackage:",{packageName:packageName}, smalltalk.Smalltalk)})},
  4676. args: ["packageName"],
  4677. source: "deletePackage: packageName\x0a\x09\x22Deletes a package by deleting its binding, but does not check if it contains classes etc.\x0a\x09To remove a package, use #removePackage instead.\x22\x0a\x0a <delete smalltalk.packages[packageName]>",
  4678. messageSends: [],
  4679. referencedClasses: []
  4680. }),
  4681. smalltalk.Smalltalk);
  4682. smalltalk.addMethod(
  4683. "_isSmalltalkObject_",
  4684. smalltalk.method({
  4685. selector: "isSmalltalkObject:",
  4686. category: 'testing',
  4687. fn: function (anObject){
  4688. var self=this;
  4689. return smalltalk.withContext(function($ctx1) { return typeof anObject.klass !== 'undefined';
  4690. return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject}, smalltalk.Smalltalk)})},
  4691. args: ["anObject"],
  4692. source: "isSmalltalkObject: anObject\x0a\x09\x22Consider anObject a Smalltalk object if it has a 'klass' property.\x0a Note that this may be unaccurate\x22\x0a \x0a <return typeof anObject.klass !== 'undefined'>",
  4693. messageSends: [],
  4694. referencedClasses: []
  4695. }),
  4696. smalltalk.Smalltalk);
  4697. smalltalk.addMethod(
  4698. "_packageAt_",
  4699. smalltalk.method({
  4700. selector: "packageAt:",
  4701. category: 'packages',
  4702. fn: function (packageName){
  4703. var self=this;
  4704. return smalltalk.withContext(function($ctx1) { return self.packages[packageName];
  4705. return self}, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName}, smalltalk.Smalltalk)})},
  4706. args: ["packageName"],
  4707. source: "packageAt: packageName\x0a <return self.packages[packageName]>",
  4708. messageSends: [],
  4709. referencedClasses: []
  4710. }),
  4711. smalltalk.Smalltalk);
  4712. smalltalk.addMethod(
  4713. "_packageAt_ifAbsent_",
  4714. smalltalk.method({
  4715. selector: "packageAt:ifAbsent:",
  4716. category: 'packages',
  4717. fn: function (packageName,aBlock){
  4718. var self=this;
  4719. return smalltalk.withContext(function($ctx1) { var $2,$1;
  4720. $2=_st(self)._packageAt_(packageName);
  4721. $1=_st($2)._ifNil_(aBlock);
  4722. return $1;
  4723. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock}, smalltalk.Smalltalk)})},
  4724. args: ["packageName", "aBlock"],
  4725. source: "packageAt: packageName ifAbsent: aBlock\x0a ^(self packageAt: packageName) ifNil: aBlock",
  4726. messageSends: ["ifNil:", "packageAt:"],
  4727. referencedClasses: []
  4728. }),
  4729. smalltalk.Smalltalk);
  4730. smalltalk.addMethod(
  4731. "_packages",
  4732. smalltalk.method({
  4733. selector: "packages",
  4734. category: 'packages',
  4735. fn: function (){
  4736. var self=this;
  4737. return smalltalk.withContext(function($ctx1) { return self.packages.all();
  4738. return self}, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.Smalltalk)})},
  4739. args: [],
  4740. source: "packages\x0a\x09\x22Return all Package instances in the system.\x22\x0a\x0a\x09<return self.packages.all()>",
  4741. messageSends: [],
  4742. referencedClasses: []
  4743. }),
  4744. smalltalk.Smalltalk);
  4745. smalltalk.addMethod(
  4746. "_parse_",
  4747. smalltalk.method({
  4748. selector: "parse:",
  4749. category: 'accessing',
  4750. fn: function (aString){
  4751. var self=this;
  4752. var result;
  4753. return smalltalk.withContext(function($ctx1) { var $1;
  4754. _st(self)._try_catch_((function(){
  4755. return smalltalk.withContext(function($ctx2) { result=_st(self)._basicParse_(aString);
  4756. return result;
  4757. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(ex){
  4758. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._parseError_parsing_(ex,aString))._signal();
  4759. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  4760. $1=result;
  4761. return $1;
  4762. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result}, smalltalk.Smalltalk)})},
  4763. args: ["aString"],
  4764. source: "parse: aString\x0a\x09| result | \x0a\x09self try: [result := self basicParse: aString] catch: [:ex | (self parseError: ex parsing: aString) signal].\x0a\x09^result",
  4765. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:"],
  4766. referencedClasses: []
  4767. }),
  4768. smalltalk.Smalltalk);
  4769. smalltalk.addMethod(
  4770. "_parseError_parsing_",
  4771. smalltalk.method({
  4772. selector: "parseError:parsing:",
  4773. category: 'error handling',
  4774. fn: function (anException,aString){
  4775. var self=this;
  4776. return smalltalk.withContext(function($ctx1) { var $1;
  4777. $1=_st(_st((smalltalk.ParseError || ParseError))._new())._messageText_(_st(_st(_st(_st(_st("Parse error on line ").__comma(_st(anException)._basicAt_("line"))).__comma(" column ")).__comma(_st(anException)._basicAt_("column"))).__comma(" : Unexpected character ")).__comma(_st(anException)._basicAt_("found")));
  4778. return $1;
  4779. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString}, smalltalk.Smalltalk)})},
  4780. args: ["anException", "aString"],
  4781. source: "parseError: anException parsing: aString\x0a\x09^ ParseError new messageText: 'Parse error on line ', (anException basicAt: 'line') ,' column ' , (anException basicAt: 'column') ,' : Unexpected character ', (anException basicAt: 'found')",
  4782. messageSends: ["messageText:", ",", "basicAt:", "new"],
  4783. referencedClasses: ["ParseError"]
  4784. }),
  4785. smalltalk.Smalltalk);
  4786. smalltalk.addMethod(
  4787. "_pseudoVariableNames",
  4788. smalltalk.method({
  4789. selector: "pseudoVariableNames",
  4790. category: 'packages',
  4791. fn: function (){
  4792. var self=this;
  4793. return smalltalk.withContext(function($ctx1) { return ["self", "super", "nil", "true", "false", "thisContext"];
  4794. }, function($ctx1) {$ctx1.fill(self,"pseudoVariableNames",{}, smalltalk.Smalltalk)})},
  4795. args: [],
  4796. source: "pseudoVariableNames\x0a\x09^ #('self' 'super' 'nil' 'true' 'false' 'thisContext')",
  4797. messageSends: [],
  4798. referencedClasses: []
  4799. }),
  4800. smalltalk.Smalltalk);
  4801. smalltalk.addMethod(
  4802. "_readJSObject_",
  4803. smalltalk.method({
  4804. selector: "readJSObject:",
  4805. category: 'accessing',
  4806. fn: function (anObject){
  4807. var self=this;
  4808. return smalltalk.withContext(function($ctx1) { return self.readJSObject(anObject);
  4809. return self}, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject}, smalltalk.Smalltalk)})},
  4810. args: ["anObject"],
  4811. source: "readJSObject: anObject\x0a\x09<return self.readJSObject(anObject)>",
  4812. messageSends: [],
  4813. referencedClasses: []
  4814. }),
  4815. smalltalk.Smalltalk);
  4816. smalltalk.addMethod(
  4817. "_removeClass_",
  4818. smalltalk.method({
  4819. selector: "removeClass:",
  4820. category: 'classes',
  4821. fn: function (aClass){
  4822. var self=this;
  4823. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  4824. $1=_st(aClass)._isMetaclass();
  4825. if(smalltalk.assert($1)){
  4826. _st(self)._error_(_st(_st(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!"));
  4827. };
  4828. _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
  4829. return smalltalk.withContext(function($ctx2) { return _st(aClass)._removeCompiledMethod_(each);
  4830. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4831. _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
  4832. return smalltalk.withContext(function($ctx2) { return _st(_st(aClass)._class())._removeCompiledMethod_(each);
  4833. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4834. _st(self)._deleteClass_(aClass);
  4835. $2=_st((smalltalk.ClassRemoved || ClassRemoved))._new();
  4836. _st($2)._theClass_(aClass);
  4837. $3=_st($2)._yourself();
  4838. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($3);
  4839. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass}, smalltalk.Smalltalk)})},
  4840. args: ["aClass"],
  4841. source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!'].\x0a \x0a\x09aClass methodDictionary values do: [:each |\x0a\x09\x09aClass removeCompiledMethod: each].\x0a \x0a\x09aClass class methodDictionary values do: [:each |\x0a\x09\x09aClass class removeCompiledMethod: each].\x0a \x0a\x09self deleteClass: aClass.\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassRemoved new\x0a \x09theClass: aClass;\x0a yourself)",
  4842. messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "do:", "removeCompiledMethod:", "values", "methodDictionary", "class", "deleteClass:", "announce:", "theClass:", "new", "yourself", "current"],
  4843. referencedClasses: ["ClassRemoved", "SystemAnnouncer"]
  4844. }),
  4845. smalltalk.Smalltalk);
  4846. smalltalk.addMethod(
  4847. "_removePackage_",
  4848. smalltalk.method({
  4849. selector: "removePackage:",
  4850. category: 'packages',
  4851. fn: function (packageName){
  4852. var self=this;
  4853. var pkg;
  4854. return smalltalk.withContext(function($ctx1) { pkg=_st(self)._packageAt_ifAbsent_(packageName,(function(){
  4855. return smalltalk.withContext(function($ctx2) { return _st(self)._error_(_st("Missing package: ").__comma(packageName));
  4856. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4857. _st(_st(pkg)._classes())._do_((function(each){
  4858. return smalltalk.withContext(function($ctx2) { return _st(self)._removeClass_(each);
  4859. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4860. _st(self)._deletePackage_(packageName);
  4861. return self}, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg}, smalltalk.Smalltalk)})},
  4862. args: ["packageName"],
  4863. source: "removePackage: packageName\x0a\x09\x22Removes a package and all its classes.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].\x0a\x09pkg classes do: [:each |\x0a \x09self removeClass: each].\x0a\x09self deletePackage: packageName",
  4864. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "removeClass:", "classes", "deletePackage:"],
  4865. referencedClasses: []
  4866. }),
  4867. smalltalk.Smalltalk);
  4868. smalltalk.addMethod(
  4869. "_renamePackage_to_",
  4870. smalltalk.method({
  4871. selector: "renamePackage:to:",
  4872. category: 'packages',
  4873. fn: function (packageName,newName){
  4874. var self=this;
  4875. var pkg;
  4876. return smalltalk.withContext(function($ctx1) { var $1;
  4877. pkg=_st(self)._packageAt_ifAbsent_(packageName,(function(){
  4878. return smalltalk.withContext(function($ctx2) { return _st(self)._error_(_st("Missing package: ").__comma(packageName));
  4879. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4880. $1=_st(self)._packageAt_(newName);
  4881. if(($receiver = $1) == nil || $receiver == undefined){
  4882. $1;
  4883. } else {
  4884. _st(self)._error_(_st("Already exists a package called: ").__comma(newName));
  4885. };
  4886. _st(_st(self)._basicAt_("packages"))._at_put_(newName,pkg);
  4887. _st(pkg)._name_(newName);
  4888. _st(self)._deletePackage_(packageName);
  4889. return self}, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg}, smalltalk.Smalltalk)})},
  4890. args: ["packageName", "newName"],
  4891. source: "renamePackage: packageName to: newName\x0a\x09\x22Rename a package.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].\x0a\x09(self packageAt: newName) ifNotNil: [self error: 'Already exists a package called: ', newName].\x0a (self basicAt: 'packages') at: newName put: pkg.\x0a\x09pkg name: newName.\x0a\x09self deletePackage: packageName.",
  4892. messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "at:put:", "basicAt:", "name:", "deletePackage:"],
  4893. referencedClasses: []
  4894. }),
  4895. smalltalk.Smalltalk);
  4896. smalltalk.addMethod(
  4897. "_reservedWords",
  4898. smalltalk.method({
  4899. selector: "reservedWords",
  4900. category: 'accessing',
  4901. fn: function (){
  4902. var self=this;
  4903. return smalltalk.withContext(function($ctx1) { return self.reservedWords;
  4904. return self}, function($ctx1) {$ctx1.fill(self,"reservedWords",{}, smalltalk.Smalltalk)})},
  4905. args: [],
  4906. source: "reservedWords\x0a\x09\x22JavaScript reserved words\x22\x0a\x09<return self.reservedWords>",
  4907. messageSends: [],
  4908. referencedClasses: []
  4909. }),
  4910. smalltalk.Smalltalk);
  4911. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  4912. smalltalk.addMethod(
  4913. "_current",
  4914. smalltalk.method({
  4915. selector: "current",
  4916. category: 'accessing',
  4917. fn: function (){
  4918. var self=this;
  4919. return smalltalk.withContext(function($ctx1) { return smalltalk;
  4920. return self}, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.Smalltalk.klass)})},
  4921. args: [],
  4922. source: "current\x0a\x09<return smalltalk>",
  4923. messageSends: [],
  4924. referencedClasses: []
  4925. }),
  4926. smalltalk.Smalltalk.klass);
  4927. smalltalk.addClass('Timeout', smalltalk.Object, ['rawTimeout'], 'Kernel-Objects');
  4928. smalltalk.Timeout.comment="I am wrapping the returns from set{Timeout,Interval}.\x0a\x0aNumber suffices in browsers, but node.js returns an object."
  4929. smalltalk.addMethod(
  4930. "_clearInterval",
  4931. smalltalk.method({
  4932. selector: "clearInterval",
  4933. category: 'timeout/interval',
  4934. fn: function (){
  4935. var self=this;
  4936. return smalltalk.withContext(function($ctx1) {
  4937. var interval = self["@rawTimeout"];
  4938. clearInterval(interval);
  4939. ;
  4940. return self}, function($ctx1) {$ctx1.fill(self,"clearInterval",{}, smalltalk.Timeout)})},
  4941. args: [],
  4942. source: "clearInterval\x0a\x09<\x0a \x09var interval = self[\x22@rawTimeout\x22];\x0a\x09\x09clearInterval(interval);\x0a >",
  4943. messageSends: [],
  4944. referencedClasses: []
  4945. }),
  4946. smalltalk.Timeout);
  4947. smalltalk.addMethod(
  4948. "_clearTimeout",
  4949. smalltalk.method({
  4950. selector: "clearTimeout",
  4951. category: 'timeout/interval',
  4952. fn: function (){
  4953. var self=this;
  4954. return smalltalk.withContext(function($ctx1) {
  4955. var timeout = self["@rawTimeout"];
  4956. clearTimeout(timeout);
  4957. ;
  4958. return self}, function($ctx1) {$ctx1.fill(self,"clearTimeout",{}, smalltalk.Timeout)})},
  4959. args: [],
  4960. source: "clearTimeout\x0a\x09<\x0a \x09var timeout = self[\x22@rawTimeout\x22];\x0a\x09\x09clearTimeout(timeout);\x0a >",
  4961. messageSends: [],
  4962. referencedClasses: []
  4963. }),
  4964. smalltalk.Timeout);
  4965. smalltalk.addMethod(
  4966. "_rawTimeout_",
  4967. smalltalk.method({
  4968. selector: "rawTimeout:",
  4969. category: 'accessing',
  4970. fn: function (anObject){
  4971. var self=this;
  4972. return smalltalk.withContext(function($ctx1) { self["@rawTimeout"]=anObject;
  4973. return self}, function($ctx1) {$ctx1.fill(self,"rawTimeout:",{anObject:anObject}, smalltalk.Timeout)})},
  4974. args: ["anObject"],
  4975. source: "rawTimeout: anObject\x0a\x09rawTimeout := anObject",
  4976. messageSends: [],
  4977. referencedClasses: []
  4978. }),
  4979. smalltalk.Timeout);
  4980. smalltalk.addMethod(
  4981. "_on_",
  4982. smalltalk.method({
  4983. selector: "on:",
  4984. category: 'instance creation',
  4985. fn: function (anObject){
  4986. var self=this;
  4987. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  4988. $2=_st(self)._new();
  4989. _st($2)._rawTimeout_(anObject);
  4990. $3=_st($2)._yourself();
  4991. $1=$3;
  4992. return $1;
  4993. }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject}, smalltalk.Timeout.klass)})},
  4994. args: ["anObject"],
  4995. source: "on: anObject\x0a\x09^self new rawTimeout: anObject; yourself",
  4996. messageSends: ["rawTimeout:", "new", "yourself"],
  4997. referencedClasses: []
  4998. }),
  4999. smalltalk.Timeout.klass);
  5000. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  5001. smalltalk.UndefinedObject.comment="UndefinedObject describes the behavior of its sole instance, `nil`. `nil` represents a prior value for variables that have not been initialized, or for results which are meaningless.\x0a\x0a`nil` is the Smalltalk representation of the `undefined` JavaScript object."
  5002. smalltalk.addMethod(
  5003. "_asJSON",
  5004. smalltalk.method({
  5005. selector: "asJSON",
  5006. category: 'converting',
  5007. fn: function (){
  5008. var self=this;
  5009. return smalltalk.withContext(function($ctx1) { var $1;
  5010. $1=null;
  5011. return $1;
  5012. }, function($ctx1) {$ctx1.fill(self,"asJSON",{}, smalltalk.UndefinedObject)})},
  5013. args: [],
  5014. source: "asJSON\x0a\x09^null",
  5015. messageSends: [],
  5016. referencedClasses: []
  5017. }),
  5018. smalltalk.UndefinedObject);
  5019. smalltalk.addMethod(
  5020. "_deepCopy",
  5021. smalltalk.method({
  5022. selector: "deepCopy",
  5023. category: 'copying',
  5024. fn: function (){
  5025. var self=this;
  5026. return smalltalk.withContext(function($ctx1) { var $1;
  5027. $1=self;
  5028. return $1;
  5029. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{}, smalltalk.UndefinedObject)})},
  5030. args: [],
  5031. source: "deepCopy\x0a\x09^self",
  5032. messageSends: [],
  5033. referencedClasses: []
  5034. }),
  5035. smalltalk.UndefinedObject);
  5036. smalltalk.addMethod(
  5037. "_ifNil_",
  5038. smalltalk.method({
  5039. selector: "ifNil:",
  5040. category: 'testing',
  5041. fn: function (aBlock){
  5042. var self=this;
  5043. return smalltalk.withContext(function($ctx1) { var $2,$1;
  5044. $2=self;
  5045. $1=_st($2)._ifNil_ifNotNil_(aBlock,(function(){
  5046. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  5047. return $1;
  5048. }, function($ctx1) {$ctx1.fill(self,"ifNil:",{aBlock:aBlock}, smalltalk.UndefinedObject)})},
  5049. args: ["aBlock"],
  5050. source: "ifNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifNil: aBlock ifNotNil: []",
  5051. messageSends: ["ifNil:ifNotNil:"],
  5052. referencedClasses: []
  5053. }),
  5054. smalltalk.UndefinedObject);
  5055. smalltalk.addMethod(
  5056. "_ifNil_ifNotNil_",
  5057. smalltalk.method({
  5058. selector: "ifNil:ifNotNil:",
  5059. category: 'testing',
  5060. fn: function (aBlock,anotherBlock){
  5061. var self=this;
  5062. return smalltalk.withContext(function($ctx1) { var $1;
  5063. $1=_st(aBlock)._value();
  5064. return $1;
  5065. }, function($ctx1) {$ctx1.fill(self,"ifNil:ifNotNil:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.UndefinedObject)})},
  5066. args: ["aBlock", "anotherBlock"],
  5067. source: "ifNil: aBlock ifNotNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^aBlock value",
  5068. messageSends: ["value"],
  5069. referencedClasses: []
  5070. }),
  5071. smalltalk.UndefinedObject);
  5072. smalltalk.addMethod(
  5073. "_ifNotNil_",
  5074. smalltalk.method({
  5075. selector: "ifNotNil:",
  5076. category: 'testing',
  5077. fn: function (aBlock){
  5078. var self=this;
  5079. return smalltalk.withContext(function($ctx1) { var $1;
  5080. $1=self;
  5081. return $1;
  5082. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:",{aBlock:aBlock}, smalltalk.UndefinedObject)})},
  5083. args: ["aBlock"],
  5084. source: "ifNotNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self",
  5085. messageSends: [],
  5086. referencedClasses: []
  5087. }),
  5088. smalltalk.UndefinedObject);
  5089. smalltalk.addMethod(
  5090. "_ifNotNil_ifNil_",
  5091. smalltalk.method({
  5092. selector: "ifNotNil:ifNil:",
  5093. category: 'testing',
  5094. fn: function (aBlock,anotherBlock){
  5095. var self=this;
  5096. return smalltalk.withContext(function($ctx1) { var $1;
  5097. $1=_st(anotherBlock)._value();
  5098. return $1;
  5099. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:ifNil:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.UndefinedObject)})},
  5100. args: ["aBlock", "anotherBlock"],
  5101. source: "ifNotNil: aBlock ifNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^anotherBlock value",
  5102. messageSends: ["value"],
  5103. referencedClasses: []
  5104. }),
  5105. smalltalk.UndefinedObject);
  5106. smalltalk.addMethod(
  5107. "_isNil",
  5108. smalltalk.method({
  5109. selector: "isNil",
  5110. category: 'testing',
  5111. fn: function (){
  5112. var self=this;
  5113. return smalltalk.withContext(function($ctx1) { return true;
  5114. }, function($ctx1) {$ctx1.fill(self,"isNil",{}, smalltalk.UndefinedObject)})},
  5115. args: [],
  5116. source: "isNil\x0a\x09^true",
  5117. messageSends: [],
  5118. referencedClasses: []
  5119. }),
  5120. smalltalk.UndefinedObject);
  5121. smalltalk.addMethod(
  5122. "_notNil",
  5123. smalltalk.method({
  5124. selector: "notNil",
  5125. category: 'testing',
  5126. fn: function (){
  5127. var self=this;
  5128. return smalltalk.withContext(function($ctx1) { return false;
  5129. }, function($ctx1) {$ctx1.fill(self,"notNil",{}, smalltalk.UndefinedObject)})},
  5130. args: [],
  5131. source: "notNil\x0a\x09^false",
  5132. messageSends: [],
  5133. referencedClasses: []
  5134. }),
  5135. smalltalk.UndefinedObject);
  5136. smalltalk.addMethod(
  5137. "_printString",
  5138. smalltalk.method({
  5139. selector: "printString",
  5140. category: 'printing',
  5141. fn: function (){
  5142. var self=this;
  5143. return smalltalk.withContext(function($ctx1) { return "nil";
  5144. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.UndefinedObject)})},
  5145. args: [],
  5146. source: "printString\x0a ^'nil'",
  5147. messageSends: [],
  5148. referencedClasses: []
  5149. }),
  5150. smalltalk.UndefinedObject);
  5151. smalltalk.addMethod(
  5152. "_shallowCopy",
  5153. smalltalk.method({
  5154. selector: "shallowCopy",
  5155. category: 'copying',
  5156. fn: function (){
  5157. var self=this;
  5158. return smalltalk.withContext(function($ctx1) { var $1;
  5159. $1=self;
  5160. return $1;
  5161. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{}, smalltalk.UndefinedObject)})},
  5162. args: [],
  5163. source: "shallowCopy\x0a\x09^self",
  5164. messageSends: [],
  5165. referencedClasses: []
  5166. }),
  5167. smalltalk.UndefinedObject);
  5168. smalltalk.addMethod(
  5169. "_subclass_instanceVariableNames_",
  5170. smalltalk.method({
  5171. selector: "subclass:instanceVariableNames:",
  5172. category: 'class creation',
  5173. fn: function (aString,anotherString){
  5174. var self=this;
  5175. return smalltalk.withContext(function($ctx1) { var $1;
  5176. $1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  5177. return $1;
  5178. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString}, smalltalk.UndefinedObject)})},
  5179. args: ["aString", "anotherString"],
  5180. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
  5181. messageSends: ["subclass:instanceVariableNames:package:"],
  5182. referencedClasses: []
  5183. }),
  5184. smalltalk.UndefinedObject);
  5185. smalltalk.addMethod(
  5186. "_subclass_instanceVariableNames_category_",
  5187. smalltalk.method({
  5188. selector: "subclass:instanceVariableNames:category:",
  5189. category: 'class creation',
  5190. fn: function (aString,aString2,aString3){
  5191. var self=this;
  5192. return smalltalk.withContext(function($ctx1) { var $1;
  5193. _st(self)._deprecatedAPI();
  5194. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  5195. return $1;
  5196. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3}, smalltalk.UndefinedObject)})},
  5197. args: ["aString", "aString2", "aString3"],
  5198. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
  5199. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  5200. referencedClasses: []
  5201. }),
  5202. smalltalk.UndefinedObject);
  5203. smalltalk.addMethod(
  5204. "_subclass_instanceVariableNames_package_",
  5205. smalltalk.method({
  5206. selector: "subclass:instanceVariableNames:package:",
  5207. category: 'class creation',
  5208. fn: function (aString,aString2,aString3){
  5209. var self=this;
  5210. return smalltalk.withContext(function($ctx1) { var $1;
  5211. $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
  5212. return $1;
  5213. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3}, smalltalk.UndefinedObject)})},
  5214. args: ["aString", "aString2", "aString3"],
  5215. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09 superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  5216. messageSends: ["superclass:subclass:instanceVariableNames:package:", "asString", "new"],
  5217. referencedClasses: ["ClassBuilder"]
  5218. }),
  5219. smalltalk.UndefinedObject);
  5220. smalltalk.addMethod(
  5221. "_new",
  5222. smalltalk.method({
  5223. selector: "new",
  5224. category: 'instance creation',
  5225. fn: function (){
  5226. var self=this;
  5227. return smalltalk.withContext(function($ctx1) { _st(self)._error_("You cannot create new instances of UndefinedObject. Use nil");
  5228. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.UndefinedObject.klass)})},
  5229. args: [],
  5230. source: "new\x0a\x09 self error: 'You cannot create new instances of UndefinedObject. Use nil'",
  5231. messageSends: ["error:"],
  5232. referencedClasses: []
  5233. }),
  5234. smalltalk.UndefinedObject.klass);
  5235. smalltalk.addPackage('Kernel-Classes', {});
  5236. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
  5237. smalltalk.Behavior.comment="Behavior is the superclass of all class objects. \x0a\x0aIt defines the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).\x0aInstances know about the subclass/superclass relationships between classes, contain the description that instances are created from, \x0aand hold the method dictionary that's associated with each class.\x0a\x0aBehavior also provides methods for compiling methods, examining the method dictionary, and iterating over the class hierarchy."
  5238. smalltalk.addMethod(
  5239. "_addCompiledMethod_",
  5240. smalltalk.method({
  5241. selector: "addCompiledMethod:",
  5242. category: 'compiling',
  5243. fn: function (aMethod){
  5244. var self=this;
  5245. return smalltalk.withContext(function($ctx1) { var $1,$2;
  5246. _st(self)._basicAddCompiledMethod_(aMethod);
  5247. $1=_st((smalltalk.MethodAdded || MethodAdded))._new();
  5248. _st($1)._theClass_(self);
  5249. _st($1)._method_(aMethod);
  5250. $2=_st($1)._yourself();
  5251. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  5252. return self}, function($ctx1) {$ctx1.fill(self,"addCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})},
  5253. args: ["aMethod"],
  5254. source: "addCompiledMethod: aMethod\x0a\x09self basicAddCompiledMethod: aMethod.\x0a \x0a SystemAnnouncer current\x0a \x09\x09announce: (MethodAdded new\x0a \x09theClass: self;\x0a method: aMethod;\x0a yourself)",
  5255. messageSends: ["basicAddCompiledMethod:", "announce:", "theClass:", "new", "method:", "yourself", "current"],
  5256. referencedClasses: ["MethodAdded", "SystemAnnouncer"]
  5257. }),
  5258. smalltalk.Behavior);
  5259. smalltalk.addMethod(
  5260. "_allInstanceVariableNames",
  5261. smalltalk.method({
  5262. selector: "allInstanceVariableNames",
  5263. category: 'accessing',
  5264. fn: function (){
  5265. var self=this;
  5266. var result;
  5267. return smalltalk.withContext(function($ctx1) { var $1,$2;
  5268. result=_st(_st(self)._instanceVariableNames())._copy();
  5269. $1=_st(self)._superclass();
  5270. if(($receiver = $1) == nil || $receiver == undefined){
  5271. $1;
  5272. } else {
  5273. _st(result)._addAll_(_st(_st(self)._superclass())._allInstanceVariableNames());
  5274. };
  5275. $2=result;
  5276. return $2;
  5277. }, function($ctx1) {$ctx1.fill(self,"allInstanceVariableNames",{result:result}, smalltalk.Behavior)})},
  5278. args: [],
  5279. source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09 result addAll: self superclass allInstanceVariableNames].\x0a\x09^result",
  5280. messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "addAll:", "allInstanceVariableNames", "superclass"],
  5281. referencedClasses: []
  5282. }),
  5283. smalltalk.Behavior);
  5284. smalltalk.addMethod(
  5285. "_allSubclasses",
  5286. smalltalk.method({
  5287. selector: "allSubclasses",
  5288. category: 'accessing',
  5289. fn: function (){
  5290. var self=this;
  5291. var result;
  5292. return smalltalk.withContext(function($ctx1) { var $1;
  5293. result=_st(self)._subclasses();
  5294. _st(_st(self)._subclasses())._do_((function(each){
  5295. return smalltalk.withContext(function($ctx2) { return _st(result)._addAll_(_st(each)._allSubclasses());
  5296. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  5297. $1=result;
  5298. return $1;
  5299. }, function($ctx1) {$ctx1.fill(self,"allSubclasses",{result:result}, smalltalk.Behavior)})},
  5300. args: [],
  5301. source: "allSubclasses\x0a\x09| result |\x0a\x09result := self subclasses.\x0a\x09self subclasses do: [:each |\x0a\x09 result addAll: each allSubclasses].\x0a\x09^result",
  5302. messageSends: ["subclasses", "do:", "addAll:", "allSubclasses"],
  5303. referencedClasses: []
  5304. }),
  5305. smalltalk.Behavior);
  5306. smalltalk.addMethod(
  5307. "_allSuperclasses",
  5308. smalltalk.method({
  5309. selector: "allSuperclasses",
  5310. category: 'accessing',
  5311. fn: function (){
  5312. var self=this;
  5313. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  5314. $1=_st(self)._superclass();
  5315. if(($receiver = $1) == nil || $receiver == undefined){
  5316. return [];
  5317. } else {
  5318. $1;
  5319. };
  5320. $3=_st((smalltalk.OrderedCollection || OrderedCollection))._with_(_st(self)._superclass());
  5321. _st($3)._addAll_(_st(_st(self)._superclass())._allSuperclasses());
  5322. $4=_st($3)._yourself();
  5323. $2=$4;
  5324. return $2;
  5325. }, function($ctx1) {$ctx1.fill(self,"allSuperclasses",{}, smalltalk.Behavior)})},
  5326. args: [],
  5327. source: "allSuperclasses\x0a\x09\x0a self superclass ifNil: [ ^ #() ].\x0a \x0a\x09^ (OrderedCollection with: self superclass) \x0a \x09addAll: self superclass allSuperclasses;\x0a yourself",
  5328. messageSends: ["ifNil:", "superclass", "addAll:", "allSuperclasses", "with:", "yourself"],
  5329. referencedClasses: ["OrderedCollection"]
  5330. }),
  5331. smalltalk.Behavior);
  5332. smalltalk.addMethod(
  5333. "_basicAddCompiledMethod_",
  5334. smalltalk.method({
  5335. selector: "basicAddCompiledMethod:",
  5336. category: 'private',
  5337. fn: function (aMethod){
  5338. var self=this;
  5339. return smalltalk.withContext(function($ctx1) { smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  5340. return self}, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})},
  5341. args: ["aMethod"],
  5342. source: "basicAddCompiledMethod: aMethod\x0a\x09<smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self)>",
  5343. messageSends: [],
  5344. referencedClasses: []
  5345. }),
  5346. smalltalk.Behavior);
  5347. smalltalk.addMethod(
  5348. "_basicNew",
  5349. smalltalk.method({
  5350. selector: "basicNew",
  5351. category: 'instance creation',
  5352. fn: function (){
  5353. var self=this;
  5354. return smalltalk.withContext(function($ctx1) { return new self.fn();
  5355. return self}, function($ctx1) {$ctx1.fill(self,"basicNew",{}, smalltalk.Behavior)})},
  5356. args: [],
  5357. source: "basicNew\x0a\x09<return new self.fn()>",
  5358. messageSends: [],
  5359. referencedClasses: []
  5360. }),
  5361. smalltalk.Behavior);
  5362. smalltalk.addMethod(
  5363. "_basicRemoveCompiledMethod_",
  5364. smalltalk.method({
  5365. selector: "basicRemoveCompiledMethod:",
  5366. category: 'private',
  5367. fn: function (aMethod){
  5368. var self=this;
  5369. return smalltalk.withContext(function($ctx1) {
  5370. smalltalk.removeMethod(aMethod)
  5371. smalltalk.init(self);
  5372. ;
  5373. return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})},
  5374. args: ["aMethod"],
  5375. source: "basicRemoveCompiledMethod: aMethod\x0a\x09<\x0a \x09smalltalk.removeMethod(aMethod)\x0a\x09\x09smalltalk.init(self);\x0a >",
  5376. messageSends: [],
  5377. referencedClasses: []
  5378. }),
  5379. smalltalk.Behavior);
  5380. smalltalk.addMethod(
  5381. "_canUnderstand_",
  5382. smalltalk.method({
  5383. selector: "canUnderstand:",
  5384. category: 'testing',
  5385. fn: function (aSelector){
  5386. var self=this;
  5387. return smalltalk.withContext(function($ctx1) { var $1;
  5388. $1=_st(_st(_st(_st(self)._methodDictionary())._keys())._includes_(_st(aSelector)._asString()))._or_((function(){
  5389. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._superclass())._notNil())._and_((function(){
  5390. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._superclass())._canUnderstand_(aSelector);
  5391. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  5392. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  5393. return $1;
  5394. }, function($ctx1) {$ctx1.fill(self,"canUnderstand:",{aSelector:aSelector}, smalltalk.Behavior)})},
  5395. args: ["aSelector"],
  5396. source: "canUnderstand: aSelector\x0a\x09^(self methodDictionary keys includes: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [self superclass canUnderstand: aSelector]]",
  5397. messageSends: ["or:", "and:", "canUnderstand:", "superclass", "notNil", "includes:", "asString", "keys", "methodDictionary"],
  5398. referencedClasses: []
  5399. }),
  5400. smalltalk.Behavior);
  5401. smalltalk.addMethod(
  5402. "_comment",
  5403. smalltalk.method({
  5404. selector: "comment",
  5405. category: 'accessing',
  5406. fn: function (){
  5407. var self=this;
  5408. return smalltalk.withContext(function($ctx1) { var $2,$1;
  5409. $2=_st(self)._basicAt_("comment");
  5410. if(($receiver = $2) == nil || $receiver == undefined){
  5411. $1="";
  5412. } else {
  5413. $1=$2;
  5414. };
  5415. return $1;
  5416. }, function($ctx1) {$ctx1.fill(self,"comment",{}, smalltalk.Behavior)})},
  5417. args: [],
  5418. source: "comment\x0a ^(self basicAt: 'comment') ifNil: ['']",
  5419. messageSends: ["ifNil:", "basicAt:"],
  5420. referencedClasses: []
  5421. }),
  5422. smalltalk.Behavior);
  5423. smalltalk.addMethod(
  5424. "_comment_",
  5425. smalltalk.method({
  5426. selector: "comment:",
  5427. category: 'accessing',
  5428. fn: function (aString){
  5429. var self=this;
  5430. return smalltalk.withContext(function($ctx1) { var $1,$2;
  5431. _st(self)._basicAt_put_("comment",aString);
  5432. $1=_st((smalltalk.ClassCommentChanged || ClassCommentChanged))._new();
  5433. _st($1)._theClass_(self);
  5434. $2=_st($1)._yourself();
  5435. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  5436. return self}, function($ctx1) {$ctx1.fill(self,"comment:",{aString:aString}, smalltalk.Behavior)})},
  5437. args: ["aString"],
  5438. source: "comment: aString\x0a self basicAt: 'comment' put: aString.\x0a SystemAnnouncer current\x0a \x09announce: (ClassCommentChanged new\x0a \x09theClass: self;\x0a yourself)",
  5439. messageSends: ["basicAt:put:", "announce:", "theClass:", "new", "yourself", "current"],
  5440. referencedClasses: ["ClassCommentChanged", "SystemAnnouncer"]
  5441. }),
  5442. smalltalk.Behavior);
  5443. smalltalk.addMethod(
  5444. "_commentStamp",
  5445. smalltalk.method({
  5446. selector: "commentStamp",
  5447. category: 'accessing',
  5448. fn: function (){
  5449. var self=this;
  5450. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  5451. $2=_st((smalltalk.ClassCommentReader || ClassCommentReader))._new();
  5452. _st($2)._class_(self);
  5453. $3=_st($2)._yourself();
  5454. $1=$3;
  5455. return $1;
  5456. }, function($ctx1) {$ctx1.fill(self,"commentStamp",{}, smalltalk.Behavior)})},
  5457. args: [],
  5458. source: "commentStamp\x0a ^ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
  5459. messageSends: ["class:", "new", "yourself"],
  5460. referencedClasses: ["ClassCommentReader"]
  5461. }),
  5462. smalltalk.Behavior);
  5463. smalltalk.addMethod(
  5464. "_commentStamp_prior_",
  5465. smalltalk.method({
  5466. selector: "commentStamp:prior:",
  5467. category: 'accessing',
  5468. fn: function (aStamp,prior){
  5469. var self=this;
  5470. return smalltalk.withContext(function($ctx1) { var $1;
  5471. $1=_st(self)._commentStamp();
  5472. return $1;
  5473. }, function($ctx1) {$ctx1.fill(self,"commentStamp:prior:",{aStamp:aStamp,prior:prior}, smalltalk.Behavior)})},
  5474. args: ["aStamp", "prior"],
  5475. source: "commentStamp: aStamp prior: prior\x0a ^self commentStamp",
  5476. messageSends: ["commentStamp"],
  5477. referencedClasses: []
  5478. }),
  5479. smalltalk.Behavior);
  5480. smalltalk.addMethod(
  5481. "_compile_",
  5482. smalltalk.method({
  5483. selector: "compile:",
  5484. category: 'compiling',
  5485. fn: function (aString){
  5486. var self=this;
  5487. return smalltalk.withContext(function($ctx1) { _st(self)._compile_category_(aString,"");
  5488. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString}, smalltalk.Behavior)})},
  5489. args: ["aString"],
  5490. source: "compile: aString\x0a\x09self compile: aString category: ''",
  5491. messageSends: ["compile:category:"],
  5492. referencedClasses: []
  5493. }),
  5494. smalltalk.Behavior);
  5495. smalltalk.addMethod(
  5496. "_compile_category_",
  5497. smalltalk.method({
  5498. selector: "compile:category:",
  5499. category: 'compiling',
  5500. fn: function (aString,anotherString){
  5501. var self=this;
  5502. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(aString,self,anotherString);
  5503. return self}, function($ctx1) {$ctx1.fill(self,"compile:category:",{aString:aString,anotherString:anotherString}, smalltalk.Behavior)})},
  5504. args: ["aString", "anotherString"],
  5505. source: "compile: aString category: anotherString\x0a\x09Compiler new\x0a\x09\x09install: aString \x0a forClass: self \x0a category: anotherString",
  5506. messageSends: ["install:forClass:category:", "new"],
  5507. referencedClasses: ["Compiler"]
  5508. }),
  5509. smalltalk.Behavior);
  5510. smalltalk.addMethod(
  5511. "_definition",
  5512. smalltalk.method({
  5513. selector: "definition",
  5514. category: 'accessing',
  5515. fn: function (){
  5516. var self=this;
  5517. return smalltalk.withContext(function($ctx1) { return "";
  5518. }, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Behavior)})},
  5519. args: [],
  5520. source: "definition\x0a\x09^ ''",
  5521. messageSends: [],
  5522. referencedClasses: []
  5523. }),
  5524. smalltalk.Behavior);
  5525. smalltalk.addMethod(
  5526. "_includesSelector_",
  5527. smalltalk.method({
  5528. selector: "includesSelector:",
  5529. category: 'testing',
  5530. fn: function (aSymbol){
  5531. var self=this;
  5532. return smalltalk.withContext(function($ctx1) { var $1;
  5533. $1=_st(_st(self)._methodDictionary())._includesKey_(_st(aSymbol)._asString());
  5534. return $1;
  5535. }, function($ctx1) {$ctx1.fill(self,"includesSelector:",{aSymbol:aSymbol}, smalltalk.Behavior)})},
  5536. args: ["aSymbol"],
  5537. source: "includesSelector: aSymbol\x0a\x09^ self methodDictionary includesKey: aSymbol asString",
  5538. messageSends: ["includesKey:", "asString", "methodDictionary"],
  5539. referencedClasses: []
  5540. }),
  5541. smalltalk.Behavior);
  5542. smalltalk.addMethod(
  5543. "_inheritsFrom_",
  5544. smalltalk.method({
  5545. selector: "inheritsFrom:",
  5546. category: 'testing',
  5547. fn: function (aClass){
  5548. var self=this;
  5549. return smalltalk.withContext(function($ctx1) { var $1;
  5550. $1=_st(_st(aClass)._allSubclasses())._includes_(self);
  5551. return $1;
  5552. }, function($ctx1) {$ctx1.fill(self,"inheritsFrom:",{aClass:aClass}, smalltalk.Behavior)})},
  5553. args: ["aClass"],
  5554. source: "inheritsFrom: aClass\x0a\x09^aClass allSubclasses includes: self",
  5555. messageSends: ["includes:", "allSubclasses"],
  5556. referencedClasses: []
  5557. }),
  5558. smalltalk.Behavior);
  5559. smalltalk.addMethod(
  5560. "_instanceVariableNames",
  5561. smalltalk.method({
  5562. selector: "instanceVariableNames",
  5563. category: 'accessing',
  5564. fn: function (){
  5565. var self=this;
  5566. return smalltalk.withContext(function($ctx1) { return self.iVarNames;
  5567. return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames",{}, smalltalk.Behavior)})},
  5568. args: [],
  5569. source: "instanceVariableNames\x0a\x09<return self.iVarNames>",
  5570. messageSends: [],
  5571. referencedClasses: []
  5572. }),
  5573. smalltalk.Behavior);
  5574. smalltalk.addMethod(
  5575. "_lookupSelector_",
  5576. smalltalk.method({
  5577. selector: "lookupSelector:",
  5578. category: 'accessing',
  5579. fn: function (selector){
  5580. var self=this;
  5581. var lookupClass;
  5582. return smalltalk.withContext(function($ctx1) { var $1,$2;
  5583. var $early={};
  5584. try {
  5585. lookupClass=self;
  5586. _st((function(){
  5587. return smalltalk.withContext(function($ctx2) { return _st(lookupClass).__eq(nil);
  5588. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  5589. return smalltalk.withContext(function($ctx2) { $1=_st(lookupClass)._includesSelector_(selector);
  5590. if(smalltalk.assert($1)){
  5591. $2=_st(lookupClass)._methodAt_(selector);
  5592. throw $early=[$2];
  5593. };
  5594. lookupClass=_st(lookupClass)._superclass();
  5595. return lookupClass;
  5596. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  5597. return nil;
  5598. }
  5599. catch(e) {if(e===$early)return e[0]; throw e}
  5600. }, function($ctx1) {$ctx1.fill(self,"lookupSelector:",{selector:selector,lookupClass:lookupClass}, smalltalk.Behavior)})},
  5601. args: ["selector"],
  5602. source: "lookupSelector: selector\x0a\x09\x22Look up the given selector in my methodDictionary.\x0a\x09Return the corresponding method if found.\x0a\x09Otherwise chase the superclass chain and try again.\x0a\x09Return nil if no method is found.\x22\x0a \x0a\x09| lookupClass |\x0a \x0a\x09lookupClass := self.\x0a\x09[ lookupClass = nil ] whileFalse: [\x0a \x09(lookupClass includesSelector: selector)\x0a\x09\x09\x09\x09ifTrue: [ ^ lookupClass methodAt: selector ].\x0a\x09\x09\x09lookupClass := lookupClass superclass ].\x0a\x09^ nil",
  5603. messageSends: ["whileFalse:", "ifTrue:", "methodAt:", "includesSelector:", "superclass", "="],
  5604. referencedClasses: []
  5605. }),
  5606. smalltalk.Behavior);
  5607. smalltalk.addMethod(
  5608. "_methodAt_",
  5609. smalltalk.method({
  5610. selector: "methodAt:",
  5611. category: 'accessing',
  5612. fn: function (aSymbol){
  5613. var self=this;
  5614. return smalltalk.withContext(function($ctx1) { var $1;
  5615. $1=_st(_st(self)._methodDictionary())._at_(_st(aSymbol)._asString());
  5616. return $1;
  5617. }, function($ctx1) {$ctx1.fill(self,"methodAt:",{aSymbol:aSymbol}, smalltalk.Behavior)})},
  5618. args: ["aSymbol"],
  5619. source: "methodAt: aSymbol\x0a\x09^ self methodDictionary at: aSymbol asString",
  5620. messageSends: ["at:", "asString", "methodDictionary"],
  5621. referencedClasses: []
  5622. }),
  5623. smalltalk.Behavior);
  5624. smalltalk.addMethod(
  5625. "_methodDictionary",
  5626. smalltalk.method({
  5627. selector: "methodDictionary",
  5628. category: 'accessing',
  5629. fn: function (){
  5630. var self=this;
  5631. return smalltalk.withContext(function($ctx1) { var dict = smalltalk.HashedCollection._new();
  5632. var methods = self.methods;
  5633. for(var i in methods) {
  5634. if(methods[i].selector) {
  5635. dict._at_put_(methods[i].selector, methods[i]);
  5636. }
  5637. };
  5638. return dict;
  5639. return self}, function($ctx1) {$ctx1.fill(self,"methodDictionary",{}, smalltalk.Behavior)})},
  5640. args: [],
  5641. source: "methodDictionary\x0a\x09<var dict = smalltalk.HashedCollection._new();\x0a\x09var methods = self.methods;\x0a\x09for(var i in methods) {\x0a\x09\x09if(methods[i].selector) {\x0a\x09\x09\x09dict._at_put_(methods[i].selector, methods[i]);\x0a\x09\x09}\x0a\x09};\x0a\x09return dict>",
  5642. messageSends: [],
  5643. referencedClasses: []
  5644. }),
  5645. smalltalk.Behavior);
  5646. smalltalk.addMethod(
  5647. "_methods",
  5648. smalltalk.method({
  5649. selector: "methods",
  5650. category: 'accessing',
  5651. fn: function (){
  5652. var self=this;
  5653. return smalltalk.withContext(function($ctx1) { var $1;
  5654. $1=_st(_st(self)._methodDictionary())._values();
  5655. return $1;
  5656. }, function($ctx1) {$ctx1.fill(self,"methods",{}, smalltalk.Behavior)})},
  5657. args: [],
  5658. source: "methods\x0a\x09^ self methodDictionary values",
  5659. messageSends: ["values", "methodDictionary"],
  5660. referencedClasses: []
  5661. }),
  5662. smalltalk.Behavior);
  5663. smalltalk.addMethod(
  5664. "_methodsFor_",
  5665. smalltalk.method({
  5666. selector: "methodsFor:",
  5667. category: 'accessing',
  5668. fn: function (aString){
  5669. var self=this;
  5670. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  5671. $2=_st((smalltalk.ClassCategoryReader || ClassCategoryReader))._new();
  5672. _st($2)._class_category_(self,aString);
  5673. $3=_st($2)._yourself();
  5674. $1=$3;
  5675. return $1;
  5676. }, function($ctx1) {$ctx1.fill(self,"methodsFor:",{aString:aString}, smalltalk.Behavior)})},
  5677. args: ["aString"],
  5678. source: "methodsFor: aString\x0a\x09^ClassCategoryReader new\x0a\x09 class: self category: aString;\x0a\x09 yourself",
  5679. messageSends: ["class:category:", "new", "yourself"],
  5680. referencedClasses: ["ClassCategoryReader"]
  5681. }),
  5682. smalltalk.Behavior);
  5683. smalltalk.addMethod(
  5684. "_methodsFor_stamp_",
  5685. smalltalk.method({
  5686. selector: "methodsFor:stamp:",
  5687. category: 'accessing',
  5688. fn: function (aString,aStamp){
  5689. var self=this;
  5690. return smalltalk.withContext(function($ctx1) { var $1;
  5691. $1=_st(self)._methodsFor_(aString);
  5692. return $1;
  5693. }, function($ctx1) {$ctx1.fill(self,"methodsFor:stamp:",{aString:aString,aStamp:aStamp}, smalltalk.Behavior)})},
  5694. args: ["aString", "aStamp"],
  5695. source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for compatibility, right now ignores stamp.\x22\x0a\x09^self methodsFor: aString",
  5696. messageSends: ["methodsFor:"],
  5697. referencedClasses: []
  5698. }),
  5699. smalltalk.Behavior);
  5700. smalltalk.addMethod(
  5701. "_methodsInProtocol_",
  5702. smalltalk.method({
  5703. selector: "methodsInProtocol:",
  5704. category: 'accessing',
  5705. fn: function (aString){
  5706. var self=this;
  5707. return smalltalk.withContext(function($ctx1) { var $1;
  5708. $1=_st(_st(_st(self)._methodDictionary())._values())._select_((function(each){
  5709. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._protocol()).__eq(aString);
  5710. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  5711. return $1;
  5712. }, function($ctx1) {$ctx1.fill(self,"methodsInProtocol:",{aString:aString}, smalltalk.Behavior)})},
  5713. args: ["aString"],
  5714. source: "methodsInProtocol: aString\x0a\x09^ self methodDictionary values select: [ :each | each protocol = aString ]",
  5715. messageSends: ["select:", "=", "protocol", "values", "methodDictionary"],
  5716. referencedClasses: []
  5717. }),
  5718. smalltalk.Behavior);
  5719. smalltalk.addMethod(
  5720. "_name",
  5721. smalltalk.method({
  5722. selector: "name",
  5723. category: 'accessing',
  5724. fn: function (){
  5725. var self=this;
  5726. return smalltalk.withContext(function($ctx1) { return self.className || nil;
  5727. return self}, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.Behavior)})},
  5728. args: [],
  5729. source: "name\x0a\x09<return self.className || nil>",
  5730. messageSends: [],
  5731. referencedClasses: []
  5732. }),
  5733. smalltalk.Behavior);
  5734. smalltalk.addMethod(
  5735. "_new",
  5736. smalltalk.method({
  5737. selector: "new",
  5738. category: 'instance creation',
  5739. fn: function (){
  5740. var self=this;
  5741. return smalltalk.withContext(function($ctx1) { var $1;
  5742. $1=_st(_st(self)._basicNew())._initialize();
  5743. return $1;
  5744. }, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.Behavior)})},
  5745. args: [],
  5746. source: "new\x0a\x09^self basicNew initialize",
  5747. messageSends: ["initialize", "basicNew"],
  5748. referencedClasses: []
  5749. }),
  5750. smalltalk.Behavior);
  5751. smalltalk.addMethod(
  5752. "_organization",
  5753. smalltalk.method({
  5754. selector: "organization",
  5755. category: 'accessing',
  5756. fn: function (){
  5757. var self=this;
  5758. return smalltalk.withContext(function($ctx1) { var $1;
  5759. $1=_st(self)._basicAt_("organization");
  5760. return $1;
  5761. }, function($ctx1) {$ctx1.fill(self,"organization",{}, smalltalk.Behavior)})},
  5762. args: [],
  5763. source: "organization\x0a\x09^ self basicAt: 'organization'",
  5764. messageSends: ["basicAt:"],
  5765. referencedClasses: []
  5766. }),
  5767. smalltalk.Behavior);
  5768. smalltalk.addMethod(
  5769. "_protocols",
  5770. smalltalk.method({
  5771. selector: "protocols",
  5772. category: 'accessing',
  5773. fn: function (){
  5774. var self=this;
  5775. return smalltalk.withContext(function($ctx1) { var $1;
  5776. $1=_st(_st(_st(self)._organization())._elements())._sorted();
  5777. return $1;
  5778. }, function($ctx1) {$ctx1.fill(self,"protocols",{}, smalltalk.Behavior)})},
  5779. args: [],
  5780. source: "protocols\x0a ^ self organization elements sorted",
  5781. messageSends: ["sorted", "elements", "organization"],
  5782. referencedClasses: []
  5783. }),
  5784. smalltalk.Behavior);
  5785. smalltalk.addMethod(
  5786. "_protocolsDo_",
  5787. smalltalk.method({
  5788. selector: "protocolsDo:",
  5789. category: 'accessing',
  5790. fn: function (aBlock){
  5791. var self=this;
  5792. var methodsByCategory;
  5793. return smalltalk.withContext(function($ctx1) { methodsByCategory=_st((smalltalk.HashedCollection || HashedCollection))._new();
  5794. _st(_st(_st(self)._methodDictionary())._values())._do_((function(m){
  5795. return smalltalk.withContext(function($ctx2) { return _st(_st(methodsByCategory)._at_ifAbsentPut_(_st(m)._category(),(function(){
  5796. return smalltalk.withContext(function($ctx3) { return _st((smalltalk.Array || Array))._new();
  5797. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._add_(m);
  5798. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1)})}));
  5799. _st(_st(self)._protocols())._do_((function(category){
  5800. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_value_(category,_st(methodsByCategory)._at_(category));
  5801. }, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1)})}));
  5802. return self}, function($ctx1) {$ctx1.fill(self,"protocolsDo:",{aBlock:aBlock,methodsByCategory:methodsByCategory}, smalltalk.Behavior)})},
  5803. args: ["aBlock"],
  5804. source: "protocolsDo: aBlock\x0a\x09\x22Execute aBlock for each method category with\x0a\x09its collection of methods in the sort order of category name.\x22\x0a\x0a\x09| methodsByCategory |\x0a\x09methodsByCategory := HashedCollection new.\x0a\x09self methodDictionary values do: [:m |\x0a\x09\x09(methodsByCategory at: m category ifAbsentPut: [Array new])\x0a \x09\x09\x09add: m]. \x0a\x09self protocols do: [:category |\x0a\x09\x09aBlock value: category value: (methodsByCategory at: category)]",
  5805. messageSends: ["new", "do:", "add:", "at:ifAbsentPut:", "category", "values", "methodDictionary", "value:value:", "at:", "protocols"],
  5806. referencedClasses: ["HashedCollection", "Array"]
  5807. }),
  5808. smalltalk.Behavior);
  5809. smalltalk.addMethod(
  5810. "_prototype",
  5811. smalltalk.method({
  5812. selector: "prototype",
  5813. category: 'accessing',
  5814. fn: function (){
  5815. var self=this;
  5816. return smalltalk.withContext(function($ctx1) { return self.fn.prototype;
  5817. return self}, function($ctx1) {$ctx1.fill(self,"prototype",{}, smalltalk.Behavior)})},
  5818. args: [],
  5819. source: "prototype\x0a\x09<return self.fn.prototype>",
  5820. messageSends: [],
  5821. referencedClasses: []
  5822. }),
  5823. smalltalk.Behavior);
  5824. smalltalk.addMethod(
  5825. "_removeCompiledMethod_",
  5826. smalltalk.method({
  5827. selector: "removeCompiledMethod:",
  5828. category: 'compiling',
  5829. fn: function (aMethod){
  5830. var self=this;
  5831. return smalltalk.withContext(function($ctx1) { var $1,$2;
  5832. _st(self)._basicRemoveCompiledMethod_(aMethod);
  5833. $1=_st((smalltalk.MethodRemoved || MethodRemoved))._new();
  5834. _st($1)._theClass_(self);
  5835. _st($1)._method_(aMethod);
  5836. $2=_st($1)._yourself();
  5837. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  5838. return self}, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})},
  5839. args: ["aMethod"],
  5840. source: "removeCompiledMethod: aMethod\x0a\x09self basicRemoveCompiledMethod: aMethod.\x0a \x0a SystemAnnouncer current\x0a \x09\x09announce: (MethodRemoved new\x0a \x09theClass: self;\x0a method: aMethod;\x0a yourself)",
  5841. messageSends: ["basicRemoveCompiledMethod:", "announce:", "theClass:", "new", "method:", "yourself", "current"],
  5842. referencedClasses: ["MethodRemoved", "SystemAnnouncer"]
  5843. }),
  5844. smalltalk.Behavior);
  5845. smalltalk.addMethod(
  5846. "_selectors",
  5847. smalltalk.method({
  5848. selector: "selectors",
  5849. category: 'accessing',
  5850. fn: function (){
  5851. var self=this;
  5852. return smalltalk.withContext(function($ctx1) { var $1;
  5853. $1=_st(_st(self)._methodDictionary())._keys();
  5854. return $1;
  5855. }, function($ctx1) {$ctx1.fill(self,"selectors",{}, smalltalk.Behavior)})},
  5856. args: [],
  5857. source: "selectors\x0a\x09^ self methodDictionary keys",
  5858. messageSends: ["keys", "methodDictionary"],
  5859. referencedClasses: []
  5860. }),
  5861. smalltalk.Behavior);
  5862. smalltalk.addMethod(
  5863. "_subclasses",
  5864. smalltalk.method({
  5865. selector: "subclasses",
  5866. category: 'accessing',
  5867. fn: function (){
  5868. var self=this;
  5869. return smalltalk.withContext(function($ctx1) { return smalltalk.subclasses(self);
  5870. return self}, function($ctx1) {$ctx1.fill(self,"subclasses",{}, smalltalk.Behavior)})},
  5871. args: [],
  5872. source: "subclasses\x0a\x09<return smalltalk.subclasses(self)>",
  5873. messageSends: [],
  5874. referencedClasses: []
  5875. }),
  5876. smalltalk.Behavior);
  5877. smalltalk.addMethod(
  5878. "_superclass",
  5879. smalltalk.method({
  5880. selector: "superclass",
  5881. category: 'accessing',
  5882. fn: function (){
  5883. var self=this;
  5884. return smalltalk.withContext(function($ctx1) { return self.superclass || nil;
  5885. return self}, function($ctx1) {$ctx1.fill(self,"superclass",{}, smalltalk.Behavior)})},
  5886. args: [],
  5887. source: "superclass\x0a\x09<return self.superclass || nil>",
  5888. messageSends: [],
  5889. referencedClasses: []
  5890. }),
  5891. smalltalk.Behavior);
  5892. smalltalk.addMethod(
  5893. "_theMetaClass",
  5894. smalltalk.method({
  5895. selector: "theMetaClass",
  5896. category: 'accessing',
  5897. fn: function (){
  5898. var self=this;
  5899. return smalltalk.withContext(function($ctx1) { var $1;
  5900. $1=_st(self)._class();
  5901. return $1;
  5902. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{}, smalltalk.Behavior)})},
  5903. args: [],
  5904. source: "theMetaClass\x0a\x09^ self class",
  5905. messageSends: ["class"],
  5906. referencedClasses: []
  5907. }),
  5908. smalltalk.Behavior);
  5909. smalltalk.addMethod(
  5910. "_theNonMetaClass",
  5911. smalltalk.method({
  5912. selector: "theNonMetaClass",
  5913. category: 'accessing',
  5914. fn: function (){
  5915. var self=this;
  5916. return smalltalk.withContext(function($ctx1) { var $1;
  5917. $1=self;
  5918. return $1;
  5919. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{}, smalltalk.Behavior)})},
  5920. args: [],
  5921. source: "theNonMetaClass\x0a\x09^ self",
  5922. messageSends: [],
  5923. referencedClasses: []
  5924. }),
  5925. smalltalk.Behavior);
  5926. smalltalk.addMethod(
  5927. "_withAllSubclasses",
  5928. smalltalk.method({
  5929. selector: "withAllSubclasses",
  5930. category: 'accessing',
  5931. fn: function (){
  5932. var self=this;
  5933. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  5934. $2=_st((smalltalk.Array || Array))._with_(self);
  5935. _st($2)._addAll_(_st(self)._allSubclasses());
  5936. $3=_st($2)._yourself();
  5937. $1=$3;
  5938. return $1;
  5939. }, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{}, smalltalk.Behavior)})},
  5940. args: [],
  5941. source: "withAllSubclasses\x0a\x09^(Array with: self) addAll: self allSubclasses; yourself",
  5942. messageSends: ["addAll:", "allSubclasses", "with:", "yourself"],
  5943. referencedClasses: ["Array"]
  5944. }),
  5945. smalltalk.Behavior);
  5946. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  5947. smalltalk.Class.comment="Class is __the__ class object. \x0a\x0aInstances are the classes of the system.\x0aClass creation is done throught a `ClassBuilder`"
  5948. smalltalk.addMethod(
  5949. "_asJavascript",
  5950. smalltalk.method({
  5951. selector: "asJavascript",
  5952. category: 'converting',
  5953. fn: function (){
  5954. var self=this;
  5955. return smalltalk.withContext(function($ctx1) { var $1;
  5956. $1=_st("smalltalk.").__comma(_st(self)._name());
  5957. return $1;
  5958. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Class)})},
  5959. args: [],
  5960. source: "asJavascript\x0a\x09^ 'smalltalk.', self name",
  5961. messageSends: [",", "name"],
  5962. referencedClasses: []
  5963. }),
  5964. smalltalk.Class);
  5965. smalltalk.addMethod(
  5966. "_category",
  5967. smalltalk.method({
  5968. selector: "category",
  5969. category: 'accessing',
  5970. fn: function (){
  5971. var self=this;
  5972. return smalltalk.withContext(function($ctx1) { var $2,$1;
  5973. $2=_st(self)._package();
  5974. if(($receiver = $2) == nil || $receiver == undefined){
  5975. $1="Unclassified";
  5976. } else {
  5977. $1=_st(_st(self)._package())._name();
  5978. };
  5979. return $1;
  5980. }, function($ctx1) {$ctx1.fill(self,"category",{}, smalltalk.Class)})},
  5981. args: [],
  5982. source: "category\x0a\x09^self package ifNil: ['Unclassified'] ifNotNil: [self package name]",
  5983. messageSends: ["ifNil:ifNotNil:", "name", "package"],
  5984. referencedClasses: []
  5985. }),
  5986. smalltalk.Class);
  5987. smalltalk.addMethod(
  5988. "_definition",
  5989. smalltalk.method({
  5990. selector: "definition",
  5991. category: 'accessing',
  5992. fn: function (){
  5993. var self=this;
  5994. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$5,$1;
  5995. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  5996. return smalltalk.withContext(function($ctx2) { $2=stream;
  5997. _st($2)._nextPutAll_(_st(_st(self)._superclass())._asString());
  5998. _st($2)._nextPutAll_(" subclass: #");
  5999. _st($2)._nextPutAll_(_st(self)._name());
  6000. _st($2)._nextPutAll_(_st(_st((smalltalk.String || String))._lf()).__comma(_st((smalltalk.String || String))._tab()));
  6001. $3=_st($2)._nextPutAll_("instanceVariableNames: '");
  6002. $3;
  6003. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  6004. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(each);
  6005. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  6006. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(" ");
  6007. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  6008. $4=stream;
  6009. _st($4)._nextPutAll_(_st(_st("'").__comma(_st((smalltalk.String || String))._lf())).__comma(_st((smalltalk.String || String))._tab()));
  6010. _st($4)._nextPutAll_("package: '");
  6011. _st($4)._nextPutAll_(_st(self)._category());
  6012. $5=_st($4)._nextPutAll_("'");
  6013. return $5;
  6014. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  6015. return $1;
  6016. }, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Class)})},
  6017. args: [],
  6018. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09 \x09nextPutAll: self superclass asString;\x0a\x09 \x09nextPutAll: ' subclass: #';\x0a\x09 \x09nextPutAll: self name;\x0a\x09 \x09nextPutAll: String lf, String tab;\x0a\x09 \x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames \x0a \x09do: [ :each | stream nextPutAll: each ] \x0a\x09 \x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream\x0a\x09 \x09nextPutAll: '''', String lf, String tab;\x0a\x09 \x09nextPutAll: 'package: ''';\x0a\x09 \x09nextPutAll: self category;\x0a\x09 \x09nextPutAll: '''' ]",
  6019. messageSends: ["streamContents:", "nextPutAll:", "asString", "superclass", "name", ",", "tab", "lf", "do:separatedBy:", "instanceVariableNames", "category"],
  6020. referencedClasses: ["String"]
  6021. }),
  6022. smalltalk.Class);
  6023. smalltalk.addMethod(
  6024. "_isClass",
  6025. smalltalk.method({
  6026. selector: "isClass",
  6027. category: 'testing',
  6028. fn: function (){
  6029. var self=this;
  6030. return smalltalk.withContext(function($ctx1) { return true;
  6031. }, function($ctx1) {$ctx1.fill(self,"isClass",{}, smalltalk.Class)})},
  6032. args: [],
  6033. source: "isClass\x0a\x09^true",
  6034. messageSends: [],
  6035. referencedClasses: []
  6036. }),
  6037. smalltalk.Class);
  6038. smalltalk.addMethod(
  6039. "_package",
  6040. smalltalk.method({
  6041. selector: "package",
  6042. category: 'accessing',
  6043. fn: function (){
  6044. var self=this;
  6045. return smalltalk.withContext(function($ctx1) { return self.pkg;
  6046. return self}, function($ctx1) {$ctx1.fill(self,"package",{}, smalltalk.Class)})},
  6047. args: [],
  6048. source: "package\x0a\x09<return self.pkg>",
  6049. messageSends: [],
  6050. referencedClasses: []
  6051. }),
  6052. smalltalk.Class);
  6053. smalltalk.addMethod(
  6054. "_package_",
  6055. smalltalk.method({
  6056. selector: "package:",
  6057. category: 'accessing',
  6058. fn: function (aPackage){
  6059. var self=this;
  6060. return smalltalk.withContext(function($ctx1) { self.pkg = aPackage;
  6061. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage}, smalltalk.Class)})},
  6062. args: ["aPackage"],
  6063. source: "package: aPackage\x0a\x09<self.pkg = aPackage>",
  6064. messageSends: [],
  6065. referencedClasses: []
  6066. }),
  6067. smalltalk.Class);
  6068. smalltalk.addMethod(
  6069. "_printString",
  6070. smalltalk.method({
  6071. selector: "printString",
  6072. category: 'printing',
  6073. fn: function (){
  6074. var self=this;
  6075. return smalltalk.withContext(function($ctx1) { var $1;
  6076. $1=_st(self)._name();
  6077. return $1;
  6078. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Class)})},
  6079. args: [],
  6080. source: "printString\x0a\x09^self name",
  6081. messageSends: ["name"],
  6082. referencedClasses: []
  6083. }),
  6084. smalltalk.Class);
  6085. smalltalk.addMethod(
  6086. "_rename_",
  6087. smalltalk.method({
  6088. selector: "rename:",
  6089. category: 'accessing',
  6090. fn: function (aString){
  6091. var self=this;
  6092. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._renameClass_to_(self,aString);
  6093. return self}, function($ctx1) {$ctx1.fill(self,"rename:",{aString:aString}, smalltalk.Class)})},
  6094. args: ["aString"],
  6095. source: "rename: aString\x0a\x09ClassBuilder new renameClass: self to: aString",
  6096. messageSends: ["renameClass:to:", "new"],
  6097. referencedClasses: ["ClassBuilder"]
  6098. }),
  6099. smalltalk.Class);
  6100. smalltalk.addMethod(
  6101. "_subclass_instanceVariableNames_",
  6102. smalltalk.method({
  6103. selector: "subclass:instanceVariableNames:",
  6104. category: 'class creation',
  6105. fn: function (aString,anotherString){
  6106. var self=this;
  6107. return smalltalk.withContext(function($ctx1) { var $1;
  6108. $1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  6109. return $1;
  6110. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString}, smalltalk.Class)})},
  6111. args: ["aString", "anotherString"],
  6112. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
  6113. messageSends: ["subclass:instanceVariableNames:package:"],
  6114. referencedClasses: []
  6115. }),
  6116. smalltalk.Class);
  6117. smalltalk.addMethod(
  6118. "_subclass_instanceVariableNames_category_",
  6119. smalltalk.method({
  6120. selector: "subclass:instanceVariableNames:category:",
  6121. category: 'class creation',
  6122. fn: function (aString,aString2,aString3){
  6123. var self=this;
  6124. return smalltalk.withContext(function($ctx1) { var $1;
  6125. _st(self)._deprecatedAPI();
  6126. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  6127. return $1;
  6128. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3}, smalltalk.Class)})},
  6129. args: ["aString", "aString2", "aString3"],
  6130. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
  6131. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  6132. referencedClasses: []
  6133. }),
  6134. smalltalk.Class);
  6135. smalltalk.addMethod(
  6136. "_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_",
  6137. smalltalk.method({
  6138. selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
  6139. category: 'class creation',
  6140. fn: function (aString,aString2,classVars,pools,aString3){
  6141. var self=this;
  6142. return smalltalk.withContext(function($ctx1) { var $1;
  6143. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  6144. return $1;
  6145. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3}, smalltalk.Class)})},
  6146. args: ["aString", "aString2", "classVars", "pools", "aString3"],
  6147. source: "subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3\x0a\x09\x22Just ignore class variables and pools. Added for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
  6148. messageSends: ["subclass:instanceVariableNames:package:"],
  6149. referencedClasses: []
  6150. }),
  6151. smalltalk.Class);
  6152. smalltalk.addMethod(
  6153. "_subclass_instanceVariableNames_package_",
  6154. smalltalk.method({
  6155. selector: "subclass:instanceVariableNames:package:",
  6156. category: 'class creation',
  6157. fn: function (aString,aString2,aString3){
  6158. var self=this;
  6159. return smalltalk.withContext(function($ctx1) { var $1;
  6160. $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
  6161. return $1;
  6162. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3}, smalltalk.Class)})},
  6163. args: ["aString", "aString2", "aString3"],
  6164. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09 superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  6165. messageSends: ["superclass:subclass:instanceVariableNames:package:", "asString", "new"],
  6166. referencedClasses: ["ClassBuilder"]
  6167. }),
  6168. smalltalk.Class);
  6169. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  6170. smalltalk.Metaclass.comment="Metaclass is the root of the class hierarchy.\x0a\x0aMetaclass instances are metaclasses, one for each real class. \x0aMetaclass instances have a single instance, which they hold onto, which is the class that they are the metaclass of."
  6171. smalltalk.addMethod(
  6172. "_asJavascript",
  6173. smalltalk.method({
  6174. selector: "asJavascript",
  6175. category: 'converting',
  6176. fn: function (){
  6177. var self=this;
  6178. return smalltalk.withContext(function($ctx1) { var $1;
  6179. $1=_st(_st("smalltalk.").__comma(_st(_st(self)._instanceClass())._name())).__comma(".klass");
  6180. return $1;
  6181. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Metaclass)})},
  6182. args: [],
  6183. source: "asJavascript\x0a\x09^ 'smalltalk.', self instanceClass name, '.klass'",
  6184. messageSends: [",", "name", "instanceClass"],
  6185. referencedClasses: []
  6186. }),
  6187. smalltalk.Metaclass);
  6188. smalltalk.addMethod(
  6189. "_definition",
  6190. smalltalk.method({
  6191. selector: "definition",
  6192. category: 'accessing',
  6193. fn: function (){
  6194. var self=this;
  6195. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  6196. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  6197. return smalltalk.withContext(function($ctx2) { $2=stream;
  6198. _st($2)._nextPutAll_(_st(self)._asString());
  6199. _st($2)._nextPutAll_(" class ");
  6200. $3=_st($2)._nextPutAll_("instanceVariableNames: '");
  6201. $3;
  6202. _st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
  6203. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(each);
  6204. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  6205. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(" ");
  6206. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  6207. return _st(stream)._nextPutAll_("'");
  6208. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  6209. return $1;
  6210. }, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Metaclass)})},
  6211. args: [],
  6212. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09 \x09 \x09nextPutAll: self asString;\x0a\x09 \x09nextPutAll: ' class ';\x0a\x09 \x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames\x0a\x09 \x09do: [ :each | stream nextPutAll: each ]\x0a\x09 \x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream nextPutAll: '''' ]",
  6213. messageSends: ["streamContents:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames"],
  6214. referencedClasses: ["String"]
  6215. }),
  6216. smalltalk.Metaclass);
  6217. smalltalk.addMethod(
  6218. "_instanceClass",
  6219. smalltalk.method({
  6220. selector: "instanceClass",
  6221. category: 'accessing',
  6222. fn: function (){
  6223. var self=this;
  6224. return smalltalk.withContext(function($ctx1) { return self.instanceClass;
  6225. return self}, function($ctx1) {$ctx1.fill(self,"instanceClass",{}, smalltalk.Metaclass)})},
  6226. args: [],
  6227. source: "instanceClass\x0a\x09<return self.instanceClass>",
  6228. messageSends: [],
  6229. referencedClasses: []
  6230. }),
  6231. smalltalk.Metaclass);
  6232. smalltalk.addMethod(
  6233. "_instanceVariableNames_",
  6234. smalltalk.method({
  6235. selector: "instanceVariableNames:",
  6236. category: 'accessing',
  6237. fn: function (aCollection){
  6238. var self=this;
  6239. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._class_instanceVariableNames_(self,aCollection);
  6240. return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames:",{aCollection:aCollection}, smalltalk.Metaclass)})},
  6241. args: ["aCollection"],
  6242. source: "instanceVariableNames: aCollection\x0a\x09ClassBuilder new\x0a\x09 class: self instanceVariableNames: aCollection",
  6243. messageSends: ["class:instanceVariableNames:", "new"],
  6244. referencedClasses: ["ClassBuilder"]
  6245. }),
  6246. smalltalk.Metaclass);
  6247. smalltalk.addMethod(
  6248. "_isMetaclass",
  6249. smalltalk.method({
  6250. selector: "isMetaclass",
  6251. category: 'testing',
  6252. fn: function (){
  6253. var self=this;
  6254. return smalltalk.withContext(function($ctx1) { return true;
  6255. }, function($ctx1) {$ctx1.fill(self,"isMetaclass",{}, smalltalk.Metaclass)})},
  6256. args: [],
  6257. source: "isMetaclass\x0a\x09^true",
  6258. messageSends: [],
  6259. referencedClasses: []
  6260. }),
  6261. smalltalk.Metaclass);
  6262. smalltalk.addMethod(
  6263. "_printString",
  6264. smalltalk.method({
  6265. selector: "printString",
  6266. category: 'printing',
  6267. fn: function (){
  6268. var self=this;
  6269. return smalltalk.withContext(function($ctx1) { var $1;
  6270. $1=_st(_st(_st(self)._instanceClass())._name()).__comma(" class");
  6271. return $1;
  6272. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Metaclass)})},
  6273. args: [],
  6274. source: "printString\x0a\x09^self instanceClass name, ' class'",
  6275. messageSends: [",", "name", "instanceClass"],
  6276. referencedClasses: []
  6277. }),
  6278. smalltalk.Metaclass);
  6279. smalltalk.addMethod(
  6280. "_theMetaClass",
  6281. smalltalk.method({
  6282. selector: "theMetaClass",
  6283. category: 'accessing',
  6284. fn: function (){
  6285. var self=this;
  6286. return smalltalk.withContext(function($ctx1) { var $1;
  6287. $1=self;
  6288. return $1;
  6289. }, function($ctx1) {$ctx1.fill(self,"theMetaClass",{}, smalltalk.Metaclass)})},
  6290. args: [],
  6291. source: "theMetaClass\x0a\x09^ self",
  6292. messageSends: [],
  6293. referencedClasses: []
  6294. }),
  6295. smalltalk.Metaclass);
  6296. smalltalk.addMethod(
  6297. "_theNonMetaClass",
  6298. smalltalk.method({
  6299. selector: "theNonMetaClass",
  6300. category: 'accessing',
  6301. fn: function (){
  6302. var self=this;
  6303. return smalltalk.withContext(function($ctx1) { var $1;
  6304. $1=_st(self)._instanceClass();
  6305. return $1;
  6306. }, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{}, smalltalk.Metaclass)})},
  6307. args: [],
  6308. source: "theNonMetaClass\x0a\x09^ self instanceClass",
  6309. messageSends: ["instanceClass"],
  6310. referencedClasses: []
  6311. }),
  6312. smalltalk.Metaclass);
  6313. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  6314. smalltalk.ClassBuilder.comment="ClassBuilder is responsible for compiling new classes or modifying existing classes in the system.\x0a\x0aRather than using ClassBuilder directly to compile a class, use `Class >> subclass:instanceVariableNames:package:`."
  6315. smalltalk.addMethod(
  6316. "_addSubclassOf_named_instanceVariableNames_package_",
  6317. smalltalk.method({
  6318. selector: "addSubclassOf:named:instanceVariableNames:package:",
  6319. category: 'private',
  6320. fn: function (aClass,aString,aCollection,packageName){
  6321. var self=this;
  6322. var theClass;
  6323. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  6324. theClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(aString);
  6325. $1=theClass;
  6326. if(($receiver = $1) == nil || $receiver == undefined){
  6327. $1;
  6328. } else {
  6329. $2=_st(_st(theClass)._superclass()).__eq_eq(aClass);
  6330. if(! smalltalk.assert($2)){
  6331. $3=_st(self)._migrateClassNamed_superclass_instanceVariableNames_package_(aString,aClass,aCollection,packageName);
  6332. return $3;
  6333. };
  6334. };
  6335. $4=_st(self)._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,aString,aCollection,packageName);
  6336. return $4;
  6337. }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName,theClass:theClass}, smalltalk.ClassBuilder)})},
  6338. args: ["aClass", "aString", "aCollection", "packageName"],
  6339. source: "addSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a | theClass |\x0a \x0a theClass := Smalltalk current at: aString.\x0a \x0a \x09theClass ifNotNil: [ \x0a \x09theClass superclass == aClass ifFalse: [\x0a \x09\x09^ self \x0a \x09\x09migrateClassNamed: aString \x0a \x09 \x09superclass: aClass \x0a \x09 \x09instanceVariableNames: aCollection \x0a \x09package: packageName ] ].\x0a\x0a\x09^ self \x0a \x09basicAddSubclassOf: aClass \x0a named: aString \x0a instanceVariableNames: aCollection \x0a package: packageName",
  6340. messageSends: ["at:", "current", "ifNotNil:", "ifFalse:", "migrateClassNamed:superclass:instanceVariableNames:package:", "==", "superclass", "basicAddSubclassOf:named:instanceVariableNames:package:"],
  6341. referencedClasses: ["Smalltalk"]
  6342. }),
  6343. smalltalk.ClassBuilder);
  6344. smalltalk.addMethod(
  6345. "_basicAddSubclassOf_named_instanceVariableNames_package_",
  6346. smalltalk.method({
  6347. selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
  6348. category: 'private',
  6349. fn: function (aClass,aString,aCollection,packageName){
  6350. var self=this;
  6351. return smalltalk.withContext(function($ctx1) {
  6352. smalltalk.addClass(aString, aClass, aCollection, packageName);
  6353. return smalltalk[aString]
  6354. ;
  6355. return self}, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName}, smalltalk.ClassBuilder)})},
  6356. args: ["aClass", "aString", "aCollection", "packageName"],
  6357. source: "basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09<\x0a\x09\x09smalltalk.addClass(aString, aClass, aCollection, packageName);\x0a\x09\x09return smalltalk[aString]\x0a\x09>",
  6358. messageSends: [],
  6359. referencedClasses: []
  6360. }),
  6361. smalltalk.ClassBuilder);
  6362. smalltalk.addMethod(
  6363. "_basicClass_instanceVariableNames_",
  6364. smalltalk.method({
  6365. selector: "basicClass:instanceVariableNames:",
  6366. category: 'private',
  6367. fn: function (aClass,aString){
  6368. var self=this;
  6369. return smalltalk.withContext(function($ctx1) { _st(self)._basicClass_instanceVariables_(aClass,_st(self)._instanceVariableNamesFor_(aString));
  6370. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
  6371. args: ["aClass", "aString"],
  6372. source: "basicClass: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariables: (self instanceVariableNamesFor: aString)",
  6373. messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"],
  6374. referencedClasses: []
  6375. }),
  6376. smalltalk.ClassBuilder);
  6377. smalltalk.addMethod(
  6378. "_basicClass_instanceVariables_",
  6379. smalltalk.method({
  6380. selector: "basicClass:instanceVariables:",
  6381. category: 'private',
  6382. fn: function (aClass,aCollection){
  6383. var self=this;
  6384. return smalltalk.withContext(function($ctx1) { var $1;
  6385. $1=_st(aClass)._isMetaclass();
  6386. if(! smalltalk.assert($1)){
  6387. _st(self)._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
  6388. };
  6389. _st(aClass)._basicAt_put_("iVarNames",aCollection);
  6390. return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection}, smalltalk.ClassBuilder)})},
  6391. args: ["aClass", "aCollection"],
  6392. source: "basicClass: aClass instanceVariables: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [self error: aClass name, ' is not a metaclass'].\x0a\x09aClass basicAt: 'iVarNames' put: aCollection",
  6393. messageSends: ["ifFalse:", "error:", ",", "name", "isMetaclass", "basicAt:put:"],
  6394. referencedClasses: []
  6395. }),
  6396. smalltalk.ClassBuilder);
  6397. smalltalk.addMethod(
  6398. "_basicRemoveClass_",
  6399. smalltalk.method({
  6400. selector: "basicRemoveClass:",
  6401. category: 'private',
  6402. fn: function (aClass){
  6403. var self=this;
  6404. return smalltalk.withContext(function($ctx1) { smalltalk.removeClass(aClass);
  6405. return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass}, smalltalk.ClassBuilder)})},
  6406. args: ["aClass"],
  6407. source: "basicRemoveClass: aClass\x0a\x09<smalltalk.removeClass(aClass)>",
  6408. messageSends: [],
  6409. referencedClasses: []
  6410. }),
  6411. smalltalk.ClassBuilder);
  6412. smalltalk.addMethod(
  6413. "_basicRenameClass_to_",
  6414. smalltalk.method({
  6415. selector: "basicRenameClass:to:",
  6416. category: 'private',
  6417. fn: function (aClass,aString){
  6418. var self=this;
  6419. return smalltalk.withContext(function($ctx1) {
  6420. smalltalk[aString] = aClass;
  6421. delete smalltalk[aClass.className];
  6422. aClass.className = aString;
  6423. ;
  6424. return self}, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
  6425. args: ["aClass", "aString"],
  6426. source: "basicRenameClass: aClass to: aString\x0a\x09<\x0a\x09\x09smalltalk[aString] = aClass;\x0a\x09\x09delete smalltalk[aClass.className];\x0a\x09\x09aClass.className = aString;\x0a\x09>",
  6427. messageSends: [],
  6428. referencedClasses: []
  6429. }),
  6430. smalltalk.ClassBuilder);
  6431. smalltalk.addMethod(
  6432. "_class_instanceVariableNames_",
  6433. smalltalk.method({
  6434. selector: "class:instanceVariableNames:",
  6435. category: 'api',
  6436. fn: function (aClass,aString){
  6437. var self=this;
  6438. return smalltalk.withContext(function($ctx1) { var $1,$2;
  6439. _st(self)._basicClass_instanceVariableNames_(aClass,aString);
  6440. _st(self)._setupClass_(aClass);
  6441. $1=_st((smalltalk.ClassDefinitionChanged || ClassDefinitionChanged))._new();
  6442. _st($1)._theClass_(aClass);
  6443. $2=_st($1)._yourself();
  6444. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  6445. return self}, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
  6446. args: ["aClass", "aString"],
  6447. source: "class: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariableNames: aString.\x0a self setupClass: aClass.\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassDefinitionChanged new\x0a \x09theClass: aClass;\x0a yourself)",
  6448. messageSends: ["basicClass:instanceVariableNames:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"],
  6449. referencedClasses: ["ClassDefinitionChanged", "SystemAnnouncer"]
  6450. }),
  6451. smalltalk.ClassBuilder);
  6452. smalltalk.addMethod(
  6453. "_copyClass_named_",
  6454. smalltalk.method({
  6455. selector: "copyClass:named:",
  6456. category: 'private',
  6457. fn: function (aClass,aString){
  6458. var self=this;
  6459. var newClass;
  6460. return smalltalk.withContext(function($ctx1) { var $1;
  6461. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),aString,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  6462. _st(self)._copyClass_to_(aClass,newClass);
  6463. $1=newClass;
  6464. return $1;
  6465. }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,aString:aString,newClass:newClass}, smalltalk.ClassBuilder)})},
  6466. args: ["aClass", "aString"],
  6467. source: "copyClass: aClass named: aString\x0a\x09| newClass |\x0a\x0a\x09newClass := self \x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: aString \x0a\x09\x09instanceVariableNames: aClass instanceVariableNames \x0a\x09\x09package: aClass package name.\x0a\x0a\x09self copyClass: aClass to: newClass.\x0a \x0a\x09^newClass",
  6468. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:"],
  6469. referencedClasses: []
  6470. }),
  6471. smalltalk.ClassBuilder);
  6472. smalltalk.addMethod(
  6473. "_copyClass_to_",
  6474. smalltalk.method({
  6475. selector: "copyClass:to:",
  6476. category: 'private',
  6477. fn: function (aClass,anotherClass){
  6478. var self=this;
  6479. return smalltalk.withContext(function($ctx1) { _st(anotherClass)._comment_(_st(aClass)._comment());
  6480. _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
  6481. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),anotherClass,_st(each)._category());
  6482. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  6483. _st(self)._basicClass_instanceVariables_(_st(anotherClass)._class(),_st(_st(aClass)._class())._instanceVariableNames());
  6484. _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
  6485. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(_st(each)._source(),_st(anotherClass)._class(),_st(each)._category());
  6486. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  6487. _st(self)._setupClass_(anotherClass);
  6488. return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass}, smalltalk.ClassBuilder)})},
  6489. args: ["aClass", "anotherClass"],
  6490. source: "copyClass: aClass to: anotherClass\x0a\x0a\x09anotherClass comment: aClass comment.\x0a\x0a\x09aClass methodDictionary values do: [ :each |\x0a\x09\x09Compiler new install: each source forClass: anotherClass category: each category ].\x0a\x0a\x09self basicClass: anotherClass class instanceVariables: aClass class instanceVariableNames.\x0a\x0a\x09aClass class methodDictionary values do: [ :each |\x0a\x09\x09Compiler new install: each source forClass: anotherClass class category: each category ].\x0a\x0a\x09self setupClass: anotherClass",
  6491. messageSends: ["comment:", "comment", "do:", "install:forClass:category:", "source", "category", "new", "values", "methodDictionary", "basicClass:instanceVariables:", "class", "instanceVariableNames", "setupClass:"],
  6492. referencedClasses: ["Compiler"]
  6493. }),
  6494. smalltalk.ClassBuilder);
  6495. smalltalk.addMethod(
  6496. "_installMethod_forClass_category_",
  6497. smalltalk.method({
  6498. selector: "installMethod:forClass:category:",
  6499. category: 'api',
  6500. fn: function (aCompiledMethod,aBehavior,aString){
  6501. var self=this;
  6502. return smalltalk.withContext(function($ctx1) { var $1;
  6503. _st(aCompiledMethod)._category_(aString);
  6504. _st(aBehavior)._addCompiledMethod_(aCompiledMethod);
  6505. _st(self)._setupClass_(aBehavior);
  6506. $1=aCompiledMethod;
  6507. return $1;
  6508. }, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:category:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString}, smalltalk.ClassBuilder)})},
  6509. args: ["aCompiledMethod", "aBehavior", "aString"],
  6510. source: "installMethod: aCompiledMethod forClass: aBehavior category: aString\x0a\x09aCompiledMethod category: aString.\x0a\x09aBehavior addCompiledMethod: aCompiledMethod.\x0a self setupClass: aBehavior.\x0a\x09^aCompiledMethod",
  6511. messageSends: ["category:", "addCompiledMethod:", "setupClass:"],
  6512. referencedClasses: []
  6513. }),
  6514. smalltalk.ClassBuilder);
  6515. smalltalk.addMethod(
  6516. "_instanceVariableNamesFor_",
  6517. smalltalk.method({
  6518. selector: "instanceVariableNamesFor:",
  6519. category: 'private',
  6520. fn: function (aString){
  6521. var self=this;
  6522. return smalltalk.withContext(function($ctx1) { var $1;
  6523. $1=_st(_st(aString)._tokenize_(" "))._reject_((function(each){
  6524. return smalltalk.withContext(function($ctx2) { return _st(each)._isEmpty();
  6525. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  6526. return $1;
  6527. }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString}, smalltalk.ClassBuilder)})},
  6528. args: ["aString"],
  6529. source: "instanceVariableNamesFor: aString\x0a\x09^(aString tokenize: ' ') reject: [ :each | each isEmpty ]",
  6530. messageSends: ["reject:", "isEmpty", "tokenize:"],
  6531. referencedClasses: []
  6532. }),
  6533. smalltalk.ClassBuilder);
  6534. smalltalk.addMethod(
  6535. "_migrateClass_superclass_",
  6536. smalltalk.method({
  6537. selector: "migrateClass:superclass:",
  6538. category: 'private',
  6539. fn: function (aClass,anotherClass){
  6540. var self=this;
  6541. return smalltalk.withContext(function($ctx1) { _st(console)._log_(_st(aClass)._name());
  6542. _st(self)._migrateClassNamed_superclass_instanceVariableNames_package_(_st(aClass)._name(),anotherClass,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
  6543. return self}, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass}, smalltalk.ClassBuilder)})},
  6544. args: ["aClass", "anotherClass"],
  6545. source: "migrateClass: aClass superclass: anotherClass\x0a\x09console log: aClass name.\x0a\x09self \x0a \x09migrateClassNamed: aClass name\x0a superclass: anotherClass\x0a instanceVariableNames: aClass instanceVariableNames\x0a package: aClass package name",
  6546. messageSends: ["log:", "name", "migrateClassNamed:superclass:instanceVariableNames:package:", "instanceVariableNames", "package"],
  6547. referencedClasses: []
  6548. }),
  6549. smalltalk.ClassBuilder);
  6550. smalltalk.addMethod(
  6551. "_migrateClassNamed_superclass_instanceVariableNames_package_",
  6552. smalltalk.method({
  6553. selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
  6554. category: 'private',
  6555. fn: function (aString,aClass,aCollection,packageName){
  6556. var self=this;
  6557. var oldClass,newClass;
  6558. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  6559. oldClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(aString);
  6560. _st(self)._basicRenameClass_to_(oldClass,_st("Old").__comma(aString));
  6561. newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(aClass,aString,aCollection,packageName);
  6562. _st(_st(oldClass)._subclasses())._do_((function(each){
  6563. return smalltalk.withContext(function($ctx2) { return _st(self)._migrateClass_superclass_(each,newClass);
  6564. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  6565. _st((function(){
  6566. return smalltalk.withContext(function($ctx2) { return _st(self)._copyClass_to_(oldClass,newClass);
  6567. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(exception){
  6568. return smalltalk.withContext(function($ctx2) { $1=self;
  6569. _st($1)._basicRemoveClass_(newClass);
  6570. $2=_st($1)._basicRenameClass_to_(oldClass,aString);
  6571. $2;
  6572. return _st(exception)._signal();
  6573. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1)})}));
  6574. _st(self)._basicRemoveClass_(oldClass);
  6575. $3=newClass;
  6576. return $3;
  6577. }, function($ctx1) {$ctx1.fill(self,"migrateClassNamed:superclass:instanceVariableNames:package:",{aString:aString,aClass:aClass,aCollection:aCollection,packageName:packageName,oldClass:oldClass,newClass:newClass}, smalltalk.ClassBuilder)})},
  6578. args: ["aString", "aClass", "aCollection", "packageName"],
  6579. source: "migrateClassNamed: aString superclass: aClass instanceVariableNames: aCollection package: packageName\x0a\x09| oldClass newClass |\x0a \x0a oldClass := Smalltalk current at: aString.\x0a \x0a \x22Rename the old class for existing instances\x22\x0a\x09self basicRenameClass: oldClass to: 'Old', aString.\x0a \x0a newClass := self \x0a\x09\x09addSubclassOf: aClass\x0a\x09\x09named: aString \x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName.\x0a\x0a\x09oldClass subclasses do: [ :each |\x0a \x09self migrateClass: each superclass: newClass ].\x0a\x0a [ self copyClass: oldClass to: newClass ] \x0a \x09on: Error\x0a do: [ :exception |\x0a \x09self \x0a \x09basicRemoveClass: newClass;\x0a \x09basicRenameClass: oldClass to: aString.\x0a exception signal ].\x0a \x0a self basicRemoveClass: oldClass.\x0a\x09^newClass",
  6580. messageSends: ["at:", "current", "basicRenameClass:to:", ",", "addSubclassOf:named:instanceVariableNames:package:", "do:", "migrateClass:superclass:", "subclasses", "on:do:", "basicRemoveClass:", "signal", "copyClass:to:"],
  6581. referencedClasses: ["Smalltalk", "Error"]
  6582. }),
  6583. smalltalk.ClassBuilder);
  6584. smalltalk.addMethod(
  6585. "_renameClass_to_",
  6586. smalltalk.method({
  6587. selector: "renameClass:to:",
  6588. category: 'api',
  6589. fn: function (aClass,aString){
  6590. var self=this;
  6591. return smalltalk.withContext(function($ctx1) { var $1,$2;
  6592. _st(self)._basicRenameClass_to_(aClass,aString);
  6593. $1=_st((smalltalk.ClassRenamed || ClassRenamed))._new();
  6594. _st($1)._theClass_(aClass);
  6595. $2=_st($1)._yourself();
  6596. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
  6597. return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
  6598. args: ["aClass", "aString"],
  6599. source: "renameClass: aClass to: aString\x0a\x09self basicRenameClass: aClass to: aString.\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassRenamed new\x0a \x09theClass: aClass;\x0a yourself)",
  6600. messageSends: ["basicRenameClass:to:", "announce:", "theClass:", "new", "yourself", "current"],
  6601. referencedClasses: ["ClassRenamed", "SystemAnnouncer"]
  6602. }),
  6603. smalltalk.ClassBuilder);
  6604. smalltalk.addMethod(
  6605. "_setupClass_",
  6606. smalltalk.method({
  6607. selector: "setupClass:",
  6608. category: 'api',
  6609. fn: function (aClass){
  6610. var self=this;
  6611. return smalltalk.withContext(function($ctx1) { smalltalk.init(aClass);;
  6612. return self}, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass}, smalltalk.ClassBuilder)})},
  6613. args: ["aClass"],
  6614. source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass);>",
  6615. messageSends: [],
  6616. referencedClasses: []
  6617. }),
  6618. smalltalk.ClassBuilder);
  6619. smalltalk.addMethod(
  6620. "_superclass_subclass_",
  6621. smalltalk.method({
  6622. selector: "superclass:subclass:",
  6623. category: 'api',
  6624. fn: function (aClass,aString){
  6625. var self=this;
  6626. return smalltalk.withContext(function($ctx1) { var $1;
  6627. $1=_st(self)._superclass_subclass_instanceVariableNames_package_(aClass,aString,"",nil);
  6628. return $1;
  6629. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
  6630. args: ["aClass", "aString"],
  6631. source: "superclass: aClass subclass: aString\x0a\x09^self superclass: aClass subclass: aString instanceVariableNames: '' package: nil",
  6632. messageSends: ["superclass:subclass:instanceVariableNames:package:"],
  6633. referencedClasses: []
  6634. }),
  6635. smalltalk.ClassBuilder);
  6636. smalltalk.addMethod(
  6637. "_superclass_subclass_instanceVariableNames_package_",
  6638. smalltalk.method({
  6639. selector: "superclass:subclass:instanceVariableNames:package:",
  6640. category: 'api',
  6641. fn: function (aClass,aString,aString2,aString3){
  6642. var self=this;
  6643. var newClass;
  6644. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$6,$5,$7,$8,$9;
  6645. $1=self;
  6646. $2=aClass;
  6647. $3=aString;
  6648. $4=_st(self)._instanceVariableNamesFor_(aString2);
  6649. $6=aString3;
  6650. if(($receiver = $6) == nil || $receiver == undefined){
  6651. $5="unclassified";
  6652. } else {
  6653. $5=$6;
  6654. };
  6655. newClass=_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$5);
  6656. _st(self)._setupClass_(newClass);
  6657. $7=_st((smalltalk.ClassAdded || ClassAdded))._new();
  6658. _st($7)._theClass_(newClass);
  6659. $8=_st($7)._yourself();
  6660. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($8);
  6661. $9=newClass;
  6662. return $9;
  6663. }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,aString:aString,aString2:aString2,aString3:aString3,newClass:newClass}, smalltalk.ClassBuilder)})},
  6664. args: ["aClass", "aString", "aString2", "aString3"],
  6665. source: "superclass: aClass subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09| newClass |\x0a\x09\x0a newClass := self addSubclassOf: aClass\x0a\x09\x09named: aString instanceVariableNames: (self instanceVariableNamesFor: aString2)\x0a\x09\x09package: (aString3 ifNil: ['unclassified']).\x0a\x09self setupClass: newClass.\x0a \x0a SystemAnnouncer current \x0a \x09announce: (ClassAdded new\x0a \x09theClass: newClass;\x0a yourself).\x0a \x0a\x09^newClass",
  6666. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"],
  6667. referencedClasses: ["ClassAdded", "SystemAnnouncer"]
  6668. }),
  6669. smalltalk.ClassBuilder);
  6670. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category'], 'Kernel-Classes');
  6671. smalltalk.ClassCategoryReader.comment="ClassCategoryReader represents a mechanism for retrieving class descriptions stored on a file."
  6672. smalltalk.addMethod(
  6673. "_class_category_",
  6674. smalltalk.method({
  6675. selector: "class:category:",
  6676. category: 'accessing',
  6677. fn: function (aClass,aString){
  6678. var self=this;
  6679. return smalltalk.withContext(function($ctx1) { self["@class"]=aClass;
  6680. self["@category"]=aString;
  6681. return self}, function($ctx1) {$ctx1.fill(self,"class:category:",{aClass:aClass,aString:aString}, smalltalk.ClassCategoryReader)})},
  6682. args: ["aClass", "aString"],
  6683. source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
  6684. messageSends: [],
  6685. referencedClasses: []
  6686. }),
  6687. smalltalk.ClassCategoryReader);
  6688. smalltalk.addMethod(
  6689. "_compileMethod_",
  6690. smalltalk.method({
  6691. selector: "compileMethod:",
  6692. category: 'private',
  6693. fn: function (aString){
  6694. var self=this;
  6695. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.Compiler || Compiler))._new())._install_forClass_category_(aString,self["@class"],self["@category"]);
  6696. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString}, smalltalk.ClassCategoryReader)})},
  6697. args: ["aString"],
  6698. source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class category: category",
  6699. messageSends: ["install:forClass:category:", "new"],
  6700. referencedClasses: ["Compiler"]
  6701. }),
  6702. smalltalk.ClassCategoryReader);
  6703. smalltalk.addMethod(
  6704. "_initialize",
  6705. smalltalk.method({
  6706. selector: "initialize",
  6707. category: 'initialization',
  6708. fn: function (){
  6709. var self=this;
  6710. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  6711. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ClassCategoryReader)})},
  6712. args: [],
  6713. source: "initialize\x0a\x09super initialize.",
  6714. messageSends: ["initialize"],
  6715. referencedClasses: []
  6716. }),
  6717. smalltalk.ClassCategoryReader);
  6718. smalltalk.addMethod(
  6719. "_scanFrom_",
  6720. smalltalk.method({
  6721. selector: "scanFrom:",
  6722. category: 'fileIn',
  6723. fn: function (aChunkParser){
  6724. var self=this;
  6725. var chunk;
  6726. return smalltalk.withContext(function($ctx1) { _st((function(){
  6727. return smalltalk.withContext(function($ctx2) { chunk=_st(aChunkParser)._nextChunk();
  6728. chunk;
  6729. return _st(chunk)._isEmpty();
  6730. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  6731. return smalltalk.withContext(function($ctx2) { return _st(self)._compileMethod_(chunk);
  6732. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  6733. _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._setupClass_(self["@class"]);
  6734. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk}, smalltalk.ClassCategoryReader)})},
  6735. args: ["aChunkParser"],
  6736. source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty] whileFalse: [\x0a\x09 self compileMethod: chunk].\x0a\x09ClassBuilder new setupClass: class",
  6737. messageSends: ["whileFalse:", "compileMethod:", "nextChunk", "isEmpty", "setupClass:", "new"],
  6738. referencedClasses: ["ClassBuilder"]
  6739. }),
  6740. smalltalk.ClassCategoryReader);
  6741. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class'], 'Kernel-Classes');
  6742. smalltalk.ClassCommentReader.comment="ClassCommentReader represents a mechanism for retrieving class comments stored on a file.\x0aSee `ClassCategoryReader` too."
  6743. smalltalk.addMethod(
  6744. "_class_",
  6745. smalltalk.method({
  6746. selector: "class:",
  6747. category: 'accessing',
  6748. fn: function (aClass){
  6749. var self=this;
  6750. return smalltalk.withContext(function($ctx1) { self["@class"]=aClass;
  6751. return self}, function($ctx1) {$ctx1.fill(self,"class:",{aClass:aClass}, smalltalk.ClassCommentReader)})},
  6752. args: ["aClass"],
  6753. source: "class: aClass\x0a\x09class := aClass",
  6754. messageSends: [],
  6755. referencedClasses: []
  6756. }),
  6757. smalltalk.ClassCommentReader);
  6758. smalltalk.addMethod(
  6759. "_initialize",
  6760. smalltalk.method({
  6761. selector: "initialize",
  6762. category: 'initialization',
  6763. fn: function (){
  6764. var self=this;
  6765. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  6766. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ClassCommentReader)})},
  6767. args: [],
  6768. source: "initialize\x0a\x09super initialize.",
  6769. messageSends: ["initialize"],
  6770. referencedClasses: []
  6771. }),
  6772. smalltalk.ClassCommentReader);
  6773. smalltalk.addMethod(
  6774. "_scanFrom_",
  6775. smalltalk.method({
  6776. selector: "scanFrom:",
  6777. category: 'fileIn',
  6778. fn: function (aChunkParser){
  6779. var self=this;
  6780. var chunk;
  6781. return smalltalk.withContext(function($ctx1) { var $1;
  6782. chunk=_st(aChunkParser)._nextChunk();
  6783. $1=_st(chunk)._isEmpty();
  6784. if(! smalltalk.assert($1)){
  6785. _st(self)._setComment_(chunk);
  6786. };
  6787. return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk}, smalltalk.ClassCommentReader)})},
  6788. args: ["aChunkParser"],
  6789. source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09 self setComment: chunk].",
  6790. messageSends: ["nextChunk", "ifFalse:", "setComment:", "isEmpty"],
  6791. referencedClasses: []
  6792. }),
  6793. smalltalk.ClassCommentReader);
  6794. smalltalk.addMethod(
  6795. "_setComment_",
  6796. smalltalk.method({
  6797. selector: "setComment:",
  6798. category: 'private',
  6799. fn: function (aString){
  6800. var self=this;
  6801. return smalltalk.withContext(function($ctx1) { _st(self["@class"])._comment_(aString);
  6802. return self}, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString}, smalltalk.ClassCommentReader)})},
  6803. args: ["aString"],
  6804. source: "setComment: aString\x0a class comment: aString",
  6805. messageSends: ["comment:"],
  6806. referencedClasses: []
  6807. }),
  6808. smalltalk.ClassCommentReader);
  6809. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  6810. smalltalk.addMethod(
  6811. "_getNodesFrom_",
  6812. smalltalk.method({
  6813. selector: "getNodesFrom:",
  6814. category: 'accessing',
  6815. fn: function (aCollection){
  6816. var self=this;
  6817. var children,others;
  6818. return smalltalk.withContext(function($ctx1) { var $1;
  6819. children=[];
  6820. others=[];
  6821. _st(aCollection)._do_((function(each){
  6822. return smalltalk.withContext(function($ctx2) { $1=_st(_st(each)._superclass()).__eq(_st(self)._theClass());
  6823. if(smalltalk.assert($1)){
  6824. return _st(children)._add_(each);
  6825. } else {
  6826. return _st(others)._add_(each);
  6827. };
  6828. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  6829. self["@nodes"]=_st(children)._collect_((function(each){
  6830. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.ClassSorterNode || ClassSorterNode))._on_classes_level_(each,others,_st(_st(self)._level()).__plus((1)));
  6831. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  6832. return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others}, smalltalk.ClassSorterNode)})},
  6833. args: ["aCollection"],
  6834. source: "getNodesFrom: aCollection\x0a\x09| children others |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09aCollection do: [:each |\x0a\x09\x09(each superclass = self theClass)\x0a\x09\x09\x09ifTrue: [children add: each]\x0a\x09\x09\x09ifFalse: [others add: each]].\x0a\x09nodes:= children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: self level + 1]",
  6835. messageSends: ["do:", "ifTrue:ifFalse:", "add:", "=", "theClass", "superclass", "collect:", "on:classes:level:", "+", "level"],
  6836. referencedClasses: ["ClassSorterNode"]
  6837. }),
  6838. smalltalk.ClassSorterNode);
  6839. smalltalk.addMethod(
  6840. "_level",
  6841. smalltalk.method({
  6842. selector: "level",
  6843. category: 'accessing',
  6844. fn: function (){
  6845. var self=this;
  6846. return smalltalk.withContext(function($ctx1) { var $1;
  6847. $1=self["@level"];
  6848. return $1;
  6849. }, function($ctx1) {$ctx1.fill(self,"level",{}, smalltalk.ClassSorterNode)})},
  6850. args: [],
  6851. source: "level\x0a\x09^level",
  6852. messageSends: [],
  6853. referencedClasses: []
  6854. }),
  6855. smalltalk.ClassSorterNode);
  6856. smalltalk.addMethod(
  6857. "_level_",
  6858. smalltalk.method({
  6859. selector: "level:",
  6860. category: 'accessing',
  6861. fn: function (anInteger){
  6862. var self=this;
  6863. return smalltalk.withContext(function($ctx1) { self["@level"]=anInteger;
  6864. return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger}, smalltalk.ClassSorterNode)})},
  6865. args: ["anInteger"],
  6866. source: "level: anInteger\x0a\x09level := anInteger",
  6867. messageSends: [],
  6868. referencedClasses: []
  6869. }),
  6870. smalltalk.ClassSorterNode);
  6871. smalltalk.addMethod(
  6872. "_nodes",
  6873. smalltalk.method({
  6874. selector: "nodes",
  6875. category: 'accessing',
  6876. fn: function (){
  6877. var self=this;
  6878. return smalltalk.withContext(function($ctx1) { var $1;
  6879. $1=self["@nodes"];
  6880. return $1;
  6881. }, function($ctx1) {$ctx1.fill(self,"nodes",{}, smalltalk.ClassSorterNode)})},
  6882. args: [],
  6883. source: "nodes\x0a\x09^nodes",
  6884. messageSends: [],
  6885. referencedClasses: []
  6886. }),
  6887. smalltalk.ClassSorterNode);
  6888. smalltalk.addMethod(
  6889. "_theClass",
  6890. smalltalk.method({
  6891. selector: "theClass",
  6892. category: 'accessing',
  6893. fn: function (){
  6894. var self=this;
  6895. return smalltalk.withContext(function($ctx1) { var $1;
  6896. $1=self["@theClass"];
  6897. return $1;
  6898. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.ClassSorterNode)})},
  6899. args: [],
  6900. source: "theClass\x0a\x09^theClass",
  6901. messageSends: [],
  6902. referencedClasses: []
  6903. }),
  6904. smalltalk.ClassSorterNode);
  6905. smalltalk.addMethod(
  6906. "_theClass_",
  6907. smalltalk.method({
  6908. selector: "theClass:",
  6909. category: 'accessing',
  6910. fn: function (aClass){
  6911. var self=this;
  6912. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  6913. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.ClassSorterNode)})},
  6914. args: ["aClass"],
  6915. source: "theClass: aClass\x0a\x09theClass := aClass",
  6916. messageSends: [],
  6917. referencedClasses: []
  6918. }),
  6919. smalltalk.ClassSorterNode);
  6920. smalltalk.addMethod(
  6921. "_traverseClassesWith_",
  6922. smalltalk.method({
  6923. selector: "traverseClassesWith:",
  6924. category: 'visiting',
  6925. fn: function (aCollection){
  6926. var self=this;
  6927. return smalltalk.withContext(function($ctx1) { _st(aCollection)._add_(_st(self)._theClass());
  6928. _st(_st(_st(self)._nodes())._sorted_((function(a,b){
  6929. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  6930. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(aNode){
  6931. return smalltalk.withContext(function($ctx2) { return _st(aNode)._traverseClassesWith_(aCollection);
  6932. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  6933. return self}, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection}, smalltalk.ClassSorterNode)})},
  6934. args: ["aCollection"],
  6935. source: "traverseClassesWith: aCollection\x0a\x09\x22sort classes alphabetically Issue #143\x22\x0a\x0a\x09aCollection add: self theClass.\x0a\x09(self nodes sorted: [:a :b | a theClass name <= b theClass name ]) do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: aCollection ].",
  6936. messageSends: ["add:", "theClass", "do:", "traverseClassesWith:", "sorted:", "<=", "name", "nodes"],
  6937. referencedClasses: []
  6938. }),
  6939. smalltalk.ClassSorterNode);
  6940. smalltalk.addMethod(
  6941. "_on_classes_level_",
  6942. smalltalk.method({
  6943. selector: "on:classes:level:",
  6944. category: 'instance creation',
  6945. fn: function (aClass,aCollection,anInteger){
  6946. var self=this;
  6947. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  6948. $2=_st(self)._new();
  6949. _st($2)._theClass_(aClass);
  6950. _st($2)._level_(anInteger);
  6951. _st($2)._getNodesFrom_(aCollection);
  6952. $3=_st($2)._yourself();
  6953. $1=$3;
  6954. return $1;
  6955. }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger}, smalltalk.ClassSorterNode.klass)})},
  6956. args: ["aClass", "aCollection", "anInteger"],
  6957. source: "on: aClass classes: aCollection level: anInteger\x0a\x09^self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09level: anInteger;\x0a\x09\x09getNodesFrom: aCollection;\x0a\x09\x09yourself",
  6958. messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"],
  6959. referencedClasses: []
  6960. }),
  6961. smalltalk.ClassSorterNode.klass);
  6962. smalltalk.addPackage('Kernel-Methods', {});
  6963. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
  6964. smalltalk.BlockClosure.comment="A BlockClosure is a lexical closure.\x0aThe JavaScript representation is a function.\x0a\x0aA BlockClosure is evaluated with the `#value*` methods in the 'evaluating' protocol."
  6965. smalltalk.addMethod(
  6966. "_applyTo_arguments_",
  6967. smalltalk.method({
  6968. selector: "applyTo:arguments:",
  6969. category: 'evaluating',
  6970. fn: function (anObject,aCollection){
  6971. var self=this;
  6972. return smalltalk.withContext(function($ctx1) { return self.apply(anObject, aCollection);
  6973. return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection}, smalltalk.BlockClosure)})},
  6974. args: ["anObject", "aCollection"],
  6975. source: "applyTo: anObject arguments: aCollection\x0a\x09<return self.apply(anObject, aCollection)>",
  6976. messageSends: [],
  6977. referencedClasses: []
  6978. }),
  6979. smalltalk.BlockClosure);
  6980. smalltalk.addMethod(
  6981. "_asCompiledMethod_",
  6982. smalltalk.method({
  6983. selector: "asCompiledMethod:",
  6984. category: 'converting',
  6985. fn: function (aString){
  6986. var self=this;
  6987. return smalltalk.withContext(function($ctx1) { return smalltalk.method({selector:aString, fn:self});;
  6988. return self}, function($ctx1) {$ctx1.fill(self,"asCompiledMethod:",{aString:aString}, smalltalk.BlockClosure)})},
  6989. args: ["aString"],
  6990. source: "asCompiledMethod: aString\x0a\x09<return smalltalk.method({selector:aString, fn:self});>",
  6991. messageSends: [],
  6992. referencedClasses: []
  6993. }),
  6994. smalltalk.BlockClosure);
  6995. smalltalk.addMethod(
  6996. "_compiledSource",
  6997. smalltalk.method({
  6998. selector: "compiledSource",
  6999. category: 'accessing',
  7000. fn: function (){
  7001. var self=this;
  7002. return smalltalk.withContext(function($ctx1) { return self.toString();
  7003. return self}, function($ctx1) {$ctx1.fill(self,"compiledSource",{}, smalltalk.BlockClosure)})},
  7004. args: [],
  7005. source: "compiledSource\x0a\x09<return self.toString()>",
  7006. messageSends: [],
  7007. referencedClasses: []
  7008. }),
  7009. smalltalk.BlockClosure);
  7010. smalltalk.addMethod(
  7011. "_currySelf",
  7012. smalltalk.method({
  7013. selector: "currySelf",
  7014. category: 'converting',
  7015. fn: function (){
  7016. var self=this;
  7017. return smalltalk.withContext(function($ctx1) {
  7018. return function () {
  7019. var args = [ this ];
  7020. args.push.apply(args, arguments);
  7021. return self.apply(null, args);
  7022. }
  7023. ;
  7024. return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{}, smalltalk.BlockClosure)})},
  7025. args: [],
  7026. source: "currySelf\x0a\x09\x22Transforms [ :selfarg :x :y | stcode ] block\x0a which represents JS function (selfarg, x, y, ...) {jscode}\x0a into function (x, y, ...) {jscode} that takes selfarg from 'this'.\x0a IOW, it is usable as JS method and first arg takes the receiver.\x22\x0a \x0a <\x0a \x09return function () {\x0a \x09\x09var args = [ this ];\x0a \x09args.push.apply(args, arguments);\x0a \x09return self.apply(null, args);\x0a \x09}\x0a\x09>",
  7027. messageSends: [],
  7028. referencedClasses: []
  7029. }),
  7030. smalltalk.BlockClosure);
  7031. smalltalk.addMethod(
  7032. "_ensure_",
  7033. smalltalk.method({
  7034. selector: "ensure:",
  7035. category: 'evaluating',
  7036. fn: function (aBlock){
  7037. var self=this;
  7038. return smalltalk.withContext(function($ctx1) { try{return self()}finally{aBlock._value()};
  7039. return self}, function($ctx1) {$ctx1.fill(self,"ensure:",{aBlock:aBlock}, smalltalk.BlockClosure)})},
  7040. args: ["aBlock"],
  7041. source: "ensure: aBlock\x0a\x09<try{return self()}finally{aBlock._value()}>",
  7042. messageSends: [],
  7043. referencedClasses: []
  7044. }),
  7045. smalltalk.BlockClosure);
  7046. smalltalk.addMethod(
  7047. "_fork",
  7048. smalltalk.method({
  7049. selector: "fork",
  7050. category: 'timeout/interval',
  7051. fn: function (){
  7052. var self=this;
  7053. return smalltalk.withContext(function($ctx1) { _st(_st((smalltalk.ForkPool || ForkPool))._default())._fork_(self);
  7054. return self}, function($ctx1) {$ctx1.fill(self,"fork",{}, smalltalk.BlockClosure)})},
  7055. args: [],
  7056. source: "fork\x0a\x09ForkPool default fork: self",
  7057. messageSends: ["fork:", "default"],
  7058. referencedClasses: ["ForkPool"]
  7059. }),
  7060. smalltalk.BlockClosure);
  7061. smalltalk.addMethod(
  7062. "_new",
  7063. smalltalk.method({
  7064. selector: "new",
  7065. category: 'evaluating',
  7066. fn: function (){
  7067. var self=this;
  7068. return smalltalk.withContext(function($ctx1) { return new self();
  7069. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.BlockClosure)})},
  7070. args: [],
  7071. source: "new\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self()>",
  7072. messageSends: [],
  7073. referencedClasses: []
  7074. }),
  7075. smalltalk.BlockClosure);
  7076. smalltalk.addMethod(
  7077. "_newValue_",
  7078. smalltalk.method({
  7079. selector: "newValue:",
  7080. category: 'evaluating',
  7081. fn: function (anObject){
  7082. var self=this;
  7083. return smalltalk.withContext(function($ctx1) { return new self(anObject);
  7084. return self}, function($ctx1) {$ctx1.fill(self,"newValue:",{anObject:anObject}, smalltalk.BlockClosure)})},
  7085. args: ["anObject"],
  7086. source: "newValue: anObject\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject)>",
  7087. messageSends: [],
  7088. referencedClasses: []
  7089. }),
  7090. smalltalk.BlockClosure);
  7091. smalltalk.addMethod(
  7092. "_newValue_value_",
  7093. smalltalk.method({
  7094. selector: "newValue:value:",
  7095. category: 'evaluating',
  7096. fn: function (anObject,anObject2){
  7097. var self=this;
  7098. return smalltalk.withContext(function($ctx1) { return new self(anObject, anObject2);
  7099. return self}, function($ctx1) {$ctx1.fill(self,"newValue:value:",{anObject:anObject,anObject2:anObject2}, smalltalk.BlockClosure)})},
  7100. args: ["anObject", "anObject2"],
  7101. source: "newValue: anObject value: anObject2\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject, anObject2)>",
  7102. messageSends: [],
  7103. referencedClasses: []
  7104. }),
  7105. smalltalk.BlockClosure);
  7106. smalltalk.addMethod(
  7107. "_newValue_value_value_",
  7108. smalltalk.method({
  7109. selector: "newValue:value:value:",
  7110. category: 'evaluating',
  7111. fn: function (anObject,anObject2,anObject3){
  7112. var self=this;
  7113. return smalltalk.withContext(function($ctx1) { return new self(anObject, anObject2,anObject3);
  7114. return self}, function($ctx1) {$ctx1.fill(self,"newValue:value:value:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3}, smalltalk.BlockClosure)})},
  7115. args: ["anObject", "anObject2", "anObject3"],
  7116. source: "newValue: anObject value: anObject2 value: anObject3\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject, anObject2,anObject3)>",
  7117. messageSends: [],
  7118. referencedClasses: []
  7119. }),
  7120. smalltalk.BlockClosure);
  7121. smalltalk.addMethod(
  7122. "_numArgs",
  7123. smalltalk.method({
  7124. selector: "numArgs",
  7125. category: 'accessing',
  7126. fn: function (){
  7127. var self=this;
  7128. return smalltalk.withContext(function($ctx1) { return self.length;
  7129. return self}, function($ctx1) {$ctx1.fill(self,"numArgs",{}, smalltalk.BlockClosure)})},
  7130. args: [],
  7131. source: "numArgs\x0a\x09<return self.length>",
  7132. messageSends: [],
  7133. referencedClasses: []
  7134. }),
  7135. smalltalk.BlockClosure);
  7136. smalltalk.addMethod(
  7137. "_on_do_",
  7138. smalltalk.method({
  7139. selector: "on:do:",
  7140. category: 'error handling',
  7141. fn: function (anErrorClass,aBlock){
  7142. var self=this;
  7143. return smalltalk.withContext(function($ctx1) { var $2,$1;
  7144. $1=_st(self)._try_catch_(self,(function(error){
  7145. var smalltalkError;
  7146. return smalltalk.withContext(function($ctx2) { smalltalkError=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._asSmalltalkException_(error);
  7147. smalltalkError;
  7148. $2=_st(smalltalkError)._isKindOf_(anErrorClass);
  7149. if(smalltalk.assert($2)){
  7150. return _st(aBlock)._value_(smalltalkError);
  7151. } else {
  7152. return _st(smalltalkError)._signal();
  7153. };
  7154. }, function($ctx2) {$ctx2.fillBlock({error:error,smalltalkError:smalltalkError},$ctx1)})}));
  7155. return $1;
  7156. }, function($ctx1) {$ctx1.fill(self,"on:do:",{anErrorClass:anErrorClass,aBlock:aBlock}, smalltalk.BlockClosure)})},
  7157. args: ["anErrorClass", "aBlock"],
  7158. source: "on: anErrorClass do: aBlock\x0a\x09\x22All exceptions thrown in the Smalltalk stack are cought.\x0a Convert all JS exceptions to JavaScriptException instances.\x22\x0a \x0a\x09^self try: self catch: [ :error | | smalltalkError |\x0a \x09smalltalkError := Smalltalk current asSmalltalkException: error.\x0a\x09 (smalltalkError isKindOf: anErrorClass) \x0a\x09 ifTrue: [ aBlock value: smalltalkError ]\x0a\x09 ifFalse: [ smalltalkError signal ] ]",
  7159. messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:"],
  7160. referencedClasses: ["Smalltalk"]
  7161. }),
  7162. smalltalk.BlockClosure);
  7163. smalltalk.addMethod(
  7164. "_timeToRun",
  7165. smalltalk.method({
  7166. selector: "timeToRun",
  7167. category: 'evaluating',
  7168. fn: function (){
  7169. var self=this;
  7170. return smalltalk.withContext(function($ctx1) { var $1;
  7171. $1=_st((smalltalk.Date || Date))._millisecondsToRun_(self);
  7172. return $1;
  7173. }, function($ctx1) {$ctx1.fill(self,"timeToRun",{}, smalltalk.BlockClosure)})},
  7174. args: [],
  7175. source: "timeToRun\x0a\x09\x22Answer the number of milliseconds taken to execute this block.\x22\x0a\x0a\x09^ Date millisecondsToRun: self",
  7176. messageSends: ["millisecondsToRun:"],
  7177. referencedClasses: ["Date"]
  7178. }),
  7179. smalltalk.BlockClosure);
  7180. smalltalk.addMethod(
  7181. "_value",
  7182. smalltalk.method({
  7183. selector: "value",
  7184. category: 'evaluating',
  7185. fn: function (){
  7186. var self=this;
  7187. return smalltalk.withContext(function($ctx1) { return self();;
  7188. return self}, function($ctx1) {$ctx1.fill(self,"value",{}, smalltalk.BlockClosure)})},
  7189. args: [],
  7190. source: "value\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self();>",
  7191. messageSends: [],
  7192. referencedClasses: []
  7193. }),
  7194. smalltalk.BlockClosure);
  7195. smalltalk.addMethod(
  7196. "_value_",
  7197. smalltalk.method({
  7198. selector: "value:",
  7199. category: 'evaluating',
  7200. fn: function (anArg){
  7201. var self=this;
  7202. return smalltalk.withContext(function($ctx1) { return self(anArg);;
  7203. return self}, function($ctx1) {$ctx1.fill(self,"value:",{anArg:anArg}, smalltalk.BlockClosure)})},
  7204. args: ["anArg"],
  7205. source: "value: anArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(anArg);>",
  7206. messageSends: [],
  7207. referencedClasses: []
  7208. }),
  7209. smalltalk.BlockClosure);
  7210. smalltalk.addMethod(
  7211. "_value_value_",
  7212. smalltalk.method({
  7213. selector: "value:value:",
  7214. category: 'evaluating',
  7215. fn: function (firstArg,secondArg){
  7216. var self=this;
  7217. return smalltalk.withContext(function($ctx1) { return self(firstArg, secondArg);;
  7218. return self}, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArg:firstArg,secondArg:secondArg}, smalltalk.BlockClosure)})},
  7219. args: ["firstArg", "secondArg"],
  7220. source: "value: firstArg value: secondArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(firstArg, secondArg);>",
  7221. messageSends: [],
  7222. referencedClasses: []
  7223. }),
  7224. smalltalk.BlockClosure);
  7225. smalltalk.addMethod(
  7226. "_value_value_value_",
  7227. smalltalk.method({
  7228. selector: "value:value:value:",
  7229. category: 'evaluating',
  7230. fn: function (firstArg,secondArg,thirdArg){
  7231. var self=this;
  7232. return smalltalk.withContext(function($ctx1) { return self(firstArg, secondArg, thirdArg);;
  7233. return self}, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArg:firstArg,secondArg:secondArg,thirdArg:thirdArg}, smalltalk.BlockClosure)})},
  7234. args: ["firstArg", "secondArg", "thirdArg"],
  7235. source: "value: firstArg value: secondArg value: thirdArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(firstArg, secondArg, thirdArg);>",
  7236. messageSends: [],
  7237. referencedClasses: []
  7238. }),
  7239. smalltalk.BlockClosure);
  7240. smalltalk.addMethod(
  7241. "_valueWithInterval_",
  7242. smalltalk.method({
  7243. selector: "valueWithInterval:",
  7244. category: 'timeout/interval',
  7245. fn: function (aNumber){
  7246. var self=this;
  7247. return smalltalk.withContext(function($ctx1) {
  7248. var interval = setInterval(self, aNumber);
  7249. return smalltalk.Timeout._on_(interval);
  7250. ;
  7251. return self}, function($ctx1) {$ctx1.fill(self,"valueWithInterval:",{aNumber:aNumber}, smalltalk.BlockClosure)})},
  7252. args: ["aNumber"],
  7253. source: "valueWithInterval: aNumber\x0a\x09<\x0a \x09var interval = setInterval(self, aNumber);\x0a \x09return smalltalk.Timeout._on_(interval);\x0a >",
  7254. messageSends: [],
  7255. referencedClasses: []
  7256. }),
  7257. smalltalk.BlockClosure);
  7258. smalltalk.addMethod(
  7259. "_valueWithPossibleArguments_",
  7260. smalltalk.method({
  7261. selector: "valueWithPossibleArguments:",
  7262. category: 'evaluating',
  7263. fn: function (aCollection){
  7264. var self=this;
  7265. return smalltalk.withContext(function($ctx1) { return self.apply(null, aCollection);;
  7266. return self}, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection}, smalltalk.BlockClosure)})},
  7267. args: ["aCollection"],
  7268. source: "valueWithPossibleArguments: aCollection\x0a\x09<return self.apply(null, aCollection);>",
  7269. messageSends: [],
  7270. referencedClasses: []
  7271. }),
  7272. smalltalk.BlockClosure);
  7273. smalltalk.addMethod(
  7274. "_valueWithTimeout_",
  7275. smalltalk.method({
  7276. selector: "valueWithTimeout:",
  7277. category: 'timeout/interval',
  7278. fn: function (aNumber){
  7279. var self=this;
  7280. return smalltalk.withContext(function($ctx1) {
  7281. var timeout = setTimeout(self, aNumber);
  7282. return smalltalk.Timeout._on_(timeout);
  7283. ;
  7284. return self}, function($ctx1) {$ctx1.fill(self,"valueWithTimeout:",{aNumber:aNumber}, smalltalk.BlockClosure)})},
  7285. args: ["aNumber"],
  7286. source: "valueWithTimeout: aNumber\x0a\x09<\x0a \x09var timeout = setTimeout(self, aNumber);\x0a \x09return smalltalk.Timeout._on_(timeout);\x0a >",
  7287. messageSends: [],
  7288. referencedClasses: []
  7289. }),
  7290. smalltalk.BlockClosure);
  7291. smalltalk.addMethod(
  7292. "_whileFalse",
  7293. smalltalk.method({
  7294. selector: "whileFalse",
  7295. category: 'controlling',
  7296. fn: function (){
  7297. var self=this;
  7298. return smalltalk.withContext(function($ctx1) { _st(self)._whileFalse_((function(){
  7299. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  7300. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse",{}, smalltalk.BlockClosure)})},
  7301. args: [],
  7302. source: "whileFalse\x0a\x09\x22inlined in the Compiler\x22\x0a\x09self whileFalse: []",
  7303. messageSends: ["whileFalse:"],
  7304. referencedClasses: []
  7305. }),
  7306. smalltalk.BlockClosure);
  7307. smalltalk.addMethod(
  7308. "_whileFalse_",
  7309. smalltalk.method({
  7310. selector: "whileFalse:",
  7311. category: 'controlling',
  7312. fn: function (aBlock){
  7313. var self=this;
  7314. return smalltalk.withContext(function($ctx1) { while(!self()) {aBlock()};
  7315. return self}, function($ctx1) {$ctx1.fill(self,"whileFalse:",{aBlock:aBlock}, smalltalk.BlockClosure)})},
  7316. args: ["aBlock"],
  7317. source: "whileFalse: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<while(!self()) {aBlock()}>",
  7318. messageSends: [],
  7319. referencedClasses: []
  7320. }),
  7321. smalltalk.BlockClosure);
  7322. smalltalk.addMethod(
  7323. "_whileTrue",
  7324. smalltalk.method({
  7325. selector: "whileTrue",
  7326. category: 'controlling',
  7327. fn: function (){
  7328. var self=this;
  7329. return smalltalk.withContext(function($ctx1) { _st(self)._whileTrue_((function(){
  7330. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  7331. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue",{}, smalltalk.BlockClosure)})},
  7332. args: [],
  7333. source: "whileTrue\x0a\x09\x22inlined in the Compiler\x22\x0a\x09self whileTrue: []",
  7334. messageSends: ["whileTrue:"],
  7335. referencedClasses: []
  7336. }),
  7337. smalltalk.BlockClosure);
  7338. smalltalk.addMethod(
  7339. "_whileTrue_",
  7340. smalltalk.method({
  7341. selector: "whileTrue:",
  7342. category: 'controlling',
  7343. fn: function (aBlock){
  7344. var self=this;
  7345. return smalltalk.withContext(function($ctx1) { while(self()) {aBlock()};
  7346. return self}, function($ctx1) {$ctx1.fill(self,"whileTrue:",{aBlock:aBlock}, smalltalk.BlockClosure)})},
  7347. args: ["aBlock"],
  7348. source: "whileTrue: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<while(self()) {aBlock()}>",
  7349. messageSends: [],
  7350. referencedClasses: []
  7351. }),
  7352. smalltalk.BlockClosure);
  7353. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  7354. smalltalk.CompiledMethod.comment="CompiledMethod hold the source and compiled code of a class method.\x0a\x0aYou can get a CompiledMethod using `Behavior>>methodAt:`\x0a\x0a\x09String methodAt: 'lines'\x0a\x0aand read the source code\x0a\x0a\x09(String methodAt: 'lines') source\x0a\x0aSee referenced classes:\x0a\x0a\x09(String methodAt: 'lines') referencedClasses\x0a\x0aor messages sent from this method:\x0a\x09\x0a\x09(String methodAt: 'lines') messageSends"
  7355. smalltalk.addMethod(
  7356. "_arguments",
  7357. smalltalk.method({
  7358. selector: "arguments",
  7359. category: 'accessing',
  7360. fn: function (){
  7361. var self=this;
  7362. return smalltalk.withContext(function($ctx1) { return self.args || [];
  7363. return self}, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.CompiledMethod)})},
  7364. args: [],
  7365. source: "arguments\x0a\x09<return self.args || []>",
  7366. messageSends: [],
  7367. referencedClasses: []
  7368. }),
  7369. smalltalk.CompiledMethod);
  7370. smalltalk.addMethod(
  7371. "_category",
  7372. smalltalk.method({
  7373. selector: "category",
  7374. category: 'accessing',
  7375. fn: function (){
  7376. var self=this;
  7377. return smalltalk.withContext(function($ctx1) { var $2,$1;
  7378. $2=_st(self)._basicAt_("category");
  7379. if(($receiver = $2) == nil || $receiver == undefined){
  7380. $1="";
  7381. } else {
  7382. $1=$2;
  7383. };
  7384. return $1;
  7385. }, function($ctx1) {$ctx1.fill(self,"category",{}, smalltalk.CompiledMethod)})},
  7386. args: [],
  7387. source: "category\x0a\x09^(self basicAt: 'category') ifNil: ['']",
  7388. messageSends: ["ifNil:", "basicAt:"],
  7389. referencedClasses: []
  7390. }),
  7391. smalltalk.CompiledMethod);
  7392. smalltalk.addMethod(
  7393. "_category_",
  7394. smalltalk.method({
  7395. selector: "category:",
  7396. category: 'accessing',
  7397. fn: function (aString){
  7398. var self=this;
  7399. var oldCategory;
  7400. return smalltalk.withContext(function($ctx1) { var $1;
  7401. oldCategory=_st(self)._category();
  7402. _st(self)._basicAt_put_("category",aString);
  7403. $1=_st(self)._methodClass();
  7404. if(($receiver = $1) == nil || $receiver == undefined){
  7405. $1;
  7406. } else {
  7407. _st(_st(_st(self)._methodClass())._organization())._addElement_(aString);
  7408. _st(_st(_st(_st(self)._methodClass())._methods())._select_((function(each){
  7409. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._category()).__eq(oldCategory);
  7410. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._ifEmpty_((function(){
  7411. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._methodClass())._organization())._removeElement_(oldCategory);
  7412. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  7413. };
  7414. return self}, function($ctx1) {$ctx1.fill(self,"category:",{aString:aString,oldCategory:oldCategory}, smalltalk.CompiledMethod)})},
  7415. args: ["aString"],
  7416. source: "category: aString\x0a\x09| oldCategory |\x0a oldCategory := self category.\x0a\x09self basicAt: 'category' put: aString.\x0a \x0a self methodClass ifNotNil: [\x0a \x09self methodClass organization addElement: aString.\x0a \x0a\x09\x09(self methodClass methods \x0a \x09\x09select: [ :each | each category = oldCategory ])\x0a \x09ifEmpty: [ self methodClass organization removeElement: oldCategory ] ]",
  7417. messageSends: ["category", "basicAt:put:", "ifNotNil:", "addElement:", "organization", "methodClass", "ifEmpty:", "removeElement:", "select:", "=", "methods"],
  7418. referencedClasses: []
  7419. }),
  7420. smalltalk.CompiledMethod);
  7421. smalltalk.addMethod(
  7422. "_fn",
  7423. smalltalk.method({
  7424. selector: "fn",
  7425. category: 'accessing',
  7426. fn: function (){
  7427. var self=this;
  7428. return smalltalk.withContext(function($ctx1) { var $1;
  7429. $1=_st(self)._basicAt_("fn");
  7430. return $1;
  7431. }, function($ctx1) {$ctx1.fill(self,"fn",{}, smalltalk.CompiledMethod)})},
  7432. args: [],
  7433. source: "fn\x0a\x09^self basicAt: 'fn'",
  7434. messageSends: ["basicAt:"],
  7435. referencedClasses: []
  7436. }),
  7437. smalltalk.CompiledMethod);
  7438. smalltalk.addMethod(
  7439. "_fn_",
  7440. smalltalk.method({
  7441. selector: "fn:",
  7442. category: 'accessing',
  7443. fn: function (aBlock){
  7444. var self=this;
  7445. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("fn",aBlock);
  7446. return self}, function($ctx1) {$ctx1.fill(self,"fn:",{aBlock:aBlock}, smalltalk.CompiledMethod)})},
  7447. args: ["aBlock"],
  7448. source: "fn: aBlock\x0a\x09self basicAt: 'fn' put: aBlock",
  7449. messageSends: ["basicAt:put:"],
  7450. referencedClasses: []
  7451. }),
  7452. smalltalk.CompiledMethod);
  7453. smalltalk.addMethod(
  7454. "_messageSends",
  7455. smalltalk.method({
  7456. selector: "messageSends",
  7457. category: 'accessing',
  7458. fn: function (){
  7459. var self=this;
  7460. return smalltalk.withContext(function($ctx1) { var $1;
  7461. $1=_st(self)._basicAt_("messageSends");
  7462. return $1;
  7463. }, function($ctx1) {$ctx1.fill(self,"messageSends",{}, smalltalk.CompiledMethod)})},
  7464. args: [],
  7465. source: "messageSends\x0a\x09^self basicAt: 'messageSends'",
  7466. messageSends: ["basicAt:"],
  7467. referencedClasses: []
  7468. }),
  7469. smalltalk.CompiledMethod);
  7470. smalltalk.addMethod(
  7471. "_methodClass",
  7472. smalltalk.method({
  7473. selector: "methodClass",
  7474. category: 'accessing',
  7475. fn: function (){
  7476. var self=this;
  7477. return smalltalk.withContext(function($ctx1) { var $1;
  7478. $1=_st(self)._basicAt_("methodClass");
  7479. return $1;
  7480. }, function($ctx1) {$ctx1.fill(self,"methodClass",{}, smalltalk.CompiledMethod)})},
  7481. args: [],
  7482. source: "methodClass\x0a\x09^self basicAt: 'methodClass'",
  7483. messageSends: ["basicAt:"],
  7484. referencedClasses: []
  7485. }),
  7486. smalltalk.CompiledMethod);
  7487. smalltalk.addMethod(
  7488. "_protocol",
  7489. smalltalk.method({
  7490. selector: "protocol",
  7491. category: 'accessing',
  7492. fn: function (){
  7493. var self=this;
  7494. return smalltalk.withContext(function($ctx1) { var $1;
  7495. $1=_st(self)._category();
  7496. return $1;
  7497. }, function($ctx1) {$ctx1.fill(self,"protocol",{}, smalltalk.CompiledMethod)})},
  7498. args: [],
  7499. source: "protocol\x0a\x09^ self category",
  7500. messageSends: ["category"],
  7501. referencedClasses: []
  7502. }),
  7503. smalltalk.CompiledMethod);
  7504. smalltalk.addMethod(
  7505. "_referencedClasses",
  7506. smalltalk.method({
  7507. selector: "referencedClasses",
  7508. category: 'accessing',
  7509. fn: function (){
  7510. var self=this;
  7511. return smalltalk.withContext(function($ctx1) { var $1;
  7512. $1=_st(self)._basicAt_("referencedClasses");
  7513. return $1;
  7514. }, function($ctx1) {$ctx1.fill(self,"referencedClasses",{}, smalltalk.CompiledMethod)})},
  7515. args: [],
  7516. source: "referencedClasses\x0a\x09^self basicAt: 'referencedClasses'",
  7517. messageSends: ["basicAt:"],
  7518. referencedClasses: []
  7519. }),
  7520. smalltalk.CompiledMethod);
  7521. smalltalk.addMethod(
  7522. "_selector",
  7523. smalltalk.method({
  7524. selector: "selector",
  7525. category: 'accessing',
  7526. fn: function (){
  7527. var self=this;
  7528. return smalltalk.withContext(function($ctx1) { var $1;
  7529. $1=_st(self)._basicAt_("selector");
  7530. return $1;
  7531. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.CompiledMethod)})},
  7532. args: [],
  7533. source: "selector\x0a\x09^self basicAt: 'selector'",
  7534. messageSends: ["basicAt:"],
  7535. referencedClasses: []
  7536. }),
  7537. smalltalk.CompiledMethod);
  7538. smalltalk.addMethod(
  7539. "_selector_",
  7540. smalltalk.method({
  7541. selector: "selector:",
  7542. category: 'accessing',
  7543. fn: function (aString){
  7544. var self=this;
  7545. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("selector",aString);
  7546. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.CompiledMethod)})},
  7547. args: ["aString"],
  7548. source: "selector: aString\x0a\x09self basicAt: 'selector' put: aString",
  7549. messageSends: ["basicAt:put:"],
  7550. referencedClasses: []
  7551. }),
  7552. smalltalk.CompiledMethod);
  7553. smalltalk.addMethod(
  7554. "_source",
  7555. smalltalk.method({
  7556. selector: "source",
  7557. category: 'accessing',
  7558. fn: function (){
  7559. var self=this;
  7560. return smalltalk.withContext(function($ctx1) { var $2,$1;
  7561. $2=_st(self)._basicAt_("source");
  7562. if(($receiver = $2) == nil || $receiver == undefined){
  7563. $1="";
  7564. } else {
  7565. $1=$2;
  7566. };
  7567. return $1;
  7568. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.CompiledMethod)})},
  7569. args: [],
  7570. source: "source\x0a\x09^(self basicAt: 'source') ifNil: ['']",
  7571. messageSends: ["ifNil:", "basicAt:"],
  7572. referencedClasses: []
  7573. }),
  7574. smalltalk.CompiledMethod);
  7575. smalltalk.addMethod(
  7576. "_source_",
  7577. smalltalk.method({
  7578. selector: "source:",
  7579. category: 'accessing',
  7580. fn: function (aString){
  7581. var self=this;
  7582. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("source",aString);
  7583. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.CompiledMethod)})},
  7584. args: ["aString"],
  7585. source: "source: aString\x0a\x09self basicAt: 'source' put: aString",
  7586. messageSends: ["basicAt:put:"],
  7587. referencedClasses: []
  7588. }),
  7589. smalltalk.CompiledMethod);
  7590. smalltalk.addClass('ForkPool', smalltalk.Object, ['poolSize', 'maxPoolSize', 'queue', 'worker'], 'Kernel-Methods');
  7591. smalltalk.ForkPool.comment="A ForkPool is responsible for handling forked blocks.\x0aThe pool size sets the maximum concurrent forked blocks.\x0a\x0aThe default instance is accessed with `ForkPool default`"
  7592. smalltalk.addMethod(
  7593. "_addWorker",
  7594. smalltalk.method({
  7595. selector: "addWorker",
  7596. category: 'private',
  7597. fn: function (){
  7598. var self=this;
  7599. return smalltalk.withContext(function($ctx1) { _st(self["@worker"])._valueWithTimeout_((0));
  7600. self["@poolSize"]=_st(self["@poolSize"]).__plus((1));
  7601. return self}, function($ctx1) {$ctx1.fill(self,"addWorker",{}, smalltalk.ForkPool)})},
  7602. args: [],
  7603. source: "addWorker\x0a\x09worker valueWithTimeout: 0.\x0a poolSize := poolSize + 1",
  7604. messageSends: ["valueWithTimeout:", "+"],
  7605. referencedClasses: []
  7606. }),
  7607. smalltalk.ForkPool);
  7608. smalltalk.addMethod(
  7609. "_defaultMaxPoolSize",
  7610. smalltalk.method({
  7611. selector: "defaultMaxPoolSize",
  7612. category: 'defaults',
  7613. fn: function (){
  7614. var self=this;
  7615. return smalltalk.withContext(function($ctx1) { var $1;
  7616. $1=_st(_st(self)._class())._defaultMaxPoolSize();
  7617. return $1;
  7618. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{}, smalltalk.ForkPool)})},
  7619. args: [],
  7620. source: "defaultMaxPoolSize\x0a\x09^ self class defaultMaxPoolSize",
  7621. messageSends: ["defaultMaxPoolSize", "class"],
  7622. referencedClasses: []
  7623. }),
  7624. smalltalk.ForkPool);
  7625. smalltalk.addMethod(
  7626. "_fork_",
  7627. smalltalk.method({
  7628. selector: "fork:",
  7629. category: 'actions',
  7630. fn: function (aBlock){
  7631. var self=this;
  7632. return smalltalk.withContext(function($ctx1) { var $1;
  7633. $1=_st(self["@poolSize"]).__lt(_st(self)._maxPoolSize());
  7634. if(smalltalk.assert($1)){
  7635. _st(self)._addWorker();
  7636. };
  7637. _st(self["@queue"])._back_(aBlock);
  7638. return self}, function($ctx1) {$ctx1.fill(self,"fork:",{aBlock:aBlock}, smalltalk.ForkPool)})},
  7639. args: ["aBlock"],
  7640. source: "fork: aBlock\x0a\x09poolSize < self maxPoolSize ifTrue: [ self addWorker ].\x0a\x09queue back: aBlock",
  7641. messageSends: ["ifTrue:", "addWorker", "<", "maxPoolSize", "back:"],
  7642. referencedClasses: []
  7643. }),
  7644. smalltalk.ForkPool);
  7645. smalltalk.addMethod(
  7646. "_initialize",
  7647. smalltalk.method({
  7648. selector: "initialize",
  7649. category: 'initialization',
  7650. fn: function (){
  7651. var self=this;
  7652. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  7653. self["@poolSize"]=(0);
  7654. self["@queue"]=_st((smalltalk.Queue || Queue))._new();
  7655. self["@worker"]=_st(self)._makeWorker();
  7656. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ForkPool)})},
  7657. args: [],
  7658. source: "initialize\x0a super initialize.\x0a \x0a\x09poolSize := 0.\x0a queue := Queue new.\x0a worker := self makeWorker",
  7659. messageSends: ["initialize", "new", "makeWorker"],
  7660. referencedClasses: ["Queue"]
  7661. }),
  7662. smalltalk.ForkPool);
  7663. smalltalk.addMethod(
  7664. "_makeWorker",
  7665. smalltalk.method({
  7666. selector: "makeWorker",
  7667. category: 'initialization',
  7668. fn: function (){
  7669. var self=this;
  7670. var sentinel;
  7671. return smalltalk.withContext(function($ctx1) { var $2,$1;
  7672. sentinel=_st((smalltalk.Object || Object))._new();
  7673. $1=(function(){
  7674. var block;
  7675. return smalltalk.withContext(function($ctx2) { self["@poolSize"]=_st(self["@poolSize"]).__minus((1));
  7676. self["@poolSize"];
  7677. block=_st(self["@queue"])._frontIfAbsent_((function(){
  7678. return smalltalk.withContext(function($ctx3) { return sentinel;
  7679. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  7680. block;
  7681. $2=_st(block).__eq_eq(sentinel);
  7682. if(! smalltalk.assert($2)){
  7683. return _st((function(){
  7684. return smalltalk.withContext(function($ctx3) { return _st(block)._value();
  7685. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
  7686. return smalltalk.withContext(function($ctx3) { return _st(self)._addWorker();
  7687. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  7688. };
  7689. }, function($ctx2) {$ctx2.fillBlock({block:block},$ctx1)})});
  7690. return $1;
  7691. }, function($ctx1) {$ctx1.fill(self,"makeWorker",{sentinel:sentinel}, smalltalk.ForkPool)})},
  7692. args: [],
  7693. source: "makeWorker\x0a\x09| sentinel |\x0a sentinel := Object new.\x0a ^[ | block |\x0a poolSize := poolSize - 1.\x0a\x09\x09block := queue frontIfAbsent: [ sentinel ].\x0a block == sentinel ifFalse: [\x0a \x09[ block value ] ensure: [ self addWorker ]]]",
  7694. messageSends: ["new", "-", "frontIfAbsent:", "ifFalse:", "ensure:", "addWorker", "value", "=="],
  7695. referencedClasses: ["Object"]
  7696. }),
  7697. smalltalk.ForkPool);
  7698. smalltalk.addMethod(
  7699. "_maxPoolSize",
  7700. smalltalk.method({
  7701. selector: "maxPoolSize",
  7702. category: 'accessing',
  7703. fn: function (){
  7704. var self=this;
  7705. return smalltalk.withContext(function($ctx1) { var $2,$1;
  7706. $2=self["@maxPoolSize"];
  7707. if(($receiver = $2) == nil || $receiver == undefined){
  7708. $1=_st(self)._defaultMaxPoolSize();
  7709. } else {
  7710. $1=$2;
  7711. };
  7712. return $1;
  7713. }, function($ctx1) {$ctx1.fill(self,"maxPoolSize",{}, smalltalk.ForkPool)})},
  7714. args: [],
  7715. source: "maxPoolSize\x0a\x09^ maxPoolSize ifNil: [ self defaultMaxPoolSize ]",
  7716. messageSends: ["ifNil:", "defaultMaxPoolSize"],
  7717. referencedClasses: []
  7718. }),
  7719. smalltalk.ForkPool);
  7720. smalltalk.addMethod(
  7721. "_maxPoolSize_",
  7722. smalltalk.method({
  7723. selector: "maxPoolSize:",
  7724. category: 'accessing',
  7725. fn: function (anInteger){
  7726. var self=this;
  7727. return smalltalk.withContext(function($ctx1) { self["@maxPoolSize"]=anInteger;
  7728. return self}, function($ctx1) {$ctx1.fill(self,"maxPoolSize:",{anInteger:anInteger}, smalltalk.ForkPool)})},
  7729. args: ["anInteger"],
  7730. source: "maxPoolSize: anInteger\x0a\x09maxPoolSize := anInteger",
  7731. messageSends: [],
  7732. referencedClasses: []
  7733. }),
  7734. smalltalk.ForkPool);
  7735. smalltalk.ForkPool.klass.iVarNames = ['default'];
  7736. smalltalk.addMethod(
  7737. "_default",
  7738. smalltalk.method({
  7739. selector: "default",
  7740. category: 'accessing',
  7741. fn: function (){
  7742. var self=this;
  7743. return smalltalk.withContext(function($ctx1) { var $2,$1;
  7744. $2=self["@default"];
  7745. if(($receiver = $2) == nil || $receiver == undefined){
  7746. self["@default"]=_st(self)._new();
  7747. $1=self["@default"];
  7748. } else {
  7749. $1=$2;
  7750. };
  7751. return $1;
  7752. }, function($ctx1) {$ctx1.fill(self,"default",{}, smalltalk.ForkPool.klass)})},
  7753. args: [],
  7754. source: "default\x0a\x09^default ifNil: [ default := self new ]",
  7755. messageSends: ["ifNil:", "new"],
  7756. referencedClasses: []
  7757. }),
  7758. smalltalk.ForkPool.klass);
  7759. smalltalk.addMethod(
  7760. "_defaultMaxPoolSize",
  7761. smalltalk.method({
  7762. selector: "defaultMaxPoolSize",
  7763. category: 'accessing',
  7764. fn: function (){
  7765. var self=this;
  7766. return smalltalk.withContext(function($ctx1) { return (100);
  7767. }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{}, smalltalk.ForkPool.klass)})},
  7768. args: [],
  7769. source: "defaultMaxPoolSize\x0a\x09^100",
  7770. messageSends: [],
  7771. referencedClasses: []
  7772. }),
  7773. smalltalk.ForkPool.klass);
  7774. smalltalk.addMethod(
  7775. "_resetDefault",
  7776. smalltalk.method({
  7777. selector: "resetDefault",
  7778. category: 'accessing',
  7779. fn: function (){
  7780. var self=this;
  7781. return smalltalk.withContext(function($ctx1) { self["@default"]=nil;
  7782. return self}, function($ctx1) {$ctx1.fill(self,"resetDefault",{}, smalltalk.ForkPool.klass)})},
  7783. args: [],
  7784. source: "resetDefault\x0a\x09default := nil",
  7785. messageSends: [],
  7786. referencedClasses: []
  7787. }),
  7788. smalltalk.ForkPool.klass);
  7789. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  7790. smalltalk.Message.comment="Generally, the system does not use instances of Message for efficiency reasons.\x0aHowever, when a message is not understood by its receiver, the interpreter will make up an instance of it in order to capture the information involved in an actual message transmission. \x0aThis instance is sent it as an argument with the message `doesNotUnderstand:` to the receiver.\x0a\x0aSee boot.js, `messageNotUnderstood` and its counterpart `Object>>doesNotUnderstand:`"
  7791. smalltalk.addMethod(
  7792. "_arguments",
  7793. smalltalk.method({
  7794. selector: "arguments",
  7795. category: 'accessing',
  7796. fn: function (){
  7797. var self=this;
  7798. return smalltalk.withContext(function($ctx1) { var $1;
  7799. $1=self["@arguments"];
  7800. return $1;
  7801. }, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.Message)})},
  7802. args: [],
  7803. source: "arguments\x0a\x09^arguments",
  7804. messageSends: [],
  7805. referencedClasses: []
  7806. }),
  7807. smalltalk.Message);
  7808. smalltalk.addMethod(
  7809. "_arguments_",
  7810. smalltalk.method({
  7811. selector: "arguments:",
  7812. category: 'accessing',
  7813. fn: function (anArray){
  7814. var self=this;
  7815. return smalltalk.withContext(function($ctx1) { self["@arguments"]=anArray;
  7816. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{anArray:anArray}, smalltalk.Message)})},
  7817. args: ["anArray"],
  7818. source: "arguments: anArray\x0a\x09arguments := anArray",
  7819. messageSends: [],
  7820. referencedClasses: []
  7821. }),
  7822. smalltalk.Message);
  7823. smalltalk.addMethod(
  7824. "_printString",
  7825. smalltalk.method({
  7826. selector: "printString",
  7827. category: 'printing',
  7828. fn: function (){
  7829. var self=this;
  7830. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  7831. $1=_st((smalltalk.String || String))._streamContents_((function(aStream){
  7832. return smalltalk.withContext(function($ctx2) { $2=aStream;
  7833. _st($2)._nextPutAll_(smalltalk.Object.fn.prototype._printString.apply(_st(self), []));
  7834. _st($2)._nextPutAll_("(");
  7835. _st($2)._nextPutAll_(self["@selector"]);
  7836. $3=_st($2)._nextPutAll_(")");
  7837. return $3;
  7838. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})}));
  7839. return $1;
  7840. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Message)})},
  7841. args: [],
  7842. source: "printString\x0a\x09^ String streamContents: [:aStream| \x0a \x09\x09\x09\x09aStream \x0a \x09\x09\x09\x09\x09nextPutAll: super printString;\x0a \x09\x09\x09\x09\x09nextPutAll: '(';\x0a \x09\x09\x09\x09\x09nextPutAll: selector;\x0a \x09\x09\x09\x09\x09nextPutAll: ')' \x09\x09\x09\x09]",
  7843. messageSends: ["streamContents:", "nextPutAll:", "printString"],
  7844. referencedClasses: ["String"]
  7845. }),
  7846. smalltalk.Message);
  7847. smalltalk.addMethod(
  7848. "_selector",
  7849. smalltalk.method({
  7850. selector: "selector",
  7851. category: 'accessing',
  7852. fn: function (){
  7853. var self=this;
  7854. return smalltalk.withContext(function($ctx1) { var $1;
  7855. $1=self["@selector"];
  7856. return $1;
  7857. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.Message)})},
  7858. args: [],
  7859. source: "selector\x0a\x09^selector",
  7860. messageSends: [],
  7861. referencedClasses: []
  7862. }),
  7863. smalltalk.Message);
  7864. smalltalk.addMethod(
  7865. "_selector_",
  7866. smalltalk.method({
  7867. selector: "selector:",
  7868. category: 'accessing',
  7869. fn: function (aString){
  7870. var self=this;
  7871. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  7872. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.Message)})},
  7873. args: ["aString"],
  7874. source: "selector: aString\x0a\x09selector := aString",
  7875. messageSends: [],
  7876. referencedClasses: []
  7877. }),
  7878. smalltalk.Message);
  7879. smalltalk.addMethod(
  7880. "_sendTo_",
  7881. smalltalk.method({
  7882. selector: "sendTo:",
  7883. category: 'printing',
  7884. fn: function (anObject){
  7885. var self=this;
  7886. return smalltalk.withContext(function($ctx1) { var $1;
  7887. $1=_st(anObject)._perform_withArguments_(_st(self)._selector(),_st(self)._arguments());
  7888. return $1;
  7889. }, function($ctx1) {$ctx1.fill(self,"sendTo:",{anObject:anObject}, smalltalk.Message)})},
  7890. args: ["anObject"],
  7891. source: "sendTo: anObject\x0a\x09^ anObject perform: self selector withArguments: self arguments",
  7892. messageSends: ["perform:withArguments:", "selector", "arguments"],
  7893. referencedClasses: []
  7894. }),
  7895. smalltalk.Message);
  7896. smalltalk.addMethod(
  7897. "_selector_arguments_",
  7898. smalltalk.method({
  7899. selector: "selector:arguments:",
  7900. category: 'instance creation',
  7901. fn: function (aString,anArray){
  7902. var self=this;
  7903. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  7904. $2=_st(self)._new();
  7905. _st($2)._selector_(aString);
  7906. _st($2)._arguments_(anArray);
  7907. $3=_st($2)._yourself();
  7908. $1=$3;
  7909. return $1;
  7910. }, function($ctx1) {$ctx1.fill(self,"selector:arguments:",{aString:aString,anArray:anArray}, smalltalk.Message.klass)})},
  7911. args: ["aString", "anArray"],
  7912. source: "selector: aString arguments: anArray\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09arguments: anArray;\x0a\x09\x09yourself",
  7913. messageSends: ["selector:", "new", "arguments:", "yourself"],
  7914. referencedClasses: []
  7915. }),
  7916. smalltalk.Message.klass);
  7917. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  7918. smalltalk.MethodContext.comment="MethodContext holds all the dynamic state associated with the execution of either a method activation resulting from a message send. That is used to build the call stack while debugging.\x0a \x0aMethodContext instances are JavaScript `SmalltalkMethodContext` objects defined in boot.js"
  7919. smalltalk.addMethod(
  7920. "_asString",
  7921. smalltalk.method({
  7922. selector: "asString",
  7923. category: 'converting',
  7924. fn: function (){
  7925. var self=this;
  7926. return smalltalk.withContext(function($ctx1) { var $2,$1;
  7927. $2=_st(self)._isBlockContext();
  7928. if(smalltalk.assert($2)){
  7929. $1=_st(_st("a block (in ").__comma(_st(_st(_st(_st(self)._methodContext())._receiver())._class())._printString())).__comma(")");
  7930. } else {
  7931. $1=_st(_st(_st(_st(_st(self)._receiver())._class())._printString()).__comma(" >> ")).__comma(_st(self)._selector());
  7932. };
  7933. return $1;
  7934. }, function($ctx1) {$ctx1.fill(self,"asString",{}, smalltalk.MethodContext)})},
  7935. args: [],
  7936. source: "asString\x0a\x09^self isBlockContext \x0a \x09ifTrue: [ 'a block (in ', self methodContext receiver class printString, ')' ]\x0a \x09ifFalse: [ self receiver class printString, ' >> ', self selector ]",
  7937. messageSends: ["ifTrue:ifFalse:", ",", "printString", "class", "receiver", "methodContext", "selector", "isBlockContext"],
  7938. referencedClasses: []
  7939. }),
  7940. smalltalk.MethodContext);
  7941. smalltalk.addMethod(
  7942. "_home",
  7943. smalltalk.method({
  7944. selector: "home",
  7945. category: 'accessing',
  7946. fn: function (){
  7947. var self=this;
  7948. return smalltalk.withContext(function($ctx1) { return self.methodContext || self.homeContext;
  7949. return self}, function($ctx1) {$ctx1.fill(self,"home",{}, smalltalk.MethodContext)})},
  7950. args: [],
  7951. source: "home\x0a\x09<return self.methodContext || self.homeContext>",
  7952. messageSends: [],
  7953. referencedClasses: []
  7954. }),
  7955. smalltalk.MethodContext);
  7956. smalltalk.addMethod(
  7957. "_isBlockContext",
  7958. smalltalk.method({
  7959. selector: "isBlockContext",
  7960. category: 'testing',
  7961. fn: function (){
  7962. var self=this;
  7963. return smalltalk.withContext(function($ctx1) { var $1;
  7964. $1=_st(_st(self)._selector())._isNil();
  7965. return $1;
  7966. }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{}, smalltalk.MethodContext)})},
  7967. args: [],
  7968. source: "isBlockContext\x0a\x09\x22Block context do not have selectors.\x22\x0a \x0a\x09^ self selector isNil",
  7969. messageSends: ["isNil", "selector"],
  7970. referencedClasses: []
  7971. }),
  7972. smalltalk.MethodContext);
  7973. smalltalk.addMethod(
  7974. "_locals",
  7975. smalltalk.method({
  7976. selector: "locals",
  7977. category: 'accessing',
  7978. fn: function (){
  7979. var self=this;
  7980. return smalltalk.withContext(function($ctx1) { return self.locals;
  7981. return self}, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.MethodContext)})},
  7982. args: [],
  7983. source: "locals\x0a\x09<return self.locals>",
  7984. messageSends: [],
  7985. referencedClasses: []
  7986. }),
  7987. smalltalk.MethodContext);
  7988. smalltalk.addMethod(
  7989. "_method",
  7990. smalltalk.method({
  7991. selector: "method",
  7992. category: 'accessing',
  7993. fn: function (){
  7994. var self=this;
  7995. return smalltalk.withContext(function($ctx1) { var $1;
  7996. $1=_st(_st(_st(_st(self)._methodContext())._receiver())._class())._lookupSelector_(_st(_st(self)._methodContext())._selector());
  7997. return $1;
  7998. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.MethodContext)})},
  7999. args: [],
  8000. source: "method\x0a\x09^self methodContext receiver class lookupSelector: self methodContext selector",
  8001. messageSends: ["lookupSelector:", "selector", "methodContext", "class", "receiver"],
  8002. referencedClasses: []
  8003. }),
  8004. smalltalk.MethodContext);
  8005. smalltalk.addMethod(
  8006. "_methodContext",
  8007. smalltalk.method({
  8008. selector: "methodContext",
  8009. category: 'accessing',
  8010. fn: function (){
  8011. var self=this;
  8012. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  8013. $1=_st(self)._isBlockContext();
  8014. if(! smalltalk.assert($1)){
  8015. $2=self;
  8016. return $2;
  8017. };
  8018. $3=_st(self)._home();
  8019. return $3;
  8020. }, function($ctx1) {$ctx1.fill(self,"methodContext",{}, smalltalk.MethodContext)})},
  8021. args: [],
  8022. source: "methodContext\x0a\x09self isBlockContext ifFalse: [ ^ self ].\x0a \x0a ^ self home",
  8023. messageSends: ["ifFalse:", "isBlockContext", "home"],
  8024. referencedClasses: []
  8025. }),
  8026. smalltalk.MethodContext);
  8027. smalltalk.addMethod(
  8028. "_outerContext",
  8029. smalltalk.method({
  8030. selector: "outerContext",
  8031. category: 'accessing',
  8032. fn: function (){
  8033. var self=this;
  8034. return smalltalk.withContext(function($ctx1) { return self.homeContext;
  8035. return self}, function($ctx1) {$ctx1.fill(self,"outerContext",{}, smalltalk.MethodContext)})},
  8036. args: [],
  8037. source: "outerContext\x0a\x09<return self.homeContext>",
  8038. messageSends: [],
  8039. referencedClasses: []
  8040. }),
  8041. smalltalk.MethodContext);
  8042. smalltalk.addMethod(
  8043. "_pc",
  8044. smalltalk.method({
  8045. selector: "pc",
  8046. category: 'accessing',
  8047. fn: function (){
  8048. var self=this;
  8049. return smalltalk.withContext(function($ctx1) { return self.pc;
  8050. return self}, function($ctx1) {$ctx1.fill(self,"pc",{}, smalltalk.MethodContext)})},
  8051. args: [],
  8052. source: "pc\x0a\x09<return self.pc>",
  8053. messageSends: [],
  8054. referencedClasses: []
  8055. }),
  8056. smalltalk.MethodContext);
  8057. smalltalk.addMethod(
  8058. "_printString",
  8059. smalltalk.method({
  8060. selector: "printString",
  8061. category: 'accessing',
  8062. fn: function (){
  8063. var self=this;
  8064. return smalltalk.withContext(function($ctx1) { var $1;
  8065. $1=_st(_st(_st(smalltalk.Object.fn.prototype._printString.apply(_st(self), [])).__comma("(")).__comma(_st(self)._asString())).__comma(")");
  8066. return $1;
  8067. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.MethodContext)})},
  8068. args: [],
  8069. source: "printString\x0a\x09^super printString, '(', self asString, ')'",
  8070. messageSends: [",", "asString", "printString"],
  8071. referencedClasses: []
  8072. }),
  8073. smalltalk.MethodContext);
  8074. smalltalk.addMethod(
  8075. "_receiver",
  8076. smalltalk.method({
  8077. selector: "receiver",
  8078. category: 'accessing',
  8079. fn: function (){
  8080. var self=this;
  8081. return smalltalk.withContext(function($ctx1) { return self.receiver;
  8082. return self}, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.MethodContext)})},
  8083. args: [],
  8084. source: "receiver\x0a\x09<return self.receiver>",
  8085. messageSends: [],
  8086. referencedClasses: []
  8087. }),
  8088. smalltalk.MethodContext);
  8089. smalltalk.addMethod(
  8090. "_selector",
  8091. smalltalk.method({
  8092. selector: "selector",
  8093. category: 'accessing',
  8094. fn: function (){
  8095. var self=this;
  8096. return smalltalk.withContext(function($ctx1) {
  8097. if(self.selector) {
  8098. return smalltalk.convertSelector(self.selector);
  8099. } else {
  8100. return nil;
  8101. }
  8102. ;
  8103. return self}, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.MethodContext)})},
  8104. args: [],
  8105. source: "selector\x0a\x09<\x0a \x09if(self.selector) {\x0a \x09return smalltalk.convertSelector(self.selector);\x0a } else {\x0a \x09return nil;\x0a }\x0a >",
  8106. messageSends: [],
  8107. referencedClasses: []
  8108. }),
  8109. smalltalk.MethodContext);
  8110. smalltalk.addMethod(
  8111. "_temps",
  8112. smalltalk.method({
  8113. selector: "temps",
  8114. category: 'accessing',
  8115. fn: function (){
  8116. var self=this;
  8117. return smalltalk.withContext(function($ctx1) { var $1;
  8118. _st(self)._deprecatedAPI();
  8119. $1=_st(self)._locals();
  8120. return $1;
  8121. }, function($ctx1) {$ctx1.fill(self,"temps",{}, smalltalk.MethodContext)})},
  8122. args: [],
  8123. source: "temps\x0a\x09self deprecatedAPI.\x0a \x0a\x09^ self locals",
  8124. messageSends: ["deprecatedAPI", "locals"],
  8125. referencedClasses: []
  8126. }),
  8127. smalltalk.MethodContext);
  8128. smalltalk.addClass('NativeFunction', smalltalk.Object, [], 'Kernel-Methods');
  8129. smalltalk.NativeFunction.comment="NativeFunction is a wrapper around native functions, such as `WebSocket`.\x0aFor 'normal' functions (whose constructor is the JavaScript `Function` object), use `BlockClosure`.\x0a\x0aSee the class-side `instance creation` methods.\x0a\x0aCreated instances will most probably be instance of `JSObjectProxy`.\x0a\x0aUsage example:\x0a\x0a | ws |\x0a ws := NativeFunction constructor: 'WebSocket' value: 'ws://localhost'.\x0a ws at: 'onopen' put: [ ws send: 'hey there from Amber' ]"
  8130. smalltalk.addMethod(
  8131. "_constructor_",
  8132. smalltalk.method({
  8133. selector: "constructor:",
  8134. category: 'instance creation',
  8135. fn: function (aString){
  8136. var self=this;
  8137. return smalltalk.withContext(function($ctx1) {
  8138. var native=eval(aString);
  8139. return new native();
  8140. ;
  8141. return self}, function($ctx1) {$ctx1.fill(self,"constructor:",{aString:aString}, smalltalk.NativeFunction.klass)})},
  8142. args: ["aString"],
  8143. source: "constructor: aString\x0a\x09<\x0a \x09var native=eval(aString); \x0a return new native();\x0a\x09>",
  8144. messageSends: [],
  8145. referencedClasses: []
  8146. }),
  8147. smalltalk.NativeFunction.klass);
  8148. smalltalk.addMethod(
  8149. "_constructor_value_",
  8150. smalltalk.method({
  8151. selector: "constructor:value:",
  8152. category: 'instance creation',
  8153. fn: function (aString,anObject){
  8154. var self=this;
  8155. return smalltalk.withContext(function($ctx1) {
  8156. var native=eval(aString);
  8157. return new native(anObject);
  8158. ;
  8159. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:",{aString:aString,anObject:anObject}, smalltalk.NativeFunction.klass)})},
  8160. args: ["aString", "anObject"],
  8161. source: "constructor: aString value:anObject\x0a\x09<\x0a \x09var native=eval(aString); \x0a return new native(anObject);\x0a\x09>",
  8162. messageSends: [],
  8163. referencedClasses: []
  8164. }),
  8165. smalltalk.NativeFunction.klass);
  8166. smalltalk.addMethod(
  8167. "_constructor_value_value_",
  8168. smalltalk.method({
  8169. selector: "constructor:value:value:",
  8170. category: 'instance creation',
  8171. fn: function (aString,anObject,anObject2){
  8172. var self=this;
  8173. return smalltalk.withContext(function($ctx1) {
  8174. var native=eval(aString);
  8175. return new native(anObject,anObject2);
  8176. ;
  8177. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2}, smalltalk.NativeFunction.klass)})},
  8178. args: ["aString", "anObject", "anObject2"],
  8179. source: "constructor: aString value:anObject value: anObject2\x0a\x09<\x0a \x09var native=eval(aString); \x0a return new native(anObject,anObject2);\x0a\x09>",
  8180. messageSends: [],
  8181. referencedClasses: []
  8182. }),
  8183. smalltalk.NativeFunction.klass);
  8184. smalltalk.addMethod(
  8185. "_constructor_value_value_value_",
  8186. smalltalk.method({
  8187. selector: "constructor:value:value:value:",
  8188. category: 'instance creation',
  8189. fn: function (aString,anObject,anObject2,anObject3){
  8190. var self=this;
  8191. return smalltalk.withContext(function($ctx1) {
  8192. var native=eval(aString);
  8193. return new native(anObject,anObject2, anObject3);
  8194. ;
  8195. return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3}, smalltalk.NativeFunction.klass)})},
  8196. args: ["aString", "anObject", "anObject2", "anObject3"],
  8197. source: "constructor: aString value:anObject value: anObject2 value:anObject3\x0a\x09<\x0a \x09var native=eval(aString); \x0a return new native(anObject,anObject2, anObject3);\x0a\x09>",
  8198. messageSends: [],
  8199. referencedClasses: []
  8200. }),
  8201. smalltalk.NativeFunction.klass);
  8202. smalltalk.addMethod(
  8203. "_exists_",
  8204. smalltalk.method({
  8205. selector: "exists:",
  8206. category: 'testing',
  8207. fn: function (aString){
  8208. var self=this;
  8209. return smalltalk.withContext(function($ctx1) {
  8210. if(aString in window) {
  8211. return true
  8212. } else {
  8213. return false
  8214. }
  8215. ;
  8216. return self}, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString}, smalltalk.NativeFunction.klass)})},
  8217. args: ["aString"],
  8218. source: "exists: aString\x0a\x09<\x0a \x09if(aString in window) {\x0a \x09return true\x0a } else {\x0a \x09return false\x0a }\x0a >",
  8219. messageSends: [],
  8220. referencedClasses: []
  8221. }),
  8222. smalltalk.NativeFunction.klass);
  8223. smalltalk.addPackage('Kernel-Collections', {});
  8224. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
  8225. smalltalk.addMethod(
  8226. "__eq",
  8227. smalltalk.method({
  8228. selector: "=",
  8229. category: 'comparing',
  8230. fn: function (anAssociation){
  8231. var self=this;
  8232. return smalltalk.withContext(function($ctx1) { var $1;
  8233. $1=_st(_st(_st(self)._class()).__eq(_st(anAssociation)._class()))._and_((function(){
  8234. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._key()).__eq(_st(anAssociation)._key()))._and_((function(){
  8235. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._value()).__eq(_st(anAssociation)._value());
  8236. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  8237. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  8238. return $1;
  8239. }, function($ctx1) {$ctx1.fill(self,"=",{anAssociation:anAssociation}, smalltalk.Association)})},
  8240. args: ["anAssociation"],
  8241. source: "= anAssociation\x0a\x09^self class = anAssociation class and: [\x0a\x09 self key = anAssociation key and: [\x0a\x09\x09self value = anAssociation value]]",
  8242. messageSends: ["and:", "=", "value", "key", "class"],
  8243. referencedClasses: []
  8244. }),
  8245. smalltalk.Association);
  8246. smalltalk.addMethod(
  8247. "_key",
  8248. smalltalk.method({
  8249. selector: "key",
  8250. category: 'accessing',
  8251. fn: function (){
  8252. var self=this;
  8253. return smalltalk.withContext(function($ctx1) { var $1;
  8254. $1=self["@key"];
  8255. return $1;
  8256. }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.Association)})},
  8257. args: [],
  8258. source: "key\x0a\x09^key",
  8259. messageSends: [],
  8260. referencedClasses: []
  8261. }),
  8262. smalltalk.Association);
  8263. smalltalk.addMethod(
  8264. "_key_",
  8265. smalltalk.method({
  8266. selector: "key:",
  8267. category: 'accessing',
  8268. fn: function (aKey){
  8269. var self=this;
  8270. return smalltalk.withContext(function($ctx1) { self["@key"]=aKey;
  8271. return self}, function($ctx1) {$ctx1.fill(self,"key:",{aKey:aKey}, smalltalk.Association)})},
  8272. args: ["aKey"],
  8273. source: "key: aKey\x0a\x09key := aKey",
  8274. messageSends: [],
  8275. referencedClasses: []
  8276. }),
  8277. smalltalk.Association);
  8278. smalltalk.addMethod(
  8279. "_printString",
  8280. smalltalk.method({
  8281. selector: "printString",
  8282. category: 'printing',
  8283. fn: function (){
  8284. var self=this;
  8285. return smalltalk.withContext(function($ctx1) { var $1;
  8286. $1=_st((smalltalk.String || String))._streamContents_((function(aStream){
  8287. return smalltalk.withContext(function($ctx2) { return _st(self)._storeOn_(aStream);
  8288. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})}));
  8289. return $1;
  8290. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Association)})},
  8291. args: [],
  8292. source: "printString\x0a\x09\x22print the contents of the Association into a string and return the string\x22\x0a\x09^String streamContents: [:aStream |\x0a\x09\x09self storeOn: aStream]",
  8293. messageSends: ["streamContents:", "storeOn:"],
  8294. referencedClasses: ["String"]
  8295. }),
  8296. smalltalk.Association);
  8297. smalltalk.addMethod(
  8298. "_storeOn_",
  8299. smalltalk.method({
  8300. selector: "storeOn:",
  8301. category: 'printing',
  8302. fn: function (aStream){
  8303. var self=this;
  8304. return smalltalk.withContext(function($ctx1) { _st(self["@key"])._storeOn_(aStream);
  8305. _st(aStream)._nextPutAll_("->");
  8306. _st(self["@value"])._storeOn_(aStream);
  8307. return self}, function($ctx1) {$ctx1.fill(self,"storeOn:",{aStream:aStream}, smalltalk.Association)})},
  8308. args: ["aStream"],
  8309. source: "storeOn: aStream\x0a\x09\x22Store in the format: key->value\x22\x0a\x0a\x09key storeOn: aStream.\x0a\x09aStream nextPutAll: '->'.\x0a\x09value storeOn: aStream.",
  8310. messageSends: ["storeOn:", "nextPutAll:"],
  8311. referencedClasses: []
  8312. }),
  8313. smalltalk.Association);
  8314. smalltalk.addMethod(
  8315. "_value",
  8316. smalltalk.method({
  8317. selector: "value",
  8318. category: 'accessing',
  8319. fn: function (){
  8320. var self=this;
  8321. return smalltalk.withContext(function($ctx1) { var $1;
  8322. $1=self["@value"];
  8323. return $1;
  8324. }, function($ctx1) {$ctx1.fill(self,"value",{}, smalltalk.Association)})},
  8325. args: [],
  8326. source: "value\x0a\x09^value",
  8327. messageSends: [],
  8328. referencedClasses: []
  8329. }),
  8330. smalltalk.Association);
  8331. smalltalk.addMethod(
  8332. "_value_",
  8333. smalltalk.method({
  8334. selector: "value:",
  8335. category: 'accessing',
  8336. fn: function (aValue){
  8337. var self=this;
  8338. return smalltalk.withContext(function($ctx1) { self["@value"]=aValue;
  8339. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aValue:aValue}, smalltalk.Association)})},
  8340. args: ["aValue"],
  8341. source: "value: aValue\x0a\x09value := aValue",
  8342. messageSends: [],
  8343. referencedClasses: []
  8344. }),
  8345. smalltalk.Association);
  8346. smalltalk.addMethod(
  8347. "_key_value_",
  8348. smalltalk.method({
  8349. selector: "key:value:",
  8350. category: 'instance creation',
  8351. fn: function (aKey,aValue){
  8352. var self=this;
  8353. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  8354. $2=_st(self)._new();
  8355. _st($2)._key_(aKey);
  8356. _st($2)._value_(aValue);
  8357. $3=_st($2)._yourself();
  8358. $1=$3;
  8359. return $1;
  8360. }, function($ctx1) {$ctx1.fill(self,"key:value:",{aKey:aKey,aValue:aValue}, smalltalk.Association.klass)})},
  8361. args: ["aKey", "aValue"],
  8362. source: "key: aKey value: aValue\x0a\x09 ^self new\x0a\x09\x09key: aKey;\x0a\x09\x09value: aValue;\x0a\x09\x09yourself",
  8363. messageSends: ["key:", "new", "value:", "yourself"],
  8364. referencedClasses: []
  8365. }),
  8366. smalltalk.Association.klass);
  8367. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel-Collections');
  8368. smalltalk.addMethod(
  8369. "__comma",
  8370. smalltalk.method({
  8371. selector: ",",
  8372. category: 'copying',
  8373. fn: function (aCollection){
  8374. var self=this;
  8375. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  8376. $2=_st(self)._copy();
  8377. _st($2)._addAll_(aCollection);
  8378. $3=_st($2)._yourself();
  8379. $1=$3;
  8380. return $1;
  8381. }, function($ctx1) {$ctx1.fill(self,",",{aCollection:aCollection}, smalltalk.Collection)})},
  8382. args: ["aCollection"],
  8383. source: ", aCollection\x0a\x09^self copy \x0a\x09 addAll: aCollection; \x0a\x09 yourself",
  8384. messageSends: ["addAll:", "copy", "yourself"],
  8385. referencedClasses: []
  8386. }),
  8387. smalltalk.Collection);
  8388. smalltalk.addMethod(
  8389. "_add_",
  8390. smalltalk.method({
  8391. selector: "add:",
  8392. category: 'adding/removing',
  8393. fn: function (anObject){
  8394. var self=this;
  8395. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  8396. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject}, smalltalk.Collection)})},
  8397. args: ["anObject"],
  8398. source: "add: anObject\x0a\x09self subclassResponsibility",
  8399. messageSends: ["subclassResponsibility"],
  8400. referencedClasses: []
  8401. }),
  8402. smalltalk.Collection);
  8403. smalltalk.addMethod(
  8404. "_addAll_",
  8405. smalltalk.method({
  8406. selector: "addAll:",
  8407. category: 'adding/removing',
  8408. fn: function (aCollection){
  8409. var self=this;
  8410. return smalltalk.withContext(function($ctx1) { var $1;
  8411. _st(aCollection)._do_((function(each){
  8412. return smalltalk.withContext(function($ctx2) { return _st(self)._add_(each);
  8413. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8414. $1=aCollection;
  8415. return $1;
  8416. }, function($ctx1) {$ctx1.fill(self,"addAll:",{aCollection:aCollection}, smalltalk.Collection)})},
  8417. args: ["aCollection"],
  8418. source: "addAll: aCollection\x0a\x09aCollection do: [:each |\x0a\x09 self add: each].\x0a\x09^aCollection",
  8419. messageSends: ["do:", "add:"],
  8420. referencedClasses: []
  8421. }),
  8422. smalltalk.Collection);
  8423. smalltalk.addMethod(
  8424. "_asArray",
  8425. smalltalk.method({
  8426. selector: "asArray",
  8427. category: 'converting',
  8428. fn: function (){
  8429. var self=this;
  8430. return smalltalk.withContext(function($ctx1) { var $1;
  8431. $1=_st((smalltalk.Array || Array))._withAll_(self);
  8432. return $1;
  8433. }, function($ctx1) {$ctx1.fill(self,"asArray",{}, smalltalk.Collection)})},
  8434. args: [],
  8435. source: "asArray\x0a\x09^Array withAll: self",
  8436. messageSends: ["withAll:"],
  8437. referencedClasses: ["Array"]
  8438. }),
  8439. smalltalk.Collection);
  8440. smalltalk.addMethod(
  8441. "_asJSON",
  8442. smalltalk.method({
  8443. selector: "asJSON",
  8444. category: 'converting',
  8445. fn: function (){
  8446. var self=this;
  8447. return smalltalk.withContext(function($ctx1) { var $1;
  8448. $1=_st(_st(self)._asArray())._collect_((function(each){
  8449. return smalltalk.withContext(function($ctx2) { return _st(each)._asJSON();
  8450. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8451. return $1;
  8452. }, function($ctx1) {$ctx1.fill(self,"asJSON",{}, smalltalk.Collection)})},
  8453. args: [],
  8454. source: "asJSON\x0a\x09^self asArray collect: [:each | each asJSON]",
  8455. messageSends: ["collect:", "asJSON", "asArray"],
  8456. referencedClasses: []
  8457. }),
  8458. smalltalk.Collection);
  8459. smalltalk.addMethod(
  8460. "_asOrderedCollection",
  8461. smalltalk.method({
  8462. selector: "asOrderedCollection",
  8463. category: 'converting',
  8464. fn: function (){
  8465. var self=this;
  8466. return smalltalk.withContext(function($ctx1) { var $1;
  8467. $1=_st(self)._asArray();
  8468. return $1;
  8469. }, function($ctx1) {$ctx1.fill(self,"asOrderedCollection",{}, smalltalk.Collection)})},
  8470. args: [],
  8471. source: "asOrderedCollection\x0a\x09^self asArray",
  8472. messageSends: ["asArray"],
  8473. referencedClasses: []
  8474. }),
  8475. smalltalk.Collection);
  8476. smalltalk.addMethod(
  8477. "_asSet",
  8478. smalltalk.method({
  8479. selector: "asSet",
  8480. category: 'converting',
  8481. fn: function (){
  8482. var self=this;
  8483. return smalltalk.withContext(function($ctx1) { var $1;
  8484. $1=_st((smalltalk.Set || Set))._withAll_(self);
  8485. return $1;
  8486. }, function($ctx1) {$ctx1.fill(self,"asSet",{}, smalltalk.Collection)})},
  8487. args: [],
  8488. source: "asSet\x0a\x09^Set withAll: self",
  8489. messageSends: ["withAll:"],
  8490. referencedClasses: ["Set"]
  8491. }),
  8492. smalltalk.Collection);
  8493. smalltalk.addMethod(
  8494. "_collect_",
  8495. smalltalk.method({
  8496. selector: "collect:",
  8497. category: 'enumerating',
  8498. fn: function (aBlock){
  8499. var self=this;
  8500. var stream;
  8501. return smalltalk.withContext(function($ctx1) { var $1;
  8502. stream=_st(_st(_st(self)._class())._new())._writeStream();
  8503. _st(self)._do_((function(each){
  8504. return smalltalk.withContext(function($ctx2) { return _st(stream)._nextPut_(_st(aBlock)._value_(each));
  8505. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8506. $1=_st(stream)._contents();
  8507. return $1;
  8508. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock,stream:stream}, smalltalk.Collection)})},
  8509. args: ["aBlock"],
  8510. source: "collect: aBlock\x0a\x09| stream |\x0a\x09stream := self class new writeStream.\x0a\x09self do: [ :each |\x0a\x09\x09stream nextPut: (aBlock value: each) ].\x0a\x09^stream contents",
  8511. messageSends: ["writeStream", "new", "class", "do:", "nextPut:", "value:", "contents"],
  8512. referencedClasses: []
  8513. }),
  8514. smalltalk.Collection);
  8515. smalltalk.addMethod(
  8516. "_copyWith_",
  8517. smalltalk.method({
  8518. selector: "copyWith:",
  8519. category: 'copying',
  8520. fn: function (anObject){
  8521. var self=this;
  8522. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  8523. $2=_st(self)._copy();
  8524. _st($2)._add_(anObject);
  8525. $3=_st($2)._yourself();
  8526. $1=$3;
  8527. return $1;
  8528. }, function($ctx1) {$ctx1.fill(self,"copyWith:",{anObject:anObject}, smalltalk.Collection)})},
  8529. args: ["anObject"],
  8530. source: "copyWith: anObject\x0a\x09^self copy add: anObject; yourself",
  8531. messageSends: ["add:", "copy", "yourself"],
  8532. referencedClasses: []
  8533. }),
  8534. smalltalk.Collection);
  8535. smalltalk.addMethod(
  8536. "_copyWithAll_",
  8537. smalltalk.method({
  8538. selector: "copyWithAll:",
  8539. category: 'copying',
  8540. fn: function (aCollection){
  8541. var self=this;
  8542. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  8543. $2=_st(self)._copy();
  8544. _st($2)._addAll_(aCollection);
  8545. $3=_st($2)._yourself();
  8546. $1=$3;
  8547. return $1;
  8548. }, function($ctx1) {$ctx1.fill(self,"copyWithAll:",{aCollection:aCollection}, smalltalk.Collection)})},
  8549. args: ["aCollection"],
  8550. source: "copyWithAll: aCollection\x0a\x09^self copy addAll: aCollection; yourself",
  8551. messageSends: ["addAll:", "copy", "yourself"],
  8552. referencedClasses: []
  8553. }),
  8554. smalltalk.Collection);
  8555. smalltalk.addMethod(
  8556. "_copyWithoutAll_",
  8557. smalltalk.method({
  8558. selector: "copyWithoutAll:",
  8559. category: 'copying',
  8560. fn: function (aCollection){
  8561. var self=this;
  8562. return smalltalk.withContext(function($ctx1) { var $1;
  8563. $1=_st(self)._reject_((function(each){
  8564. return smalltalk.withContext(function($ctx2) { return _st(aCollection)._includes_(each);
  8565. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8566. return $1;
  8567. }, function($ctx1) {$ctx1.fill(self,"copyWithoutAll:",{aCollection:aCollection}, smalltalk.Collection)})},
  8568. args: ["aCollection"],
  8569. source: "copyWithoutAll: aCollection\x0a\x09\x22Answer a copy of the receiver that does not contain any elements \x0a\x09equal to those in aCollection.\x22\x0a\x0a\x09^ self reject: [:each | aCollection includes: each]",
  8570. messageSends: ["reject:", "includes:"],
  8571. referencedClasses: []
  8572. }),
  8573. smalltalk.Collection);
  8574. smalltalk.addMethod(
  8575. "_detect_",
  8576. smalltalk.method({
  8577. selector: "detect:",
  8578. category: 'enumerating',
  8579. fn: function (aBlock){
  8580. var self=this;
  8581. return smalltalk.withContext(function($ctx1) { var $1;
  8582. $1=_st(self)._detect_ifNone_(aBlock,(function(){
  8583. return smalltalk.withContext(function($ctx2) { return _st(self)._errorNotFound();
  8584. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  8585. return $1;
  8586. }, function($ctx1) {$ctx1.fill(self,"detect:",{aBlock:aBlock}, smalltalk.Collection)})},
  8587. args: ["aBlock"],
  8588. source: "detect: aBlock\x0a\x09^self detect: aBlock ifNone: [self errorNotFound]",
  8589. messageSends: ["detect:ifNone:", "errorNotFound"],
  8590. referencedClasses: []
  8591. }),
  8592. smalltalk.Collection);
  8593. smalltalk.addMethod(
  8594. "_detect_ifNone_",
  8595. smalltalk.method({
  8596. selector: "detect:ifNone:",
  8597. category: 'enumerating',
  8598. fn: function (aBlock,anotherBlock){
  8599. var self=this;
  8600. return smalltalk.withContext(function($ctx1) {
  8601. for(var i = 0; i < self.length; i++)
  8602. if(aBlock(self[i]))
  8603. return self[i];
  8604. return anotherBlock();
  8605. ;
  8606. return self}, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.Collection)})},
  8607. args: ["aBlock", "anotherBlock"],
  8608. source: "detect: aBlock ifNone: anotherBlock\x0a\x09<\x0a\x09\x09for(var i = 0; i < self.length; i++)\x0a\x09\x09\x09if(aBlock(self[i]))\x0a\x09\x09\x09\x09return self[i];\x0a\x09\x09return anotherBlock();\x0a\x09>",
  8609. messageSends: [],
  8610. referencedClasses: []
  8611. }),
  8612. smalltalk.Collection);
  8613. smalltalk.addMethod(
  8614. "_do_",
  8615. smalltalk.method({
  8616. selector: "do:",
  8617. category: 'enumerating',
  8618. fn: function (aBlock){
  8619. var self=this;
  8620. return smalltalk.withContext(function($ctx1) { for(var i=0;i<self.length;i++){aBlock(self[i]);};
  8621. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.Collection)})},
  8622. args: ["aBlock"],
  8623. source: "do: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock(self[i]);}>",
  8624. messageSends: [],
  8625. referencedClasses: []
  8626. }),
  8627. smalltalk.Collection);
  8628. smalltalk.addMethod(
  8629. "_do_separatedBy_",
  8630. smalltalk.method({
  8631. selector: "do:separatedBy:",
  8632. category: 'enumerating',
  8633. fn: function (aBlock,anotherBlock){
  8634. var self=this;
  8635. var first;
  8636. return smalltalk.withContext(function($ctx1) { var $1;
  8637. first=true;
  8638. _st(self)._do_((function(each){
  8639. return smalltalk.withContext(function($ctx2) { $1=first;
  8640. if(smalltalk.assert($1)){
  8641. first=false;
  8642. first;
  8643. } else {
  8644. _st(anotherBlock)._value();
  8645. };
  8646. return _st(aBlock)._value_(each);
  8647. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8648. return self}, function($ctx1) {$ctx1.fill(self,"do:separatedBy:",{aBlock:aBlock,anotherBlock:anotherBlock,first:first}, smalltalk.Collection)})},
  8649. args: ["aBlock", "anotherBlock"],
  8650. source: "do: aBlock separatedBy: anotherBlock\x0a\x09| first |\x0a\x09first := true.\x0a\x09self do: [:each |\x0a\x09 first\x0a\x09\x09ifTrue: [first := false]\x0a\x09\x09ifFalse: [anotherBlock value].\x0a\x09 aBlock value: each]",
  8651. messageSends: ["do:", "ifTrue:ifFalse:", "value", "value:"],
  8652. referencedClasses: []
  8653. }),
  8654. smalltalk.Collection);
  8655. smalltalk.addMethod(
  8656. "_errorNotFound",
  8657. smalltalk.method({
  8658. selector: "errorNotFound",
  8659. category: 'error handling',
  8660. fn: function (){
  8661. var self=this;
  8662. return smalltalk.withContext(function($ctx1) { _st(self)._error_("Object is not in the collection");
  8663. return self}, function($ctx1) {$ctx1.fill(self,"errorNotFound",{}, smalltalk.Collection)})},
  8664. args: [],
  8665. source: "errorNotFound\x0a\x09self error: 'Object is not in the collection'",
  8666. messageSends: ["error:"],
  8667. referencedClasses: []
  8668. }),
  8669. smalltalk.Collection);
  8670. smalltalk.addMethod(
  8671. "_ifEmpty_",
  8672. smalltalk.method({
  8673. selector: "ifEmpty:",
  8674. category: 'testing',
  8675. fn: function (aBlock){
  8676. var self=this;
  8677. return smalltalk.withContext(function($ctx1) { var $2,$1;
  8678. $2=_st(self)._isEmpty();
  8679. if(smalltalk.assert($2)){
  8680. $1=_st(aBlock)._value();
  8681. } else {
  8682. $1=self;
  8683. };
  8684. return $1;
  8685. }, function($ctx1) {$ctx1.fill(self,"ifEmpty:",{aBlock:aBlock}, smalltalk.Collection)})},
  8686. args: ["aBlock"],
  8687. source: "ifEmpty: aBlock\x0a\x09\x22Evaluate the given block with the receiver as argument, answering its value if the receiver is empty, otherwise answer the receiver. Note that the fact that this method returns its argument in case the receiver is not empty allows one to write expressions like the following ones: self classifyMethodAs: \x0a\x09\x09(myProtocol ifEmpty: ['As yet unclassified'])\x22\x0a\x09^ self isEmpty \x0a\x09\x09ifTrue: [ aBlock value ]\x0a\x09\x09ifFalse: [ self ]",
  8688. messageSends: ["ifTrue:ifFalse:", "value", "isEmpty"],
  8689. referencedClasses: []
  8690. }),
  8691. smalltalk.Collection);
  8692. smalltalk.addMethod(
  8693. "_ifNotEmpty_",
  8694. smalltalk.method({
  8695. selector: "ifNotEmpty:",
  8696. category: 'testing',
  8697. fn: function (aBlock){
  8698. var self=this;
  8699. return smalltalk.withContext(function($ctx1) { var $1;
  8700. $1=_st(self)._notEmpty();
  8701. _st($1)._ifTrue_(aBlock);
  8702. return self}, function($ctx1) {$ctx1.fill(self,"ifNotEmpty:",{aBlock:aBlock}, smalltalk.Collection)})},
  8703. args: ["aBlock"],
  8704. source: "ifNotEmpty: aBlock\x0a\x09self notEmpty ifTrue: aBlock.",
  8705. messageSends: ["ifTrue:", "notEmpty"],
  8706. referencedClasses: []
  8707. }),
  8708. smalltalk.Collection);
  8709. smalltalk.addMethod(
  8710. "_includes_",
  8711. smalltalk.method({
  8712. selector: "includes:",
  8713. category: 'testing',
  8714. fn: function (anObject){
  8715. var self=this;
  8716. var sentinel;
  8717. return smalltalk.withContext(function($ctx1) { var $1;
  8718. sentinel=_st((smalltalk.Object || Object))._new();
  8719. $1=_st(_st(self)._detect_ifNone_((function(each){
  8720. return smalltalk.withContext(function($ctx2) { return _st(each).__eq(anObject);
  8721. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  8722. return smalltalk.withContext(function($ctx2) { return sentinel;
  8723. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__tild_eq(sentinel);
  8724. return $1;
  8725. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject,sentinel:sentinel}, smalltalk.Collection)})},
  8726. args: ["anObject"],
  8727. source: "includes: anObject\x0a\x09| sentinel |\x0a sentinel := Object new.\x0a ^(self detect: [ :each | each = anObject] ifNone: [ sentinel ]) ~= sentinel",
  8728. messageSends: ["new", "~=", "detect:ifNone:", "="],
  8729. referencedClasses: ["Object"]
  8730. }),
  8731. smalltalk.Collection);
  8732. smalltalk.addMethod(
  8733. "_inject_into_",
  8734. smalltalk.method({
  8735. selector: "inject:into:",
  8736. category: 'enumerating',
  8737. fn: function (anObject,aBlock){
  8738. var self=this;
  8739. var result;
  8740. return smalltalk.withContext(function($ctx1) { var $1;
  8741. result=anObject;
  8742. _st(self)._do_((function(each){
  8743. return smalltalk.withContext(function($ctx2) { result=_st(aBlock)._value_value_(result,each);
  8744. return result;
  8745. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8746. $1=result;
  8747. return $1;
  8748. }, function($ctx1) {$ctx1.fill(self,"inject:into:",{anObject:anObject,aBlock:aBlock,result:result}, smalltalk.Collection)})},
  8749. args: ["anObject", "aBlock"],
  8750. source: "inject: anObject into: aBlock\x0a\x09| result |\x0a\x09result := anObject.\x0a\x09self do: [:each | \x0a\x09 result := aBlock value: result value: each].\x0a\x09^result",
  8751. messageSends: ["do:", "value:value:"],
  8752. referencedClasses: []
  8753. }),
  8754. smalltalk.Collection);
  8755. smalltalk.addMethod(
  8756. "_intersection_",
  8757. smalltalk.method({
  8758. selector: "intersection:",
  8759. category: 'enumerating',
  8760. fn: function (aCollection){
  8761. var self=this;
  8762. var set,outputSet;
  8763. return smalltalk.withContext(function($ctx1) { var $1,$2;
  8764. set=_st(self)._asSet();
  8765. outputSet=_st((smalltalk.Set || Set))._new();
  8766. _st(aCollection)._do_((function(each){
  8767. return smalltalk.withContext(function($ctx2) { $1=_st(_st(set)._includes_(each))._and_((function(){
  8768. return smalltalk.withContext(function($ctx3) { return _st(_st(outputSet)._includes_(each))._not();
  8769. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  8770. if(smalltalk.assert($1)){
  8771. return _st(outputSet)._add_(each);
  8772. };
  8773. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8774. $2=_st(_st(self)._class())._withAll_(_st(outputSet)._asArray());
  8775. return $2;
  8776. }, function($ctx1) {$ctx1.fill(self,"intersection:",{aCollection:aCollection,set:set,outputSet:outputSet}, smalltalk.Collection)})},
  8777. args: ["aCollection"],
  8778. source: "intersection: aCollection\x0a\x09\x22Answer the set theoretic intersection of two collections.\x22\x0a\x0a\x09| set outputSet |\x0a\x09\x0a\x09set := self asSet.\x0a\x09outputSet := Set new.\x0a\x09\x0a\x09aCollection do: [ :each |\x0a\x09\x09((set includes: each) and: [(outputSet includes: each) not])\x0a\x09\x09\x09ifTrue: [ \x0a\x09\x09\x09\x09outputSet add: each]].\x0a\x09\x09\x0a\x09^ self class withAll: outputSet asArray",
  8779. messageSends: ["asSet", "new", "do:", "ifTrue:", "add:", "and:", "not", "includes:", "withAll:", "asArray", "class"],
  8780. referencedClasses: ["Set"]
  8781. }),
  8782. smalltalk.Collection);
  8783. smalltalk.addMethod(
  8784. "_isEmpty",
  8785. smalltalk.method({
  8786. selector: "isEmpty",
  8787. category: 'testing',
  8788. fn: function (){
  8789. var self=this;
  8790. return smalltalk.withContext(function($ctx1) { var $1;
  8791. $1=_st(_st(self)._size()).__eq((0));
  8792. return $1;
  8793. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{}, smalltalk.Collection)})},
  8794. args: [],
  8795. source: "isEmpty\x0a\x09^self size = 0",
  8796. messageSends: ["=", "size"],
  8797. referencedClasses: []
  8798. }),
  8799. smalltalk.Collection);
  8800. smalltalk.addMethod(
  8801. "_notEmpty",
  8802. smalltalk.method({
  8803. selector: "notEmpty",
  8804. category: 'testing',
  8805. fn: function (){
  8806. var self=this;
  8807. return smalltalk.withContext(function($ctx1) { var $1;
  8808. $1=_st(_st(self)._isEmpty())._not();
  8809. return $1;
  8810. }, function($ctx1) {$ctx1.fill(self,"notEmpty",{}, smalltalk.Collection)})},
  8811. args: [],
  8812. source: "notEmpty\x0a\x09^self isEmpty not",
  8813. messageSends: ["not", "isEmpty"],
  8814. referencedClasses: []
  8815. }),
  8816. smalltalk.Collection);
  8817. smalltalk.addMethod(
  8818. "_occurrencesOf_",
  8819. smalltalk.method({
  8820. selector: "occurrencesOf:",
  8821. category: 'accessing',
  8822. fn: function (anObject){
  8823. var self=this;
  8824. var tally;
  8825. return smalltalk.withContext(function($ctx1) { var $1,$2;
  8826. tally=(0);
  8827. _st(self)._do_((function(each){
  8828. return smalltalk.withContext(function($ctx2) { $1=_st(anObject).__eq(each);
  8829. if(smalltalk.assert($1)){
  8830. tally=_st(tally).__plus((1));
  8831. return tally;
  8832. };
  8833. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8834. $2=tally;
  8835. return $2;
  8836. }, function($ctx1) {$ctx1.fill(self,"occurrencesOf:",{anObject:anObject,tally:tally}, smalltalk.Collection)})},
  8837. args: ["anObject"],
  8838. source: "occurrencesOf: anObject \x0a\x09\x22Answer how many of the receiver's elements are equal to anObject.\x22\x0a\x0a\x09| tally |\x0a\x09tally := 0.\x0a\x09self do: [:each | anObject = each ifTrue: [tally := tally + 1]].\x0a\x09^tally",
  8839. messageSends: ["do:", "ifTrue:", "+", "="],
  8840. referencedClasses: []
  8841. }),
  8842. smalltalk.Collection);
  8843. smalltalk.addMethod(
  8844. "_printString",
  8845. smalltalk.method({
  8846. selector: "printString",
  8847. category: 'printing',
  8848. fn: function (){
  8849. var self=this;
  8850. return smalltalk.withContext(function($ctx1) { var $1;
  8851. $1=_st((smalltalk.String || String))._streamContents_((function(aStream){
  8852. return smalltalk.withContext(function($ctx2) { _st(aStream)._nextPutAll_(_st(smalltalk.Object.fn.prototype._printString.apply(_st(self), [])).__comma(" ("));
  8853. _st(self)._do_separatedBy_((function(each){
  8854. return smalltalk.withContext(function($ctx3) { return _st(aStream)._nextPutAll_(_st(each)._printString());
  8855. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  8856. return smalltalk.withContext(function($ctx3) { return _st(aStream)._nextPutAll_(" ");
  8857. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  8858. return _st(aStream)._nextPutAll_(")");
  8859. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})}));
  8860. return $1;
  8861. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Collection)})},
  8862. args: [],
  8863. source: "printString\x0a\x09\x22print the contents of the Collection into a string and return it\x22\x0a\x09^String streamContents: [:aStream |\x0a\x09\x09aStream\x0a\x09\x09\x09nextPutAll: super printString, ' ('.\x0a\x09\x09self do: [:each | aStream nextPutAll: each printString]\x0a\x09\x09\x09separatedBy: [aStream nextPutAll: ' '].\x0a\x09\x09aStream nextPutAll: ')']",
  8864. messageSends: ["streamContents:", "nextPutAll:", ",", "printString", "do:separatedBy:"],
  8865. referencedClasses: ["String"]
  8866. }),
  8867. smalltalk.Collection);
  8868. smalltalk.addMethod(
  8869. "_readStream",
  8870. smalltalk.method({
  8871. selector: "readStream",
  8872. category: 'accessing',
  8873. fn: function (){
  8874. var self=this;
  8875. return smalltalk.withContext(function($ctx1) { var $1;
  8876. $1=_st(self)._stream();
  8877. return $1;
  8878. }, function($ctx1) {$ctx1.fill(self,"readStream",{}, smalltalk.Collection)})},
  8879. args: [],
  8880. source: "readStream\x0a\x09^self stream",
  8881. messageSends: ["stream"],
  8882. referencedClasses: []
  8883. }),
  8884. smalltalk.Collection);
  8885. smalltalk.addMethod(
  8886. "_reject_",
  8887. smalltalk.method({
  8888. selector: "reject:",
  8889. category: 'enumerating',
  8890. fn: function (aBlock){
  8891. var self=this;
  8892. return smalltalk.withContext(function($ctx1) { var $1;
  8893. $1=_st(self)._select_((function(each){
  8894. return smalltalk.withContext(function($ctx2) { return _st(_st(aBlock)._value_(each)).__eq(false);
  8895. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8896. return $1;
  8897. }, function($ctx1) {$ctx1.fill(self,"reject:",{aBlock:aBlock}, smalltalk.Collection)})},
  8898. args: ["aBlock"],
  8899. source: "reject: aBlock\x0a\x09^self select: [:each | (aBlock value: each) = false]",
  8900. messageSends: ["select:", "=", "value:"],
  8901. referencedClasses: []
  8902. }),
  8903. smalltalk.Collection);
  8904. smalltalk.addMethod(
  8905. "_remove_",
  8906. smalltalk.method({
  8907. selector: "remove:",
  8908. category: 'adding/removing',
  8909. fn: function (anObject){
  8910. var self=this;
  8911. return smalltalk.withContext(function($ctx1) { var $1;
  8912. $1=_st(self)._remove_ifAbsent_(anObject,(function(){
  8913. return smalltalk.withContext(function($ctx2) { return _st(self)._errorNotFound();
  8914. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  8915. return $1;
  8916. }, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject}, smalltalk.Collection)})},
  8917. args: ["anObject"],
  8918. source: "remove: anObject\x0a ^self remove: anObject ifAbsent: [self errorNotFound]",
  8919. messageSends: ["remove:ifAbsent:", "errorNotFound"],
  8920. referencedClasses: []
  8921. }),
  8922. smalltalk.Collection);
  8923. smalltalk.addMethod(
  8924. "_remove_ifAbsent_",
  8925. smalltalk.method({
  8926. selector: "remove:ifAbsent:",
  8927. category: 'adding/removing',
  8928. fn: function (anObject,aBlock){
  8929. var self=this;
  8930. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  8931. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock}, smalltalk.Collection)})},
  8932. args: ["anObject", "aBlock"],
  8933. source: "remove: anObject ifAbsent: aBlock\x0a self subclassResponsibility",
  8934. messageSends: ["subclassResponsibility"],
  8935. referencedClasses: []
  8936. }),
  8937. smalltalk.Collection);
  8938. smalltalk.addMethod(
  8939. "_select_",
  8940. smalltalk.method({
  8941. selector: "select:",
  8942. category: 'enumerating',
  8943. fn: function (aBlock){
  8944. var self=this;
  8945. var stream;
  8946. return smalltalk.withContext(function($ctx1) { var $1,$2;
  8947. stream=_st(_st(_st(self)._class())._new())._writeStream();
  8948. _st(self)._do_((function(each){
  8949. return smalltalk.withContext(function($ctx2) { $1=_st(aBlock)._value_(each);
  8950. if(smalltalk.assert($1)){
  8951. return _st(stream)._nextPut_(each);
  8952. };
  8953. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  8954. $2=_st(stream)._contents();
  8955. return $2;
  8956. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,stream:stream}, smalltalk.Collection)})},
  8957. args: ["aBlock"],
  8958. source: "select: aBlock\x0a\x09| stream |\x0a\x09stream := self class new writeStream.\x0a\x09self do: [:each |\x0a\x09 (aBlock value: each) ifTrue: [\x0a\x09\x09stream nextPut: each]].\x0a\x09^stream contents",
  8959. messageSends: ["writeStream", "new", "class", "do:", "ifTrue:", "nextPut:", "value:", "contents"],
  8960. referencedClasses: []
  8961. }),
  8962. smalltalk.Collection);
  8963. smalltalk.addMethod(
  8964. "_size",
  8965. smalltalk.method({
  8966. selector: "size",
  8967. category: 'accessing',
  8968. fn: function (){
  8969. var self=this;
  8970. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  8971. return self}, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Collection)})},
  8972. args: [],
  8973. source: "size\x0a\x09self subclassResponsibility",
  8974. messageSends: ["subclassResponsibility"],
  8975. referencedClasses: []
  8976. }),
  8977. smalltalk.Collection);
  8978. smalltalk.addMethod(
  8979. "_stream",
  8980. smalltalk.method({
  8981. selector: "stream",
  8982. category: 'accessing',
  8983. fn: function (){
  8984. var self=this;
  8985. return smalltalk.withContext(function($ctx1) { var $1;
  8986. $1=_st(_st(self)._streamClass())._on_(self);
  8987. return $1;
  8988. }, function($ctx1) {$ctx1.fill(self,"stream",{}, smalltalk.Collection)})},
  8989. args: [],
  8990. source: "stream\x0a\x09^self streamClass on: self",
  8991. messageSends: ["on:", "streamClass"],
  8992. referencedClasses: []
  8993. }),
  8994. smalltalk.Collection);
  8995. smalltalk.addMethod(
  8996. "_streamClass",
  8997. smalltalk.method({
  8998. selector: "streamClass",
  8999. category: 'accessing',
  9000. fn: function (){
  9001. var self=this;
  9002. return smalltalk.withContext(function($ctx1) { var $1;
  9003. $1=_st(_st(self)._class())._streamClass();
  9004. return $1;
  9005. }, function($ctx1) {$ctx1.fill(self,"streamClass",{}, smalltalk.Collection)})},
  9006. args: [],
  9007. source: "streamClass\x0a\x09^self class streamClass",
  9008. messageSends: ["streamClass", "class"],
  9009. referencedClasses: []
  9010. }),
  9011. smalltalk.Collection);
  9012. smalltalk.addMethod(
  9013. "_writeStream",
  9014. smalltalk.method({
  9015. selector: "writeStream",
  9016. category: 'accessing',
  9017. fn: function (){
  9018. var self=this;
  9019. return smalltalk.withContext(function($ctx1) { var $1;
  9020. $1=_st(self)._stream();
  9021. return $1;
  9022. }, function($ctx1) {$ctx1.fill(self,"writeStream",{}, smalltalk.Collection)})},
  9023. args: [],
  9024. source: "writeStream\x0a\x09^self stream",
  9025. messageSends: ["stream"],
  9026. referencedClasses: []
  9027. }),
  9028. smalltalk.Collection);
  9029. smalltalk.addMethod(
  9030. "_new_",
  9031. smalltalk.method({
  9032. selector: "new:",
  9033. category: 'instance creation',
  9034. fn: function (anInteger){
  9035. var self=this;
  9036. return smalltalk.withContext(function($ctx1) { var $1;
  9037. $1=_st(self)._new();
  9038. return $1;
  9039. }, function($ctx1) {$ctx1.fill(self,"new:",{anInteger:anInteger}, smalltalk.Collection.klass)})},
  9040. args: ["anInteger"],
  9041. source: "new: anInteger\x0a\x09^self new",
  9042. messageSends: ["new"],
  9043. referencedClasses: []
  9044. }),
  9045. smalltalk.Collection.klass);
  9046. smalltalk.addMethod(
  9047. "_streamClass",
  9048. smalltalk.method({
  9049. selector: "streamClass",
  9050. category: 'accessing',
  9051. fn: function (){
  9052. var self=this;
  9053. return smalltalk.withContext(function($ctx1) { var $1;
  9054. $1=(smalltalk.Stream || Stream);
  9055. return $1;
  9056. }, function($ctx1) {$ctx1.fill(self,"streamClass",{}, smalltalk.Collection.klass)})},
  9057. args: [],
  9058. source: "streamClass\x0a\x09 ^Stream",
  9059. messageSends: [],
  9060. referencedClasses: ["Stream"]
  9061. }),
  9062. smalltalk.Collection.klass);
  9063. smalltalk.addMethod(
  9064. "_with_",
  9065. smalltalk.method({
  9066. selector: "with:",
  9067. category: 'instance creation',
  9068. fn: function (anObject){
  9069. var self=this;
  9070. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  9071. $2=_st(self)._new();
  9072. _st($2)._add_(anObject);
  9073. $3=_st($2)._yourself();
  9074. $1=$3;
  9075. return $1;
  9076. }, function($ctx1) {$ctx1.fill(self,"with:",{anObject:anObject}, smalltalk.Collection.klass)})},
  9077. args: ["anObject"],
  9078. source: "with: anObject\x0a\x09 ^self new\x0a\x09\x09add: anObject;\x0a\x09\x09yourself",
  9079. messageSends: ["add:", "new", "yourself"],
  9080. referencedClasses: []
  9081. }),
  9082. smalltalk.Collection.klass);
  9083. smalltalk.addMethod(
  9084. "_with_with_",
  9085. smalltalk.method({
  9086. selector: "with:with:",
  9087. category: 'instance creation',
  9088. fn: function (anObject,anotherObject){
  9089. var self=this;
  9090. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  9091. $2=_st(self)._new();
  9092. _st($2)._add_(anObject);
  9093. _st($2)._add_(anotherObject);
  9094. $3=_st($2)._yourself();
  9095. $1=$3;
  9096. return $1;
  9097. }, function($ctx1) {$ctx1.fill(self,"with:with:",{anObject:anObject,anotherObject:anotherObject}, smalltalk.Collection.klass)})},
  9098. args: ["anObject", "anotherObject"],
  9099. source: "with: anObject with: anotherObject\x0a\x09 ^self new\x0a\x09\x09add: anObject;\x0a\x09\x09add: anotherObject;\x0a\x09\x09yourself",
  9100. messageSends: ["add:", "new", "yourself"],
  9101. referencedClasses: []
  9102. }),
  9103. smalltalk.Collection.klass);
  9104. smalltalk.addMethod(
  9105. "_with_with_with_",
  9106. smalltalk.method({
  9107. selector: "with:with:with:",
  9108. category: 'instance creation',
  9109. fn: function (firstObject,secondObject,thirdObject){
  9110. var self=this;
  9111. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  9112. $2=_st(self)._new();
  9113. _st($2)._add_(firstObject);
  9114. _st($2)._add_(secondObject);
  9115. _st($2)._add_(thirdObject);
  9116. $3=_st($2)._yourself();
  9117. $1=$3;
  9118. return $1;
  9119. }, function($ctx1) {$ctx1.fill(self,"with:with:with:",{firstObject:firstObject,secondObject:secondObject,thirdObject:thirdObject}, smalltalk.Collection.klass)})},
  9120. args: ["firstObject", "secondObject", "thirdObject"],
  9121. source: "with: firstObject with: secondObject with: thirdObject\x0a\x09 ^self new\x0a\x09\x09add: firstObject;\x0a\x09\x09add: secondObject;\x0a\x09\x09add: thirdObject;\x0a\x09\x09yourself",
  9122. messageSends: ["add:", "new", "yourself"],
  9123. referencedClasses: []
  9124. }),
  9125. smalltalk.Collection.klass);
  9126. smalltalk.addMethod(
  9127. "_withAll_",
  9128. smalltalk.method({
  9129. selector: "withAll:",
  9130. category: 'instance creation',
  9131. fn: function (aCollection){
  9132. var self=this;
  9133. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  9134. $2=_st(self)._new();
  9135. _st($2)._addAll_(aCollection);
  9136. $3=_st($2)._yourself();
  9137. $1=$3;
  9138. return $1;
  9139. }, function($ctx1) {$ctx1.fill(self,"withAll:",{aCollection:aCollection}, smalltalk.Collection.klass)})},
  9140. args: ["aCollection"],
  9141. source: "withAll: aCollection\x0a\x09 ^self new\x0a\x09\x09addAll: aCollection;\x0a\x09\x09yourself",
  9142. messageSends: ["addAll:", "new", "yourself"],
  9143. referencedClasses: []
  9144. }),
  9145. smalltalk.Collection.klass);
  9146. smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
  9147. smalltalk.HashedCollection.comment="A HashedCollection is a traditional JavaScript object, or a Smalltalk Dictionary.\x0a\x0aUnlike a Dictionary, it can only have strings as keys."
  9148. smalltalk.addMethod(
  9149. "__comma",
  9150. smalltalk.method({
  9151. selector: ",",
  9152. category: 'copying',
  9153. fn: function (aCollection){
  9154. var self=this;
  9155. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  9156. return self}, function($ctx1) {$ctx1.fill(self,",",{aCollection:aCollection}, smalltalk.HashedCollection)})},
  9157. args: ["aCollection"],
  9158. source: ", aCollection\x0a\x09self shouldNotImplement",
  9159. messageSends: ["shouldNotImplement"],
  9160. referencedClasses: []
  9161. }),
  9162. smalltalk.HashedCollection);
  9163. smalltalk.addMethod(
  9164. "__eq",
  9165. smalltalk.method({
  9166. selector: "=",
  9167. category: 'comparing',
  9168. fn: function (aHashedCollection){
  9169. var self=this;
  9170. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  9171. $1=_st(_st(self)._class()).__eq(_st(aHashedCollection)._class());
  9172. if(! smalltalk.assert($1)){
  9173. return false;
  9174. };
  9175. $2=_st(_st(self)._size()).__eq(_st(aHashedCollection)._size());
  9176. if(! smalltalk.assert($2)){
  9177. return false;
  9178. };
  9179. $3=_st(_st(self)._associations()).__eq(_st(aHashedCollection)._associations());
  9180. return $3;
  9181. }, function($ctx1) {$ctx1.fill(self,"=",{aHashedCollection:aHashedCollection}, smalltalk.HashedCollection)})},
  9182. args: ["aHashedCollection"],
  9183. source: "= aHashedCollection\x0a\x09self class = aHashedCollection class ifFalse: [^false].\x0a\x09self size = aHashedCollection size ifFalse: [^false].\x0a\x09^self associations = aHashedCollection associations",
  9184. messageSends: ["ifFalse:", "=", "class", "size", "associations"],
  9185. referencedClasses: []
  9186. }),
  9187. smalltalk.HashedCollection);
  9188. smalltalk.addMethod(
  9189. "_add_",
  9190. smalltalk.method({
  9191. selector: "add:",
  9192. category: 'adding/removing',
  9193. fn: function (anAssociation){
  9194. var self=this;
  9195. return smalltalk.withContext(function($ctx1) { _st(self)._at_put_(_st(anAssociation)._key(),_st(anAssociation)._value());
  9196. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anAssociation:anAssociation}, smalltalk.HashedCollection)})},
  9197. args: ["anAssociation"],
  9198. source: "add: anAssociation\x0a\x09self at: anAssociation key put: anAssociation value",
  9199. messageSends: ["at:put:", "key", "value"],
  9200. referencedClasses: []
  9201. }),
  9202. smalltalk.HashedCollection);
  9203. smalltalk.addMethod(
  9204. "_addAll_",
  9205. smalltalk.method({
  9206. selector: "addAll:",
  9207. category: 'adding/removing',
  9208. fn: function (aHashedCollection){
  9209. var self=this;
  9210. return smalltalk.withContext(function($ctx1) { var $1;
  9211. smalltalk.Collection.fn.prototype._addAll_.apply(_st(self), [_st(aHashedCollection)._associations()]);
  9212. $1=aHashedCollection;
  9213. return $1;
  9214. }, function($ctx1) {$ctx1.fill(self,"addAll:",{aHashedCollection:aHashedCollection}, smalltalk.HashedCollection)})},
  9215. args: ["aHashedCollection"],
  9216. source: "addAll: aHashedCollection\x0a\x09super addAll: aHashedCollection associations.\x0a\x09^aHashedCollection",
  9217. messageSends: ["addAll:", "associations"],
  9218. referencedClasses: []
  9219. }),
  9220. smalltalk.HashedCollection);
  9221. smalltalk.addMethod(
  9222. "_asDictionary",
  9223. smalltalk.method({
  9224. selector: "asDictionary",
  9225. category: 'converting',
  9226. fn: function (){
  9227. var self=this;
  9228. return smalltalk.withContext(function($ctx1) { var $1;
  9229. $1=_st((smalltalk.Dictionary || Dictionary))._fromPairs_(_st(self)._associations());
  9230. return $1;
  9231. }, function($ctx1) {$ctx1.fill(self,"asDictionary",{}, smalltalk.HashedCollection)})},
  9232. args: [],
  9233. source: "asDictionary\x0a\x09^Dictionary fromPairs: self associations",
  9234. messageSends: ["fromPairs:", "associations"],
  9235. referencedClasses: ["Dictionary"]
  9236. }),
  9237. smalltalk.HashedCollection);
  9238. smalltalk.addMethod(
  9239. "_asJSON",
  9240. smalltalk.method({
  9241. selector: "asJSON",
  9242. category: 'converting',
  9243. fn: function (){
  9244. var self=this;
  9245. var c;
  9246. return smalltalk.withContext(function($ctx1) { var $1;
  9247. c=_st(_st(self)._class())._new();
  9248. _st(self)._keysAndValuesDo_((function(key,value){
  9249. return smalltalk.withContext(function($ctx2) { return _st(c)._at_put_(key,_st(value)._asJSON());
  9250. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  9251. $1=c;
  9252. return $1;
  9253. }, function($ctx1) {$ctx1.fill(self,"asJSON",{c:c}, smalltalk.HashedCollection)})},
  9254. args: [],
  9255. source: "asJSON\x0a\x09| c |\x0a\x09c := self class new.\x0a\x09self keysAndValuesDo: [:key :value |\x0a\x09\x09c at: key put: value asJSON].\x0a\x09^c",
  9256. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "asJSON"],
  9257. referencedClasses: []
  9258. }),
  9259. smalltalk.HashedCollection);
  9260. smalltalk.addMethod(
  9261. "_associations",
  9262. smalltalk.method({
  9263. selector: "associations",
  9264. category: 'accessing',
  9265. fn: function (){
  9266. var self=this;
  9267. var associations;
  9268. return smalltalk.withContext(function($ctx1) { var $1;
  9269. associations=[];
  9270. _st(_st(self)._keys())._do_((function(each){
  9271. return smalltalk.withContext(function($ctx2) { return _st(associations)._add_(_st((smalltalk.Association || Association))._key_value_(each,_st(self)._at_(each)));
  9272. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  9273. $1=associations;
  9274. return $1;
  9275. }, function($ctx1) {$ctx1.fill(self,"associations",{associations:associations}, smalltalk.HashedCollection)})},
  9276. args: [],
  9277. source: "associations\x0a\x09| associations |\x0a\x09associations := #().\x0a\x09self keys do: [:each |\x0a\x09 associations add: (Association key: each value: (self at: each))].\x0a\x09^associations",
  9278. messageSends: ["do:", "add:", "key:value:", "at:", "keys"],
  9279. referencedClasses: ["Association"]
  9280. }),
  9281. smalltalk.HashedCollection);
  9282. smalltalk.addMethod(
  9283. "_associationsDo_",
  9284. smalltalk.method({
  9285. selector: "associationsDo:",
  9286. category: 'enumerating',
  9287. fn: function (aBlock){
  9288. var self=this;
  9289. return smalltalk.withContext(function($ctx1) { _st(_st(self)._associations())._do_(aBlock);
  9290. return self}, function($ctx1) {$ctx1.fill(self,"associationsDo:",{aBlock:aBlock}, smalltalk.HashedCollection)})},
  9291. args: ["aBlock"],
  9292. source: "associationsDo: aBlock\x0a\x09self associations do: aBlock",
  9293. messageSends: ["do:", "associations"],
  9294. referencedClasses: []
  9295. }),
  9296. smalltalk.HashedCollection);
  9297. smalltalk.addMethod(
  9298. "_at_",
  9299. smalltalk.method({
  9300. selector: "at:",
  9301. category: 'accessing',
  9302. fn: function (aKey){
  9303. var self=this;
  9304. return smalltalk.withContext(function($ctx1) { var $1;
  9305. $1=_st(self)._at_ifAbsent_(aKey,(function(){
  9306. return smalltalk.withContext(function($ctx2) { return _st(self)._errorNotFound();
  9307. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  9308. return $1;
  9309. }, function($ctx1) {$ctx1.fill(self,"at:",{aKey:aKey}, smalltalk.HashedCollection)})},
  9310. args: ["aKey"],
  9311. source: "at: aKey\x0a\x09^self at: aKey ifAbsent: [self errorNotFound]",
  9312. messageSends: ["at:ifAbsent:", "errorNotFound"],
  9313. referencedClasses: []
  9314. }),
  9315. smalltalk.HashedCollection);
  9316. smalltalk.addMethod(
  9317. "_at_ifAbsent_",
  9318. smalltalk.method({
  9319. selector: "at:ifAbsent:",
  9320. category: 'accessing',
  9321. fn: function (aKey,aBlock){
  9322. var self=this;
  9323. return smalltalk.withContext(function($ctx1) { var $2,$1;
  9324. $2=_st(self)._includesKey_(aKey);
  9325. $1=_st($2)._ifTrue_ifFalse_((function(){
  9326. return smalltalk.withContext(function($ctx2) { return _st(self)._basicAt_(aKey);
  9327. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),aBlock);
  9328. return $1;
  9329. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock}, smalltalk.HashedCollection)})},
  9330. args: ["aKey", "aBlock"],
  9331. source: "at: aKey ifAbsent: aBlock\x0a\x09^(self includesKey: aKey)\x0a\x09\x09ifTrue: [self basicAt: aKey]\x0a\x09\x09ifFalse: aBlock",
  9332. messageSends: ["ifTrue:ifFalse:", "basicAt:", "includesKey:"],
  9333. referencedClasses: []
  9334. }),
  9335. smalltalk.HashedCollection);
  9336. smalltalk.addMethod(
  9337. "_at_ifAbsentPut_",
  9338. smalltalk.method({
  9339. selector: "at:ifAbsentPut:",
  9340. category: 'accessing',
  9341. fn: function (aKey,aBlock){
  9342. var self=this;
  9343. return smalltalk.withContext(function($ctx1) { var $1;
  9344. $1=_st(self)._at_ifAbsent_(aKey,(function(){
  9345. return smalltalk.withContext(function($ctx2) { return _st(self)._at_put_(aKey,_st(aBlock)._value());
  9346. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  9347. return $1;
  9348. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsentPut:",{aKey:aKey,aBlock:aBlock}, smalltalk.HashedCollection)})},
  9349. args: ["aKey", "aBlock"],
  9350. source: "at: aKey ifAbsentPut: aBlock\x0a\x09^self at: aKey ifAbsent: [\x0a\x09 self at: aKey put: aBlock value]",
  9351. messageSends: ["at:ifAbsent:", "at:put:", "value"],
  9352. referencedClasses: []
  9353. }),
  9354. smalltalk.HashedCollection);
  9355. smalltalk.addMethod(
  9356. "_at_ifPresent_",
  9357. smalltalk.method({
  9358. selector: "at:ifPresent:",
  9359. category: 'accessing',
  9360. fn: function (aKey,aBlock){
  9361. var self=this;
  9362. return smalltalk.withContext(function($ctx1) { var $2,$1;
  9363. $2=_st(self)._includesKey_(aKey);
  9364. if(smalltalk.assert($2)){
  9365. $1=_st(aBlock)._value_(_st(self)._at_(aKey));
  9366. } else {
  9367. $1=nil;
  9368. };
  9369. return $1;
  9370. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aKey:aKey,aBlock:aBlock}, smalltalk.HashedCollection)})},
  9371. args: ["aKey", "aBlock"],
  9372. source: "at: aKey ifPresent: aBlock\x0a\x09\x22Lookup the given key in the receiver. \x0a\x09If it is present, answer the value of evaluating the given block with the value associated with the key. \x0a\x09Otherwise, answer nil.\x22\x0a\x09^(self includesKey: aKey)\x0a\x09\x09ifTrue: [ aBlock value: (self at: aKey) ]\x0a\x09\x09ifFalse: [ nil ]",
  9373. messageSends: ["ifTrue:ifFalse:", "value:", "at:", "includesKey:"],
  9374. referencedClasses: []
  9375. }),
  9376. smalltalk.HashedCollection);
  9377. smalltalk.addMethod(
  9378. "_at_ifPresent_ifAbsent_",
  9379. smalltalk.method({
  9380. selector: "at:ifPresent:ifAbsent:",
  9381. category: 'accessing',
  9382. fn: function (aKey,aBlock,anotherBlock){
  9383. var self=this;
  9384. return smalltalk.withContext(function($ctx1) { var $2,$1;
  9385. $2=_st(self)._includesKey_(aKey);
  9386. $1=_st($2)._ifTrue_ifFalse_((function(){
  9387. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_(_st(self)._at_(aKey));
  9388. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),anotherBlock);
  9389. return $1;
  9390. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aKey:aKey,aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.HashedCollection)})},
  9391. args: ["aKey", "aBlock", "anotherBlock"],
  9392. source: "at: aKey ifPresent: aBlock ifAbsent: anotherBlock\x0a\x09\x22Lookup the given key in the receiver. \x0a\x09If it is present, answer the value of evaluating the oneArgBlock with the value associated with the key, \x0a\x09otherwise answer the value of absentBlock.\x22\x0a\x09^(self includesKey: aKey)\x0a\x09\x09ifTrue: [ aBlock value: (self at: aKey) ]\x0a\x09\x09ifFalse: anotherBlock",
  9393. messageSends: ["ifTrue:ifFalse:", "value:", "at:", "includesKey:"],
  9394. referencedClasses: []
  9395. }),
  9396. smalltalk.HashedCollection);
  9397. smalltalk.addMethod(
  9398. "_at_put_",
  9399. smalltalk.method({
  9400. selector: "at:put:",
  9401. category: 'accessing',
  9402. fn: function (aKey,aValue){
  9403. var self=this;
  9404. return smalltalk.withContext(function($ctx1) { var $1;
  9405. $1=_st(self)._basicAt_put_(aKey,aValue);
  9406. return $1;
  9407. }, function($ctx1) {$ctx1.fill(self,"at:put:",{aKey:aKey,aValue:aValue}, smalltalk.HashedCollection)})},
  9408. args: ["aKey", "aValue"],
  9409. source: "at: aKey put: aValue\x0a\x09^self basicAt: aKey put: aValue",
  9410. messageSends: ["basicAt:put:"],
  9411. referencedClasses: []
  9412. }),
  9413. smalltalk.HashedCollection);
  9414. smalltalk.addMethod(
  9415. "_collect_",
  9416. smalltalk.method({
  9417. selector: "collect:",
  9418. category: 'enumerating',
  9419. fn: function (aBlock){
  9420. var self=this;
  9421. var newDict;
  9422. return smalltalk.withContext(function($ctx1) { var $1;
  9423. newDict=_st(_st(self)._class())._new();
  9424. _st(self)._keysAndValuesDo_((function(key,value){
  9425. return smalltalk.withContext(function($ctx2) { return _st(newDict)._at_put_(key,_st(aBlock)._value_(value));
  9426. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  9427. $1=newDict;
  9428. return $1;
  9429. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock,newDict:newDict}, smalltalk.HashedCollection)})},
  9430. args: ["aBlock"],
  9431. source: "collect: aBlock\x0a\x09| newDict |\x0a\x09newDict := self class new.\x0a\x09self keysAndValuesDo: [:key :value |\x0a\x09 newDict at: key put: (aBlock value: value)].\x0a\x09^newDict",
  9432. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "value:"],
  9433. referencedClasses: []
  9434. }),
  9435. smalltalk.HashedCollection);
  9436. smalltalk.addMethod(
  9437. "_copyFrom_to_",
  9438. smalltalk.method({
  9439. selector: "copyFrom:to:",
  9440. category: 'copying',
  9441. fn: function (anIndex,anotherIndex){
  9442. var self=this;
  9443. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  9444. return self}, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex}, smalltalk.HashedCollection)})},
  9445. args: ["anIndex", "anotherIndex"],
  9446. source: "copyFrom: anIndex to: anotherIndex\x0a\x09self shouldNotImplement",
  9447. messageSends: ["shouldNotImplement"],
  9448. referencedClasses: []
  9449. }),
  9450. smalltalk.HashedCollection);
  9451. smalltalk.addMethod(
  9452. "_deepCopy",
  9453. smalltalk.method({
  9454. selector: "deepCopy",
  9455. category: 'copying',
  9456. fn: function (){
  9457. var self=this;
  9458. var copy;
  9459. return smalltalk.withContext(function($ctx1) { var $1;
  9460. copy=_st(_st(self)._class())._new();
  9461. _st(self)._associationsDo_((function(each){
  9462. return smalltalk.withContext(function($ctx2) { return _st(copy)._at_put_(_st(each)._key(),_st(_st(each)._value())._deepCopy());
  9463. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  9464. $1=copy;
  9465. return $1;
  9466. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{copy:copy}, smalltalk.HashedCollection)})},
  9467. args: [],
  9468. source: "deepCopy\x0a\x09| copy |\x0a\x09copy := self class new.\x0a\x09self associationsDo: [:each |\x0a\x09 copy at: each key put: each value deepCopy].\x0a\x09^copy",
  9469. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "deepCopy", "value"],
  9470. referencedClasses: []
  9471. }),
  9472. smalltalk.HashedCollection);
  9473. smalltalk.addMethod(
  9474. "_detect_ifNone_",
  9475. smalltalk.method({
  9476. selector: "detect:ifNone:",
  9477. category: 'enumerating',
  9478. fn: function (aBlock,anotherBlock){
  9479. var self=this;
  9480. return smalltalk.withContext(function($ctx1) { var $1;
  9481. $1=_st(_st(self)._values())._detect_ifNone_(aBlock,anotherBlock);
  9482. return $1;
  9483. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.HashedCollection)})},
  9484. args: ["aBlock", "anotherBlock"],
  9485. source: "detect: aBlock ifNone: anotherBlock\x0a\x09^self values detect: aBlock ifNone: anotherBlock",
  9486. messageSends: ["detect:ifNone:", "values"],
  9487. referencedClasses: []
  9488. }),
  9489. smalltalk.HashedCollection);
  9490. smalltalk.addMethod(
  9491. "_do_",
  9492. smalltalk.method({
  9493. selector: "do:",
  9494. category: 'enumerating',
  9495. fn: function (aBlock){
  9496. var self=this;
  9497. return smalltalk.withContext(function($ctx1) { _st(_st(self)._values())._do_(aBlock);
  9498. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.HashedCollection)})},
  9499. args: ["aBlock"],
  9500. source: "do: aBlock\x0a\x09self values do: aBlock",
  9501. messageSends: ["do:", "values"],
  9502. referencedClasses: []
  9503. }),
  9504. smalltalk.HashedCollection);
  9505. smalltalk.addMethod(
  9506. "_includes_",
  9507. smalltalk.method({
  9508. selector: "includes:",
  9509. category: 'enumerating',
  9510. fn: function (anObject){
  9511. var self=this;
  9512. return smalltalk.withContext(function($ctx1) { var $1;
  9513. $1=_st(_st(self)._values())._includes_(anObject);
  9514. return $1;
  9515. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject}, smalltalk.HashedCollection)})},
  9516. args: ["anObject"],
  9517. source: "includes: anObject\x0a\x09^self values includes: anObject",
  9518. messageSends: ["includes:", "values"],
  9519. referencedClasses: []
  9520. }),
  9521. smalltalk.HashedCollection);
  9522. smalltalk.addMethod(
  9523. "_includesKey_",
  9524. smalltalk.method({
  9525. selector: "includesKey:",
  9526. category: 'testing',
  9527. fn: function (aKey){
  9528. var self=this;
  9529. return smalltalk.withContext(function($ctx1) { return self.hasOwnProperty(aKey);
  9530. return self}, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey}, smalltalk.HashedCollection)})},
  9531. args: ["aKey"],
  9532. source: "includesKey: aKey\x0a\x09<return self.hasOwnProperty(aKey)>",
  9533. messageSends: [],
  9534. referencedClasses: []
  9535. }),
  9536. smalltalk.HashedCollection);
  9537. smalltalk.addMethod(
  9538. "_keys",
  9539. smalltalk.method({
  9540. selector: "keys",
  9541. category: 'accessing',
  9542. fn: function (){
  9543. var self=this;
  9544. return smalltalk.withContext(function($ctx1) {
  9545. if ('function'===typeof Object.keys) return Object.keys(self);
  9546. var keys = [];
  9547. for(var i in self) {
  9548. if(self.hasOwnProperty(i)) {
  9549. keys.push(i);
  9550. }
  9551. };
  9552. return keys;
  9553. ;
  9554. return self}, function($ctx1) {$ctx1.fill(self,"keys",{}, smalltalk.HashedCollection)})},
  9555. args: [],
  9556. source: "keys\x0a\x09<\x0a\x09\x09if ('function'===typeof Object.keys) return Object.keys(self);\x0a\x09\x09var keys = [];\x0a\x09\x09for(var i in self) {\x0a\x09\x09\x09if(self.hasOwnProperty(i)) {\x0a\x09\x09\x09\x09keys.push(i);\x0a\x09\x09\x09}\x0a\x09\x09};\x0a\x09\x09return keys;\x0a\x09>",
  9557. messageSends: [],
  9558. referencedClasses: []
  9559. }),
  9560. smalltalk.HashedCollection);
  9561. smalltalk.addMethod(
  9562. "_keysAndValuesDo_",
  9563. smalltalk.method({
  9564. selector: "keysAndValuesDo:",
  9565. category: 'enumerating',
  9566. fn: function (aBlock){
  9567. var self=this;
  9568. return smalltalk.withContext(function($ctx1) { _st(self)._associationsDo_((function(each){
  9569. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_value_(_st(each)._key(),_st(each)._value());
  9570. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  9571. return self}, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock}, smalltalk.HashedCollection)})},
  9572. args: ["aBlock"],
  9573. source: "keysAndValuesDo: aBlock\x0a\x09self associationsDo: [:each |\x0a\x09 aBlock value: each key value: each value]",
  9574. messageSends: ["associationsDo:", "value:value:", "key", "value"],
  9575. referencedClasses: []
  9576. }),
  9577. smalltalk.HashedCollection);
  9578. smalltalk.addMethod(
  9579. "_printString",
  9580. smalltalk.method({
  9581. selector: "printString",
  9582. category: 'printing',
  9583. fn: function (){
  9584. var self=this;
  9585. return smalltalk.withContext(function($ctx1) { var $1;
  9586. $1=_st((smalltalk.String || String))._streamContents_((function(aStream){
  9587. return smalltalk.withContext(function($ctx2) { _st(aStream)._nextPutAll_(_st(_st("a ").__comma(_st(_st(self)._class())._name())).__comma("("));
  9588. _st(_st(self)._associations())._do_separatedBy_((function(each){
  9589. return smalltalk.withContext(function($ctx3) { return _st(each)._storeOn_(aStream);
  9590. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  9591. return smalltalk.withContext(function($ctx3) { return _st(aStream)._nextPutAll_(" , ");
  9592. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  9593. return _st(aStream)._nextPutAll_(")");
  9594. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})}));
  9595. return $1;
  9596. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.HashedCollection)})},
  9597. args: [],
  9598. source: "printString\x0a\x09\x22print the contents of the HashedCollection into a string and return the string\x22\x0a\x09^String streamContents: [:aStream |\x0a\x09\x09aStream nextPutAll: 'a ', self class name, '('.\x0a\x09\x09self associations\x0a\x09\x09\x09do: [:each | each storeOn: aStream]\x0a\x09\x09\x09separatedBy: [ aStream nextPutAll: ' , '].\x0a\x09\x09aStream nextPutAll: ')']",
  9599. messageSends: ["streamContents:", "nextPutAll:", ",", "name", "class", "do:separatedBy:", "storeOn:", "associations"],
  9600. referencedClasses: ["String"]
  9601. }),
  9602. smalltalk.HashedCollection);
  9603. smalltalk.addMethod(
  9604. "_remove_ifAbsent_",
  9605. smalltalk.method({
  9606. selector: "remove:ifAbsent:",
  9607. category: 'adding/removing',
  9608. fn: function (aKey,aBlock){
  9609. var self=this;
  9610. return smalltalk.withContext(function($ctx1) { var $1;
  9611. $1=_st(self)._removeKey_ifAbsent_(aKey,aBlock);
  9612. return $1;
  9613. }, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{aKey:aKey,aBlock:aBlock}, smalltalk.HashedCollection)})},
  9614. args: ["aKey", "aBlock"],
  9615. source: "remove: aKey ifAbsent: aBlock\x0a ^self removeKey: aKey ifAbsent: aBlock",
  9616. messageSends: ["removeKey:ifAbsent:"],
  9617. referencedClasses: []
  9618. }),
  9619. smalltalk.HashedCollection);
  9620. smalltalk.addMethod(
  9621. "_removeKey_",
  9622. smalltalk.method({
  9623. selector: "removeKey:",
  9624. category: 'adding/removing',
  9625. fn: function (aKey){
  9626. var self=this;
  9627. return smalltalk.withContext(function($ctx1) { var $1;
  9628. $1=_st(self)._remove_(aKey);
  9629. return $1;
  9630. }, function($ctx1) {$ctx1.fill(self,"removeKey:",{aKey:aKey}, smalltalk.HashedCollection)})},
  9631. args: ["aKey"],
  9632. source: "removeKey: aKey\x0a ^self remove: aKey",
  9633. messageSends: ["remove:"],
  9634. referencedClasses: []
  9635. }),
  9636. smalltalk.HashedCollection);
  9637. smalltalk.addMethod(
  9638. "_removeKey_ifAbsent_",
  9639. smalltalk.method({
  9640. selector: "removeKey:ifAbsent:",
  9641. category: 'adding/removing',
  9642. fn: function (aKey,aBlock){
  9643. var self=this;
  9644. return smalltalk.withContext(function($ctx1) { var $2,$1;
  9645. $2=_st(self)._includesKey_(aKey);
  9646. if(smalltalk.assert($2)){
  9647. $1=_st(self)._basicDelete_(aKey);
  9648. } else {
  9649. $1=_st(aBlock)._value();
  9650. };
  9651. return $1;
  9652. }, function($ctx1) {$ctx1.fill(self,"removeKey:ifAbsent:",{aKey:aKey,aBlock:aBlock}, smalltalk.HashedCollection)})},
  9653. args: ["aKey", "aBlock"],
  9654. source: "removeKey: aKey ifAbsent: aBlock\x0a\x09^(self includesKey: aKey) \x0a\x09\x09ifFalse: [aBlock value]\x0a\x09\x09ifTrue: [self basicDelete: aKey]",
  9655. messageSends: ["ifFalse:ifTrue:", "value", "basicDelete:", "includesKey:"],
  9656. referencedClasses: []
  9657. }),
  9658. smalltalk.HashedCollection);
  9659. smalltalk.addMethod(
  9660. "_select_",
  9661. smalltalk.method({
  9662. selector: "select:",
  9663. category: 'enumerating',
  9664. fn: function (aBlock){
  9665. var self=this;
  9666. var newDict;
  9667. return smalltalk.withContext(function($ctx1) { var $1,$2;
  9668. newDict=_st(_st(self)._class())._new();
  9669. _st(self)._keysAndValuesDo_((function(key,value){
  9670. return smalltalk.withContext(function($ctx2) { $1=_st(aBlock)._value_(value);
  9671. if(smalltalk.assert($1)){
  9672. return _st(newDict)._at_put_(key,value);
  9673. };
  9674. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  9675. $2=newDict;
  9676. return $2;
  9677. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,newDict:newDict}, smalltalk.HashedCollection)})},
  9678. args: ["aBlock"],
  9679. source: "select: aBlock\x0a\x09| newDict |\x0a\x09newDict := self class new.\x0a\x09self keysAndValuesDo: [:key :value |\x0a\x09 (aBlock value: value) ifTrue: [newDict at: key put: value]].\x0a\x09^newDict",
  9680. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "at:put:", "value:"],
  9681. referencedClasses: []
  9682. }),
  9683. smalltalk.HashedCollection);
  9684. smalltalk.addMethod(
  9685. "_shallowCopy",
  9686. smalltalk.method({
  9687. selector: "shallowCopy",
  9688. category: 'copying',
  9689. fn: function (){
  9690. var self=this;
  9691. var copy;
  9692. return smalltalk.withContext(function($ctx1) { var $1;
  9693. copy=_st(_st(self)._class())._new();
  9694. _st(self)._associationsDo_((function(each){
  9695. return smalltalk.withContext(function($ctx2) { return _st(copy)._at_put_(_st(each)._key(),_st(each)._value());
  9696. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  9697. $1=copy;
  9698. return $1;
  9699. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{copy:copy}, smalltalk.HashedCollection)})},
  9700. args: [],
  9701. source: "shallowCopy\x0a\x09| copy |\x0a\x09copy := self class new.\x0a\x09self associationsDo: [:each |\x0a\x09 copy at: each key put: each value].\x0a\x09^copy",
  9702. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "value"],
  9703. referencedClasses: []
  9704. }),
  9705. smalltalk.HashedCollection);
  9706. smalltalk.addMethod(
  9707. "_size",
  9708. smalltalk.method({
  9709. selector: "size",
  9710. category: 'accessing',
  9711. fn: function (){
  9712. var self=this;
  9713. return smalltalk.withContext(function($ctx1) { var $1;
  9714. $1=_st(_st(self)._keys())._size();
  9715. return $1;
  9716. }, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.HashedCollection)})},
  9717. args: [],
  9718. source: "size\x0a\x09^self keys size",
  9719. messageSends: ["size", "keys"],
  9720. referencedClasses: []
  9721. }),
  9722. smalltalk.HashedCollection);
  9723. smalltalk.addMethod(
  9724. "_storeOn_",
  9725. smalltalk.method({
  9726. selector: "storeOn:",
  9727. category: 'printing',
  9728. fn: function (aStream){
  9729. var self=this;
  9730. return smalltalk.withContext(function($ctx1) { _st(aStream)._nextPutAll_("#{");
  9731. _st(_st(self)._associations())._do_separatedBy_((function(each){
  9732. return smalltalk.withContext(function($ctx2) { return _st(each)._storeOn_(aStream);
  9733. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  9734. return smalltalk.withContext(function($ctx2) { return _st(aStream)._nextPutAll_(". ");
  9735. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  9736. _st(aStream)._nextPutAll_("}");
  9737. return self}, function($ctx1) {$ctx1.fill(self,"storeOn:",{aStream:aStream}, smalltalk.HashedCollection)})},
  9738. args: ["aStream"],
  9739. source: "storeOn: aStream\x0a\x09aStream nextPutAll: '#{'.\x0a\x09self associations\x0a\x09\x09do: [:each | each storeOn: aStream]\x0a\x09\x09separatedBy: [ aStream nextPutAll: '. '].\x0a\x09aStream nextPutAll: '}'",
  9740. messageSends: ["nextPutAll:", "do:separatedBy:", "storeOn:", "associations"],
  9741. referencedClasses: []
  9742. }),
  9743. smalltalk.HashedCollection);
  9744. smalltalk.addMethod(
  9745. "_values",
  9746. smalltalk.method({
  9747. selector: "values",
  9748. category: 'accessing',
  9749. fn: function (){
  9750. var self=this;
  9751. return smalltalk.withContext(function($ctx1) { var $1;
  9752. $1=_st(_st(self)._keys())._collect_((function(each){
  9753. return smalltalk.withContext(function($ctx2) { return _st(self)._at_(each);
  9754. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  9755. return $1;
  9756. }, function($ctx1) {$ctx1.fill(self,"values",{}, smalltalk.HashedCollection)})},
  9757. args: [],
  9758. source: "values\x0a\x09^self keys collect: [:each | self at: each]",
  9759. messageSends: ["collect:", "at:", "keys"],
  9760. referencedClasses: []
  9761. }),
  9762. smalltalk.HashedCollection);
  9763. smalltalk.addMethod(
  9764. "_fromPairs_",
  9765. smalltalk.method({
  9766. selector: "fromPairs:",
  9767. category: 'instance creation',
  9768. fn: function (aCollection){
  9769. var self=this;
  9770. var dict;
  9771. return smalltalk.withContext(function($ctx1) { var $1;
  9772. dict=_st(self)._new();
  9773. _st(aCollection)._do_((function(each){
  9774. return smalltalk.withContext(function($ctx2) { return _st(dict)._add_(each);
  9775. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  9776. $1=dict;
  9777. return $1;
  9778. }, function($ctx1) {$ctx1.fill(self,"fromPairs:",{aCollection:aCollection,dict:dict}, smalltalk.HashedCollection.klass)})},
  9779. args: ["aCollection"],
  9780. source: "fromPairs: aCollection\x0a\x09| dict |\x0a\x09dict := self new.\x0a\x09aCollection do: [:each | dict add: each].\x0a\x09^dict",
  9781. messageSends: ["new", "do:", "add:"],
  9782. referencedClasses: []
  9783. }),
  9784. smalltalk.HashedCollection.klass);
  9785. smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
  9786. smalltalk.addMethod(
  9787. "_asHashedCollection",
  9788. smalltalk.method({
  9789. selector: "asHashedCollection",
  9790. category: 'converting',
  9791. fn: function (){
  9792. var self=this;
  9793. return smalltalk.withContext(function($ctx1) { var $1;
  9794. $1=_st((smalltalk.HashedCollection || HashedCollection))._fromPairs_(_st(self)._associations());
  9795. return $1;
  9796. }, function($ctx1) {$ctx1.fill(self,"asHashedCollection",{}, smalltalk.Dictionary)})},
  9797. args: [],
  9798. source: "asHashedCollection\x0a\x09^HashedCollection fromPairs: self associations",
  9799. messageSends: ["fromPairs:", "associations"],
  9800. referencedClasses: ["HashedCollection"]
  9801. }),
  9802. smalltalk.Dictionary);
  9803. smalltalk.addMethod(
  9804. "_asJSON",
  9805. smalltalk.method({
  9806. selector: "asJSON",
  9807. category: 'converting',
  9808. fn: function (){
  9809. var self=this;
  9810. return smalltalk.withContext(function($ctx1) { var $1;
  9811. $1=_st(_st(self)._asHashedCollection())._asJSON();
  9812. return $1;
  9813. }, function($ctx1) {$ctx1.fill(self,"asJSON",{}, smalltalk.Dictionary)})},
  9814. args: [],
  9815. source: "asJSON\x0a\x09^self asHashedCollection asJSON",
  9816. messageSends: ["asJSON", "asHashedCollection"],
  9817. referencedClasses: []
  9818. }),
  9819. smalltalk.Dictionary);
  9820. smalltalk.addMethod(
  9821. "_at_ifAbsent_",
  9822. smalltalk.method({
  9823. selector: "at:ifAbsent:",
  9824. category: 'accessing',
  9825. fn: function (aKey,aBlock){
  9826. var self=this;
  9827. return smalltalk.withContext(function($ctx1) {
  9828. var index;
  9829. for(var i=0;i<self['@keys'].length;i++){
  9830. if(self['@keys'][i].__eq(aKey)) {index = i;}
  9831. };
  9832. if(typeof index === 'undefined') {
  9833. return aBlock();
  9834. } else {
  9835. return self['@values'][index];
  9836. }
  9837. ;
  9838. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock}, smalltalk.Dictionary)})},
  9839. args: ["aKey", "aBlock"],
  9840. source: "at: aKey ifAbsent: aBlock\x0a\x09<\x0a\x09\x09var index;\x0a\x09\x09for(var i=0;i<self['@keys'].length;i++){\x0a\x09\x09\x09if(self['@keys'][i].__eq(aKey)) {index = i;}\x0a\x09\x09};\x0a\x09\x09if(typeof index === 'undefined') {\x0a\x09\x09\x09return aBlock();\x0a\x09\x09} else {\x0a\x09\x09\x09return self['@values'][index];\x0a\x09\x09}\x0a\x09>",
  9841. messageSends: [],
  9842. referencedClasses: []
  9843. }),
  9844. smalltalk.Dictionary);
  9845. smalltalk.addMethod(
  9846. "_at_put_",
  9847. smalltalk.method({
  9848. selector: "at:put:",
  9849. category: 'accessing',
  9850. fn: function (aKey,aValue){
  9851. var self=this;
  9852. return smalltalk.withContext(function($ctx1) {
  9853. var index = self['@keys'].indexOf(aKey);
  9854. if(index === -1) {
  9855. self['@values'].push(aValue);
  9856. self['@keys'].push(aKey);
  9857. } else {
  9858. self['@values'][index] = aValue;
  9859. };
  9860. return aValue;
  9861. ;
  9862. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aKey:aKey,aValue:aValue}, smalltalk.Dictionary)})},
  9863. args: ["aKey", "aValue"],
  9864. source: "at: aKey put: aValue\x0a\x09<\x0a\x09\x09var index = self['@keys'].indexOf(aKey);\x0a\x09\x09if(index === -1) {\x0a\x09\x09\x09self['@values'].push(aValue);\x0a\x09\x09\x09self['@keys'].push(aKey);\x0a\x09\x09} else {\x0a\x09\x09\x09self['@values'][index] = aValue;\x0a\x09\x09};\x0a\x0a\x09\x09return aValue;\x0a\x09>",
  9865. messageSends: [],
  9866. referencedClasses: []
  9867. }),
  9868. smalltalk.Dictionary);
  9869. smalltalk.addMethod(
  9870. "_includesKey_",
  9871. smalltalk.method({
  9872. selector: "includesKey:",
  9873. category: 'testing',
  9874. fn: function (aKey){
  9875. var self=this;
  9876. return smalltalk.withContext(function($ctx1) { var $1;
  9877. $1=_st(self["@keys"])._includes_(aKey);
  9878. return $1;
  9879. }, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey}, smalltalk.Dictionary)})},
  9880. args: ["aKey"],
  9881. source: "includesKey: aKey\x0a\x09^keys includes: aKey",
  9882. messageSends: ["includes:"],
  9883. referencedClasses: []
  9884. }),
  9885. smalltalk.Dictionary);
  9886. smalltalk.addMethod(
  9887. "_initialize",
  9888. smalltalk.method({
  9889. selector: "initialize",
  9890. category: 'initialization',
  9891. fn: function (){
  9892. var self=this;
  9893. return smalltalk.withContext(function($ctx1) { smalltalk.HashedCollection.fn.prototype._initialize.apply(_st(self), []);
  9894. self["@keys"]=[];
  9895. self["@values"]=[];
  9896. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Dictionary)})},
  9897. args: [],
  9898. source: "initialize\x0a\x09super initialize.\x0a\x09keys := #().\x0a\x09values := #()",
  9899. messageSends: ["initialize"],
  9900. referencedClasses: []
  9901. }),
  9902. smalltalk.Dictionary);
  9903. smalltalk.addMethod(
  9904. "_keyAtValue_",
  9905. smalltalk.method({
  9906. selector: "keyAtValue:",
  9907. category: 'accessing',
  9908. fn: function (anObject){
  9909. var self=this;
  9910. return smalltalk.withContext(function($ctx1) { var $1;
  9911. $1=_st(_st(_st(self)._associations())._detect_ifNone_((function(k,v){
  9912. return smalltalk.withContext(function($ctx2) { return _st(v).__eq_eq(anObject);
  9913. }, function($ctx2) {$ctx2.fillBlock({k:k,v:v},$ctx1)})}),(function(){
  9914. return smalltalk.withContext(function($ctx2) { return _st(self)._error_("Not found");
  9915. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._key();
  9916. return $1;
  9917. }, function($ctx1) {$ctx1.fill(self,"keyAtValue:",{anObject:anObject}, smalltalk.Dictionary)})},
  9918. args: ["anObject"],
  9919. source: "keyAtValue: anObject\x0a\x0a\x09^ (self associations \x0a \x09detect:[:k :v| v == anObject] \x0a \x09ifNone:[self error: 'Not found']) key",
  9920. messageSends: ["key", "detect:ifNone:", "==", "error:", "associations"],
  9921. referencedClasses: []
  9922. }),
  9923. smalltalk.Dictionary);
  9924. smalltalk.addMethod(
  9925. "_keys",
  9926. smalltalk.method({
  9927. selector: "keys",
  9928. category: 'accessing',
  9929. fn: function (){
  9930. var self=this;
  9931. return smalltalk.withContext(function($ctx1) { var $1;
  9932. $1=_st(self["@keys"])._copy();
  9933. return $1;
  9934. }, function($ctx1) {$ctx1.fill(self,"keys",{}, smalltalk.Dictionary)})},
  9935. args: [],
  9936. source: "keys\x0a\x09^keys copy",
  9937. messageSends: ["copy"],
  9938. referencedClasses: []
  9939. }),
  9940. smalltalk.Dictionary);
  9941. smalltalk.addMethod(
  9942. "_removeKey_ifAbsent_",
  9943. smalltalk.method({
  9944. selector: "removeKey:ifAbsent:",
  9945. category: 'adding/removing',
  9946. fn: function (aKey,aBlock){
  9947. var self=this;
  9948. return smalltalk.withContext(function($ctx1) {
  9949. var index = self['@keys'].indexOf(aKey);
  9950. if(index === -1) {
  9951. return aBlock()
  9952. } else {
  9953. var value;
  9954. self['@keys'].splice(index, 1);
  9955. value = self['@values'].splice(index, 1);
  9956. return value[0];
  9957. };
  9958. ;
  9959. return self}, function($ctx1) {$ctx1.fill(self,"removeKey:ifAbsent:",{aKey:aKey,aBlock:aBlock}, smalltalk.Dictionary)})},
  9960. args: ["aKey", "aBlock"],
  9961. source: "removeKey: aKey ifAbsent: aBlock\x0a <\x0a var index = self['@keys'].indexOf(aKey);\x0a if(index === -1) {\x0a return aBlock()\x0a } else {\x0a var value;\x0a self['@keys'].splice(index, 1);\x0a value = self['@values'].splice(index, 1);\x0a return value[0];\x0a };\x0a >",
  9962. messageSends: [],
  9963. referencedClasses: []
  9964. }),
  9965. smalltalk.Dictionary);
  9966. smalltalk.addMethod(
  9967. "_valueAt_",
  9968. smalltalk.method({
  9969. selector: "valueAt:",
  9970. category: 'accessing',
  9971. fn: function (anObject){
  9972. var self=this;
  9973. return smalltalk.withContext(function($ctx1) { var $1;
  9974. $1=_st(self)._associationsDo_((2));
  9975. return $1;
  9976. }, function($ctx1) {$ctx1.fill(self,"valueAt:",{anObject:anObject}, smalltalk.Dictionary)})},
  9977. args: ["anObject"],
  9978. source: "valueAt: anObject\x0a\x0a\x09^ self associationsDo:2",
  9979. messageSends: ["associationsDo:"],
  9980. referencedClasses: []
  9981. }),
  9982. smalltalk.Dictionary);
  9983. smalltalk.addMethod(
  9984. "_values",
  9985. smalltalk.method({
  9986. selector: "values",
  9987. category: 'accessing',
  9988. fn: function (){
  9989. var self=this;
  9990. return smalltalk.withContext(function($ctx1) { var $1;
  9991. $1=_st(self["@values"])._copy();
  9992. return $1;
  9993. }, function($ctx1) {$ctx1.fill(self,"values",{}, smalltalk.Dictionary)})},
  9994. args: [],
  9995. source: "values\x0a\x09^values copy",
  9996. messageSends: ["copy"],
  9997. referencedClasses: []
  9998. }),
  9999. smalltalk.Dictionary);
  10000. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel-Collections');
  10001. smalltalk.addMethod(
  10002. "__eq",
  10003. smalltalk.method({
  10004. selector: "=",
  10005. category: 'comparing',
  10006. fn: function (aCollection){
  10007. var self=this;
  10008. return smalltalk.withContext(function($ctx1) { var $1,$2;
  10009. var $early={};
  10010. try {
  10011. $1=_st(_st(_st(self)._class()).__eq(_st(aCollection)._class()))._and_((function(){
  10012. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._size()).__eq(_st(aCollection)._size());
  10013. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  10014. if(! smalltalk.assert($1)){
  10015. return false;
  10016. };
  10017. _st(self)._withIndexDo_((function(each,i){
  10018. return smalltalk.withContext(function($ctx2) { $2=_st(_st(aCollection)._at_(i)).__eq(each);
  10019. if(! smalltalk.assert($2)){
  10020. throw $early=[false];
  10021. };
  10022. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  10023. return true;
  10024. }
  10025. catch(e) {if(e===$early)return e[0]; throw e}
  10026. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection}, smalltalk.SequenceableCollection)})},
  10027. args: ["aCollection"],
  10028. source: "= aCollection\x0a\x09(self class = aCollection class and: [\x0a\x09\x09self size = aCollection size]) ifFalse: [^false].\x0a\x09self withIndexDo: [:each :i |\x0a (aCollection at: i) = each ifFalse: [^false]].\x0a\x09^true",
  10029. messageSends: ["ifFalse:", "and:", "=", "size", "class", "withIndexDo:", "at:"],
  10030. referencedClasses: []
  10031. }),
  10032. smalltalk.SequenceableCollection);
  10033. smalltalk.addMethod(
  10034. "_addLast_",
  10035. smalltalk.method({
  10036. selector: "addLast:",
  10037. category: 'adding',
  10038. fn: function (anObject){
  10039. var self=this;
  10040. return smalltalk.withContext(function($ctx1) { _st(self)._add_(anObject);
  10041. return self}, function($ctx1) {$ctx1.fill(self,"addLast:",{anObject:anObject}, smalltalk.SequenceableCollection)})},
  10042. args: ["anObject"],
  10043. source: "addLast: anObject\x0a\x09self add: anObject",
  10044. messageSends: ["add:"],
  10045. referencedClasses: []
  10046. }),
  10047. smalltalk.SequenceableCollection);
  10048. smalltalk.addMethod(
  10049. "_allButFirst",
  10050. smalltalk.method({
  10051. selector: "allButFirst",
  10052. category: 'accessing',
  10053. fn: function (){
  10054. var self=this;
  10055. return smalltalk.withContext(function($ctx1) { var $1;
  10056. $1=_st(self)._copyFrom_to_((2),_st(self)._size());
  10057. return $1;
  10058. }, function($ctx1) {$ctx1.fill(self,"allButFirst",{}, smalltalk.SequenceableCollection)})},
  10059. args: [],
  10060. source: "allButFirst\x0a\x09^self copyFrom: 2 to: self size",
  10061. messageSends: ["copyFrom:to:", "size"],
  10062. referencedClasses: []
  10063. }),
  10064. smalltalk.SequenceableCollection);
  10065. smalltalk.addMethod(
  10066. "_allButLast",
  10067. smalltalk.method({
  10068. selector: "allButLast",
  10069. category: 'accessing',
  10070. fn: function (){
  10071. var self=this;
  10072. return smalltalk.withContext(function($ctx1) { var $1;
  10073. $1=_st(self)._copyFrom_to_((1),_st(_st(self)._size()).__minus((1)));
  10074. return $1;
  10075. }, function($ctx1) {$ctx1.fill(self,"allButLast",{}, smalltalk.SequenceableCollection)})},
  10076. args: [],
  10077. source: "allButLast\x0a\x09^self copyFrom: 1 to: self size - 1",
  10078. messageSends: ["copyFrom:to:", "-", "size"],
  10079. referencedClasses: []
  10080. }),
  10081. smalltalk.SequenceableCollection);
  10082. smalltalk.addMethod(
  10083. "_at_",
  10084. smalltalk.method({
  10085. selector: "at:",
  10086. category: 'accessing',
  10087. fn: function (anIndex){
  10088. var self=this;
  10089. return smalltalk.withContext(function($ctx1) { var $1;
  10090. $1=_st(self)._at_ifAbsent_(anIndex,(function(){
  10091. return smalltalk.withContext(function($ctx2) { return _st(self)._errorNotFound();
  10092. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  10093. return $1;
  10094. }, function($ctx1) {$ctx1.fill(self,"at:",{anIndex:anIndex}, smalltalk.SequenceableCollection)})},
  10095. args: ["anIndex"],
  10096. source: "at: anIndex\x0a\x09^self at: anIndex ifAbsent: [\x0a\x09 self errorNotFound]",
  10097. messageSends: ["at:ifAbsent:", "errorNotFound"],
  10098. referencedClasses: []
  10099. }),
  10100. smalltalk.SequenceableCollection);
  10101. smalltalk.addMethod(
  10102. "_at_ifAbsent_",
  10103. smalltalk.method({
  10104. selector: "at:ifAbsent:",
  10105. category: 'accessing',
  10106. fn: function (anIndex,aBlock){
  10107. var self=this;
  10108. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  10109. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock}, smalltalk.SequenceableCollection)})},
  10110. args: ["anIndex", "aBlock"],
  10111. source: "at: anIndex ifAbsent: aBlock\x0a\x09self subclassResponsibility",
  10112. messageSends: ["subclassResponsibility"],
  10113. referencedClasses: []
  10114. }),
  10115. smalltalk.SequenceableCollection);
  10116. smalltalk.addMethod(
  10117. "_at_put_",
  10118. smalltalk.method({
  10119. selector: "at:put:",
  10120. category: 'accessing',
  10121. fn: function (anIndex,anObject){
  10122. var self=this;
  10123. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  10124. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject}, smalltalk.SequenceableCollection)})},
  10125. args: ["anIndex", "anObject"],
  10126. source: "at: anIndex put: anObject\x0a\x09self subclassResponsibility",
  10127. messageSends: ["subclassResponsibility"],
  10128. referencedClasses: []
  10129. }),
  10130. smalltalk.SequenceableCollection);
  10131. smalltalk.addMethod(
  10132. "_atRandom",
  10133. smalltalk.method({
  10134. selector: "atRandom",
  10135. category: 'accessing',
  10136. fn: function (){
  10137. var self=this;
  10138. return smalltalk.withContext(function($ctx1) { var $1;
  10139. $1=_st(self)._at_(_st(_st(self)._size())._atRandom());
  10140. return $1;
  10141. }, function($ctx1) {$ctx1.fill(self,"atRandom",{}, smalltalk.SequenceableCollection)})},
  10142. args: [],
  10143. source: "atRandom\x0a\x09^ self at: self size atRandom",
  10144. messageSends: ["at:", "atRandom", "size"],
  10145. referencedClasses: []
  10146. }),
  10147. smalltalk.SequenceableCollection);
  10148. smalltalk.addMethod(
  10149. "_copyFrom_to_",
  10150. smalltalk.method({
  10151. selector: "copyFrom:to:",
  10152. category: 'copying',
  10153. fn: function (anIndex,anotherIndex){
  10154. var self=this;
  10155. var range,newCollection;
  10156. return smalltalk.withContext(function($ctx1) { var $1;
  10157. range=_st(anIndex)._to_(anotherIndex);
  10158. newCollection=_st(_st(self)._class())._new_(_st(range)._size());
  10159. _st(range)._withIndexDo_((function(each,i){
  10160. return smalltalk.withContext(function($ctx2) { return _st(newCollection)._at_put_(i,_st(self)._at_(each));
  10161. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  10162. $1=newCollection;
  10163. return $1;
  10164. }, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex,range:range,newCollection:newCollection}, smalltalk.SequenceableCollection)})},
  10165. args: ["anIndex", "anotherIndex"],
  10166. source: "copyFrom: anIndex to: anotherIndex\x0a\x09| range newCollection |\x0a\x09range := anIndex to: anotherIndex.\x0a\x09newCollection := self class new: range size.\x0a\x09range withIndexDo: [:each :i |\x0a\x09 newCollection at: i put: (self at: each)].\x0a\x09^newCollection",
  10167. messageSends: ["to:", "new:", "size", "class", "withIndexDo:", "at:put:", "at:"],
  10168. referencedClasses: []
  10169. }),
  10170. smalltalk.SequenceableCollection);
  10171. smalltalk.addMethod(
  10172. "_deepCopy",
  10173. smalltalk.method({
  10174. selector: "deepCopy",
  10175. category: 'copying',
  10176. fn: function (){
  10177. var self=this;
  10178. var newCollection;
  10179. return smalltalk.withContext(function($ctx1) { var $1;
  10180. newCollection=_st(_st(self)._class())._new_(_st(self)._size());
  10181. _st(self)._withIndexDo_((function(each,index){
  10182. return smalltalk.withContext(function($ctx2) { return _st(newCollection)._at_put_(index,_st(each)._deepCopy());
  10183. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  10184. $1=newCollection;
  10185. return $1;
  10186. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{newCollection:newCollection}, smalltalk.SequenceableCollection)})},
  10187. args: [],
  10188. source: "deepCopy\x0a\x09| newCollection |\x0a\x09newCollection := self class new: self size.\x0a\x09self withIndexDo: [:each :index | \x0a\x09\x09newCollection at: index put: each deepCopy].\x0a\x09^newCollection",
  10189. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:", "deepCopy"],
  10190. referencedClasses: []
  10191. }),
  10192. smalltalk.SequenceableCollection);
  10193. smalltalk.addMethod(
  10194. "_first",
  10195. smalltalk.method({
  10196. selector: "first",
  10197. category: 'accessing',
  10198. fn: function (){
  10199. var self=this;
  10200. return smalltalk.withContext(function($ctx1) { var $1;
  10201. $1=_st(self)._at_((1));
  10202. return $1;
  10203. }, function($ctx1) {$ctx1.fill(self,"first",{}, smalltalk.SequenceableCollection)})},
  10204. args: [],
  10205. source: "first\x0a\x09^self at: 1",
  10206. messageSends: ["at:"],
  10207. referencedClasses: []
  10208. }),
  10209. smalltalk.SequenceableCollection);
  10210. smalltalk.addMethod(
  10211. "_first_",
  10212. smalltalk.method({
  10213. selector: "first:",
  10214. category: 'accessing',
  10215. fn: function (n){
  10216. var self=this;
  10217. return smalltalk.withContext(function($ctx1) { var $1;
  10218. $1=_st(self)._copyFrom_to_((1),n);
  10219. return $1;
  10220. }, function($ctx1) {$ctx1.fill(self,"first:",{n:n}, smalltalk.SequenceableCollection)})},
  10221. args: ["n"],
  10222. source: "first: n\x0a\x09\x22Answer the first n elements of the receiver.\x0a\x09Raise an error if there are not enough elements.\x22\x0a\x0a\x09^ self copyFrom: 1 to: n",
  10223. messageSends: ["copyFrom:to:"],
  10224. referencedClasses: []
  10225. }),
  10226. smalltalk.SequenceableCollection);
  10227. smalltalk.addMethod(
  10228. "_fourth",
  10229. smalltalk.method({
  10230. selector: "fourth",
  10231. category: 'accessing',
  10232. fn: function (){
  10233. var self=this;
  10234. return smalltalk.withContext(function($ctx1) { var $1;
  10235. $1=_st(self)._at_((4));
  10236. return $1;
  10237. }, function($ctx1) {$ctx1.fill(self,"fourth",{}, smalltalk.SequenceableCollection)})},
  10238. args: [],
  10239. source: "fourth\x0a\x09^self at: 4",
  10240. messageSends: ["at:"],
  10241. referencedClasses: []
  10242. }),
  10243. smalltalk.SequenceableCollection);
  10244. smalltalk.addMethod(
  10245. "_includes_",
  10246. smalltalk.method({
  10247. selector: "includes:",
  10248. category: 'testing',
  10249. fn: function (anObject){
  10250. var self=this;
  10251. return smalltalk.withContext(function($ctx1) { var $1;
  10252. $1=_st(_st(self)._indexOf_ifAbsent_(anObject,(function(){
  10253. return smalltalk.withContext(function($ctx2) { return nil;
  10254. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._notNil();
  10255. return $1;
  10256. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject}, smalltalk.SequenceableCollection)})},
  10257. args: ["anObject"],
  10258. source: "includes: anObject\x0a\x09^(self indexOf: anObject ifAbsent: [nil]) notNil",
  10259. messageSends: ["notNil", "indexOf:ifAbsent:"],
  10260. referencedClasses: []
  10261. }),
  10262. smalltalk.SequenceableCollection);
  10263. smalltalk.addMethod(
  10264. "_indexOf_",
  10265. smalltalk.method({
  10266. selector: "indexOf:",
  10267. category: 'accessing',
  10268. fn: function (anObject){
  10269. var self=this;
  10270. return smalltalk.withContext(function($ctx1) { var $1;
  10271. $1=_st(self)._indexOf_ifAbsent_(anObject,(function(){
  10272. return smalltalk.withContext(function($ctx2) { return _st(self)._errorNotFound();
  10273. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  10274. return $1;
  10275. }, function($ctx1) {$ctx1.fill(self,"indexOf:",{anObject:anObject}, smalltalk.SequenceableCollection)})},
  10276. args: ["anObject"],
  10277. source: "indexOf: anObject\x0a\x09^self indexOf: anObject ifAbsent: [self errorNotFound]",
  10278. messageSends: ["indexOf:ifAbsent:", "errorNotFound"],
  10279. referencedClasses: []
  10280. }),
  10281. smalltalk.SequenceableCollection);
  10282. smalltalk.addMethod(
  10283. "_indexOf_ifAbsent_",
  10284. smalltalk.method({
  10285. selector: "indexOf:ifAbsent:",
  10286. category: 'accessing',
  10287. fn: function (anObject,aBlock){
  10288. var self=this;
  10289. return smalltalk.withContext(function($ctx1) {
  10290. for(var i=0;i<self.length;i++) {
  10291. if(self[i].__eq(anObject)) {return i+1}
  10292. };
  10293. return aBlock();
  10294. ;
  10295. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:ifAbsent:",{anObject:anObject,aBlock:aBlock}, smalltalk.SequenceableCollection)})},
  10296. args: ["anObject", "aBlock"],
  10297. source: "indexOf: anObject ifAbsent: aBlock\x0a\x09<\x0a\x09\x09for(var i=0;i<self.length;i++) {\x0a\x09\x09\x09if(self[i].__eq(anObject)) {return i+1}\x0a\x09\x09};\x0a\x09\x09return aBlock();\x0a\x09>",
  10298. messageSends: [],
  10299. referencedClasses: []
  10300. }),
  10301. smalltalk.SequenceableCollection);
  10302. smalltalk.addMethod(
  10303. "_indexOf_startingAt_",
  10304. smalltalk.method({
  10305. selector: "indexOf:startingAt:",
  10306. category: 'accessing',
  10307. fn: function (anObject,start){
  10308. var self=this;
  10309. return smalltalk.withContext(function($ctx1) { var $1;
  10310. $1=_st(self)._indexOf_startingAt_ifAbsent_(anObject,start,(function(){
  10311. return smalltalk.withContext(function($ctx2) { return (0);
  10312. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  10313. return $1;
  10314. }, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:",{anObject:anObject,start:start}, smalltalk.SequenceableCollection)})},
  10315. args: ["anObject", "start"],
  10316. source: "indexOf: anObject startingAt: start\x0a\x09\x22Answer the index of the first occurence of anElement after start\x0a\x09within the receiver. If the receiver does not contain anElement, \x0a\x09answer 0.\x22\x0a\x09^self indexOf: anObject startingAt: start ifAbsent: [0]",
  10317. messageSends: ["indexOf:startingAt:ifAbsent:"],
  10318. referencedClasses: []
  10319. }),
  10320. smalltalk.SequenceableCollection);
  10321. smalltalk.addMethod(
  10322. "_indexOf_startingAt_ifAbsent_",
  10323. smalltalk.method({
  10324. selector: "indexOf:startingAt:ifAbsent:",
  10325. category: 'accessing',
  10326. fn: function (anObject,start,aBlock){
  10327. var self=this;
  10328. return smalltalk.withContext(function($ctx1) {
  10329. for(var i=start-1;i<self.length;i++){
  10330. if(self[i].__eq(anObject)) {return i+1}
  10331. }
  10332. return aBlock();
  10333. ;
  10334. return self}, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:ifAbsent:",{anObject:anObject,start:start,aBlock:aBlock}, smalltalk.SequenceableCollection)})},
  10335. args: ["anObject", "start", "aBlock"],
  10336. source: "indexOf: anObject startingAt: start ifAbsent: aBlock\x0a\x09<\x0a\x09\x09for(var i=start-1;i<self.length;i++){\x0a\x09\x09\x09if(self[i].__eq(anObject)) {return i+1}\x0a\x09\x09}\x0a\x09\x09return aBlock();\x0a\x09>",
  10337. messageSends: [],
  10338. referencedClasses: []
  10339. }),
  10340. smalltalk.SequenceableCollection);
  10341. smalltalk.addMethod(
  10342. "_last",
  10343. smalltalk.method({
  10344. selector: "last",
  10345. category: 'accessing',
  10346. fn: function (){
  10347. var self=this;
  10348. return smalltalk.withContext(function($ctx1) { var $1;
  10349. $1=_st(self)._at_(_st(self)._size());
  10350. return $1;
  10351. }, function($ctx1) {$ctx1.fill(self,"last",{}, smalltalk.SequenceableCollection)})},
  10352. args: [],
  10353. source: "last\x0a\x09^self at: self size",
  10354. messageSends: ["at:", "size"],
  10355. referencedClasses: []
  10356. }),
  10357. smalltalk.SequenceableCollection);
  10358. smalltalk.addMethod(
  10359. "_removeLast",
  10360. smalltalk.method({
  10361. selector: "removeLast",
  10362. category: 'adding',
  10363. fn: function (){
  10364. var self=this;
  10365. return smalltalk.withContext(function($ctx1) { _st(self)._remove_(_st(self)._last());
  10366. return self}, function($ctx1) {$ctx1.fill(self,"removeLast",{}, smalltalk.SequenceableCollection)})},
  10367. args: [],
  10368. source: "removeLast\x0a\x09self remove: self last",
  10369. messageSends: ["remove:", "last"],
  10370. referencedClasses: []
  10371. }),
  10372. smalltalk.SequenceableCollection);
  10373. smalltalk.addMethod(
  10374. "_reversed",
  10375. smalltalk.method({
  10376. selector: "reversed",
  10377. category: 'converting',
  10378. fn: function (){
  10379. var self=this;
  10380. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  10381. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{}, smalltalk.SequenceableCollection)})},
  10382. args: [],
  10383. source: "reversed\x0a\x09self subclassResponsibility",
  10384. messageSends: ["subclassResponsibility"],
  10385. referencedClasses: []
  10386. }),
  10387. smalltalk.SequenceableCollection);
  10388. smalltalk.addMethod(
  10389. "_second",
  10390. smalltalk.method({
  10391. selector: "second",
  10392. category: 'accessing',
  10393. fn: function (){
  10394. var self=this;
  10395. return smalltalk.withContext(function($ctx1) { var $1;
  10396. $1=_st(self)._at_((2));
  10397. return $1;
  10398. }, function($ctx1) {$ctx1.fill(self,"second",{}, smalltalk.SequenceableCollection)})},
  10399. args: [],
  10400. source: "second\x0a\x09^self at: 2",
  10401. messageSends: ["at:"],
  10402. referencedClasses: []
  10403. }),
  10404. smalltalk.SequenceableCollection);
  10405. smalltalk.addMethod(
  10406. "_shallowCopy",
  10407. smalltalk.method({
  10408. selector: "shallowCopy",
  10409. category: 'copying',
  10410. fn: function (){
  10411. var self=this;
  10412. var newCollection;
  10413. return smalltalk.withContext(function($ctx1) { var $1;
  10414. newCollection=_st(_st(self)._class())._new_(_st(self)._size());
  10415. _st(self)._withIndexDo_((function(each,index){
  10416. return smalltalk.withContext(function($ctx2) { return _st(newCollection)._at_put_(index,each);
  10417. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  10418. $1=newCollection;
  10419. return $1;
  10420. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{newCollection:newCollection}, smalltalk.SequenceableCollection)})},
  10421. args: [],
  10422. source: "shallowCopy\x0a\x09| newCollection |\x0a\x09newCollection := self class new: self size.\x0a\x09self withIndexDo: [ :each :index | \x0a\x09\x09newCollection at: index put: each].\x0a\x09^newCollection",
  10423. messageSends: ["new:", "size", "class", "withIndexDo:", "at:put:"],
  10424. referencedClasses: []
  10425. }),
  10426. smalltalk.SequenceableCollection);
  10427. smalltalk.addMethod(
  10428. "_third",
  10429. smalltalk.method({
  10430. selector: "third",
  10431. category: 'accessing',
  10432. fn: function (){
  10433. var self=this;
  10434. return smalltalk.withContext(function($ctx1) { var $1;
  10435. $1=_st(self)._at_((3));
  10436. return $1;
  10437. }, function($ctx1) {$ctx1.fill(self,"third",{}, smalltalk.SequenceableCollection)})},
  10438. args: [],
  10439. source: "third\x0a\x09^self at: 3",
  10440. messageSends: ["at:"],
  10441. referencedClasses: []
  10442. }),
  10443. smalltalk.SequenceableCollection);
  10444. smalltalk.addMethod(
  10445. "_withIndexDo_",
  10446. smalltalk.method({
  10447. selector: "withIndexDo:",
  10448. category: 'enumerating',
  10449. fn: function (aBlock){
  10450. var self=this;
  10451. return smalltalk.withContext(function($ctx1) { for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  10452. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock}, smalltalk.SequenceableCollection)})},
  10453. args: ["aBlock"],
  10454. source: "withIndexDo: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock(self[i], i+1);}>",
  10455. messageSends: [],
  10456. referencedClasses: []
  10457. }),
  10458. smalltalk.SequenceableCollection);
  10459. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  10460. smalltalk.addMethod(
  10461. "_add_",
  10462. smalltalk.method({
  10463. selector: "add:",
  10464. category: 'adding/removing',
  10465. fn: function (anObject){
  10466. var self=this;
  10467. return smalltalk.withContext(function($ctx1) { self.push(anObject); return anObject;;
  10468. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject}, smalltalk.Array)})},
  10469. args: ["anObject"],
  10470. source: "add: anObject\x0a\x09<self.push(anObject); return anObject;>",
  10471. messageSends: [],
  10472. referencedClasses: []
  10473. }),
  10474. smalltalk.Array);
  10475. smalltalk.addMethod(
  10476. "_asJavascript",
  10477. smalltalk.method({
  10478. selector: "asJavascript",
  10479. category: 'converting',
  10480. fn: function (){
  10481. var self=this;
  10482. return smalltalk.withContext(function($ctx1) { var $1;
  10483. $1=_st(_st("[").__comma(_st(_st(self)._collect_((function(each){
  10484. return smalltalk.withContext(function($ctx2) { return _st(each)._asJavascript();
  10485. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._join_(", "))).__comma("]");
  10486. return $1;
  10487. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Array)})},
  10488. args: [],
  10489. source: "asJavascript\x0a\x09^'[', ((self collect: [:each | each asJavascript]) join: ', '), ']'",
  10490. messageSends: [",", "join:", "collect:", "asJavascript"],
  10491. referencedClasses: []
  10492. }),
  10493. smalltalk.Array);
  10494. smalltalk.addMethod(
  10495. "_at_ifAbsent_",
  10496. smalltalk.method({
  10497. selector: "at:ifAbsent:",
  10498. category: 'accessing',
  10499. fn: function (anIndex,aBlock){
  10500. var self=this;
  10501. return smalltalk.withContext(function($ctx1) {
  10502. if((anIndex < 1) || (self.length < anIndex)) {return aBlock()};
  10503. return self[anIndex - 1];
  10504. ;
  10505. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock}, smalltalk.Array)})},
  10506. args: ["anIndex", "aBlock"],
  10507. source: "at: anIndex ifAbsent: aBlock\x0a\x09<\x0a\x09\x09if((anIndex < 1) || (self.length < anIndex)) {return aBlock()};\x0a\x09\x09return self[anIndex - 1];\x0a\x09>",
  10508. messageSends: [],
  10509. referencedClasses: []
  10510. }),
  10511. smalltalk.Array);
  10512. smalltalk.addMethod(
  10513. "_at_put_",
  10514. smalltalk.method({
  10515. selector: "at:put:",
  10516. category: 'accessing',
  10517. fn: function (anIndex,anObject){
  10518. var self=this;
  10519. return smalltalk.withContext(function($ctx1) { return self[anIndex - 1] = anObject;
  10520. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject}, smalltalk.Array)})},
  10521. args: ["anIndex", "anObject"],
  10522. source: "at: anIndex put: anObject\x0a\x09<return self[anIndex - 1] = anObject>",
  10523. messageSends: [],
  10524. referencedClasses: []
  10525. }),
  10526. smalltalk.Array);
  10527. smalltalk.addMethod(
  10528. "_join_",
  10529. smalltalk.method({
  10530. selector: "join:",
  10531. category: 'enumerating',
  10532. fn: function (aString){
  10533. var self=this;
  10534. return smalltalk.withContext(function($ctx1) { return self.join(aString);
  10535. return self}, function($ctx1) {$ctx1.fill(self,"join:",{aString:aString}, smalltalk.Array)})},
  10536. args: ["aString"],
  10537. source: "join: aString\x0a\x09<return self.join(aString)>",
  10538. messageSends: [],
  10539. referencedClasses: []
  10540. }),
  10541. smalltalk.Array);
  10542. smalltalk.addMethod(
  10543. "_remove_ifAbsent_",
  10544. smalltalk.method({
  10545. selector: "remove:ifAbsent:",
  10546. category: 'adding/removing',
  10547. fn: function (anObject,aBlock){
  10548. var self=this;
  10549. return smalltalk.withContext(function($ctx1) {
  10550. for(var i=0;i<self.length;i++) {
  10551. if(self[i] == anObject) {
  10552. self.splice(i,1);
  10553. return self;
  10554. }
  10555. };
  10556. aBlock._value();
  10557. ;
  10558. return self}, function($ctx1) {$ctx1.fill(self,"remove:ifAbsent:",{anObject:anObject,aBlock:aBlock}, smalltalk.Array)})},
  10559. args: ["anObject", "aBlock"],
  10560. source: "remove: anObject ifAbsent: aBlock\x0a\x09<\x0a\x09\x09for(var i=0;i<self.length;i++) {\x0a\x09\x09\x09if(self[i] == anObject) {\x0a\x09\x09\x09\x09self.splice(i,1);\x0a\x09\x09\x09\x09return self;\x0a\x09\x09\x09}\x0a\x09\x09};\x0a aBlock._value();\x0a\x09>",
  10561. messageSends: [],
  10562. referencedClasses: []
  10563. }),
  10564. smalltalk.Array);
  10565. smalltalk.addMethod(
  10566. "_removeFrom_to_",
  10567. smalltalk.method({
  10568. selector: "removeFrom:to:",
  10569. category: 'adding/removing',
  10570. fn: function (aNumber,anotherNumber){
  10571. var self=this;
  10572. return smalltalk.withContext(function($ctx1) { self.splice(aNumber - 1,anotherNumber - 1);
  10573. return self}, function($ctx1) {$ctx1.fill(self,"removeFrom:to:",{aNumber:aNumber,anotherNumber:anotherNumber}, smalltalk.Array)})},
  10574. args: ["aNumber", "anotherNumber"],
  10575. source: "removeFrom: aNumber to: anotherNumber\x0a\x09<self.splice(aNumber - 1,anotherNumber - 1)>",
  10576. messageSends: [],
  10577. referencedClasses: []
  10578. }),
  10579. smalltalk.Array);
  10580. smalltalk.addMethod(
  10581. "_reversed",
  10582. smalltalk.method({
  10583. selector: "reversed",
  10584. category: 'converting',
  10585. fn: function (){
  10586. var self=this;
  10587. return smalltalk.withContext(function($ctx1) { return self._copy().reverse();
  10588. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{}, smalltalk.Array)})},
  10589. args: [],
  10590. source: "reversed\x0a\x09<return self._copy().reverse()>",
  10591. messageSends: [],
  10592. referencedClasses: []
  10593. }),
  10594. smalltalk.Array);
  10595. smalltalk.addMethod(
  10596. "_size",
  10597. smalltalk.method({
  10598. selector: "size",
  10599. category: 'accessing',
  10600. fn: function (){
  10601. var self=this;
  10602. return smalltalk.withContext(function($ctx1) { return self.length;
  10603. return self}, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Array)})},
  10604. args: [],
  10605. source: "size\x0a\x09<return self.length>",
  10606. messageSends: [],
  10607. referencedClasses: []
  10608. }),
  10609. smalltalk.Array);
  10610. smalltalk.addMethod(
  10611. "_sort",
  10612. smalltalk.method({
  10613. selector: "sort",
  10614. category: 'enumerating',
  10615. fn: function (){
  10616. var self=this;
  10617. return smalltalk.withContext(function($ctx1) { var $1;
  10618. $1=_st(self)._basicPerform_("sort");
  10619. return $1;
  10620. }, function($ctx1) {$ctx1.fill(self,"sort",{}, smalltalk.Array)})},
  10621. args: [],
  10622. source: "sort\x0a ^self basicPerform: 'sort'",
  10623. messageSends: ["basicPerform:"],
  10624. referencedClasses: []
  10625. }),
  10626. smalltalk.Array);
  10627. smalltalk.addMethod(
  10628. "_sort_",
  10629. smalltalk.method({
  10630. selector: "sort:",
  10631. category: 'enumerating',
  10632. fn: function (aBlock){
  10633. var self=this;
  10634. return smalltalk.withContext(function($ctx1) {
  10635. return self.sort(function(a, b) {
  10636. if(aBlock(a,b)) {return -1} else {return 1}
  10637. })
  10638. ;
  10639. return self}, function($ctx1) {$ctx1.fill(self,"sort:",{aBlock:aBlock}, smalltalk.Array)})},
  10640. args: ["aBlock"],
  10641. source: "sort: aBlock\x0a\x09<\x0a\x09\x09return self.sort(function(a, b) {\x0a\x09\x09\x09if(aBlock(a,b)) {return -1} else {return 1}\x0a\x09\x09})\x0a\x09>",
  10642. messageSends: [],
  10643. referencedClasses: []
  10644. }),
  10645. smalltalk.Array);
  10646. smalltalk.addMethod(
  10647. "_sorted",
  10648. smalltalk.method({
  10649. selector: "sorted",
  10650. category: 'enumerating',
  10651. fn: function (){
  10652. var self=this;
  10653. return smalltalk.withContext(function($ctx1) { var $1;
  10654. $1=_st(_st(self)._copy())._sort();
  10655. return $1;
  10656. }, function($ctx1) {$ctx1.fill(self,"sorted",{}, smalltalk.Array)})},
  10657. args: [],
  10658. source: "sorted\x0a\x09^self copy sort",
  10659. messageSends: ["sort", "copy"],
  10660. referencedClasses: []
  10661. }),
  10662. smalltalk.Array);
  10663. smalltalk.addMethod(
  10664. "_sorted_",
  10665. smalltalk.method({
  10666. selector: "sorted:",
  10667. category: 'enumerating',
  10668. fn: function (aBlock){
  10669. var self=this;
  10670. return smalltalk.withContext(function($ctx1) { var $1;
  10671. $1=_st(_st(self)._copy())._sort_(aBlock);
  10672. return $1;
  10673. }, function($ctx1) {$ctx1.fill(self,"sorted:",{aBlock:aBlock}, smalltalk.Array)})},
  10674. args: ["aBlock"],
  10675. source: "sorted: aBlock\x0a\x09^self copy sort: aBlock",
  10676. messageSends: ["sort:", "copy"],
  10677. referencedClasses: []
  10678. }),
  10679. smalltalk.Array);
  10680. smalltalk.addMethod(
  10681. "_new_",
  10682. smalltalk.method({
  10683. selector: "new:",
  10684. category: 'instance creation',
  10685. fn: function (anInteger){
  10686. var self=this;
  10687. return smalltalk.withContext(function($ctx1) { return new Array(anInteger);
  10688. return self}, function($ctx1) {$ctx1.fill(self,"new:",{anInteger:anInteger}, smalltalk.Array.klass)})},
  10689. args: ["anInteger"],
  10690. source: "new: anInteger\x0a\x09<return new Array(anInteger)>",
  10691. messageSends: [],
  10692. referencedClasses: []
  10693. }),
  10694. smalltalk.Array.klass);
  10695. smalltalk.addMethod(
  10696. "_with_",
  10697. smalltalk.method({
  10698. selector: "with:",
  10699. category: 'instance creation',
  10700. fn: function (anObject){
  10701. var self=this;
  10702. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  10703. $2=_st(self)._new_((1));
  10704. _st($2)._at_put_((1),anObject);
  10705. $3=_st($2)._yourself();
  10706. $1=$3;
  10707. return $1;
  10708. }, function($ctx1) {$ctx1.fill(self,"with:",{anObject:anObject}, smalltalk.Array.klass)})},
  10709. args: ["anObject"],
  10710. source: "with: anObject\x0a\x09 ^(self new: 1)\x0a\x09\x09at: 1 put: anObject;\x0a\x09\x09yourself",
  10711. messageSends: ["at:put:", "new:", "yourself"],
  10712. referencedClasses: []
  10713. }),
  10714. smalltalk.Array.klass);
  10715. smalltalk.addMethod(
  10716. "_with_with_",
  10717. smalltalk.method({
  10718. selector: "with:with:",
  10719. category: 'instance creation',
  10720. fn: function (anObject,anObject2){
  10721. var self=this;
  10722. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  10723. $2=_st(self)._new_((2));
  10724. _st($2)._at_put_((1),anObject);
  10725. _st($2)._at_put_((2),anObject2);
  10726. $3=_st($2)._yourself();
  10727. $1=$3;
  10728. return $1;
  10729. }, function($ctx1) {$ctx1.fill(self,"with:with:",{anObject:anObject,anObject2:anObject2}, smalltalk.Array.klass)})},
  10730. args: ["anObject", "anObject2"],
  10731. source: "with: anObject with: anObject2\x0a\x09 ^(self new: 2)\x0a\x09\x09at: 1 put: anObject;\x0a\x09\x09at: 2 put: anObject2;\x0a\x09\x09yourself",
  10732. messageSends: ["at:put:", "new:", "yourself"],
  10733. referencedClasses: []
  10734. }),
  10735. smalltalk.Array.klass);
  10736. smalltalk.addMethod(
  10737. "_with_with_with_",
  10738. smalltalk.method({
  10739. selector: "with:with:with:",
  10740. category: 'instance creation',
  10741. fn: function (anObject,anObject2,anObject3){
  10742. var self=this;
  10743. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  10744. $2=_st(self)._new_((3));
  10745. _st($2)._at_put_((1),anObject);
  10746. _st($2)._at_put_((2),anObject2);
  10747. _st($2)._at_put_((3),anObject3);
  10748. $3=_st($2)._yourself();
  10749. $1=$3;
  10750. return $1;
  10751. }, function($ctx1) {$ctx1.fill(self,"with:with:with:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3}, smalltalk.Array.klass)})},
  10752. args: ["anObject", "anObject2", "anObject3"],
  10753. source: "with: anObject with: anObject2 with: anObject3\x0a\x09 ^(self new: 3)\x0a\x09\x09at: 1 put: anObject;\x0a\x09\x09at: 2 put: anObject2;\x0a\x09\x09at: 3 put: anObject3;\x0a\x09\x09yourself",
  10754. messageSends: ["at:put:", "new:", "yourself"],
  10755. referencedClasses: []
  10756. }),
  10757. smalltalk.Array.klass);
  10758. smalltalk.addMethod(
  10759. "_withAll_",
  10760. smalltalk.method({
  10761. selector: "withAll:",
  10762. category: 'instance creation',
  10763. fn: function (aCollection){
  10764. var self=this;
  10765. var instance,index;
  10766. return smalltalk.withContext(function($ctx1) { var $1;
  10767. index=(1);
  10768. instance=_st(self)._new_(_st(aCollection)._size());
  10769. _st(aCollection)._do_((function(each){
  10770. return smalltalk.withContext(function($ctx2) { _st(instance)._at_put_(index,each);
  10771. index=_st(index).__plus((1));
  10772. return index;
  10773. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  10774. $1=instance;
  10775. return $1;
  10776. }, function($ctx1) {$ctx1.fill(self,"withAll:",{aCollection:aCollection,instance:instance,index:index}, smalltalk.Array.klass)})},
  10777. args: ["aCollection"],
  10778. source: "withAll: aCollection\x0a\x09| instance index |\x0a\x09index := 1.\x0a\x09instance := self new: aCollection size.\x0a\x09aCollection do: [:each |\x0a\x09\x09instance at: index put: each.\x0a\x09\x09index := index + 1].\x0a\x09^instance",
  10779. messageSends: ["new:", "size", "do:", "at:put:", "+"],
  10780. referencedClasses: []
  10781. }),
  10782. smalltalk.Array.klass);
  10783. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  10784. smalltalk.addMethod(
  10785. "__comma",
  10786. smalltalk.method({
  10787. selector: ",",
  10788. category: 'copying',
  10789. fn: function (aString){
  10790. var self=this;
  10791. return smalltalk.withContext(function($ctx1) { var $1;
  10792. $1=_st(_st(self)._asString()).__comma(_st(aString)._asString());
  10793. return $1;
  10794. }, function($ctx1) {$ctx1.fill(self,",",{aString:aString}, smalltalk.CharacterArray)})},
  10795. args: ["aString"],
  10796. source: ", aString\x0a\x09^self asString, aString asString",
  10797. messageSends: [",", "asString"],
  10798. referencedClasses: []
  10799. }),
  10800. smalltalk.CharacterArray);
  10801. smalltalk.addMethod(
  10802. "_add_",
  10803. smalltalk.method({
  10804. selector: "add:",
  10805. category: 'adding',
  10806. fn: function (anObject){
  10807. var self=this;
  10808. return smalltalk.withContext(function($ctx1) { _st(self)._errorReadOnly();
  10809. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject}, smalltalk.CharacterArray)})},
  10810. args: ["anObject"],
  10811. source: "add: anObject\x0a\x09self errorReadOnly",
  10812. messageSends: ["errorReadOnly"],
  10813. referencedClasses: []
  10814. }),
  10815. smalltalk.CharacterArray);
  10816. smalltalk.addMethod(
  10817. "_asLowercase",
  10818. smalltalk.method({
  10819. selector: "asLowercase",
  10820. category: 'converting',
  10821. fn: function (){
  10822. var self=this;
  10823. return smalltalk.withContext(function($ctx1) { var $1;
  10824. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._asLowercase());
  10825. return $1;
  10826. }, function($ctx1) {$ctx1.fill(self,"asLowercase",{}, smalltalk.CharacterArray)})},
  10827. args: [],
  10828. source: "asLowercase\x0a\x09^self class fromString: self asString asLowercase",
  10829. messageSends: ["fromString:", "asLowercase", "asString", "class"],
  10830. referencedClasses: []
  10831. }),
  10832. smalltalk.CharacterArray);
  10833. smalltalk.addMethod(
  10834. "_asNumber",
  10835. smalltalk.method({
  10836. selector: "asNumber",
  10837. category: 'converting',
  10838. fn: function (){
  10839. var self=this;
  10840. return smalltalk.withContext(function($ctx1) { var $1;
  10841. $1=_st(_st(self)._asString())._asNumber();
  10842. return $1;
  10843. }, function($ctx1) {$ctx1.fill(self,"asNumber",{}, smalltalk.CharacterArray)})},
  10844. args: [],
  10845. source: "asNumber\x0a\x09^self asString asNumber",
  10846. messageSends: ["asNumber", "asString"],
  10847. referencedClasses: []
  10848. }),
  10849. smalltalk.CharacterArray);
  10850. smalltalk.addMethod(
  10851. "_asString",
  10852. smalltalk.method({
  10853. selector: "asString",
  10854. category: 'converting',
  10855. fn: function (){
  10856. var self=this;
  10857. return smalltalk.withContext(function($ctx1) { var $1;
  10858. $1=_st(self)._subclassResponsibility();
  10859. return $1;
  10860. }, function($ctx1) {$ctx1.fill(self,"asString",{}, smalltalk.CharacterArray)})},
  10861. args: [],
  10862. source: "asString\x0a\x09^self subclassResponsibility",
  10863. messageSends: ["subclassResponsibility"],
  10864. referencedClasses: []
  10865. }),
  10866. smalltalk.CharacterArray);
  10867. smalltalk.addMethod(
  10868. "_asSymbol",
  10869. smalltalk.method({
  10870. selector: "asSymbol",
  10871. category: 'converting',
  10872. fn: function (){
  10873. var self=this;
  10874. return smalltalk.withContext(function($ctx1) { var $1;
  10875. $1=_st(self)._subclassResponsibility();
  10876. return $1;
  10877. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{}, smalltalk.CharacterArray)})},
  10878. args: [],
  10879. source: "asSymbol\x0a\x09^self subclassResponsibility",
  10880. messageSends: ["subclassResponsibility"],
  10881. referencedClasses: []
  10882. }),
  10883. smalltalk.CharacterArray);
  10884. smalltalk.addMethod(
  10885. "_asUppercase",
  10886. smalltalk.method({
  10887. selector: "asUppercase",
  10888. category: 'converting',
  10889. fn: function (){
  10890. var self=this;
  10891. return smalltalk.withContext(function($ctx1) { var $1;
  10892. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._asUppercase());
  10893. return $1;
  10894. }, function($ctx1) {$ctx1.fill(self,"asUppercase",{}, smalltalk.CharacterArray)})},
  10895. args: [],
  10896. source: "asUppercase\x0a\x09^self class fromString: self asString asUppercase",
  10897. messageSends: ["fromString:", "asUppercase", "asString", "class"],
  10898. referencedClasses: []
  10899. }),
  10900. smalltalk.CharacterArray);
  10901. smalltalk.addMethod(
  10902. "_at_put_",
  10903. smalltalk.method({
  10904. selector: "at:put:",
  10905. category: 'accessing',
  10906. fn: function (anIndex,anObject){
  10907. var self=this;
  10908. return smalltalk.withContext(function($ctx1) { _st(self)._errorReadOnly();
  10909. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{anIndex:anIndex,anObject:anObject}, smalltalk.CharacterArray)})},
  10910. args: ["anIndex", "anObject"],
  10911. source: "at: anIndex put: anObject\x0a\x09self errorReadOnly",
  10912. messageSends: ["errorReadOnly"],
  10913. referencedClasses: []
  10914. }),
  10915. smalltalk.CharacterArray);
  10916. smalltalk.addMethod(
  10917. "_errorReadOnly",
  10918. smalltalk.method({
  10919. selector: "errorReadOnly",
  10920. category: 'error handling',
  10921. fn: function (){
  10922. var self=this;
  10923. return smalltalk.withContext(function($ctx1) { _st(self)._error_("Object is read-only");
  10924. return self}, function($ctx1) {$ctx1.fill(self,"errorReadOnly",{}, smalltalk.CharacterArray)})},
  10925. args: [],
  10926. source: "errorReadOnly\x0a\x09self error: 'Object is read-only'",
  10927. messageSends: ["error:"],
  10928. referencedClasses: []
  10929. }),
  10930. smalltalk.CharacterArray);
  10931. smalltalk.addMethod(
  10932. "_printString",
  10933. smalltalk.method({
  10934. selector: "printString",
  10935. category: 'printing',
  10936. fn: function (){
  10937. var self=this;
  10938. return smalltalk.withContext(function($ctx1) { var $1;
  10939. $1=_st(_st(self)._asString())._printString();
  10940. return $1;
  10941. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.CharacterArray)})},
  10942. args: [],
  10943. source: "printString\x0a\x09^self asString printString",
  10944. messageSends: ["printString", "asString"],
  10945. referencedClasses: []
  10946. }),
  10947. smalltalk.CharacterArray);
  10948. smalltalk.addMethod(
  10949. "_remove_",
  10950. smalltalk.method({
  10951. selector: "remove:",
  10952. category: 'adding',
  10953. fn: function (anObject){
  10954. var self=this;
  10955. return smalltalk.withContext(function($ctx1) { _st(self)._errorReadOnly();
  10956. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject}, smalltalk.CharacterArray)})},
  10957. args: ["anObject"],
  10958. source: "remove: anObject\x0a\x09self errorReadOnly",
  10959. messageSends: ["errorReadOnly"],
  10960. referencedClasses: []
  10961. }),
  10962. smalltalk.CharacterArray);
  10963. smalltalk.addMethod(
  10964. "_fromString_",
  10965. smalltalk.method({
  10966. selector: "fromString:",
  10967. category: 'instance creation',
  10968. fn: function (aString){
  10969. var self=this;
  10970. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  10971. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString}, smalltalk.CharacterArray.klass)})},
  10972. args: ["aString"],
  10973. source: "fromString: aString\x0a\x09self subclassResponsibility",
  10974. messageSends: ["subclassResponsibility"],
  10975. referencedClasses: []
  10976. }),
  10977. smalltalk.CharacterArray.klass);
  10978. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  10979. smalltalk.addMethod(
  10980. "__comma",
  10981. smalltalk.method({
  10982. selector: ",",
  10983. category: 'copying',
  10984. fn: function (aString){
  10985. var self=this;
  10986. return smalltalk.withContext(function($ctx1) { return self + aString;
  10987. return self}, function($ctx1) {$ctx1.fill(self,",",{aString:aString}, smalltalk.String)})},
  10988. args: ["aString"],
  10989. source: ", aString\x0a\x09<return self + aString>",
  10990. messageSends: [],
  10991. referencedClasses: []
  10992. }),
  10993. smalltalk.String);
  10994. smalltalk.addMethod(
  10995. "__lt",
  10996. smalltalk.method({
  10997. selector: "<",
  10998. category: 'comparing',
  10999. fn: function (aString){
  11000. var self=this;
  11001. return smalltalk.withContext(function($ctx1) { return String(self) < aString._asString();
  11002. return self}, function($ctx1) {$ctx1.fill(self,"<",{aString:aString}, smalltalk.String)})},
  11003. args: ["aString"],
  11004. source: "< aString\x0a\x09<return String(self) < aString._asString()>",
  11005. messageSends: [],
  11006. referencedClasses: []
  11007. }),
  11008. smalltalk.String);
  11009. smalltalk.addMethod(
  11010. "__lt_eq",
  11011. smalltalk.method({
  11012. selector: "<=",
  11013. category: 'comparing',
  11014. fn: function (aString){
  11015. var self=this;
  11016. return smalltalk.withContext(function($ctx1) { return String(self) <= aString._asString();
  11017. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aString:aString}, smalltalk.String)})},
  11018. args: ["aString"],
  11019. source: "<= aString\x0a\x09<return String(self) <= aString._asString()>",
  11020. messageSends: [],
  11021. referencedClasses: []
  11022. }),
  11023. smalltalk.String);
  11024. smalltalk.addMethod(
  11025. "__eq",
  11026. smalltalk.method({
  11027. selector: "=",
  11028. category: 'comparing',
  11029. fn: function (aString){
  11030. var self=this;
  11031. return smalltalk.withContext(function($ctx1) {
  11032. if(! aString._isString || ! aString._isString()) {
  11033. return false;
  11034. }
  11035. return String(self) === String(aString)
  11036. ;
  11037. return self}, function($ctx1) {$ctx1.fill(self,"=",{aString:aString}, smalltalk.String)})},
  11038. args: ["aString"],
  11039. source: "= aString\x0a\x09<\x0a \x09if(! aString._isString || ! aString._isString()) {\x0a \x09return false;\x0a }\x0a \x09return String(self) === String(aString)\x0a >",
  11040. messageSends: [],
  11041. referencedClasses: []
  11042. }),
  11043. smalltalk.String);
  11044. smalltalk.addMethod(
  11045. "__eq_eq",
  11046. smalltalk.method({
  11047. selector: "==",
  11048. category: 'comparing',
  11049. fn: function (aString){
  11050. var self=this;
  11051. return smalltalk.withContext(function($ctx1) { var $1;
  11052. $1=_st(self).__eq(aString);
  11053. return $1;
  11054. }, function($ctx1) {$ctx1.fill(self,"==",{aString:aString}, smalltalk.String)})},
  11055. args: ["aString"],
  11056. source: "== aString\x0a\x09^self = aString",
  11057. messageSends: ["="],
  11058. referencedClasses: []
  11059. }),
  11060. smalltalk.String);
  11061. smalltalk.addMethod(
  11062. "__gt",
  11063. smalltalk.method({
  11064. selector: ">",
  11065. category: 'comparing',
  11066. fn: function (aString){
  11067. var self=this;
  11068. return smalltalk.withContext(function($ctx1) { return String(self) > aString._asString();
  11069. return self}, function($ctx1) {$ctx1.fill(self,">",{aString:aString}, smalltalk.String)})},
  11070. args: ["aString"],
  11071. source: "> aString\x0a\x09<return String(self) >> aString._asString()>",
  11072. messageSends: [],
  11073. referencedClasses: []
  11074. }),
  11075. smalltalk.String);
  11076. smalltalk.addMethod(
  11077. "__gt_eq",
  11078. smalltalk.method({
  11079. selector: ">=",
  11080. category: 'comparing',
  11081. fn: function (aString){
  11082. var self=this;
  11083. return smalltalk.withContext(function($ctx1) { return String(self) >= aString._asString();
  11084. return self}, function($ctx1) {$ctx1.fill(self,">=",{aString:aString}, smalltalk.String)})},
  11085. args: ["aString"],
  11086. source: ">= aString\x0a\x09<return String(self) >>= aString._asString()>",
  11087. messageSends: [],
  11088. referencedClasses: []
  11089. }),
  11090. smalltalk.String);
  11091. smalltalk.addMethod(
  11092. "_asJSON",
  11093. smalltalk.method({
  11094. selector: "asJSON",
  11095. category: 'converting',
  11096. fn: function (){
  11097. var self=this;
  11098. return smalltalk.withContext(function($ctx1) { var $1;
  11099. $1=self;
  11100. return $1;
  11101. }, function($ctx1) {$ctx1.fill(self,"asJSON",{}, smalltalk.String)})},
  11102. args: [],
  11103. source: "asJSON\x0a\x09^self",
  11104. messageSends: [],
  11105. referencedClasses: []
  11106. }),
  11107. smalltalk.String);
  11108. smalltalk.addMethod(
  11109. "_asJavaScriptSelector",
  11110. smalltalk.method({
  11111. selector: "asJavaScriptSelector",
  11112. category: 'converting',
  11113. fn: function (){
  11114. var self=this;
  11115. return smalltalk.withContext(function($ctx1) { var $1;
  11116. $1=_st(_st(_st(self)._asSelector())._replace_with_("^_",""))._replace_with_("_.*","");
  11117. return $1;
  11118. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSelector",{}, smalltalk.String)})},
  11119. args: [],
  11120. source: "asJavaScriptSelector\x0a\x09^(self asSelector replace: '^_' with: '') replace: '_.*' with: ''.",
  11121. messageSends: ["replace:with:", "asSelector"],
  11122. referencedClasses: []
  11123. }),
  11124. smalltalk.String);
  11125. smalltalk.addMethod(
  11126. "_asJavascript",
  11127. smalltalk.method({
  11128. selector: "asJavascript",
  11129. category: 'converting',
  11130. fn: function (){
  11131. var self=this;
  11132. return smalltalk.withContext(function($ctx1) {
  11133. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  11134. return "\"" + self.replace(/[\x00-\x1f"\\\x7f-\x9f]/g, function(ch){var c=ch.charCodeAt(0);return "\\x"+("0"+c.toString(16)).slice(-2)}) + "\"";
  11135. else
  11136. return "\"" + self + "\"";
  11137. ;
  11138. return self}, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.String)})},
  11139. args: [],
  11140. source: "asJavascript\x0a\x09<\x0a\x09\x09if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)\x0a\x09\x09\x09return \x22\x5c\x22\x22 + self.replace(/[\x5cx00-\x5cx1f\x22\x5c\x5c\x5cx7f-\x5cx9f]/g, function(ch){var c=ch.charCodeAt(0);return \x22\x5c\x5cx\x22+(\x220\x22+c.toString(16)).slice(-2)}) + \x22\x5c\x22\x22;\x0a\x09\x09else\x0a\x09\x09\x09return \x22\x5c\x22\x22 + self + \x22\x5c\x22\x22;\x0a\x09>",
  11141. messageSends: [],
  11142. referencedClasses: []
  11143. }),
  11144. smalltalk.String);
  11145. smalltalk.addMethod(
  11146. "_asLowercase",
  11147. smalltalk.method({
  11148. selector: "asLowercase",
  11149. category: 'converting',
  11150. fn: function (){
  11151. var self=this;
  11152. return smalltalk.withContext(function($ctx1) { return self.toLowerCase();
  11153. return self}, function($ctx1) {$ctx1.fill(self,"asLowercase",{}, smalltalk.String)})},
  11154. args: [],
  11155. source: "asLowercase\x0a\x09<return self.toLowerCase()>",
  11156. messageSends: [],
  11157. referencedClasses: []
  11158. }),
  11159. smalltalk.String);
  11160. smalltalk.addMethod(
  11161. "_asNumber",
  11162. smalltalk.method({
  11163. selector: "asNumber",
  11164. category: 'converting',
  11165. fn: function (){
  11166. var self=this;
  11167. return smalltalk.withContext(function($ctx1) { return Number(self);
  11168. return self}, function($ctx1) {$ctx1.fill(self,"asNumber",{}, smalltalk.String)})},
  11169. args: [],
  11170. source: "asNumber\x0a\x09<return Number(self)>",
  11171. messageSends: [],
  11172. referencedClasses: []
  11173. }),
  11174. smalltalk.String);
  11175. smalltalk.addMethod(
  11176. "_asRegexp",
  11177. smalltalk.method({
  11178. selector: "asRegexp",
  11179. category: 'converting',
  11180. fn: function (){
  11181. var self=this;
  11182. return smalltalk.withContext(function($ctx1) { var $1;
  11183. $1=_st((smalltalk.RegularExpression || RegularExpression))._fromString_(self);
  11184. return $1;
  11185. }, function($ctx1) {$ctx1.fill(self,"asRegexp",{}, smalltalk.String)})},
  11186. args: [],
  11187. source: "asRegexp\x0a\x09^ RegularExpression fromString: self",
  11188. messageSends: ["fromString:"],
  11189. referencedClasses: ["RegularExpression"]
  11190. }),
  11191. smalltalk.String);
  11192. smalltalk.addMethod(
  11193. "_asSelector",
  11194. smalltalk.method({
  11195. selector: "asSelector",
  11196. category: 'converting',
  11197. fn: function (){
  11198. var self=this;
  11199. return smalltalk.withContext(function($ctx1) { return smalltalk.selector(self);
  11200. return self}, function($ctx1) {$ctx1.fill(self,"asSelector",{}, smalltalk.String)})},
  11201. args: [],
  11202. source: "asSelector\x0a\x09<return smalltalk.selector(self)>",
  11203. messageSends: [],
  11204. referencedClasses: []
  11205. }),
  11206. smalltalk.String);
  11207. smalltalk.addMethod(
  11208. "_asString",
  11209. smalltalk.method({
  11210. selector: "asString",
  11211. category: 'converting',
  11212. fn: function (){
  11213. var self=this;
  11214. return smalltalk.withContext(function($ctx1) { var $1;
  11215. $1=self;
  11216. return $1;
  11217. }, function($ctx1) {$ctx1.fill(self,"asString",{}, smalltalk.String)})},
  11218. args: [],
  11219. source: "asString\x0a\x09^self",
  11220. messageSends: [],
  11221. referencedClasses: []
  11222. }),
  11223. smalltalk.String);
  11224. smalltalk.addMethod(
  11225. "_asSymbol",
  11226. smalltalk.method({
  11227. selector: "asSymbol",
  11228. category: 'converting',
  11229. fn: function (){
  11230. var self=this;
  11231. return smalltalk.withContext(function($ctx1) { var $1;
  11232. $1=_st((smalltalk.Symbol || Symbol))._lookup_(self);
  11233. return $1;
  11234. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{}, smalltalk.String)})},
  11235. args: [],
  11236. source: "asSymbol\x0a\x09^Symbol lookup: self",
  11237. messageSends: ["lookup:"],
  11238. referencedClasses: ["Symbol"]
  11239. }),
  11240. smalltalk.String);
  11241. smalltalk.addMethod(
  11242. "_asUppercase",
  11243. smalltalk.method({
  11244. selector: "asUppercase",
  11245. category: 'converting',
  11246. fn: function (){
  11247. var self=this;
  11248. return smalltalk.withContext(function($ctx1) { return self.toUpperCase();
  11249. return self}, function($ctx1) {$ctx1.fill(self,"asUppercase",{}, smalltalk.String)})},
  11250. args: [],
  11251. source: "asUppercase\x0a\x09<return self.toUpperCase()>",
  11252. messageSends: [],
  11253. referencedClasses: []
  11254. }),
  11255. smalltalk.String);
  11256. smalltalk.addMethod(
  11257. "_asciiValue",
  11258. smalltalk.method({
  11259. selector: "asciiValue",
  11260. category: 'accessing',
  11261. fn: function (){
  11262. var self=this;
  11263. return smalltalk.withContext(function($ctx1) { return self.charCodeAt(0);;
  11264. return self}, function($ctx1) {$ctx1.fill(self,"asciiValue",{}, smalltalk.String)})},
  11265. args: [],
  11266. source: "asciiValue\x0a\x09<return self.charCodeAt(0);>",
  11267. messageSends: [],
  11268. referencedClasses: []
  11269. }),
  11270. smalltalk.String);
  11271. smalltalk.addMethod(
  11272. "_at_ifAbsent_",
  11273. smalltalk.method({
  11274. selector: "at:ifAbsent:",
  11275. category: 'accessing',
  11276. fn: function (anIndex,aBlock){
  11277. var self=this;
  11278. return smalltalk.withContext(function($ctx1) { return String(self).charAt(anIndex - 1) || aBlock();
  11279. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock}, smalltalk.String)})},
  11280. args: ["anIndex", "aBlock"],
  11281. source: "at: anIndex ifAbsent: aBlock\x0a\x09<return String(self).charAt(anIndex - 1) || aBlock()>",
  11282. messageSends: [],
  11283. referencedClasses: []
  11284. }),
  11285. smalltalk.String);
  11286. smalltalk.addMethod(
  11287. "_copyFrom_to_",
  11288. smalltalk.method({
  11289. selector: "copyFrom:to:",
  11290. category: 'copying',
  11291. fn: function (anIndex,anotherIndex){
  11292. var self=this;
  11293. return smalltalk.withContext(function($ctx1) { return self.substring(anIndex - 1, anotherIndex);
  11294. return self}, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex}, smalltalk.String)})},
  11295. args: ["anIndex", "anotherIndex"],
  11296. source: "copyFrom: anIndex to: anotherIndex\x0a\x09<return self.substring(anIndex - 1, anotherIndex)>",
  11297. messageSends: [],
  11298. referencedClasses: []
  11299. }),
  11300. smalltalk.String);
  11301. smalltalk.addMethod(
  11302. "_deepCopy",
  11303. smalltalk.method({
  11304. selector: "deepCopy",
  11305. category: 'copying',
  11306. fn: function (){
  11307. var self=this;
  11308. return smalltalk.withContext(function($ctx1) { var $1;
  11309. $1=_st(self)._shallowCopy();
  11310. return $1;
  11311. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{}, smalltalk.String)})},
  11312. args: [],
  11313. source: "deepCopy\x0a\x09^self shallowCopy",
  11314. messageSends: ["shallowCopy"],
  11315. referencedClasses: []
  11316. }),
  11317. smalltalk.String);
  11318. smalltalk.addMethod(
  11319. "_do_",
  11320. smalltalk.method({
  11321. selector: "do:",
  11322. category: 'enumerating',
  11323. fn: function (aBlock){
  11324. var self=this;
  11325. return smalltalk.withContext(function($ctx1) { for(var i=0;i<self.length;i++){aBlock(self.charAt(i));};
  11326. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.String)})},
  11327. args: ["aBlock"],
  11328. source: "do: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock(self.charAt(i));}>",
  11329. messageSends: [],
  11330. referencedClasses: []
  11331. }),
  11332. smalltalk.String);
  11333. smalltalk.addMethod(
  11334. "_escaped",
  11335. smalltalk.method({
  11336. selector: "escaped",
  11337. category: 'accessing',
  11338. fn: function (){
  11339. var self=this;
  11340. return smalltalk.withContext(function($ctx1) { return escape(self);
  11341. return self}, function($ctx1) {$ctx1.fill(self,"escaped",{}, smalltalk.String)})},
  11342. args: [],
  11343. source: "escaped\x0a\x09<return escape(self)>",
  11344. messageSends: [],
  11345. referencedClasses: []
  11346. }),
  11347. smalltalk.String);
  11348. smalltalk.addMethod(
  11349. "_includesSubString_",
  11350. smalltalk.method({
  11351. selector: "includesSubString:",
  11352. category: 'testing',
  11353. fn: function (subString){
  11354. var self=this;
  11355. return smalltalk.withContext(function($ctx1) { return self.indexOf(subString) != -1 ;
  11356. return self}, function($ctx1) {$ctx1.fill(self,"includesSubString:",{subString:subString}, smalltalk.String)})},
  11357. args: ["subString"],
  11358. source: "includesSubString: subString\x0a\x09< return self.indexOf(subString) != -1 >",
  11359. messageSends: [],
  11360. referencedClasses: []
  11361. }),
  11362. smalltalk.String);
  11363. smalltalk.addMethod(
  11364. "_isString",
  11365. smalltalk.method({
  11366. selector: "isString",
  11367. category: 'testing',
  11368. fn: function (){
  11369. var self=this;
  11370. return smalltalk.withContext(function($ctx1) { return true;
  11371. }, function($ctx1) {$ctx1.fill(self,"isString",{}, smalltalk.String)})},
  11372. args: [],
  11373. source: "isString\x0a\x09^true",
  11374. messageSends: [],
  11375. referencedClasses: []
  11376. }),
  11377. smalltalk.String);
  11378. smalltalk.addMethod(
  11379. "_join_",
  11380. smalltalk.method({
  11381. selector: "join:",
  11382. category: 'split join',
  11383. fn: function (aCollection){
  11384. var self=this;
  11385. return smalltalk.withContext(function($ctx1) { var $1;
  11386. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  11387. return smalltalk.withContext(function($ctx2) { return _st(aCollection)._do_separatedBy_((function(each){
  11388. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(_st(each)._asString());
  11389. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  11390. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(self);
  11391. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  11392. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  11393. return $1;
  11394. }, function($ctx1) {$ctx1.fill(self,"join:",{aCollection:aCollection}, smalltalk.String)})},
  11395. args: ["aCollection"],
  11396. source: "join: aCollection \x0a\x09^ String\x0a\x09\x09streamContents: [:stream | aCollection\x0a\x09\x09\x09\x09do: [:each | stream nextPutAll: each asString] \x0a\x09\x09\x09\x09separatedBy: [stream nextPutAll: self]]",
  11397. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"],
  11398. referencedClasses: ["String"]
  11399. }),
  11400. smalltalk.String);
  11401. smalltalk.addMethod(
  11402. "_lineIndicesDo_",
  11403. smalltalk.method({
  11404. selector: "lineIndicesDo:",
  11405. category: 'split join',
  11406. fn: function (aBlock){
  11407. var self=this;
  11408. var cr,lf,start,sz,nextLF,nextCR;
  11409. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  11410. var $early={};
  11411. try {
  11412. start=(1);
  11413. sz=_st(self)._size();
  11414. cr=_st((smalltalk.String || String))._cr();
  11415. nextCR=_st(self)._indexOf_startingAt_(cr,(1));
  11416. lf=_st((smalltalk.String || String))._lf();
  11417. nextLF=_st(self)._indexOf_startingAt_(lf,(1));
  11418. _st((function(){
  11419. return smalltalk.withContext(function($ctx2) { return _st(start).__lt_eq(sz);
  11420. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  11421. return smalltalk.withContext(function($ctx2) { $1=_st(_st(nextLF).__eq((0)))._and_((function(){
  11422. return smalltalk.withContext(function($ctx3) { return _st(nextCR).__eq((0));
  11423. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  11424. if(smalltalk.assert($1)){
  11425. _st(aBlock)._value_value_value_(start,sz,sz);
  11426. $2=self;
  11427. throw $early=[$2];
  11428. };
  11429. $3=_st(_st(nextCR).__eq((0)))._or_((function(){
  11430. return smalltalk.withContext(function($ctx3) { return _st(_st((0)).__lt(nextLF))._and_((function(){
  11431. return smalltalk.withContext(function($ctx4) { return _st(nextLF).__lt(nextCR);
  11432. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  11433. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  11434. if(smalltalk.assert($3)){
  11435. _st(aBlock)._value_value_value_(start,_st(nextLF).__minus((1)),nextLF);
  11436. start=_st((1)).__plus(nextLF);
  11437. start;
  11438. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  11439. return nextLF;
  11440. } else {
  11441. $4=_st(_st((1)).__plus(nextCR)).__eq(nextLF);
  11442. if(smalltalk.assert($4)){
  11443. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextLF);
  11444. start=_st((1)).__plus(nextLF);
  11445. start;
  11446. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  11447. nextCR;
  11448. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  11449. return nextLF;
  11450. } else {
  11451. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextCR);
  11452. start=_st((1)).__plus(nextCR);
  11453. start;
  11454. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  11455. return nextCR;
  11456. };
  11457. };
  11458. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  11459. return self}
  11460. catch(e) {if(e===$early)return e[0]; throw e}
  11461. }, function($ctx1) {$ctx1.fill(self,"lineIndicesDo:",{aBlock:aBlock,cr:cr,lf:lf,start:start,sz:sz,nextLF:nextLF,nextCR:nextCR}, smalltalk.String)})},
  11462. args: ["aBlock"],
  11463. source: "lineIndicesDo: aBlock\x0a\x09\x22execute aBlock with 3 arguments for each line:\x0a\x09- start index of line\x0a\x09- end index of line without line delimiter\x0a\x09- end index of line including line delimiter(s) CR, LF or CRLF\x22\x0a\x09\x0a\x09| cr lf start sz nextLF nextCR |\x0a\x09start := 1.\x0a\x09sz := self size.\x0a\x09cr := String cr.\x0a\x09nextCR := self indexOf: cr startingAt: 1.\x0a\x09lf := String lf.\x0a\x09nextLF := self indexOf: lf startingAt: 1.\x0a\x09[ start <= sz ] whileTrue: [\x0a\x09\x09(nextLF = 0 and: [ nextCR = 0 ])\x0a\x09\x09\x09ifTrue: [ \x22No more CR, nor LF, the string is over\x22\x0a\x09\x09\x09\x09\x09aBlock value: start value: sz value: sz.\x0a\x09\x09\x09\x09\x09^self ].\x0a\x09\x09(nextCR = 0 or: [ 0 < nextLF and: [ nextLF < nextCR ] ])\x0a\x09\x09\x09ifTrue: [ \x22Found a LF\x22\x0a\x09\x09\x09\x09\x09aBlock value: start value: nextLF - 1 value: nextLF.\x0a\x09\x09\x09\x09\x09start := 1 + nextLF.\x0a\x09\x09\x09\x09\x09nextLF := self indexOf: lf startingAt: start ]\x0a\x09\x09\x09ifFalse: [ 1 + nextCR = nextLF\x0a\x09\x09\x09\x09ifTrue: [ \x22Found a CR-LF pair\x22\x0a\x09\x09\x09\x09\x09aBlock value: start value: nextCR - 1 value: nextLF.\x0a\x09\x09\x09\x09\x09start := 1 + nextLF.\x0a\x09\x09\x09\x09\x09nextCR := self indexOf: cr startingAt: start.\x0a\x09\x09\x09\x09\x09nextLF := self indexOf: lf startingAt: start ]\x0a\x09\x09\x09\x09ifFalse: [ \x22Found a CR\x22\x0a\x09\x09\x09\x09\x09aBlock value: start value: nextCR - 1 value: nextCR.\x0a\x09\x09\x09\x09\x09start := 1 + nextCR.\x0a\x09\x09\x09\x09\x09nextCR := self indexOf: cr startingAt: start ]]]",
  11464. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "ifTrue:", "value:value:value:", "and:", "=", "ifTrue:ifFalse:", "-", "+", "or:", "<", "<="],
  11465. referencedClasses: ["String"]
  11466. }),
  11467. smalltalk.String);
  11468. smalltalk.addMethod(
  11469. "_lineNumber_",
  11470. smalltalk.method({
  11471. selector: "lineNumber:",
  11472. category: 'split join',
  11473. fn: function (anIndex){
  11474. var self=this;
  11475. var lineCount;
  11476. return smalltalk.withContext(function($ctx1) { var $1,$2;
  11477. var $early={};
  11478. try {
  11479. lineCount=(0);
  11480. _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  11481. return smalltalk.withContext(function($ctx2) { lineCount=_st(lineCount).__plus((1));
  11482. $1=_st(lineCount).__eq(anIndex);
  11483. if(smalltalk.assert($1)){
  11484. $2=_st(self)._copyFrom_to_(start,endWithoutDelimiters);
  11485. throw $early=[$2];
  11486. };
  11487. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  11488. return nil;
  11489. }
  11490. catch(e) {if(e===$early)return e[0]; throw e}
  11491. }, function($ctx1) {$ctx1.fill(self,"lineNumber:",{anIndex:anIndex,lineCount:lineCount}, smalltalk.String)})},
  11492. args: ["anIndex"],
  11493. source: "lineNumber: anIndex\x0a\x09\x22Answer a string containing the characters in the given line number.\x22\x0a\x0a\x09| lineCount |\x0a\x09lineCount := 0.\x0a\x09self lineIndicesDo: [:start :endWithoutDelimiters :end |\x0a\x09\x09(lineCount := lineCount + 1) = anIndex ifTrue: [^self copyFrom: start to: endWithoutDelimiters]].\x0a\x09^nil",
  11494. messageSends: ["lineIndicesDo:", "ifTrue:", "copyFrom:to:", "=", "+"],
  11495. referencedClasses: []
  11496. }),
  11497. smalltalk.String);
  11498. smalltalk.addMethod(
  11499. "_lines",
  11500. smalltalk.method({
  11501. selector: "lines",
  11502. category: 'split join',
  11503. fn: function (){
  11504. var self=this;
  11505. var lines;
  11506. return smalltalk.withContext(function($ctx1) { var $1;
  11507. lines=_st((smalltalk.Array || Array))._new();
  11508. _st(self)._linesDo_((function(aLine){
  11509. return smalltalk.withContext(function($ctx2) { return _st(lines)._add_(aLine);
  11510. }, function($ctx2) {$ctx2.fillBlock({aLine:aLine},$ctx1)})}));
  11511. $1=lines;
  11512. return $1;
  11513. }, function($ctx1) {$ctx1.fill(self,"lines",{lines:lines}, smalltalk.String)})},
  11514. args: [],
  11515. source: "lines\x0a\x09\x22Answer an array of lines composing this receiver without the line ending delimiters.\x22\x0a\x0a\x09| lines |\x0a\x09lines := Array new.\x0a\x09self linesDo: [:aLine | lines add: aLine].\x0a\x09^lines",
  11516. messageSends: ["new", "linesDo:", "add:"],
  11517. referencedClasses: ["Array"]
  11518. }),
  11519. smalltalk.String);
  11520. smalltalk.addMethod(
  11521. "_linesDo_",
  11522. smalltalk.method({
  11523. selector: "linesDo:",
  11524. category: 'split join',
  11525. fn: function (aBlock){
  11526. var self=this;
  11527. return smalltalk.withContext(function($ctx1) { _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  11528. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_(_st(self)._copyFrom_to_(start,endWithoutDelimiters));
  11529. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  11530. return self}, function($ctx1) {$ctx1.fill(self,"linesDo:",{aBlock:aBlock}, smalltalk.String)})},
  11531. args: ["aBlock"],
  11532. source: "linesDo: aBlock\x0a\x09\x22Execute aBlock with each line in this string. The terminating line\x0a\x09delimiters CR, LF or CRLF pairs are not included in what is passed to aBlock\x22\x0a\x0a\x09self lineIndicesDo: [:start :endWithoutDelimiters :end |\x0a\x09\x09aBlock value: (self copyFrom: start to: endWithoutDelimiters)]",
  11533. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"],
  11534. referencedClasses: []
  11535. }),
  11536. smalltalk.String);
  11537. smalltalk.addMethod(
  11538. "_match_",
  11539. smalltalk.method({
  11540. selector: "match:",
  11541. category: 'regular expressions',
  11542. fn: function (aRegexp){
  11543. var self=this;
  11544. return smalltalk.withContext(function($ctx1) { return self.search(aRegexp) != -1;
  11545. return self}, function($ctx1) {$ctx1.fill(self,"match:",{aRegexp:aRegexp}, smalltalk.String)})},
  11546. args: ["aRegexp"],
  11547. source: "match: aRegexp\x0a\x09<return self.search(aRegexp) != -1>",
  11548. messageSends: [],
  11549. referencedClasses: []
  11550. }),
  11551. smalltalk.String);
  11552. smalltalk.addMethod(
  11553. "_matchesOf_",
  11554. smalltalk.method({
  11555. selector: "matchesOf:",
  11556. category: 'regular expressions',
  11557. fn: function (aRegularExpression){
  11558. var self=this;
  11559. return smalltalk.withContext(function($ctx1) { return self.match(aRegularExpression);
  11560. return self}, function($ctx1) {$ctx1.fill(self,"matchesOf:",{aRegularExpression:aRegularExpression}, smalltalk.String)})},
  11561. args: ["aRegularExpression"],
  11562. source: "matchesOf: aRegularExpression\x0a <return self.match(aRegularExpression)>",
  11563. messageSends: [],
  11564. referencedClasses: []
  11565. }),
  11566. smalltalk.String);
  11567. smalltalk.addMethod(
  11568. "_printNl",
  11569. smalltalk.method({
  11570. selector: "printNl",
  11571. category: 'printing',
  11572. fn: function (){
  11573. var self=this;
  11574. return smalltalk.withContext(function($ctx1) { console.log(self);
  11575. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{}, smalltalk.String)})},
  11576. args: [],
  11577. source: "printNl\x0a\x09<console.log(self)>",
  11578. messageSends: [],
  11579. referencedClasses: []
  11580. }),
  11581. smalltalk.String);
  11582. smalltalk.addMethod(
  11583. "_printString",
  11584. smalltalk.method({
  11585. selector: "printString",
  11586. category: 'printing',
  11587. fn: function (){
  11588. var self=this;
  11589. return smalltalk.withContext(function($ctx1) { var $1;
  11590. $1=_st(_st("'").__comma(self)).__comma("'");
  11591. return $1;
  11592. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.String)})},
  11593. args: [],
  11594. source: "printString\x0a\x09^'''', self, ''''",
  11595. messageSends: [","],
  11596. referencedClasses: []
  11597. }),
  11598. smalltalk.String);
  11599. smalltalk.addMethod(
  11600. "_replace_with_",
  11601. smalltalk.method({
  11602. selector: "replace:with:",
  11603. category: 'regular expressions',
  11604. fn: function (aString,anotherString){
  11605. var self=this;
  11606. return smalltalk.withContext(function($ctx1) { var $1;
  11607. $1=_st(self)._replaceRegexp_with_(_st((smalltalk.RegularExpression || RegularExpression))._fromString_flag_(aString,"g"),anotherString);
  11608. return $1;
  11609. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString}, smalltalk.String)})},
  11610. args: ["aString", "anotherString"],
  11611. source: "replace: aString with: anotherString\x0a\x09^self replaceRegexp: (RegularExpression fromString: aString flag: 'g') with: anotherString",
  11612. messageSends: ["replaceRegexp:with:", "fromString:flag:"],
  11613. referencedClasses: ["RegularExpression"]
  11614. }),
  11615. smalltalk.String);
  11616. smalltalk.addMethod(
  11617. "_replaceRegexp_with_",
  11618. smalltalk.method({
  11619. selector: "replaceRegexp:with:",
  11620. category: 'regular expressions',
  11621. fn: function (aRegexp,aString){
  11622. var self=this;
  11623. return smalltalk.withContext(function($ctx1) { return self.replace(aRegexp, aString);
  11624. return self}, function($ctx1) {$ctx1.fill(self,"replaceRegexp:with:",{aRegexp:aRegexp,aString:aString}, smalltalk.String)})},
  11625. args: ["aRegexp", "aString"],
  11626. source: "replaceRegexp: aRegexp with: aString\x0a\x09<return self.replace(aRegexp, aString)>",
  11627. messageSends: [],
  11628. referencedClasses: []
  11629. }),
  11630. smalltalk.String);
  11631. smalltalk.addMethod(
  11632. "_reversed",
  11633. smalltalk.method({
  11634. selector: "reversed",
  11635. category: 'converting',
  11636. fn: function (){
  11637. var self=this;
  11638. return smalltalk.withContext(function($ctx1) { return self.split("").reverse().join("");
  11639. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{}, smalltalk.String)})},
  11640. args: [],
  11641. source: "reversed\x0a\x09<return self.split(\x22\x22).reverse().join(\x22\x22)>",
  11642. messageSends: [],
  11643. referencedClasses: []
  11644. }),
  11645. smalltalk.String);
  11646. smalltalk.addMethod(
  11647. "_shallowCopy",
  11648. smalltalk.method({
  11649. selector: "shallowCopy",
  11650. category: 'copying',
  11651. fn: function (){
  11652. var self=this;
  11653. return smalltalk.withContext(function($ctx1) { var $1;
  11654. $1=_st(_st(self)._class())._fromString_(self);
  11655. return $1;
  11656. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{}, smalltalk.String)})},
  11657. args: [],
  11658. source: "shallowCopy\x0a\x09^self class fromString: self",
  11659. messageSends: ["fromString:", "class"],
  11660. referencedClasses: []
  11661. }),
  11662. smalltalk.String);
  11663. smalltalk.addMethod(
  11664. "_size",
  11665. smalltalk.method({
  11666. selector: "size",
  11667. category: 'accessing',
  11668. fn: function (){
  11669. var self=this;
  11670. return smalltalk.withContext(function($ctx1) { return self.length;
  11671. return self}, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.String)})},
  11672. args: [],
  11673. source: "size\x0a\x09<return self.length>",
  11674. messageSends: [],
  11675. referencedClasses: []
  11676. }),
  11677. smalltalk.String);
  11678. smalltalk.addMethod(
  11679. "_tokenize_",
  11680. smalltalk.method({
  11681. selector: "tokenize:",
  11682. category: 'converting',
  11683. fn: function (aString){
  11684. var self=this;
  11685. return smalltalk.withContext(function($ctx1) { return self.split(aString);
  11686. return self}, function($ctx1) {$ctx1.fill(self,"tokenize:",{aString:aString}, smalltalk.String)})},
  11687. args: ["aString"],
  11688. source: "tokenize: aString\x0a\x09<return self.split(aString)>",
  11689. messageSends: [],
  11690. referencedClasses: []
  11691. }),
  11692. smalltalk.String);
  11693. smalltalk.addMethod(
  11694. "_trimBoth",
  11695. smalltalk.method({
  11696. selector: "trimBoth",
  11697. category: 'regular expressions',
  11698. fn: function (){
  11699. var self=this;
  11700. return smalltalk.withContext(function($ctx1) { var $1;
  11701. $1=_st(self)._trimBoth_("\x5cs");
  11702. return $1;
  11703. }, function($ctx1) {$ctx1.fill(self,"trimBoth",{}, smalltalk.String)})},
  11704. args: [],
  11705. source: "trimBoth\x0a\x09^self trimBoth: '\x5cs'",
  11706. messageSends: ["trimBoth:"],
  11707. referencedClasses: []
  11708. }),
  11709. smalltalk.String);
  11710. smalltalk.addMethod(
  11711. "_trimBoth_",
  11712. smalltalk.method({
  11713. selector: "trimBoth:",
  11714. category: 'regular expressions',
  11715. fn: function (separators){
  11716. var self=this;
  11717. return smalltalk.withContext(function($ctx1) { var $1;
  11718. $1=_st(_st(self)._trimLeft_(separators))._trimRight_(separators);
  11719. return $1;
  11720. }, function($ctx1) {$ctx1.fill(self,"trimBoth:",{separators:separators}, smalltalk.String)})},
  11721. args: ["separators"],
  11722. source: "trimBoth: separators\x0a\x0a\x09^(self trimLeft: separators) trimRight: separators",
  11723. messageSends: ["trimRight:", "trimLeft:"],
  11724. referencedClasses: []
  11725. }),
  11726. smalltalk.String);
  11727. smalltalk.addMethod(
  11728. "_trimLeft",
  11729. smalltalk.method({
  11730. selector: "trimLeft",
  11731. category: 'regular expressions',
  11732. fn: function (){
  11733. var self=this;
  11734. return smalltalk.withContext(function($ctx1) { var $1;
  11735. $1=_st(self)._trimLeft_("\x5cs");
  11736. return $1;
  11737. }, function($ctx1) {$ctx1.fill(self,"trimLeft",{}, smalltalk.String)})},
  11738. args: [],
  11739. source: "trimLeft\x0a\x09^self trimLeft: '\x5cs'",
  11740. messageSends: ["trimLeft:"],
  11741. referencedClasses: []
  11742. }),
  11743. smalltalk.String);
  11744. smalltalk.addMethod(
  11745. "_trimLeft_",
  11746. smalltalk.method({
  11747. selector: "trimLeft:",
  11748. category: 'regular expressions',
  11749. fn: function (separators){
  11750. var self=this;
  11751. return smalltalk.withContext(function($ctx1) { var $1;
  11752. $1=_st(self)._replaceRegexp_with_(_st((smalltalk.RegularExpression || RegularExpression))._fromString_flag_(_st(_st("^[").__comma(separators)).__comma("]+"),"g"),"");
  11753. return $1;
  11754. }, function($ctx1) {$ctx1.fill(self,"trimLeft:",{separators:separators}, smalltalk.String)})},
  11755. args: ["separators"],
  11756. source: "trimLeft: separators\x0a\x0a\x09^self replaceRegexp: (RegularExpression fromString: '^[', separators, ']+' flag: 'g') with: ''",
  11757. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","],
  11758. referencedClasses: ["RegularExpression"]
  11759. }),
  11760. smalltalk.String);
  11761. smalltalk.addMethod(
  11762. "_trimRight",
  11763. smalltalk.method({
  11764. selector: "trimRight",
  11765. category: 'regular expressions',
  11766. fn: function (){
  11767. var self=this;
  11768. return smalltalk.withContext(function($ctx1) { var $1;
  11769. $1=_st(self)._trimRight_("\x5cs");
  11770. return $1;
  11771. }, function($ctx1) {$ctx1.fill(self,"trimRight",{}, smalltalk.String)})},
  11772. args: [],
  11773. source: "trimRight\x0a\x09^self trimRight: '\x5cs'",
  11774. messageSends: ["trimRight:"],
  11775. referencedClasses: []
  11776. }),
  11777. smalltalk.String);
  11778. smalltalk.addMethod(
  11779. "_trimRight_",
  11780. smalltalk.method({
  11781. selector: "trimRight:",
  11782. category: 'regular expressions',
  11783. fn: function (separators){
  11784. var self=this;
  11785. return smalltalk.withContext(function($ctx1) { var $1;
  11786. $1=_st(self)._replaceRegexp_with_(_st((smalltalk.RegularExpression || RegularExpression))._fromString_flag_(_st(_st("[").__comma(separators)).__comma("]+$"),"g"),"");
  11787. return $1;
  11788. }, function($ctx1) {$ctx1.fill(self,"trimRight:",{separators:separators}, smalltalk.String)})},
  11789. args: ["separators"],
  11790. source: "trimRight: separators\x0a\x0a\x09^self replaceRegexp: (RegularExpression fromString: '[', separators, ']+$' flag: 'g') with: ''",
  11791. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","],
  11792. referencedClasses: ["RegularExpression"]
  11793. }),
  11794. smalltalk.String);
  11795. smalltalk.addMethod(
  11796. "_unescaped",
  11797. smalltalk.method({
  11798. selector: "unescaped",
  11799. category: 'accessing',
  11800. fn: function (){
  11801. var self=this;
  11802. return smalltalk.withContext(function($ctx1) { return unescape(self);
  11803. return self}, function($ctx1) {$ctx1.fill(self,"unescaped",{}, smalltalk.String)})},
  11804. args: [],
  11805. source: "unescaped\x0a\x09<return unescape(self)>",
  11806. messageSends: [],
  11807. referencedClasses: []
  11808. }),
  11809. smalltalk.String);
  11810. smalltalk.addMethod(
  11811. "_withIndexDo_",
  11812. smalltalk.method({
  11813. selector: "withIndexDo:",
  11814. category: 'enumerating',
  11815. fn: function (aBlock){
  11816. var self=this;
  11817. return smalltalk.withContext(function($ctx1) { for(var i=0;i<self.length;i++){aBlock(self.charAt(i), i+1);};
  11818. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock}, smalltalk.String)})},
  11819. args: ["aBlock"],
  11820. source: "withIndexDo: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock(self.charAt(i), i+1);}>",
  11821. messageSends: [],
  11822. referencedClasses: []
  11823. }),
  11824. smalltalk.String);
  11825. smalltalk.addMethod(
  11826. "_cr",
  11827. smalltalk.method({
  11828. selector: "cr",
  11829. category: 'accessing',
  11830. fn: function (){
  11831. var self=this;
  11832. return smalltalk.withContext(function($ctx1) { return '\r';
  11833. return self}, function($ctx1) {$ctx1.fill(self,"cr",{}, smalltalk.String.klass)})},
  11834. args: [],
  11835. source: "cr\x0a\x09<return '\x5cr'>",
  11836. messageSends: [],
  11837. referencedClasses: []
  11838. }),
  11839. smalltalk.String.klass);
  11840. smalltalk.addMethod(
  11841. "_crlf",
  11842. smalltalk.method({
  11843. selector: "crlf",
  11844. category: 'accessing',
  11845. fn: function (){
  11846. var self=this;
  11847. return smalltalk.withContext(function($ctx1) { return '\r\n';
  11848. return self}, function($ctx1) {$ctx1.fill(self,"crlf",{}, smalltalk.String.klass)})},
  11849. args: [],
  11850. source: "crlf\x0a\x09<return '\x5cr\x5cn'>",
  11851. messageSends: [],
  11852. referencedClasses: []
  11853. }),
  11854. smalltalk.String.klass);
  11855. smalltalk.addMethod(
  11856. "_fromCharCode_",
  11857. smalltalk.method({
  11858. selector: "fromCharCode:",
  11859. category: 'instance creation',
  11860. fn: function (anInteger){
  11861. var self=this;
  11862. return smalltalk.withContext(function($ctx1) { return String.fromCharCode(anInteger);
  11863. return self}, function($ctx1) {$ctx1.fill(self,"fromCharCode:",{anInteger:anInteger}, smalltalk.String.klass)})},
  11864. args: ["anInteger"],
  11865. source: "fromCharCode: anInteger\x0a\x09<return String.fromCharCode(anInteger)>",
  11866. messageSends: [],
  11867. referencedClasses: []
  11868. }),
  11869. smalltalk.String.klass);
  11870. smalltalk.addMethod(
  11871. "_fromString_",
  11872. smalltalk.method({
  11873. selector: "fromString:",
  11874. category: 'instance creation',
  11875. fn: function (aString){
  11876. var self=this;
  11877. return smalltalk.withContext(function($ctx1) { return new self.fn(aString);
  11878. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString}, smalltalk.String.klass)})},
  11879. args: ["aString"],
  11880. source: "fromString: aString\x0a\x09 <return new self.fn(aString)>",
  11881. messageSends: [],
  11882. referencedClasses: []
  11883. }),
  11884. smalltalk.String.klass);
  11885. smalltalk.addMethod(
  11886. "_lf",
  11887. smalltalk.method({
  11888. selector: "lf",
  11889. category: 'accessing',
  11890. fn: function (){
  11891. var self=this;
  11892. return smalltalk.withContext(function($ctx1) { return '\n';
  11893. return self}, function($ctx1) {$ctx1.fill(self,"lf",{}, smalltalk.String.klass)})},
  11894. args: [],
  11895. source: "lf\x0a\x09<return '\x5cn'>",
  11896. messageSends: [],
  11897. referencedClasses: []
  11898. }),
  11899. smalltalk.String.klass);
  11900. smalltalk.addMethod(
  11901. "_space",
  11902. smalltalk.method({
  11903. selector: "space",
  11904. category: 'accessing',
  11905. fn: function (){
  11906. var self=this;
  11907. return smalltalk.withContext(function($ctx1) { return ' ';
  11908. return self}, function($ctx1) {$ctx1.fill(self,"space",{}, smalltalk.String.klass)})},
  11909. args: [],
  11910. source: "space\x0a\x09<return ' '>",
  11911. messageSends: [],
  11912. referencedClasses: []
  11913. }),
  11914. smalltalk.String.klass);
  11915. smalltalk.addMethod(
  11916. "_streamClass",
  11917. smalltalk.method({
  11918. selector: "streamClass",
  11919. category: 'accessing',
  11920. fn: function (){
  11921. var self=this;
  11922. return smalltalk.withContext(function($ctx1) { var $1;
  11923. $1=(smalltalk.StringStream || StringStream);
  11924. return $1;
  11925. }, function($ctx1) {$ctx1.fill(self,"streamClass",{}, smalltalk.String.klass)})},
  11926. args: [],
  11927. source: "streamClass\x0a\x09 ^StringStream",
  11928. messageSends: [],
  11929. referencedClasses: ["StringStream"]
  11930. }),
  11931. smalltalk.String.klass);
  11932. smalltalk.addMethod(
  11933. "_streamContents_",
  11934. smalltalk.method({
  11935. selector: "streamContents:",
  11936. category: 'instance creation',
  11937. fn: function (blockWithArg){
  11938. var self=this;
  11939. var stream;
  11940. return smalltalk.withContext(function($ctx1) { var $1;
  11941. stream=_st(_st(self)._streamClass())._on_(_st((smalltalk.String || String))._new());
  11942. _st(blockWithArg)._value_(stream);
  11943. $1=_st(stream)._contents();
  11944. return $1;
  11945. }, function($ctx1) {$ctx1.fill(self,"streamContents:",{blockWithArg:blockWithArg,stream:stream}, smalltalk.String.klass)})},
  11946. args: ["blockWithArg"],
  11947. source: "streamContents: blockWithArg\x0a\x09|stream|\x0a\x09stream := (self streamClass on: String new).\x0a\x09blockWithArg value: stream.\x0a\x09^ stream contents",
  11948. messageSends: ["on:", "new", "streamClass", "value:", "contents"],
  11949. referencedClasses: ["String"]
  11950. }),
  11951. smalltalk.String.klass);
  11952. smalltalk.addMethod(
  11953. "_tab",
  11954. smalltalk.method({
  11955. selector: "tab",
  11956. category: 'accessing',
  11957. fn: function (){
  11958. var self=this;
  11959. return smalltalk.withContext(function($ctx1) { return '\t';
  11960. return self}, function($ctx1) {$ctx1.fill(self,"tab",{}, smalltalk.String.klass)})},
  11961. args: [],
  11962. source: "tab\x0a\x09<return '\x5ct'>",
  11963. messageSends: [],
  11964. referencedClasses: []
  11965. }),
  11966. smalltalk.String.klass);
  11967. smalltalk.addMethod(
  11968. "_value_",
  11969. smalltalk.method({
  11970. selector: "value:",
  11971. category: 'instance creation',
  11972. fn: function (aUTFCharCode){
  11973. var self=this;
  11974. return smalltalk.withContext(function($ctx1) { return String.fromCharCode(aUTFCharCode);;
  11975. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode}, smalltalk.String.klass)})},
  11976. args: ["aUTFCharCode"],
  11977. source: "value: aUTFCharCode\x0a\x0a\x09<return String.fromCharCode(aUTFCharCode);>",
  11978. messageSends: [],
  11979. referencedClasses: []
  11980. }),
  11981. smalltalk.String.klass);
  11982. smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
  11983. smalltalk.addMethod(
  11984. "__lt",
  11985. smalltalk.method({
  11986. selector: "<",
  11987. category: 'comparing',
  11988. fn: function (aSymbol){
  11989. var self=this;
  11990. return smalltalk.withContext(function($ctx1) { var $1;
  11991. $1=_st(_st(self)._asString()).__lt(_st(aSymbol)._asString());
  11992. return $1;
  11993. }, function($ctx1) {$ctx1.fill(self,"<",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  11994. args: ["aSymbol"],
  11995. source: "< aSymbol\x0a\x09^self asString < aSymbol asString",
  11996. messageSends: ["<", "asString"],
  11997. referencedClasses: []
  11998. }),
  11999. smalltalk.Symbol);
  12000. smalltalk.addMethod(
  12001. "__lt_eq",
  12002. smalltalk.method({
  12003. selector: "<=",
  12004. category: 'comparing',
  12005. fn: function (aSymbol){
  12006. var self=this;
  12007. return smalltalk.withContext(function($ctx1) { var $1;
  12008. $1=_st(_st(self)._asString()).__lt_eq(_st(aSymbol)._asString());
  12009. return $1;
  12010. }, function($ctx1) {$ctx1.fill(self,"<=",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  12011. args: ["aSymbol"],
  12012. source: "<= aSymbol\x0a\x09^self asString <= aSymbol asString",
  12013. messageSends: ["<=", "asString"],
  12014. referencedClasses: []
  12015. }),
  12016. smalltalk.Symbol);
  12017. smalltalk.addMethod(
  12018. "__eq",
  12019. smalltalk.method({
  12020. selector: "=",
  12021. category: 'comparing',
  12022. fn: function (aSymbol){
  12023. var self=this;
  12024. return smalltalk.withContext(function($ctx1) { var $1,$2;
  12025. $1=_st(_st(aSymbol)._class()).__eq(_st(self)._class());
  12026. if(! smalltalk.assert($1)){
  12027. return false;
  12028. };
  12029. $2=_st(_st(self)._asString()).__eq(_st(aSymbol)._asString());
  12030. return $2;
  12031. }, function($ctx1) {$ctx1.fill(self,"=",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  12032. args: ["aSymbol"],
  12033. source: "= aSymbol\x0a\x09aSymbol class = self class ifFalse: [^false].\x0a\x09^self asString = aSymbol asString",
  12034. messageSends: ["ifFalse:", "=", "class", "asString"],
  12035. referencedClasses: []
  12036. }),
  12037. smalltalk.Symbol);
  12038. smalltalk.addMethod(
  12039. "__gt",
  12040. smalltalk.method({
  12041. selector: ">",
  12042. category: 'comparing',
  12043. fn: function (aSymbol){
  12044. var self=this;
  12045. return smalltalk.withContext(function($ctx1) { var $1;
  12046. $1=_st(_st(self)._asString()).__gt(_st(aSymbol)._asString());
  12047. return $1;
  12048. }, function($ctx1) {$ctx1.fill(self,">",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  12049. args: ["aSymbol"],
  12050. source: "> aSymbol\x0a\x09^self asString > aSymbol asString",
  12051. messageSends: [">", "asString"],
  12052. referencedClasses: []
  12053. }),
  12054. smalltalk.Symbol);
  12055. smalltalk.addMethod(
  12056. "__gt_eq",
  12057. smalltalk.method({
  12058. selector: ">=",
  12059. category: 'comparing',
  12060. fn: function (aSymbol){
  12061. var self=this;
  12062. return smalltalk.withContext(function($ctx1) { var $1;
  12063. $1=_st(_st(self)._asString()).__gt_eq(_st(aSymbol)._asString());
  12064. return $1;
  12065. }, function($ctx1) {$ctx1.fill(self,">=",{aSymbol:aSymbol}, smalltalk.Symbol)})},
  12066. args: ["aSymbol"],
  12067. source: ">= aSymbol\x0a\x09^self asString >= aSymbol asString",
  12068. messageSends: [">=", "asString"],
  12069. referencedClasses: []
  12070. }),
  12071. smalltalk.Symbol);
  12072. smalltalk.addMethod(
  12073. "_asJSON",
  12074. smalltalk.method({
  12075. selector: "asJSON",
  12076. category: 'converting',
  12077. fn: function (){
  12078. var self=this;
  12079. return smalltalk.withContext(function($ctx1) { var $1;
  12080. $1=_st(_st(self)._asString())._asJSON();
  12081. return $1;
  12082. }, function($ctx1) {$ctx1.fill(self,"asJSON",{}, smalltalk.Symbol)})},
  12083. args: [],
  12084. source: "asJSON\x0a\x09^self asString asJSON",
  12085. messageSends: ["asJSON", "asString"],
  12086. referencedClasses: []
  12087. }),
  12088. smalltalk.Symbol);
  12089. smalltalk.addMethod(
  12090. "_asJavascript",
  12091. smalltalk.method({
  12092. selector: "asJavascript",
  12093. category: 'converting',
  12094. fn: function (){
  12095. var self=this;
  12096. return smalltalk.withContext(function($ctx1) { var $1;
  12097. $1=_st(_st("smalltalk.symbolFor(").__comma(_st(_st(self)._asString())._asJavascript())).__comma(")");
  12098. return $1;
  12099. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Symbol)})},
  12100. args: [],
  12101. source: "asJavascript\x0a\x09^'smalltalk.symbolFor(', self asString asJavascript, ')'",
  12102. messageSends: [",", "asJavascript", "asString"],
  12103. referencedClasses: []
  12104. }),
  12105. smalltalk.Symbol);
  12106. smalltalk.addMethod(
  12107. "_asSelector",
  12108. smalltalk.method({
  12109. selector: "asSelector",
  12110. category: 'converting',
  12111. fn: function (){
  12112. var self=this;
  12113. return smalltalk.withContext(function($ctx1) { var $1;
  12114. $1=_st(_st(self)._asString())._asSelector();
  12115. return $1;
  12116. }, function($ctx1) {$ctx1.fill(self,"asSelector",{}, smalltalk.Symbol)})},
  12117. args: [],
  12118. source: "asSelector\x0a\x09^self asString asSelector",
  12119. messageSends: ["asSelector", "asString"],
  12120. referencedClasses: []
  12121. }),
  12122. smalltalk.Symbol);
  12123. smalltalk.addMethod(
  12124. "_asString",
  12125. smalltalk.method({
  12126. selector: "asString",
  12127. category: 'converting',
  12128. fn: function (){
  12129. var self=this;
  12130. return smalltalk.withContext(function($ctx1) { return self.value;
  12131. return self}, function($ctx1) {$ctx1.fill(self,"asString",{}, smalltalk.Symbol)})},
  12132. args: [],
  12133. source: "asString\x0a\x09<return self.value>",
  12134. messageSends: [],
  12135. referencedClasses: []
  12136. }),
  12137. smalltalk.Symbol);
  12138. smalltalk.addMethod(
  12139. "_asSuperSelector",
  12140. smalltalk.method({
  12141. selector: "asSuperSelector",
  12142. category: 'converting',
  12143. fn: function (){
  12144. var self=this;
  12145. return smalltalk.withContext(function($ctx1) { var $1;
  12146. $1=_st(_st(self)._asString())._asSuperSelector();
  12147. return $1;
  12148. }, function($ctx1) {$ctx1.fill(self,"asSuperSelector",{}, smalltalk.Symbol)})},
  12149. args: [],
  12150. source: "asSuperSelector\x0a\x09^self asString asSuperSelector",
  12151. messageSends: ["asSuperSelector", "asString"],
  12152. referencedClasses: []
  12153. }),
  12154. smalltalk.Symbol);
  12155. smalltalk.addMethod(
  12156. "_asSymbol",
  12157. smalltalk.method({
  12158. selector: "asSymbol",
  12159. category: 'converting',
  12160. fn: function (){
  12161. var self=this;
  12162. return smalltalk.withContext(function($ctx1) { var $1;
  12163. $1=self;
  12164. return $1;
  12165. }, function($ctx1) {$ctx1.fill(self,"asSymbol",{}, smalltalk.Symbol)})},
  12166. args: [],
  12167. source: "asSymbol\x0a\x09^self",
  12168. messageSends: [],
  12169. referencedClasses: []
  12170. }),
  12171. smalltalk.Symbol);
  12172. smalltalk.addMethod(
  12173. "_at_ifAbsent_",
  12174. smalltalk.method({
  12175. selector: "at:ifAbsent:",
  12176. category: 'accessing',
  12177. fn: function (anIndex,aBlock){
  12178. var self=this;
  12179. return smalltalk.withContext(function($ctx1) { var $1;
  12180. $1=_st(_st(self)._asString())._at_ifAbsent_(anIndex,aBlock);
  12181. return $1;
  12182. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{anIndex:anIndex,aBlock:aBlock}, smalltalk.Symbol)})},
  12183. args: ["anIndex", "aBlock"],
  12184. source: "at: anIndex ifAbsent: aBlock\x0a\x09^self asString at: anIndex ifAbsent: aBlock",
  12185. messageSends: ["at:ifAbsent:", "asString"],
  12186. referencedClasses: []
  12187. }),
  12188. smalltalk.Symbol);
  12189. smalltalk.addMethod(
  12190. "_collect_",
  12191. smalltalk.method({
  12192. selector: "collect:",
  12193. category: 'enumerating',
  12194. fn: function (aBlock){
  12195. var self=this;
  12196. return smalltalk.withContext(function($ctx1) { var $1;
  12197. $1=_st(_st(_st(self)._asString())._collect_(aBlock))._asSymbol();
  12198. return $1;
  12199. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock}, smalltalk.Symbol)})},
  12200. args: ["aBlock"],
  12201. source: "collect: aBlock\x0a\x09^ (self asString collect: aBlock) asSymbol",
  12202. messageSends: ["asSymbol", "collect:", "asString"],
  12203. referencedClasses: []
  12204. }),
  12205. smalltalk.Symbol);
  12206. smalltalk.addMethod(
  12207. "_copyFrom_to_",
  12208. smalltalk.method({
  12209. selector: "copyFrom:to:",
  12210. category: 'copying',
  12211. fn: function (anIndex,anotherIndex){
  12212. var self=this;
  12213. return smalltalk.withContext(function($ctx1) { var $1;
  12214. $1=_st(_st(self)._class())._fromString_(_st(_st(self)._asString())._copyFrom_to_(anIndex,anotherIndex));
  12215. return $1;
  12216. }, function($ctx1) {$ctx1.fill(self,"copyFrom:to:",{anIndex:anIndex,anotherIndex:anotherIndex}, smalltalk.Symbol)})},
  12217. args: ["anIndex", "anotherIndex"],
  12218. source: "copyFrom: anIndex to: anotherIndex\x0a\x09^self class fromString: (self asString copyFrom: anIndex to: anotherIndex)",
  12219. messageSends: ["fromString:", "copyFrom:to:", "asString", "class"],
  12220. referencedClasses: []
  12221. }),
  12222. smalltalk.Symbol);
  12223. smalltalk.addMethod(
  12224. "_deepCopy",
  12225. smalltalk.method({
  12226. selector: "deepCopy",
  12227. category: 'copying',
  12228. fn: function (){
  12229. var self=this;
  12230. return smalltalk.withContext(function($ctx1) { var $1;
  12231. $1=self;
  12232. return $1;
  12233. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{}, smalltalk.Symbol)})},
  12234. args: [],
  12235. source: "deepCopy\x0a\x09^self",
  12236. messageSends: [],
  12237. referencedClasses: []
  12238. }),
  12239. smalltalk.Symbol);
  12240. smalltalk.addMethod(
  12241. "_detect_",
  12242. smalltalk.method({
  12243. selector: "detect:",
  12244. category: 'enumerating',
  12245. fn: function (aBlock){
  12246. var self=this;
  12247. return smalltalk.withContext(function($ctx1) { var $1;
  12248. $1=_st(_st(self)._asString())._detect_(aBlock);
  12249. return $1;
  12250. }, function($ctx1) {$ctx1.fill(self,"detect:",{aBlock:aBlock}, smalltalk.Symbol)})},
  12251. args: ["aBlock"],
  12252. source: "detect: aBlock\x0a\x09^ self asString detect: aBlock",
  12253. messageSends: ["detect:", "asString"],
  12254. referencedClasses: []
  12255. }),
  12256. smalltalk.Symbol);
  12257. smalltalk.addMethod(
  12258. "_do_",
  12259. smalltalk.method({
  12260. selector: "do:",
  12261. category: 'enumerating',
  12262. fn: function (aBlock){
  12263. var self=this;
  12264. return smalltalk.withContext(function($ctx1) { _st(_st(self)._asString())._do_(aBlock);
  12265. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.Symbol)})},
  12266. args: ["aBlock"],
  12267. source: "do: aBlock\x0a\x09self asString do: aBlock",
  12268. messageSends: ["do:", "asString"],
  12269. referencedClasses: []
  12270. }),
  12271. smalltalk.Symbol);
  12272. smalltalk.addMethod(
  12273. "_isSymbol",
  12274. smalltalk.method({
  12275. selector: "isSymbol",
  12276. category: 'printing',
  12277. fn: function (){
  12278. var self=this;
  12279. return smalltalk.withContext(function($ctx1) { return true;
  12280. }, function($ctx1) {$ctx1.fill(self,"isSymbol",{}, smalltalk.Symbol)})},
  12281. args: [],
  12282. source: "isSymbol\x0a\x09^true",
  12283. messageSends: [],
  12284. referencedClasses: []
  12285. }),
  12286. smalltalk.Symbol);
  12287. smalltalk.addMethod(
  12288. "_printString",
  12289. smalltalk.method({
  12290. selector: "printString",
  12291. category: 'printing',
  12292. fn: function (){
  12293. var self=this;
  12294. return smalltalk.withContext(function($ctx1) { var $1;
  12295. $1=_st("#").__comma(_st(self)._asString());
  12296. return $1;
  12297. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Symbol)})},
  12298. args: [],
  12299. source: "printString\x0a\x09^'#', self asString",
  12300. messageSends: [",", "asString"],
  12301. referencedClasses: []
  12302. }),
  12303. smalltalk.Symbol);
  12304. smalltalk.addMethod(
  12305. "_select_",
  12306. smalltalk.method({
  12307. selector: "select:",
  12308. category: 'enumerating',
  12309. fn: function (aBlock){
  12310. var self=this;
  12311. return smalltalk.withContext(function($ctx1) { var $1;
  12312. $1=_st(_st(_st(self)._asString())._select_(aBlock))._asSymbol();
  12313. return $1;
  12314. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock}, smalltalk.Symbol)})},
  12315. args: ["aBlock"],
  12316. source: "select: aBlock\x0a\x09^ (self asString select: aBlock) asSymbol",
  12317. messageSends: ["asSymbol", "select:", "asString"],
  12318. referencedClasses: []
  12319. }),
  12320. smalltalk.Symbol);
  12321. smalltalk.addMethod(
  12322. "_shallowCopy",
  12323. smalltalk.method({
  12324. selector: "shallowCopy",
  12325. category: 'copying',
  12326. fn: function (){
  12327. var self=this;
  12328. return smalltalk.withContext(function($ctx1) { var $1;
  12329. $1=self;
  12330. return $1;
  12331. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{}, smalltalk.Symbol)})},
  12332. args: [],
  12333. source: "shallowCopy\x0a\x09^self",
  12334. messageSends: [],
  12335. referencedClasses: []
  12336. }),
  12337. smalltalk.Symbol);
  12338. smalltalk.addMethod(
  12339. "_size",
  12340. smalltalk.method({
  12341. selector: "size",
  12342. category: 'accessing',
  12343. fn: function (){
  12344. var self=this;
  12345. return smalltalk.withContext(function($ctx1) { var $1;
  12346. $1=_st(_st(self)._asString())._size();
  12347. return $1;
  12348. }, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Symbol)})},
  12349. args: [],
  12350. source: "size\x0a\x09^self asString size",
  12351. messageSends: ["size", "asString"],
  12352. referencedClasses: []
  12353. }),
  12354. smalltalk.Symbol);
  12355. smalltalk.addMethod(
  12356. "_value_",
  12357. smalltalk.method({
  12358. selector: "value:",
  12359. category: 'evaluating',
  12360. fn: function (anObject){
  12361. var self=this;
  12362. return smalltalk.withContext(function($ctx1) { var $1;
  12363. $1=_st(anObject)._perform_(self);
  12364. return $1;
  12365. }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject}, smalltalk.Symbol)})},
  12366. args: ["anObject"],
  12367. source: "value: anObject \x0a\x09^anObject perform: self",
  12368. messageSends: ["perform:"],
  12369. referencedClasses: []
  12370. }),
  12371. smalltalk.Symbol);
  12372. smalltalk.addMethod(
  12373. "_withIndexDo_",
  12374. smalltalk.method({
  12375. selector: "withIndexDo:",
  12376. category: 'enumerating',
  12377. fn: function (aBlock){
  12378. var self=this;
  12379. return smalltalk.withContext(function($ctx1) { _st(_st(self)._asString())._withIndexDo_(aBlock);
  12380. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock}, smalltalk.Symbol)})},
  12381. args: ["aBlock"],
  12382. source: "withIndexDo: aBlock\x0a\x09self asString withIndexDo: aBlock",
  12383. messageSends: ["withIndexDo:", "asString"],
  12384. referencedClasses: []
  12385. }),
  12386. smalltalk.Symbol);
  12387. smalltalk.addMethod(
  12388. "_basicNew",
  12389. smalltalk.method({
  12390. selector: "basicNew",
  12391. category: 'instance creation',
  12392. fn: function (){
  12393. var self=this;
  12394. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  12395. return self}, function($ctx1) {$ctx1.fill(self,"basicNew",{}, smalltalk.Symbol.klass)})},
  12396. args: [],
  12397. source: "basicNew\x0a\x09self shouldNotImplement",
  12398. messageSends: ["shouldNotImplement"],
  12399. referencedClasses: []
  12400. }),
  12401. smalltalk.Symbol.klass);
  12402. smalltalk.addMethod(
  12403. "_fromString_",
  12404. smalltalk.method({
  12405. selector: "fromString:",
  12406. category: 'instance creation',
  12407. fn: function (aString){
  12408. var self=this;
  12409. return smalltalk.withContext(function($ctx1) { var $1;
  12410. $1=_st(self)._lookup_(aString);
  12411. return $1;
  12412. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString}, smalltalk.Symbol.klass)})},
  12413. args: ["aString"],
  12414. source: "fromString: aString\x0a\x09^self lookup: aString",
  12415. messageSends: ["lookup:"],
  12416. referencedClasses: []
  12417. }),
  12418. smalltalk.Symbol.klass);
  12419. smalltalk.addMethod(
  12420. "_lookup_",
  12421. smalltalk.method({
  12422. selector: "lookup:",
  12423. category: 'instance creation',
  12424. fn: function (aString){
  12425. var self=this;
  12426. return smalltalk.withContext(function($ctx1) { return smalltalk.symbolFor(aString);;
  12427. return self}, function($ctx1) {$ctx1.fill(self,"lookup:",{aString:aString}, smalltalk.Symbol.klass)})},
  12428. args: ["aString"],
  12429. source: "lookup: aString\x0a\x09<return smalltalk.symbolFor(aString);>",
  12430. messageSends: [],
  12431. referencedClasses: []
  12432. }),
  12433. smalltalk.Symbol.klass);
  12434. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  12435. smalltalk.addMethod(
  12436. "__eq",
  12437. smalltalk.method({
  12438. selector: "=",
  12439. category: 'comparing',
  12440. fn: function (aCollection){
  12441. var self=this;
  12442. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  12443. var $early={};
  12444. try {
  12445. $1=_st(_st(self)._class()).__eq(_st(aCollection)._class());
  12446. if(! smalltalk.assert($1)){
  12447. return false;
  12448. };
  12449. $2=_st(_st(self)._size()).__eq(_st(aCollection)._size());
  12450. if(! smalltalk.assert($2)){
  12451. return false;
  12452. };
  12453. _st(self)._do_((function(each){
  12454. return smalltalk.withContext(function($ctx2) { $3=_st(aCollection)._includes_(each);
  12455. if(! smalltalk.assert($3)){
  12456. throw $early=[false];
  12457. };
  12458. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  12459. return true;
  12460. }
  12461. catch(e) {if(e===$early)return e[0]; throw e}
  12462. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection}, smalltalk.Set)})},
  12463. args: ["aCollection"],
  12464. source: "= aCollection\x0a\x09self class = aCollection class ifFalse: [ ^ false ].\x0a self size = aCollection size ifFalse: [ ^ false ].\x0a\x09self do: [:each | (aCollection includes: each) ifFalse: [ ^ false ] ].\x0a\x09^ true",
  12465. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"],
  12466. referencedClasses: []
  12467. }),
  12468. smalltalk.Set);
  12469. smalltalk.addMethod(
  12470. "_add_",
  12471. smalltalk.method({
  12472. selector: "add:",
  12473. category: 'adding/removing',
  12474. fn: function (anObject){
  12475. var self=this;
  12476. return smalltalk.withContext(function($ctx1) {
  12477. var found;
  12478. for(var i=0; i < self['@elements'].length; i++) {
  12479. if(anObject == self['@elements'][i]) {
  12480. found = true;
  12481. break;
  12482. }
  12483. }
  12484. if(!found) {self['@elements'].push(anObject)}
  12485. ;
  12486. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject}, smalltalk.Set)})},
  12487. args: ["anObject"],
  12488. source: "add: anObject\x0a\x09<\x0a\x09\x09var found;\x0a\x09\x09for(var i=0; i < self['@elements'].length; i++) {\x0a\x09\x09\x09if(anObject == self['@elements'][i]) {\x0a\x09\x09\x09\x09found = true;\x0a\x09\x09\x09\x09break;\x0a\x09\x09\x09}\x0a\x09\x09}\x0a\x09\x09if(!found) {self['@elements'].push(anObject)}\x0a\x09>",
  12489. messageSends: [],
  12490. referencedClasses: []
  12491. }),
  12492. smalltalk.Set);
  12493. smalltalk.addMethod(
  12494. "_asArray",
  12495. smalltalk.method({
  12496. selector: "asArray",
  12497. category: 'converting',
  12498. fn: function (){
  12499. var self=this;
  12500. return smalltalk.withContext(function($ctx1) { var $1;
  12501. $1=_st(self["@elements"])._copy();
  12502. return $1;
  12503. }, function($ctx1) {$ctx1.fill(self,"asArray",{}, smalltalk.Set)})},
  12504. args: [],
  12505. source: "asArray\x0a\x09^elements copy",
  12506. messageSends: ["copy"],
  12507. referencedClasses: []
  12508. }),
  12509. smalltalk.Set);
  12510. smalltalk.addMethod(
  12511. "_collect_",
  12512. smalltalk.method({
  12513. selector: "collect:",
  12514. category: 'enumerating',
  12515. fn: function (aBlock){
  12516. var self=this;
  12517. return smalltalk.withContext(function($ctx1) { var $1;
  12518. $1=_st(_st(self)._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  12519. return $1;
  12520. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock}, smalltalk.Set)})},
  12521. args: ["aBlock"],
  12522. source: "collect: aBlock\x0a\x09^self class withAll: (elements collect: aBlock)",
  12523. messageSends: ["withAll:", "collect:", "class"],
  12524. referencedClasses: []
  12525. }),
  12526. smalltalk.Set);
  12527. smalltalk.addMethod(
  12528. "_detect_ifNone_",
  12529. smalltalk.method({
  12530. selector: "detect:ifNone:",
  12531. category: 'enumerating',
  12532. fn: function (aBlock,anotherBlock){
  12533. var self=this;
  12534. return smalltalk.withContext(function($ctx1) { var $1;
  12535. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  12536. return $1;
  12537. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.Set)})},
  12538. args: ["aBlock", "anotherBlock"],
  12539. source: "detect: aBlock ifNone: anotherBlock\x0a\x09^elements detect: aBlock ifNone: anotherBlock",
  12540. messageSends: ["detect:ifNone:"],
  12541. referencedClasses: []
  12542. }),
  12543. smalltalk.Set);
  12544. smalltalk.addMethod(
  12545. "_do_",
  12546. smalltalk.method({
  12547. selector: "do:",
  12548. category: 'enumerating',
  12549. fn: function (aBlock){
  12550. var self=this;
  12551. return smalltalk.withContext(function($ctx1) { _st(self["@elements"])._do_(aBlock);
  12552. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.Set)})},
  12553. args: ["aBlock"],
  12554. source: "do: aBlock\x0a\x09elements do: aBlock",
  12555. messageSends: ["do:"],
  12556. referencedClasses: []
  12557. }),
  12558. smalltalk.Set);
  12559. smalltalk.addMethod(
  12560. "_includes_",
  12561. smalltalk.method({
  12562. selector: "includes:",
  12563. category: 'testing',
  12564. fn: function (anObject){
  12565. var self=this;
  12566. return smalltalk.withContext(function($ctx1) { var $1;
  12567. $1=_st(self["@elements"])._includes_(anObject);
  12568. return $1;
  12569. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject}, smalltalk.Set)})},
  12570. args: ["anObject"],
  12571. source: "includes: anObject\x0a\x09^elements includes: anObject",
  12572. messageSends: ["includes:"],
  12573. referencedClasses: []
  12574. }),
  12575. smalltalk.Set);
  12576. smalltalk.addMethod(
  12577. "_initialize",
  12578. smalltalk.method({
  12579. selector: "initialize",
  12580. category: 'initialization',
  12581. fn: function (){
  12582. var self=this;
  12583. return smalltalk.withContext(function($ctx1) { smalltalk.Collection.fn.prototype._initialize.apply(_st(self), []);
  12584. self["@elements"]=[];
  12585. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Set)})},
  12586. args: [],
  12587. source: "initialize\x0a\x09super initialize.\x0a\x09elements := #()",
  12588. messageSends: ["initialize"],
  12589. referencedClasses: []
  12590. }),
  12591. smalltalk.Set);
  12592. smalltalk.addMethod(
  12593. "_remove_",
  12594. smalltalk.method({
  12595. selector: "remove:",
  12596. category: 'adding/removing',
  12597. fn: function (anObject){
  12598. var self=this;
  12599. return smalltalk.withContext(function($ctx1) { _st(self["@elements"])._remove_(anObject);
  12600. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject}, smalltalk.Set)})},
  12601. args: ["anObject"],
  12602. source: "remove: anObject\x0a\x09elements remove: anObject",
  12603. messageSends: ["remove:"],
  12604. referencedClasses: []
  12605. }),
  12606. smalltalk.Set);
  12607. smalltalk.addMethod(
  12608. "_select_",
  12609. smalltalk.method({
  12610. selector: "select:",
  12611. category: 'enumerating',
  12612. fn: function (aBlock){
  12613. var self=this;
  12614. var collection;
  12615. return smalltalk.withContext(function($ctx1) { var $1,$2;
  12616. collection=_st(_st(self)._class())._new();
  12617. _st(self)._do_((function(each){
  12618. return smalltalk.withContext(function($ctx2) { $1=_st(aBlock)._value_(each);
  12619. if(smalltalk.assert($1)){
  12620. return _st(collection)._add_(each);
  12621. };
  12622. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  12623. $2=collection;
  12624. return $2;
  12625. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection}, smalltalk.Set)})},
  12626. args: ["aBlock"],
  12627. source: "select: aBlock\x0a\x09| collection |\x0a\x09collection := self class new. \x0a\x09self do: [:each |\x0a\x09\x09(aBlock value: each) ifTrue: [\x0a\x09\x09\x09collection add: each]].\x0a\x09^collection",
  12628. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"],
  12629. referencedClasses: []
  12630. }),
  12631. smalltalk.Set);
  12632. smalltalk.addMethod(
  12633. "_size",
  12634. smalltalk.method({
  12635. selector: "size",
  12636. category: 'accessing',
  12637. fn: function (){
  12638. var self=this;
  12639. return smalltalk.withContext(function($ctx1) { var $1;
  12640. $1=_st(self["@elements"])._size();
  12641. return $1;
  12642. }, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Set)})},
  12643. args: [],
  12644. source: "size\x0a\x09^elements size",
  12645. messageSends: ["size"],
  12646. referencedClasses: []
  12647. }),
  12648. smalltalk.Set);
  12649. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  12650. smalltalk.Queue.comment="A Queue am a one-sided queue.\x0a\x0aA Queue uses two OrderedCollections inside,\x0a`read` is at the front, is not modified and only read using `readIndex`.\x0a`write` is at the back and is appended new items.\x0aWhen `read` is exhausted, `write` is promoted to `read` and new `write` is created.\x0a\x0aAs a consequence, no data moving is done by the Queue; write appending may do data moving\x0awhen growing `write`, but this is left to engine to implement as good as it chooses to."
  12651. smalltalk.addMethod(
  12652. "_back_",
  12653. smalltalk.method({
  12654. selector: "back:",
  12655. category: 'accessing',
  12656. fn: function (anObject){
  12657. var self=this;
  12658. return smalltalk.withContext(function($ctx1) { _st(self["@write"])._add_(anObject);
  12659. return self}, function($ctx1) {$ctx1.fill(self,"back:",{anObject:anObject}, smalltalk.Queue)})},
  12660. args: ["anObject"],
  12661. source: "back: anObject\x0a\x09write add: anObject",
  12662. messageSends: ["add:"],
  12663. referencedClasses: []
  12664. }),
  12665. smalltalk.Queue);
  12666. smalltalk.addMethod(
  12667. "_front",
  12668. smalltalk.method({
  12669. selector: "front",
  12670. category: 'accessing',
  12671. fn: function (){
  12672. var self=this;
  12673. return smalltalk.withContext(function($ctx1) { var $1;
  12674. $1=_st(self)._frontIfAbsent_((function(){
  12675. return smalltalk.withContext(function($ctx2) { return _st(self)._error_("Cannot read from empty Queue.");
  12676. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  12677. return $1;
  12678. }, function($ctx1) {$ctx1.fill(self,"front",{}, smalltalk.Queue)})},
  12679. args: [],
  12680. source: "front\x0a ^self frontIfAbsent: [ self error: 'Cannot read from empty Queue.' ]",
  12681. messageSends: ["frontIfAbsent:", "error:"],
  12682. referencedClasses: []
  12683. }),
  12684. smalltalk.Queue);
  12685. smalltalk.addMethod(
  12686. "_frontIfAbsent_",
  12687. smalltalk.method({
  12688. selector: "frontIfAbsent:",
  12689. category: 'accessing',
  12690. fn: function (aBlock){
  12691. var self=this;
  12692. var result;
  12693. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  12694. var $early={};
  12695. try {
  12696. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  12697. return smalltalk.withContext(function($ctx2) { $1=_st(self["@write"])._isEmpty();
  12698. if(smalltalk.assert($1)){
  12699. $2=_st(self["@readIndex"]).__gt((1));
  12700. if(smalltalk.assert($2)){
  12701. self["@read"]=[];
  12702. self["@read"];
  12703. self["@readIndex"]=(1);
  12704. self["@readIndex"];
  12705. };
  12706. $3=_st(aBlock)._value();
  12707. throw $early=[$3];
  12708. };
  12709. self["@read"]=self["@write"];
  12710. self["@read"];
  12711. self["@readIndex"]=(1);
  12712. self["@readIndex"];
  12713. self["@write"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  12714. self["@write"];
  12715. return _st(self["@read"])._first();
  12716. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  12717. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  12718. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  12719. $4=result;
  12720. return $4;
  12721. }
  12722. catch(e) {if(e===$early)return e[0]; throw e}
  12723. }, function($ctx1) {$ctx1.fill(self,"frontIfAbsent:",{aBlock:aBlock,result:result}, smalltalk.Queue)})},
  12724. args: ["aBlock"],
  12725. source: "frontIfAbsent: aBlock\x0a\x09| result |\x0a\x09result := read at: readIndex ifAbsent: [\x0a\x09\x09write isEmpty ifTrue: [\x0a\x09\x09\x09readIndex > 1 ifTrue: [ read := #(). readIndex := 1 ].\x0a\x09\x09\x09^aBlock value ].\x0a \x09read := write.\x0a \x09readIndex := 1.\x0a \x09write := OrderedCollection new.\x0a \x09read first ].\x0a read at: readIndex put: nil.\x0a readIndex := readIndex + 1.\x0a ^result",
  12726. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"],
  12727. referencedClasses: ["OrderedCollection"]
  12728. }),
  12729. smalltalk.Queue);
  12730. smalltalk.addMethod(
  12731. "_initialize",
  12732. smalltalk.method({
  12733. selector: "initialize",
  12734. category: 'initialization',
  12735. fn: function (){
  12736. var self=this;
  12737. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  12738. self["@read"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  12739. self["@write"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  12740. self["@readIndex"]=(1);
  12741. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Queue)})},
  12742. args: [],
  12743. source: "initialize\x0a\x09super initialize.\x0a\x09read := OrderedCollection new.\x0a write := OrderedCollection new.\x0a readIndex := 1",
  12744. messageSends: ["initialize", "new"],
  12745. referencedClasses: ["OrderedCollection"]
  12746. }),
  12747. smalltalk.Queue);
  12748. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  12749. smalltalk.addMethod(
  12750. "_compile_",
  12751. smalltalk.method({
  12752. selector: "compile:",
  12753. category: 'evaluating',
  12754. fn: function (aString){
  12755. var self=this;
  12756. return smalltalk.withContext(function($ctx1) { return self.compile(aString);
  12757. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString}, smalltalk.RegularExpression)})},
  12758. args: ["aString"],
  12759. source: "compile: aString\x0a\x09<return self.compile(aString)>",
  12760. messageSends: [],
  12761. referencedClasses: []
  12762. }),
  12763. smalltalk.RegularExpression);
  12764. smalltalk.addMethod(
  12765. "_exec_",
  12766. smalltalk.method({
  12767. selector: "exec:",
  12768. category: 'evaluating',
  12769. fn: function (aString){
  12770. var self=this;
  12771. return smalltalk.withContext(function($ctx1) { return self.exec(aString) || nil;
  12772. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString}, smalltalk.RegularExpression)})},
  12773. args: ["aString"],
  12774. source: "exec: aString\x0a\x09<return self.exec(aString) || nil>",
  12775. messageSends: [],
  12776. referencedClasses: []
  12777. }),
  12778. smalltalk.RegularExpression);
  12779. smalltalk.addMethod(
  12780. "_test_",
  12781. smalltalk.method({
  12782. selector: "test:",
  12783. category: 'evaluating',
  12784. fn: function (aString){
  12785. var self=this;
  12786. return smalltalk.withContext(function($ctx1) { return self.test(aString);
  12787. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString}, smalltalk.RegularExpression)})},
  12788. args: ["aString"],
  12789. source: "test: aString\x0a\x09<return self.test(aString)>",
  12790. messageSends: [],
  12791. referencedClasses: []
  12792. }),
  12793. smalltalk.RegularExpression);
  12794. smalltalk.addMethod(
  12795. "_fromString_",
  12796. smalltalk.method({
  12797. selector: "fromString:",
  12798. category: 'instance creation',
  12799. fn: function (aString){
  12800. var self=this;
  12801. return smalltalk.withContext(function($ctx1) { var $1;
  12802. $1=_st(self)._fromString_flag_(aString,"");
  12803. return $1;
  12804. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString}, smalltalk.RegularExpression.klass)})},
  12805. args: ["aString"],
  12806. source: "fromString: aString\x0a\x09 ^self fromString: aString flag: ''",
  12807. messageSends: ["fromString:flag:"],
  12808. referencedClasses: []
  12809. }),
  12810. smalltalk.RegularExpression.klass);
  12811. smalltalk.addMethod(
  12812. "_fromString_flag_",
  12813. smalltalk.method({
  12814. selector: "fromString:flag:",
  12815. category: 'instance creation',
  12816. fn: function (aString,anotherString){
  12817. var self=this;
  12818. return smalltalk.withContext(function($ctx1) { return new RegExp(aString, anotherString);
  12819. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString}, smalltalk.RegularExpression.klass)})},
  12820. args: ["aString", "anotherString"],
  12821. source: "fromString: aString flag: anotherString\x0a\x09<return new RegExp(aString, anotherString)>",
  12822. messageSends: [],
  12823. referencedClasses: []
  12824. }),
  12825. smalltalk.RegularExpression.klass);
  12826. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  12827. smalltalk.addMethod(
  12828. "_atEnd",
  12829. smalltalk.method({
  12830. selector: "atEnd",
  12831. category: 'testing',
  12832. fn: function (){
  12833. var self=this;
  12834. return smalltalk.withContext(function($ctx1) { var $1;
  12835. $1=_st(_st(self)._position()).__eq(_st(self)._size());
  12836. return $1;
  12837. }, function($ctx1) {$ctx1.fill(self,"atEnd",{}, smalltalk.Stream)})},
  12838. args: [],
  12839. source: "atEnd\x0a\x09^self position = self size",
  12840. messageSends: ["=", "size", "position"],
  12841. referencedClasses: []
  12842. }),
  12843. smalltalk.Stream);
  12844. smalltalk.addMethod(
  12845. "_atStart",
  12846. smalltalk.method({
  12847. selector: "atStart",
  12848. category: 'testing',
  12849. fn: function (){
  12850. var self=this;
  12851. return smalltalk.withContext(function($ctx1) { var $1;
  12852. $1=_st(_st(self)._position()).__eq((0));
  12853. return $1;
  12854. }, function($ctx1) {$ctx1.fill(self,"atStart",{}, smalltalk.Stream)})},
  12855. args: [],
  12856. source: "atStart\x0a\x09^self position = 0",
  12857. messageSends: ["=", "position"],
  12858. referencedClasses: []
  12859. }),
  12860. smalltalk.Stream);
  12861. smalltalk.addMethod(
  12862. "_close",
  12863. smalltalk.method({
  12864. selector: "close",
  12865. category: 'actions',
  12866. fn: function (){
  12867. var self=this;
  12868. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"close",{}, smalltalk.Stream)})},
  12869. args: [],
  12870. source: "close",
  12871. messageSends: [],
  12872. referencedClasses: []
  12873. }),
  12874. smalltalk.Stream);
  12875. smalltalk.addMethod(
  12876. "_collection",
  12877. smalltalk.method({
  12878. selector: "collection",
  12879. category: 'accessing',
  12880. fn: function (){
  12881. var self=this;
  12882. return smalltalk.withContext(function($ctx1) { var $1;
  12883. $1=self["@collection"];
  12884. return $1;
  12885. }, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.Stream)})},
  12886. args: [],
  12887. source: "collection\x0a\x09^collection",
  12888. messageSends: [],
  12889. referencedClasses: []
  12890. }),
  12891. smalltalk.Stream);
  12892. smalltalk.addMethod(
  12893. "_contents",
  12894. smalltalk.method({
  12895. selector: "contents",
  12896. category: 'accessing',
  12897. fn: function (){
  12898. var self=this;
  12899. return smalltalk.withContext(function($ctx1) { var $1;
  12900. $1=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._streamSize());
  12901. return $1;
  12902. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.Stream)})},
  12903. args: [],
  12904. source: "contents\x0a\x09^self collection\x0a\x09 copyFrom: 1 \x0a\x09 to: self streamSize",
  12905. messageSends: ["copyFrom:to:", "streamSize", "collection"],
  12906. referencedClasses: []
  12907. }),
  12908. smalltalk.Stream);
  12909. smalltalk.addMethod(
  12910. "_do_",
  12911. smalltalk.method({
  12912. selector: "do:",
  12913. category: 'enumerating',
  12914. fn: function (aBlock){
  12915. var self=this;
  12916. return smalltalk.withContext(function($ctx1) { _st((function(){
  12917. return smalltalk.withContext(function($ctx2) { return _st(self)._atEnd();
  12918. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  12919. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_(_st(self)._next());
  12920. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  12921. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.Stream)})},
  12922. args: ["aBlock"],
  12923. source: "do: aBlock\x0a\x09[self atEnd] whileFalse: [aBlock value: self next]",
  12924. messageSends: ["whileFalse:", "value:", "next", "atEnd"],
  12925. referencedClasses: []
  12926. }),
  12927. smalltalk.Stream);
  12928. smalltalk.addMethod(
  12929. "_flush",
  12930. smalltalk.method({
  12931. selector: "flush",
  12932. category: 'actions',
  12933. fn: function (){
  12934. var self=this;
  12935. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"flush",{}, smalltalk.Stream)})},
  12936. args: [],
  12937. source: "flush",
  12938. messageSends: [],
  12939. referencedClasses: []
  12940. }),
  12941. smalltalk.Stream);
  12942. smalltalk.addMethod(
  12943. "_isEmpty",
  12944. smalltalk.method({
  12945. selector: "isEmpty",
  12946. category: 'testing',
  12947. fn: function (){
  12948. var self=this;
  12949. return smalltalk.withContext(function($ctx1) { var $1;
  12950. $1=_st(_st(self)._size()).__eq((0));
  12951. return $1;
  12952. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{}, smalltalk.Stream)})},
  12953. args: [],
  12954. source: "isEmpty\x0a\x09^self size = 0",
  12955. messageSends: ["=", "size"],
  12956. referencedClasses: []
  12957. }),
  12958. smalltalk.Stream);
  12959. smalltalk.addMethod(
  12960. "_next",
  12961. smalltalk.method({
  12962. selector: "next",
  12963. category: 'reading',
  12964. fn: function (){
  12965. var self=this;
  12966. return smalltalk.withContext(function($ctx1) { var $2,$1;
  12967. $2=_st(self)._atEnd();
  12968. if(smalltalk.assert($2)){
  12969. $1=nil;
  12970. } else {
  12971. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  12972. $1=_st(self["@collection"])._at_(_st(self)._position());
  12973. };
  12974. return $1;
  12975. }, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.Stream)})},
  12976. args: [],
  12977. source: "next\x0a\x09^self atEnd \x0a\x09\x09ifTrue: [nil]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09self position: self position + 1. \x0a\x09\x09\x09collection at: self position]",
  12978. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"],
  12979. referencedClasses: []
  12980. }),
  12981. smalltalk.Stream);
  12982. smalltalk.addMethod(
  12983. "_next_",
  12984. smalltalk.method({
  12985. selector: "next:",
  12986. category: 'reading',
  12987. fn: function (anInteger){
  12988. var self=this;
  12989. var tempCollection;
  12990. return smalltalk.withContext(function($ctx1) { var $1,$2;
  12991. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  12992. _st(anInteger)._timesRepeat_((function(){
  12993. return smalltalk.withContext(function($ctx2) { $1=_st(self)._atEnd();
  12994. if(! smalltalk.assert($1)){
  12995. return _st(tempCollection)._add_(_st(self)._next());
  12996. };
  12997. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  12998. $2=tempCollection;
  12999. return $2;
  13000. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection}, smalltalk.Stream)})},
  13001. args: ["anInteger"],
  13002. source: "next: anInteger\x0a\x09| tempCollection |\x0a\x09tempCollection := self collection class new.\x0a\x09anInteger timesRepeat: [\x0a\x09 self atEnd ifFalse: [\x0a\x09\x09tempCollection add: self next]].\x0a\x09^tempCollection",
  13003. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"],
  13004. referencedClasses: []
  13005. }),
  13006. smalltalk.Stream);
  13007. smalltalk.addMethod(
  13008. "_nextPut_",
  13009. smalltalk.method({
  13010. selector: "nextPut:",
  13011. category: 'writing',
  13012. fn: function (anObject){
  13013. var self=this;
  13014. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  13015. _st(_st(self)._collection())._at_put_(_st(self)._position(),anObject);
  13016. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  13017. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject}, smalltalk.Stream)})},
  13018. args: ["anObject"],
  13019. source: "nextPut: anObject\x0a\x09self position: self position + 1.\x0a\x09self collection at: self position put: anObject.\x0a\x09self setStreamSize: (self streamSize max: self position)",
  13020. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"],
  13021. referencedClasses: []
  13022. }),
  13023. smalltalk.Stream);
  13024. smalltalk.addMethod(
  13025. "_nextPutAll_",
  13026. smalltalk.method({
  13027. selector: "nextPutAll:",
  13028. category: 'writing',
  13029. fn: function (aCollection){
  13030. var self=this;
  13031. return smalltalk.withContext(function($ctx1) { _st(aCollection)._do_((function(each){
  13032. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPut_(each);
  13033. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  13034. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection}, smalltalk.Stream)})},
  13035. args: ["aCollection"],
  13036. source: "nextPutAll: aCollection\x0a\x09aCollection do: [:each |\x0a\x09 self nextPut: each]",
  13037. messageSends: ["do:", "nextPut:"],
  13038. referencedClasses: []
  13039. }),
  13040. smalltalk.Stream);
  13041. smalltalk.addMethod(
  13042. "_peek",
  13043. smalltalk.method({
  13044. selector: "peek",
  13045. category: 'reading',
  13046. fn: function (){
  13047. var self=this;
  13048. return smalltalk.withContext(function($ctx1) { var $2,$1;
  13049. $2=_st(self)._atEnd();
  13050. if(! smalltalk.assert($2)){
  13051. $1=_st(_st(self)._collection())._at_(_st(_st(self)._position()).__plus((1)));
  13052. };
  13053. return $1;
  13054. }, function($ctx1) {$ctx1.fill(self,"peek",{}, smalltalk.Stream)})},
  13055. args: [],
  13056. source: "peek\x0a\x09^self atEnd ifFalse: [\x0a\x09 self collection at: self position + 1]",
  13057. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"],
  13058. referencedClasses: []
  13059. }),
  13060. smalltalk.Stream);
  13061. smalltalk.addMethod(
  13062. "_position",
  13063. smalltalk.method({
  13064. selector: "position",
  13065. category: 'accessing',
  13066. fn: function (){
  13067. var self=this;
  13068. return smalltalk.withContext(function($ctx1) { var $2,$1;
  13069. $2=self["@position"];
  13070. if(($receiver = $2) == nil || $receiver == undefined){
  13071. self["@position"]=(0);
  13072. $1=self["@position"];
  13073. } else {
  13074. $1=$2;
  13075. };
  13076. return $1;
  13077. }, function($ctx1) {$ctx1.fill(self,"position",{}, smalltalk.Stream)})},
  13078. args: [],
  13079. source: "position\x0a\x09^position ifNil: [position := 0]",
  13080. messageSends: ["ifNil:"],
  13081. referencedClasses: []
  13082. }),
  13083. smalltalk.Stream);
  13084. smalltalk.addMethod(
  13085. "_position_",
  13086. smalltalk.method({
  13087. selector: "position:",
  13088. category: 'accessing',
  13089. fn: function (anInteger){
  13090. var self=this;
  13091. return smalltalk.withContext(function($ctx1) { self["@position"]=anInteger;
  13092. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger}, smalltalk.Stream)})},
  13093. args: ["anInteger"],
  13094. source: "position: anInteger\x0a\x09position := anInteger",
  13095. messageSends: [],
  13096. referencedClasses: []
  13097. }),
  13098. smalltalk.Stream);
  13099. smalltalk.addMethod(
  13100. "_reset",
  13101. smalltalk.method({
  13102. selector: "reset",
  13103. category: 'actions',
  13104. fn: function (){
  13105. var self=this;
  13106. return smalltalk.withContext(function($ctx1) { _st(self)._position_((0));
  13107. return self}, function($ctx1) {$ctx1.fill(self,"reset",{}, smalltalk.Stream)})},
  13108. args: [],
  13109. source: "reset\x0a\x09self position: 0",
  13110. messageSends: ["position:"],
  13111. referencedClasses: []
  13112. }),
  13113. smalltalk.Stream);
  13114. smalltalk.addMethod(
  13115. "_resetContents",
  13116. smalltalk.method({
  13117. selector: "resetContents",
  13118. category: 'actions',
  13119. fn: function (){
  13120. var self=this;
  13121. return smalltalk.withContext(function($ctx1) { _st(self)._reset();
  13122. _st(self)._setStreamSize_((0));
  13123. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{}, smalltalk.Stream)})},
  13124. args: [],
  13125. source: "resetContents\x0a\x09self reset.\x0a\x09self setStreamSize: 0",
  13126. messageSends: ["reset", "setStreamSize:"],
  13127. referencedClasses: []
  13128. }),
  13129. smalltalk.Stream);
  13130. smalltalk.addMethod(
  13131. "_setCollection_",
  13132. smalltalk.method({
  13133. selector: "setCollection:",
  13134. category: 'accessing',
  13135. fn: function (aCollection){
  13136. var self=this;
  13137. return smalltalk.withContext(function($ctx1) { self["@collection"]=aCollection;
  13138. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection}, smalltalk.Stream)})},
  13139. args: ["aCollection"],
  13140. source: "setCollection: aCollection\x0a\x09collection := aCollection",
  13141. messageSends: [],
  13142. referencedClasses: []
  13143. }),
  13144. smalltalk.Stream);
  13145. smalltalk.addMethod(
  13146. "_setStreamSize_",
  13147. smalltalk.method({
  13148. selector: "setStreamSize:",
  13149. category: 'accessing',
  13150. fn: function (anInteger){
  13151. var self=this;
  13152. return smalltalk.withContext(function($ctx1) { self["@streamSize"]=anInteger;
  13153. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger}, smalltalk.Stream)})},
  13154. args: ["anInteger"],
  13155. source: "setStreamSize: anInteger\x0a\x09streamSize := anInteger",
  13156. messageSends: [],
  13157. referencedClasses: []
  13158. }),
  13159. smalltalk.Stream);
  13160. smalltalk.addMethod(
  13161. "_setToEnd",
  13162. smalltalk.method({
  13163. selector: "setToEnd",
  13164. category: 'positioning',
  13165. fn: function (){
  13166. var self=this;
  13167. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(self)._size());
  13168. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{}, smalltalk.Stream)})},
  13169. args: [],
  13170. source: "setToEnd\x0a\x09self position: self size",
  13171. messageSends: ["position:", "size"],
  13172. referencedClasses: []
  13173. }),
  13174. smalltalk.Stream);
  13175. smalltalk.addMethod(
  13176. "_size",
  13177. smalltalk.method({
  13178. selector: "size",
  13179. category: 'accessing',
  13180. fn: function (){
  13181. var self=this;
  13182. return smalltalk.withContext(function($ctx1) { var $1;
  13183. $1=_st(self)._streamSize();
  13184. return $1;
  13185. }, function($ctx1) {$ctx1.fill(self,"size",{}, smalltalk.Stream)})},
  13186. args: [],
  13187. source: "size\x0a\x09^self streamSize",
  13188. messageSends: ["streamSize"],
  13189. referencedClasses: []
  13190. }),
  13191. smalltalk.Stream);
  13192. smalltalk.addMethod(
  13193. "_skip_",
  13194. smalltalk.method({
  13195. selector: "skip:",
  13196. category: 'positioning',
  13197. fn: function (anInteger){
  13198. var self=this;
  13199. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(_st(_st(self)._position()).__plus(anInteger))._min_max_(_st(self)._size(),(0)));
  13200. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger}, smalltalk.Stream)})},
  13201. args: ["anInteger"],
  13202. source: "skip: anInteger\x0a\x09self position: ((self position + anInteger) min: self size max: 0)",
  13203. messageSends: ["position:", "min:max:", "size", "+", "position"],
  13204. referencedClasses: []
  13205. }),
  13206. smalltalk.Stream);
  13207. smalltalk.addMethod(
  13208. "_streamSize",
  13209. smalltalk.method({
  13210. selector: "streamSize",
  13211. category: 'accessing',
  13212. fn: function (){
  13213. var self=this;
  13214. return smalltalk.withContext(function($ctx1) { var $1;
  13215. $1=self["@streamSize"];
  13216. return $1;
  13217. }, function($ctx1) {$ctx1.fill(self,"streamSize",{}, smalltalk.Stream)})},
  13218. args: [],
  13219. source: "streamSize\x0a\x09^streamSize",
  13220. messageSends: [],
  13221. referencedClasses: []
  13222. }),
  13223. smalltalk.Stream);
  13224. smalltalk.addMethod(
  13225. "_on_",
  13226. smalltalk.method({
  13227. selector: "on:",
  13228. category: 'instance creation',
  13229. fn: function (aCollection){
  13230. var self=this;
  13231. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  13232. $2=_st(self)._new();
  13233. _st($2)._setCollection_(aCollection);
  13234. _st($2)._setStreamSize_(_st(aCollection)._size());
  13235. $3=_st($2)._yourself();
  13236. $1=$3;
  13237. return $1;
  13238. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection}, smalltalk.Stream.klass)})},
  13239. args: ["aCollection"],
  13240. source: "on: aCollection\x0a\x09 ^self new \x0a\x09\x09setCollection: aCollection;\x0a\x09\x09setStreamSize: aCollection size;\x0a\x09\x09yourself",
  13241. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"],
  13242. referencedClasses: []
  13243. }),
  13244. smalltalk.Stream.klass);
  13245. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  13246. smalltalk.addMethod(
  13247. "_cr",
  13248. smalltalk.method({
  13249. selector: "cr",
  13250. category: 'writing',
  13251. fn: function (){
  13252. var self=this;
  13253. return smalltalk.withContext(function($ctx1) { var $1;
  13254. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._cr());
  13255. return $1;
  13256. }, function($ctx1) {$ctx1.fill(self,"cr",{}, smalltalk.StringStream)})},
  13257. args: [],
  13258. source: "cr\x0a\x09^self nextPutAll: String cr",
  13259. messageSends: ["nextPutAll:", "cr"],
  13260. referencedClasses: ["String"]
  13261. }),
  13262. smalltalk.StringStream);
  13263. smalltalk.addMethod(
  13264. "_crlf",
  13265. smalltalk.method({
  13266. selector: "crlf",
  13267. category: 'writing',
  13268. fn: function (){
  13269. var self=this;
  13270. return smalltalk.withContext(function($ctx1) { var $1;
  13271. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._crlf());
  13272. return $1;
  13273. }, function($ctx1) {$ctx1.fill(self,"crlf",{}, smalltalk.StringStream)})},
  13274. args: [],
  13275. source: "crlf\x0a\x09^self nextPutAll: String crlf",
  13276. messageSends: ["nextPutAll:", "crlf"],
  13277. referencedClasses: ["String"]
  13278. }),
  13279. smalltalk.StringStream);
  13280. smalltalk.addMethod(
  13281. "_lf",
  13282. smalltalk.method({
  13283. selector: "lf",
  13284. category: 'writing',
  13285. fn: function (){
  13286. var self=this;
  13287. return smalltalk.withContext(function($ctx1) { var $1;
  13288. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._lf());
  13289. return $1;
  13290. }, function($ctx1) {$ctx1.fill(self,"lf",{}, smalltalk.StringStream)})},
  13291. args: [],
  13292. source: "lf\x0a\x09^self nextPutAll: String lf",
  13293. messageSends: ["nextPutAll:", "lf"],
  13294. referencedClasses: ["String"]
  13295. }),
  13296. smalltalk.StringStream);
  13297. smalltalk.addMethod(
  13298. "_next_",
  13299. smalltalk.method({
  13300. selector: "next:",
  13301. category: 'reading',
  13302. fn: function (anInteger){
  13303. var self=this;
  13304. var tempCollection;
  13305. return smalltalk.withContext(function($ctx1) { var $1,$2;
  13306. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  13307. _st(anInteger)._timesRepeat_((function(){
  13308. return smalltalk.withContext(function($ctx2) { $1=_st(self)._atEnd();
  13309. if(! smalltalk.assert($1)){
  13310. tempCollection=_st(tempCollection).__comma(_st(self)._next());
  13311. return tempCollection;
  13312. };
  13313. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  13314. $2=tempCollection;
  13315. return $2;
  13316. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection}, smalltalk.StringStream)})},
  13317. args: ["anInteger"],
  13318. source: "next: anInteger\x0a\x09| tempCollection |\x0a\x09tempCollection := self collection class new.\x0a\x09anInteger timesRepeat: [\x0a\x09 self atEnd ifFalse: [\x0a\x09\x09tempCollection := tempCollection, self next]].\x0a\x09^tempCollection",
  13319. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"],
  13320. referencedClasses: []
  13321. }),
  13322. smalltalk.StringStream);
  13323. smalltalk.addMethod(
  13324. "_nextPut_",
  13325. smalltalk.method({
  13326. selector: "nextPut:",
  13327. category: 'writing',
  13328. fn: function (aString){
  13329. var self=this;
  13330. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutAll_(aString);
  13331. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString}, smalltalk.StringStream)})},
  13332. args: ["aString"],
  13333. source: "nextPut: aString\x0a\x09self nextPutAll: aString",
  13334. messageSends: ["nextPutAll:"],
  13335. referencedClasses: []
  13336. }),
  13337. smalltalk.StringStream);
  13338. smalltalk.addMethod(
  13339. "_nextPutAll_",
  13340. smalltalk.method({
  13341. selector: "nextPutAll:",
  13342. category: 'writing',
  13343. fn: function (aString){
  13344. var self=this;
  13345. return smalltalk.withContext(function($ctx1) { _st(self)._setCollection_(_st(_st(_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._position())).__comma(aString)).__comma(_st(_st(self)._collection())._copyFrom_to_(_st(_st(_st(self)._position()).__plus((1))).__plus(_st(aString)._size()),_st(_st(self)._collection())._size())));
  13346. _st(self)._position_(_st(_st(self)._position()).__plus(_st(aString)._size()));
  13347. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  13348. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString}, smalltalk.StringStream)})},
  13349. args: ["aString"],
  13350. source: "nextPutAll: aString\x0a\x09self setCollection: \x0a\x09 (self collection copyFrom: 1 to: self position),\x0a\x09 aString,\x0a\x09 (self collection copyFrom: (self position + 1 + aString size) to: self collection size).\x0a\x09self position: self position + aString size.\x0a\x09self setStreamSize: (self streamSize max: self position)",
  13351. messageSends: ["setCollection:", ",", "copyFrom:to:", "+", "size", "position", "collection", "position:", "setStreamSize:", "max:", "streamSize"],
  13352. referencedClasses: []
  13353. }),
  13354. smalltalk.StringStream);
  13355. smalltalk.addMethod(
  13356. "_space",
  13357. smalltalk.method({
  13358. selector: "space",
  13359. category: 'writing',
  13360. fn: function (){
  13361. var self=this;
  13362. return smalltalk.withContext(function($ctx1) { _st(self)._nextPut_(" ");
  13363. return self}, function($ctx1) {$ctx1.fill(self,"space",{}, smalltalk.StringStream)})},
  13364. args: [],
  13365. source: "space\x0a\x09self nextPut: ' '",
  13366. messageSends: ["nextPut:"],
  13367. referencedClasses: []
  13368. }),
  13369. smalltalk.StringStream);
  13370. smalltalk.addPackage('Kernel-Exceptions', {});
  13371. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
  13372. smalltalk.Error.comment="From the ANSI standard:\x0a\x0aThis protocol describes the behavior of instances of class `Error`. \x0aThese are used to represent error conditions that prevent the normal continuation of processing. \x0aActual error exceptions used by an application may be subclasses of this class.\x0aAs `Error` is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner."
  13373. smalltalk.addMethod(
  13374. "_context",
  13375. smalltalk.method({
  13376. selector: "context",
  13377. category: 'accessing',
  13378. fn: function (){
  13379. var self=this;
  13380. return smalltalk.withContext(function($ctx1) { return self.context;
  13381. return self}, function($ctx1) {$ctx1.fill(self,"context",{}, smalltalk.Error)})},
  13382. args: [],
  13383. source: "context\x0a\x09<return self.context>",
  13384. messageSends: [],
  13385. referencedClasses: []
  13386. }),
  13387. smalltalk.Error);
  13388. smalltalk.addMethod(
  13389. "_initialize",
  13390. smalltalk.method({
  13391. selector: "initialize",
  13392. category: 'initialization',
  13393. fn: function (){
  13394. var self=this;
  13395. return smalltalk.withContext(function($ctx1) { _st(self)._messageText_(_st("Errorclass: ").__comma(_st(_st(self)._class())._name()));
  13396. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Error)})},
  13397. args: [],
  13398. source: "initialize\x0a\x09self messageText: 'Errorclass: ', (self class name).",
  13399. messageSends: ["messageText:", ",", "name", "class"],
  13400. referencedClasses: []
  13401. }),
  13402. smalltalk.Error);
  13403. smalltalk.addMethod(
  13404. "_isSmalltalkError",
  13405. smalltalk.method({
  13406. selector: "isSmalltalkError",
  13407. category: 'testing',
  13408. fn: function (){
  13409. var self=this;
  13410. return smalltalk.withContext(function($ctx1) { return self.smalltalkError === true;
  13411. return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkError",{}, smalltalk.Error)})},
  13412. args: [],
  13413. source: "isSmalltalkError\x0a\x09<return self.smalltalkError === true>",
  13414. messageSends: [],
  13415. referencedClasses: []
  13416. }),
  13417. smalltalk.Error);
  13418. smalltalk.addMethod(
  13419. "_jsStack",
  13420. smalltalk.method({
  13421. selector: "jsStack",
  13422. category: 'accessing',
  13423. fn: function (){
  13424. var self=this;
  13425. return smalltalk.withContext(function($ctx1) { return self.stack;
  13426. return self}, function($ctx1) {$ctx1.fill(self,"jsStack",{}, smalltalk.Error)})},
  13427. args: [],
  13428. source: "jsStack\x0a\x09<return self.stack>",
  13429. messageSends: [],
  13430. referencedClasses: []
  13431. }),
  13432. smalltalk.Error);
  13433. smalltalk.addMethod(
  13434. "_messageText",
  13435. smalltalk.method({
  13436. selector: "messageText",
  13437. category: 'accessing',
  13438. fn: function (){
  13439. var self=this;
  13440. return smalltalk.withContext(function($ctx1) { var $1;
  13441. $1=self["@messageText"];
  13442. return $1;
  13443. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.Error)})},
  13444. args: [],
  13445. source: "messageText\x0a\x09^messageText",
  13446. messageSends: [],
  13447. referencedClasses: []
  13448. }),
  13449. smalltalk.Error);
  13450. smalltalk.addMethod(
  13451. "_messageText_",
  13452. smalltalk.method({
  13453. selector: "messageText:",
  13454. category: 'accessing',
  13455. fn: function (aString){
  13456. var self=this;
  13457. return smalltalk.withContext(function($ctx1) { self["@messageText"]=aString;
  13458. return self}, function($ctx1) {$ctx1.fill(self,"messageText:",{aString:aString}, smalltalk.Error)})},
  13459. args: ["aString"],
  13460. source: "messageText: aString\x0a\x09messageText := aString",
  13461. messageSends: [],
  13462. referencedClasses: []
  13463. }),
  13464. smalltalk.Error);
  13465. smalltalk.addMethod(
  13466. "_signal",
  13467. smalltalk.method({
  13468. selector: "signal",
  13469. category: 'signaling',
  13470. fn: function (){
  13471. var self=this;
  13472. return smalltalk.withContext(function($ctx1) { self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  13473. return self}, function($ctx1) {$ctx1.fill(self,"signal",{}, smalltalk.Error)})},
  13474. args: [],
  13475. source: "signal\x0a\x09<self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self)>",
  13476. messageSends: [],
  13477. referencedClasses: []
  13478. }),
  13479. smalltalk.Error);
  13480. smalltalk.addMethod(
  13481. "_signal_",
  13482. smalltalk.method({
  13483. selector: "signal:",
  13484. category: 'signaling',
  13485. fn: function (aString){
  13486. var self=this;
  13487. return smalltalk.withContext(function($ctx1) { _st(self)._messageText_(aString);
  13488. _st(self)._signal();
  13489. return self}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString}, smalltalk.Error)})},
  13490. args: ["aString"],
  13491. source: "signal: aString\x0a\x09self messageText: aString.\x0a\x09self signal",
  13492. messageSends: ["messageText:", "signal"],
  13493. referencedClasses: []
  13494. }),
  13495. smalltalk.Error);
  13496. smalltalk.addMethod(
  13497. "_signal",
  13498. smalltalk.method({
  13499. selector: "signal",
  13500. category: 'instance creation',
  13501. fn: function (){
  13502. var self=this;
  13503. return smalltalk.withContext(function($ctx1) { var $1;
  13504. $1=_st(_st(self)._new())._signal();
  13505. return $1;
  13506. }, function($ctx1) {$ctx1.fill(self,"signal",{}, smalltalk.Error.klass)})},
  13507. args: [],
  13508. source: "signal\x0a\x09^self new signal",
  13509. messageSends: ["signal", "new"],
  13510. referencedClasses: []
  13511. }),
  13512. smalltalk.Error.klass);
  13513. smalltalk.addMethod(
  13514. "_signal_",
  13515. smalltalk.method({
  13516. selector: "signal:",
  13517. category: 'instance creation',
  13518. fn: function (aString){
  13519. var self=this;
  13520. return smalltalk.withContext(function($ctx1) { var $1;
  13521. $1=_st(_st(self)._new())._signal_(aString);
  13522. return $1;
  13523. }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString}, smalltalk.Error.klass)})},
  13524. args: ["aString"],
  13525. source: "signal: aString\x0a\x09 ^self new\x0a\x09\x09signal: aString",
  13526. messageSends: ["signal:", "new"],
  13527. referencedClasses: []
  13528. }),
  13529. smalltalk.Error.klass);
  13530. smalltalk.addClass('JavaScriptException', smalltalk.Error, ['exception'], 'Kernel-Exceptions');
  13531. smalltalk.JavaScriptException.comment="A JavaScriptException is thrown when a non-Smalltalk exception occurs while in the Smalltalk stack.\x0aSee `boot.js` `inContext()` and `BlockClosure >> on:do:`"
  13532. smalltalk.addMethod(
  13533. "_context_",
  13534. smalltalk.method({
  13535. selector: "context:",
  13536. category: 'accessing',
  13537. fn: function (aMethodContext){
  13538. var self=this;
  13539. return smalltalk.withContext(function($ctx1) { self.context = aMethodContext;
  13540. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext}, smalltalk.JavaScriptException)})},
  13541. args: ["aMethodContext"],
  13542. source: "context: aMethodContext\x0a\x09\x22Set the context from the outside.\x0a See boot.js `inContext()` exception handling\x22\x0a \x0a <self.context = aMethodContext>",
  13543. messageSends: [],
  13544. referencedClasses: []
  13545. }),
  13546. smalltalk.JavaScriptException);
  13547. smalltalk.addMethod(
  13548. "_exception",
  13549. smalltalk.method({
  13550. selector: "exception",
  13551. category: 'accessing',
  13552. fn: function (){
  13553. var self=this;
  13554. return smalltalk.withContext(function($ctx1) { var $1;
  13555. $1=self["@exception"];
  13556. return $1;
  13557. }, function($ctx1) {$ctx1.fill(self,"exception",{}, smalltalk.JavaScriptException)})},
  13558. args: [],
  13559. source: "exception\x0a\x09^ exception",
  13560. messageSends: [],
  13561. referencedClasses: []
  13562. }),
  13563. smalltalk.JavaScriptException);
  13564. smalltalk.addMethod(
  13565. "_exception_",
  13566. smalltalk.method({
  13567. selector: "exception:",
  13568. category: 'accessing',
  13569. fn: function (anException){
  13570. var self=this;
  13571. return smalltalk.withContext(function($ctx1) { self["@exception"]=anException;
  13572. return self}, function($ctx1) {$ctx1.fill(self,"exception:",{anException:anException}, smalltalk.JavaScriptException)})},
  13573. args: ["anException"],
  13574. source: "exception: anException\x0a\x09exception := anException",
  13575. messageSends: [],
  13576. referencedClasses: []
  13577. }),
  13578. smalltalk.JavaScriptException);
  13579. smalltalk.addMethod(
  13580. "_messageText",
  13581. smalltalk.method({
  13582. selector: "messageText",
  13583. category: 'accessing',
  13584. fn: function (){
  13585. var self=this;
  13586. return smalltalk.withContext(function($ctx1) { return 'JavaScript exception: ' + self["@exception"].toString();
  13587. return self}, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.JavaScriptException)})},
  13588. args: [],
  13589. source: "messageText\x0a\x09<return 'JavaScript exception: ' + self[\x22@exception\x22].toString()>",
  13590. messageSends: [],
  13591. referencedClasses: []
  13592. }),
  13593. smalltalk.JavaScriptException);
  13594. smalltalk.addMethod(
  13595. "_on_",
  13596. smalltalk.method({
  13597. selector: "on:",
  13598. category: 'instance creation',
  13599. fn: function (anException){
  13600. var self=this;
  13601. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  13602. $2=_st(self)._new();
  13603. _st($2)._exception_(anException);
  13604. $3=_st($2)._yourself();
  13605. $1=$3;
  13606. return $1;
  13607. }, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException}, smalltalk.JavaScriptException.klass)})},
  13608. args: ["anException"],
  13609. source: "on: anException\x0a\x09^ self new\x0a \x09exception: anException;\x0a yourself",
  13610. messageSends: ["exception:", "new", "yourself"],
  13611. referencedClasses: []
  13612. }),
  13613. smalltalk.JavaScriptException.klass);
  13614. smalltalk.addMethod(
  13615. "_on_context_",
  13616. smalltalk.method({
  13617. selector: "on:context:",
  13618. category: 'instance creation',
  13619. fn: function (anException,aMethodContext){
  13620. var self=this;
  13621. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  13622. $2=_st(self)._new();
  13623. _st($2)._exception_(anException);
  13624. _st($2)._context_(aMethodContext);
  13625. $3=_st($2)._yourself();
  13626. $1=$3;
  13627. return $1;
  13628. }, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext}, smalltalk.JavaScriptException.klass)})},
  13629. args: ["anException", "aMethodContext"],
  13630. source: "on: anException context: aMethodContext\x0a\x09^ self new\x0a \x09exception: anException;\x0a context: aMethodContext;\x0a yourself",
  13631. messageSends: ["exception:", "new", "context:", "yourself"],
  13632. referencedClasses: []
  13633. }),
  13634. smalltalk.JavaScriptException.klass);
  13635. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
  13636. smalltalk.MessageNotUnderstood.comment="This exception is provided to support `Object>>doesNotUnderstand:`."
  13637. smalltalk.addMethod(
  13638. "_message",
  13639. smalltalk.method({
  13640. selector: "message",
  13641. category: 'accessing',
  13642. fn: function (){
  13643. var self=this;
  13644. return smalltalk.withContext(function($ctx1) { var $1;
  13645. $1=self["@message"];
  13646. return $1;
  13647. }, function($ctx1) {$ctx1.fill(self,"message",{}, smalltalk.MessageNotUnderstood)})},
  13648. args: [],
  13649. source: "message\x0a\x09^message",
  13650. messageSends: [],
  13651. referencedClasses: []
  13652. }),
  13653. smalltalk.MessageNotUnderstood);
  13654. smalltalk.addMethod(
  13655. "_message_",
  13656. smalltalk.method({
  13657. selector: "message:",
  13658. category: 'accessing',
  13659. fn: function (aMessage){
  13660. var self=this;
  13661. return smalltalk.withContext(function($ctx1) { self["@message"]=aMessage;
  13662. return self}, function($ctx1) {$ctx1.fill(self,"message:",{aMessage:aMessage}, smalltalk.MessageNotUnderstood)})},
  13663. args: ["aMessage"],
  13664. source: "message: aMessage\x0a\x09message := aMessage",
  13665. messageSends: [],
  13666. referencedClasses: []
  13667. }),
  13668. smalltalk.MessageNotUnderstood);
  13669. smalltalk.addMethod(
  13670. "_messageText",
  13671. smalltalk.method({
  13672. selector: "messageText",
  13673. category: 'accessing',
  13674. fn: function (){
  13675. var self=this;
  13676. return smalltalk.withContext(function($ctx1) { var $1;
  13677. $1=_st(_st(_st(_st(self)._receiver())._asString()).__comma(" does not understand #")).__comma(_st(_st(self)._message())._selector());
  13678. return $1;
  13679. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.MessageNotUnderstood)})},
  13680. args: [],
  13681. source: "messageText\x0a\x09^self receiver asString, ' does not understand #', self message selector",
  13682. messageSends: [",", "selector", "message", "asString", "receiver"],
  13683. referencedClasses: []
  13684. }),
  13685. smalltalk.MessageNotUnderstood);
  13686. smalltalk.addMethod(
  13687. "_receiver",
  13688. smalltalk.method({
  13689. selector: "receiver",
  13690. category: 'accessing',
  13691. fn: function (){
  13692. var self=this;
  13693. return smalltalk.withContext(function($ctx1) { var $1;
  13694. $1=self["@receiver"];
  13695. return $1;
  13696. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.MessageNotUnderstood)})},
  13697. args: [],
  13698. source: "receiver\x0a\x09^receiver",
  13699. messageSends: [],
  13700. referencedClasses: []
  13701. }),
  13702. smalltalk.MessageNotUnderstood);
  13703. smalltalk.addMethod(
  13704. "_receiver_",
  13705. smalltalk.method({
  13706. selector: "receiver:",
  13707. category: 'accessing',
  13708. fn: function (anObject){
  13709. var self=this;
  13710. return smalltalk.withContext(function($ctx1) { self["@receiver"]=anObject;
  13711. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject}, smalltalk.MessageNotUnderstood)})},
  13712. args: ["anObject"],
  13713. source: "receiver: anObject\x0a\x09receiver := anObject",
  13714. messageSends: [],
  13715. referencedClasses: []
  13716. }),
  13717. smalltalk.MessageNotUnderstood);
  13718. smalltalk.addClass('NonBooleanReceiver', smalltalk.Error, ['object'], 'Kernel-Exceptions');
  13719. smalltalk.NonBooleanReceiver.comment="NonBooleanReceiver exceptions may be thrown when executing inlined methods such as `#ifTrue:` with a non boolean receiver."
  13720. smalltalk.addMethod(
  13721. "_object",
  13722. smalltalk.method({
  13723. selector: "object",
  13724. category: 'accessing',
  13725. fn: function (){
  13726. var self=this;
  13727. return smalltalk.withContext(function($ctx1) { var $1;
  13728. $1=self["@object"];
  13729. return $1;
  13730. }, function($ctx1) {$ctx1.fill(self,"object",{}, smalltalk.NonBooleanReceiver)})},
  13731. args: [],
  13732. source: "object\x0a\x09^ object",
  13733. messageSends: [],
  13734. referencedClasses: []
  13735. }),
  13736. smalltalk.NonBooleanReceiver);
  13737. smalltalk.addMethod(
  13738. "_object_",
  13739. smalltalk.method({
  13740. selector: "object:",
  13741. category: 'accessing',
  13742. fn: function (anObject){
  13743. var self=this;
  13744. return smalltalk.withContext(function($ctx1) { self["@object"]=anObject;
  13745. return self}, function($ctx1) {$ctx1.fill(self,"object:",{anObject:anObject}, smalltalk.NonBooleanReceiver)})},
  13746. args: ["anObject"],
  13747. source: "object: anObject\x0a\x09object := anObject",
  13748. messageSends: [],
  13749. referencedClasses: []
  13750. }),
  13751. smalltalk.NonBooleanReceiver);
  13752. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
  13753. smalltalk.ErrorHandler.comment="ErrorHandler is used to manage Smalltalk errors. \x0aSee `boot.js` `handleError()` function.\x0a\x0aSubclasses of `ErrorHandler` can register themselves as the current handler with\x0a`ErrorHandler class >> register`.\x0a\x0aSubclasses may override `#handleError:` to perform an action on the thrown exception.\x0aThe default behavior is to log the error and the context stack to the JavaScript console."
  13754. smalltalk.addMethod(
  13755. "_handleError_",
  13756. smalltalk.method({
  13757. selector: "handleError:",
  13758. category: 'error handling',
  13759. fn: function (anError){
  13760. var self=this;
  13761. return smalltalk.withContext(function($ctx1) { var $1;
  13762. $1=_st(anError)._context();
  13763. if(($receiver = $1) == nil || $receiver == undefined){
  13764. $1;
  13765. } else {
  13766. _st(self)._logErrorContext_(_st(anError)._context());
  13767. };
  13768. _st(self)._logError_(anError);
  13769. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError}, smalltalk.ErrorHandler)})},
  13770. args: ["anError"],
  13771. source: "handleError: anError\x0a\x09anError context ifNotNil: [self logErrorContext: anError context].\x0a\x09self logError: anError",
  13772. messageSends: ["ifNotNil:", "logErrorContext:", "context", "logError:"],
  13773. referencedClasses: []
  13774. }),
  13775. smalltalk.ErrorHandler);
  13776. smalltalk.addMethod(
  13777. "_log_",
  13778. smalltalk.method({
  13779. selector: "log:",
  13780. category: 'private',
  13781. fn: function (aString){
  13782. var self=this;
  13783. return smalltalk.withContext(function($ctx1) { _st(console)._log_(aString);
  13784. return self}, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString}, smalltalk.ErrorHandler)})},
  13785. args: ["aString"],
  13786. source: "log: aString\x0a\x09console log: aString",
  13787. messageSends: ["log:"],
  13788. referencedClasses: []
  13789. }),
  13790. smalltalk.ErrorHandler);
  13791. smalltalk.addMethod(
  13792. "_logContext_",
  13793. smalltalk.method({
  13794. selector: "logContext:",
  13795. category: 'private',
  13796. fn: function (aContext){
  13797. var self=this;
  13798. return smalltalk.withContext(function($ctx1) { var $1;
  13799. $1=_st(aContext)._home();
  13800. if(($receiver = $1) == nil || $receiver == undefined){
  13801. $1;
  13802. } else {
  13803. _st(self)._logContext_(_st(aContext)._home());
  13804. };
  13805. _st(self)._log_(_st(_st(_st(_st(aContext)._receiver())._asString()).__comma(">>")).__comma(_st(_st(aContext)._selector())._asString()));
  13806. return self}, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext}, smalltalk.ErrorHandler)})},
  13807. args: ["aContext"],
  13808. source: "logContext: aContext\x0a\x09aContext home ifNotNil: [\x0a\x09\x09self logContext: aContext home].\x0a\x09self log: aContext receiver asString, '>>', aContext selector asString",
  13809. messageSends: ["ifNotNil:", "logContext:", "home", "log:", ",", "asString", "selector", "receiver"],
  13810. referencedClasses: []
  13811. }),
  13812. smalltalk.ErrorHandler);
  13813. smalltalk.addMethod(
  13814. "_logError_",
  13815. smalltalk.method({
  13816. selector: "logError:",
  13817. category: 'private',
  13818. fn: function (anError){
  13819. var self=this;
  13820. return smalltalk.withContext(function($ctx1) { _st(self)._log_(_st(anError)._messageText());
  13821. return self}, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError}, smalltalk.ErrorHandler)})},
  13822. args: ["anError"],
  13823. source: "logError: anError\x0a\x09self log: anError messageText",
  13824. messageSends: ["log:", "messageText"],
  13825. referencedClasses: []
  13826. }),
  13827. smalltalk.ErrorHandler);
  13828. smalltalk.addMethod(
  13829. "_logErrorContext_",
  13830. smalltalk.method({
  13831. selector: "logErrorContext:",
  13832. category: 'private',
  13833. fn: function (aContext){
  13834. var self=this;
  13835. return smalltalk.withContext(function($ctx1) { var $1,$2;
  13836. $1=aContext;
  13837. if(($receiver = $1) == nil || $receiver == undefined){
  13838. $1;
  13839. } else {
  13840. $2=_st(aContext)._home();
  13841. if(($receiver = $2) == nil || $receiver == undefined){
  13842. $2;
  13843. } else {
  13844. _st(self)._logContext_(_st(aContext)._home());
  13845. };
  13846. };
  13847. return self}, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext}, smalltalk.ErrorHandler)})},
  13848. args: ["aContext"],
  13849. source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home]]",
  13850. messageSends: ["ifNotNil:", "logContext:", "home"],
  13851. referencedClasses: []
  13852. }),
  13853. smalltalk.ErrorHandler);
  13854. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  13855. smalltalk.addMethod(
  13856. "_current",
  13857. smalltalk.method({
  13858. selector: "current",
  13859. category: 'accessing',
  13860. fn: function (){
  13861. var self=this;
  13862. return smalltalk.withContext(function($ctx1) { var $2,$1;
  13863. $2=self["@current"];
  13864. if(($receiver = $2) == nil || $receiver == undefined){
  13865. self["@current"]=_st(self)._new();
  13866. $1=self["@current"];
  13867. } else {
  13868. $1=$2;
  13869. };
  13870. return $1;
  13871. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.ErrorHandler.klass)})},
  13872. args: [],
  13873. source: "current\x0a\x09^current ifNil: [current := self new]",
  13874. messageSends: ["ifNil:", "new"],
  13875. referencedClasses: []
  13876. }),
  13877. smalltalk.ErrorHandler.klass);
  13878. smalltalk.addMethod(
  13879. "_initialize",
  13880. smalltalk.method({
  13881. selector: "initialize",
  13882. category: 'initialization',
  13883. fn: function (){
  13884. var self=this;
  13885. return smalltalk.withContext(function($ctx1) { _st(self)._register();
  13886. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ErrorHandler.klass)})},
  13887. args: [],
  13888. source: "initialize\x0a\x09self register",
  13889. messageSends: ["register"],
  13890. referencedClasses: []
  13891. }),
  13892. smalltalk.ErrorHandler.klass);
  13893. smalltalk.addMethod(
  13894. "_register",
  13895. smalltalk.method({
  13896. selector: "register",
  13897. category: 'initialization',
  13898. fn: function (){
  13899. var self=this;
  13900. return smalltalk.withContext(function($ctx1) { _st((smalltalk.ErrorHandler || ErrorHandler))._setCurrent_(_st(self)._new());
  13901. return self}, function($ctx1) {$ctx1.fill(self,"register",{}, smalltalk.ErrorHandler.klass)})},
  13902. args: [],
  13903. source: "register\x0a\x09ErrorHandler setCurrent: self new",
  13904. messageSends: ["setCurrent:", "new"],
  13905. referencedClasses: ["ErrorHandler"]
  13906. }),
  13907. smalltalk.ErrorHandler.klass);
  13908. smalltalk.addMethod(
  13909. "_setCurrent_",
  13910. smalltalk.method({
  13911. selector: "setCurrent:",
  13912. category: 'accessing',
  13913. fn: function (anHandler){
  13914. var self=this;
  13915. return smalltalk.withContext(function($ctx1) { self["@current"]=anHandler;
  13916. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler}, smalltalk.ErrorHandler.klass)})},
  13917. args: ["anHandler"],
  13918. source: "setCurrent: anHandler\x0a\x09current := anHandler",
  13919. messageSends: [],
  13920. referencedClasses: []
  13921. }),
  13922. smalltalk.ErrorHandler.klass);
  13923. smalltalk.addPackage('Kernel-Transcript', {});
  13924. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  13925. smalltalk.addMethod(
  13926. "_clear",
  13927. smalltalk.method({
  13928. selector: "clear",
  13929. category: 'printing',
  13930. fn: function (){
  13931. var self=this;
  13932. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"clear",{}, smalltalk.ConsoleTranscript)})},
  13933. args: [],
  13934. source: "clear\x0a\x09\x22no op\x22",
  13935. messageSends: [],
  13936. referencedClasses: []
  13937. }),
  13938. smalltalk.ConsoleTranscript);
  13939. smalltalk.addMethod(
  13940. "_cr",
  13941. smalltalk.method({
  13942. selector: "cr",
  13943. category: 'printing',
  13944. fn: function (){
  13945. var self=this;
  13946. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"cr",{}, smalltalk.ConsoleTranscript)})},
  13947. args: [],
  13948. source: "cr\x0a\x09\x22no op\x22",
  13949. messageSends: [],
  13950. referencedClasses: []
  13951. }),
  13952. smalltalk.ConsoleTranscript);
  13953. smalltalk.addMethod(
  13954. "_open",
  13955. smalltalk.method({
  13956. selector: "open",
  13957. category: 'actions',
  13958. fn: function (){
  13959. var self=this;
  13960. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"open",{}, smalltalk.ConsoleTranscript)})},
  13961. args: [],
  13962. source: "open",
  13963. messageSends: [],
  13964. referencedClasses: []
  13965. }),
  13966. smalltalk.ConsoleTranscript);
  13967. smalltalk.addMethod(
  13968. "_show_",
  13969. smalltalk.method({
  13970. selector: "show:",
  13971. category: 'printing',
  13972. fn: function (anObject){
  13973. var self=this;
  13974. return smalltalk.withContext(function($ctx1) { console.log(String(string._asString()));
  13975. return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject}, smalltalk.ConsoleTranscript)})},
  13976. args: ["anObject"],
  13977. source: "show: anObject\x0a\x09<console.log(String(string._asString()))>",
  13978. messageSends: [],
  13979. referencedClasses: []
  13980. }),
  13981. smalltalk.ConsoleTranscript);
  13982. smalltalk.addMethod(
  13983. "_initialize",
  13984. smalltalk.method({
  13985. selector: "initialize",
  13986. category: 'initialization',
  13987. fn: function (){
  13988. var self=this;
  13989. return smalltalk.withContext(function($ctx1) { _st((smalltalk.Transcript || Transcript))._register_(_st(self)._new());
  13990. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ConsoleTranscript.klass)})},
  13991. args: [],
  13992. source: "initialize\x0a\x09Transcript register: self new",
  13993. messageSends: ["register:", "new"],
  13994. referencedClasses: ["Transcript"]
  13995. }),
  13996. smalltalk.ConsoleTranscript.klass);
  13997. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  13998. smalltalk.Transcript.klass.iVarNames = ['current'];
  13999. smalltalk.addMethod(
  14000. "_clear",
  14001. smalltalk.method({
  14002. selector: "clear",
  14003. category: 'printing',
  14004. fn: function (){
  14005. var self=this;
  14006. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._clear();
  14007. return self}, function($ctx1) {$ctx1.fill(self,"clear",{}, smalltalk.Transcript.klass)})},
  14008. args: [],
  14009. source: "clear\x0a self current clear",
  14010. messageSends: ["clear", "current"],
  14011. referencedClasses: []
  14012. }),
  14013. smalltalk.Transcript.klass);
  14014. smalltalk.addMethod(
  14015. "_cr",
  14016. smalltalk.method({
  14017. selector: "cr",
  14018. category: 'printing',
  14019. fn: function (){
  14020. var self=this;
  14021. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._show_(_st((smalltalk.String || String))._cr());
  14022. return self}, function($ctx1) {$ctx1.fill(self,"cr",{}, smalltalk.Transcript.klass)})},
  14023. args: [],
  14024. source: "cr\x0a self current show: String cr",
  14025. messageSends: ["show:", "cr", "current"],
  14026. referencedClasses: ["String"]
  14027. }),
  14028. smalltalk.Transcript.klass);
  14029. smalltalk.addMethod(
  14030. "_current",
  14031. smalltalk.method({
  14032. selector: "current",
  14033. category: 'instance creation',
  14034. fn: function (){
  14035. var self=this;
  14036. return smalltalk.withContext(function($ctx1) { var $1;
  14037. $1=self["@current"];
  14038. return $1;
  14039. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.Transcript.klass)})},
  14040. args: [],
  14041. source: "current\x0a ^current",
  14042. messageSends: [],
  14043. referencedClasses: []
  14044. }),
  14045. smalltalk.Transcript.klass);
  14046. smalltalk.addMethod(
  14047. "_new",
  14048. smalltalk.method({
  14049. selector: "new",
  14050. category: 'instance creation',
  14051. fn: function (){
  14052. var self=this;
  14053. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  14054. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.Transcript.klass)})},
  14055. args: [],
  14056. source: "new\x0a self shouldNotImplement",
  14057. messageSends: ["shouldNotImplement"],
  14058. referencedClasses: []
  14059. }),
  14060. smalltalk.Transcript.klass);
  14061. smalltalk.addMethod(
  14062. "_open",
  14063. smalltalk.method({
  14064. selector: "open",
  14065. category: 'instance creation',
  14066. fn: function (){
  14067. var self=this;
  14068. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._open();
  14069. return self}, function($ctx1) {$ctx1.fill(self,"open",{}, smalltalk.Transcript.klass)})},
  14070. args: [],
  14071. source: "open\x0a self current open",
  14072. messageSends: ["open", "current"],
  14073. referencedClasses: []
  14074. }),
  14075. smalltalk.Transcript.klass);
  14076. smalltalk.addMethod(
  14077. "_register_",
  14078. smalltalk.method({
  14079. selector: "register:",
  14080. category: 'instance creation',
  14081. fn: function (aTranscript){
  14082. var self=this;
  14083. return smalltalk.withContext(function($ctx1) { self["@current"]=aTranscript;
  14084. return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript}, smalltalk.Transcript.klass)})},
  14085. args: ["aTranscript"],
  14086. source: "register: aTranscript\x0a\x09current := aTranscript",
  14087. messageSends: [],
  14088. referencedClasses: []
  14089. }),
  14090. smalltalk.Transcript.klass);
  14091. smalltalk.addMethod(
  14092. "_show_",
  14093. smalltalk.method({
  14094. selector: "show:",
  14095. category: 'printing',
  14096. fn: function (anObject){
  14097. var self=this;
  14098. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._show_(anObject);
  14099. return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject}, smalltalk.Transcript.klass)})},
  14100. args: ["anObject"],
  14101. source: "show: anObject\x0a self current show: anObject",
  14102. messageSends: ["show:", "current"],
  14103. referencedClasses: []
  14104. }),
  14105. smalltalk.Transcript.klass);
  14106. smalltalk.addPackage('Kernel-Announcements', {});
  14107. smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['block', 'announcementClass'], 'Kernel-Announcements');
  14108. smalltalk.AnnouncementSubscription.comment="The subscription is a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible."
  14109. smalltalk.addMethod(
  14110. "_announcementClass",
  14111. smalltalk.method({
  14112. selector: "announcementClass",
  14113. category: 'accessing',
  14114. fn: function (){
  14115. var self=this;
  14116. return smalltalk.withContext(function($ctx1) { var $1;
  14117. $1=self["@announcementClass"];
  14118. return $1;
  14119. }, function($ctx1) {$ctx1.fill(self,"announcementClass",{}, smalltalk.AnnouncementSubscription)})},
  14120. args: [],
  14121. source: "announcementClass\x0a\x09^announcementClass",
  14122. messageSends: [],
  14123. referencedClasses: []
  14124. }),
  14125. smalltalk.AnnouncementSubscription);
  14126. smalltalk.addMethod(
  14127. "_announcementClass_",
  14128. smalltalk.method({
  14129. selector: "announcementClass:",
  14130. category: 'accessing',
  14131. fn: function (aClass){
  14132. var self=this;
  14133. return smalltalk.withContext(function($ctx1) { self["@announcementClass"]=aClass;
  14134. return self}, function($ctx1) {$ctx1.fill(self,"announcementClass:",{aClass:aClass}, smalltalk.AnnouncementSubscription)})},
  14135. args: ["aClass"],
  14136. source: "announcementClass: aClass\x0a\x09announcementClass := aClass",
  14137. messageSends: [],
  14138. referencedClasses: []
  14139. }),
  14140. smalltalk.AnnouncementSubscription);
  14141. smalltalk.addMethod(
  14142. "_block",
  14143. smalltalk.method({
  14144. selector: "block",
  14145. category: 'accessing',
  14146. fn: function (){
  14147. var self=this;
  14148. return smalltalk.withContext(function($ctx1) { var $1;
  14149. $1=self["@block"];
  14150. return $1;
  14151. }, function($ctx1) {$ctx1.fill(self,"block",{}, smalltalk.AnnouncementSubscription)})},
  14152. args: [],
  14153. source: "block\x0a\x09^block",
  14154. messageSends: [],
  14155. referencedClasses: []
  14156. }),
  14157. smalltalk.AnnouncementSubscription);
  14158. smalltalk.addMethod(
  14159. "_block_",
  14160. smalltalk.method({
  14161. selector: "block:",
  14162. category: 'accessing',
  14163. fn: function (aBlock){
  14164. var self=this;
  14165. return smalltalk.withContext(function($ctx1) { self["@block"]=aBlock;
  14166. return self}, function($ctx1) {$ctx1.fill(self,"block:",{aBlock:aBlock}, smalltalk.AnnouncementSubscription)})},
  14167. args: ["aBlock"],
  14168. source: "block: aBlock\x0a\x09block := aBlock",
  14169. messageSends: [],
  14170. referencedClasses: []
  14171. }),
  14172. smalltalk.AnnouncementSubscription);
  14173. smalltalk.addMethod(
  14174. "_deliver_",
  14175. smalltalk.method({
  14176. selector: "deliver:",
  14177. category: 'announcing',
  14178. fn: function (anAnnouncement){
  14179. var self=this;
  14180. return smalltalk.withContext(function($ctx1) { var $1;
  14181. $1=_st(self)._handlesAnnouncement_(anAnnouncement);
  14182. if(smalltalk.assert($1)){
  14183. _st(_st(self)._block())._value_(anAnnouncement);
  14184. };
  14185. return self}, function($ctx1) {$ctx1.fill(self,"deliver:",{anAnnouncement:anAnnouncement}, smalltalk.AnnouncementSubscription)})},
  14186. args: ["anAnnouncement"],
  14187. source: "deliver: anAnnouncement\x0a\x09(self handlesAnnouncement: anAnnouncement)\x0a\x09\x09ifTrue: [self block value: anAnnouncement]",
  14188. messageSends: ["ifTrue:", "value:", "block", "handlesAnnouncement:"],
  14189. referencedClasses: []
  14190. }),
  14191. smalltalk.AnnouncementSubscription);
  14192. smalltalk.addMethod(
  14193. "_handlesAnnouncement_",
  14194. smalltalk.method({
  14195. selector: "handlesAnnouncement:",
  14196. category: 'announcing',
  14197. fn: function (anAnnouncement){
  14198. var self=this;
  14199. return smalltalk.withContext(function($ctx1) { var $1;
  14200. $1=_st(anAnnouncement)._isKindOf_(_st(self)._announcementClass());
  14201. return $1;
  14202. }, function($ctx1) {$ctx1.fill(self,"handlesAnnouncement:",{anAnnouncement:anAnnouncement}, smalltalk.AnnouncementSubscription)})},
  14203. args: ["anAnnouncement"],
  14204. source: "handlesAnnouncement: anAnnouncement\x0a\x09^anAnnouncement isKindOf: self announcementClass",
  14205. messageSends: ["isKindOf:", "announcementClass"],
  14206. referencedClasses: []
  14207. }),
  14208. smalltalk.AnnouncementSubscription);
  14209. smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
  14210. smalltalk.Announcer.comment="The code is based on the announcements as [described by Vassili Bykov](http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework).\x0aThe Announcer holds annoncement subscriptions (`AnnouncementSubscription`) in a private registry.\x0a\x0aUse `#on:do:` to register subscriptions."
  14211. smalltalk.addMethod(
  14212. "_announce_",
  14213. smalltalk.method({
  14214. selector: "announce:",
  14215. category: 'announcing',
  14216. fn: function (anAnnouncement){
  14217. var self=this;
  14218. return smalltalk.withContext(function($ctx1) { _st(self["@subscriptions"])._do_((function(each){
  14219. return smalltalk.withContext(function($ctx2) { return _st(each)._deliver_(anAnnouncement);
  14220. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  14221. return self}, function($ctx1) {$ctx1.fill(self,"announce:",{anAnnouncement:anAnnouncement}, smalltalk.Announcer)})},
  14222. args: ["anAnnouncement"],
  14223. source: "announce: anAnnouncement\x0a\x09subscriptions do: [:each |\x0a\x09\x09each deliver: anAnnouncement]",
  14224. messageSends: ["do:", "deliver:"],
  14225. referencedClasses: []
  14226. }),
  14227. smalltalk.Announcer);
  14228. smalltalk.addMethod(
  14229. "_initialize",
  14230. smalltalk.method({
  14231. selector: "initialize",
  14232. category: 'initialization',
  14233. fn: function (){
  14234. var self=this;
  14235. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  14236. self["@subscriptions"]=_st((smalltalk.Array || Array))._new();
  14237. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Announcer)})},
  14238. args: [],
  14239. source: "initialize\x0a\x09super initialize.\x0a\x09subscriptions := Array new",
  14240. messageSends: ["initialize", "new"],
  14241. referencedClasses: ["Array"]
  14242. }),
  14243. smalltalk.Announcer);
  14244. smalltalk.addMethod(
  14245. "_on_do_",
  14246. smalltalk.method({
  14247. selector: "on:do:",
  14248. category: 'subscribing',
  14249. fn: function (aClass,aBlock){
  14250. var self=this;
  14251. return smalltalk.withContext(function($ctx1) { var $1,$2;
  14252. $1=_st((smalltalk.AnnouncementSubscription || AnnouncementSubscription))._new();
  14253. _st($1)._block_(aBlock);
  14254. _st($1)._announcementClass_(aClass);
  14255. $2=_st($1)._yourself();
  14256. _st(self["@subscriptions"])._add_($2);
  14257. return self}, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock}, smalltalk.Announcer)})},
  14258. args: ["aClass", "aBlock"],
  14259. source: "on: aClass do: aBlock\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09block: aBlock;\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
  14260. messageSends: ["add:", "block:", "new", "announcementClass:", "yourself"],
  14261. referencedClasses: ["AnnouncementSubscription"]
  14262. }),
  14263. smalltalk.Announcer);
  14264. smalltalk.addClass('SystemAnnouncer', smalltalk.Announcer, [], 'Kernel-Announcements');
  14265. smalltalk.SystemAnnouncer.comment="My unique instance #current is the global announcer handling all Amber system-related announces"
  14266. smalltalk.SystemAnnouncer.klass.iVarNames = ['current'];
  14267. smalltalk.addMethod(
  14268. "_current",
  14269. smalltalk.method({
  14270. selector: "current",
  14271. category: 'accessing',
  14272. fn: function (){
  14273. var self=this;
  14274. return smalltalk.withContext(function($ctx1) { var $2,$1;
  14275. $2=self["@current"];
  14276. if(($receiver = $2) == nil || $receiver == undefined){
  14277. self["@current"]=smalltalk.Announcer.klass.fn.prototype._new.apply(_st(self), []);
  14278. $1=self["@current"];
  14279. } else {
  14280. $1=$2;
  14281. };
  14282. return $1;
  14283. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.SystemAnnouncer.klass)})},
  14284. args: [],
  14285. source: "current\x0a\x09^ current ifNil: [ current := super new ]",
  14286. messageSends: ["ifNil:", "new"],
  14287. referencedClasses: []
  14288. }),
  14289. smalltalk.SystemAnnouncer.klass);
  14290. smalltalk.addMethod(
  14291. "_new",
  14292. smalltalk.method({
  14293. selector: "new",
  14294. category: 'instance creation',
  14295. fn: function (){
  14296. var self=this;
  14297. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  14298. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.SystemAnnouncer.klass)})},
  14299. args: [],
  14300. source: "new\x0a\x09self shouldNotImplement",
  14301. messageSends: ["shouldNotImplement"],
  14302. referencedClasses: []
  14303. }),
  14304. smalltalk.SystemAnnouncer.klass);
  14305. smalltalk.addClass('SystemAnnouncement', smalltalk.Object, ['theClass'], 'Kernel-Announcements');
  14306. smalltalk.SystemAnnouncement.comment="I am the superclass of all system announcements"
  14307. smalltalk.addMethod(
  14308. "_theClass",
  14309. smalltalk.method({
  14310. selector: "theClass",
  14311. category: 'accessing',
  14312. fn: function (){
  14313. var self=this;
  14314. return smalltalk.withContext(function($ctx1) { var $1;
  14315. $1=self["@theClass"];
  14316. return $1;
  14317. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.SystemAnnouncement)})},
  14318. args: [],
  14319. source: "theClass\x0a\x09^ theClass",
  14320. messageSends: [],
  14321. referencedClasses: []
  14322. }),
  14323. smalltalk.SystemAnnouncement);
  14324. smalltalk.addMethod(
  14325. "_theClass_",
  14326. smalltalk.method({
  14327. selector: "theClass:",
  14328. category: 'accessing',
  14329. fn: function (aClass){
  14330. var self=this;
  14331. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  14332. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.SystemAnnouncement)})},
  14333. args: ["aClass"],
  14334. source: "theClass: aClass\x0a\x09theClass := aClass",
  14335. messageSends: [],
  14336. referencedClasses: []
  14337. }),
  14338. smalltalk.SystemAnnouncement);
  14339. smalltalk.addClass('ClassAdded', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  14340. smalltalk.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods"
  14341. smalltalk.addClass('ClassCommentChanged', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  14342. smalltalk.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)"
  14343. smalltalk.addClass('ClassDefinitionChanged', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  14344. smalltalk.ClassDefinitionChanged.comment="I am emitted when the defintion of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:"
  14345. smalltalk.addClass('ClassRemoved', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  14346. smalltalk.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:"
  14347. smalltalk.addClass('ClassRenamed', smalltalk.SystemAnnouncement, [], 'Kernel-Announcements');
  14348. smalltalk.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:"
  14349. smalltalk.addClass('MethodAnnouncement', smalltalk.SystemAnnouncement, ['method'], 'Kernel-Announcements');
  14350. smalltalk.addMethod(
  14351. "_method",
  14352. smalltalk.method({
  14353. selector: "method",
  14354. category: 'accessing',
  14355. fn: function (){
  14356. var self=this;
  14357. return smalltalk.withContext(function($ctx1) { var $1;
  14358. $1=self["@method"];
  14359. return $1;
  14360. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.MethodAnnouncement)})},
  14361. args: [],
  14362. source: "method\x0a\x09^ method",
  14363. messageSends: [],
  14364. referencedClasses: []
  14365. }),
  14366. smalltalk.MethodAnnouncement);
  14367. smalltalk.addMethod(
  14368. "_method_",
  14369. smalltalk.method({
  14370. selector: "method:",
  14371. category: 'accessing',
  14372. fn: function (aCompiledMethod){
  14373. var self=this;
  14374. return smalltalk.withContext(function($ctx1) { self["@method"]=aCompiledMethod;
  14375. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod}, smalltalk.MethodAnnouncement)})},
  14376. args: ["aCompiledMethod"],
  14377. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  14378. messageSends: [],
  14379. referencedClasses: []
  14380. }),
  14381. smalltalk.MethodAnnouncement);
  14382. smalltalk.addClass('MethodAdded', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  14383. smalltalk.addClass('MethodRemoved', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  14384. smalltalk.addPackage('Compiler-Core', {});
  14385. smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
  14386. smalltalk.Compiler.comment="I provide the public interface for compiling Amber source code into JavaScript.\x0a\x0aThe code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`. \x0aThe default code generator is an instance of `InlinedCodeGenerator`"
  14387. smalltalk.addMethod(
  14388. "_codeGeneratorClass",
  14389. smalltalk.method({
  14390. selector: "codeGeneratorClass",
  14391. category: 'accessing',
  14392. fn: function (){
  14393. var self=this;
  14394. return smalltalk.withContext(function($ctx1) { var $2,$1;
  14395. $2=self["@codeGeneratorClass"];
  14396. if(($receiver = $2) == nil || $receiver == undefined){
  14397. $1=(smalltalk.InliningCodeGenerator || InliningCodeGenerator);
  14398. } else {
  14399. $1=$2;
  14400. };
  14401. return $1;
  14402. }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{}, smalltalk.Compiler)})},
  14403. args: [],
  14404. source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [InliningCodeGenerator]",
  14405. messageSends: ["ifNil:"],
  14406. referencedClasses: ["InliningCodeGenerator"]
  14407. }),
  14408. smalltalk.Compiler);
  14409. smalltalk.addMethod(
  14410. "_codeGeneratorClass_",
  14411. smalltalk.method({
  14412. selector: "codeGeneratorClass:",
  14413. category: 'accessing',
  14414. fn: function (aClass){
  14415. var self=this;
  14416. return smalltalk.withContext(function($ctx1) { self["@codeGeneratorClass"]=aClass;
  14417. return self}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass:",{aClass:aClass}, smalltalk.Compiler)})},
  14418. args: ["aClass"],
  14419. source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass",
  14420. messageSends: [],
  14421. referencedClasses: []
  14422. }),
  14423. smalltalk.Compiler);
  14424. smalltalk.addMethod(
  14425. "_compile_",
  14426. smalltalk.method({
  14427. selector: "compile:",
  14428. category: 'compiling',
  14429. fn: function (aString){
  14430. var self=this;
  14431. return smalltalk.withContext(function($ctx1) { var $1;
  14432. $1=_st(self)._compileNode_(_st(self)._parse_(aString));
  14433. return $1;
  14434. }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString}, smalltalk.Compiler)})},
  14435. args: ["aString"],
  14436. source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
  14437. messageSends: ["compileNode:", "parse:"],
  14438. referencedClasses: []
  14439. }),
  14440. smalltalk.Compiler);
  14441. smalltalk.addMethod(
  14442. "_compile_forClass_",
  14443. smalltalk.method({
  14444. selector: "compile:forClass:",
  14445. category: 'compiling',
  14446. fn: function (aString,aClass){
  14447. var self=this;
  14448. return smalltalk.withContext(function($ctx1) { var $1;
  14449. _st(self)._currentClass_(aClass);
  14450. _st(self)._source_(aString);
  14451. $1=_st(self)._compile_(aString);
  14452. return $1;
  14453. }, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass}, smalltalk.Compiler)})},
  14454. args: ["aString", "aClass"],
  14455. source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
  14456. messageSends: ["currentClass:", "source:", "compile:"],
  14457. referencedClasses: []
  14458. }),
  14459. smalltalk.Compiler);
  14460. smalltalk.addMethod(
  14461. "_compileExpression_",
  14462. smalltalk.method({
  14463. selector: "compileExpression:",
  14464. category: 'compiling',
  14465. fn: function (aString){
  14466. var self=this;
  14467. return smalltalk.withContext(function($ctx1) { var $1;
  14468. _st(self)._currentClass_((smalltalk.DoIt || DoIt));
  14469. _st(self)._source_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  14470. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  14471. return $1;
  14472. }, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString}, smalltalk.Compiler)})},
  14473. args: ["aString"],
  14474. source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  14475. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
  14476. referencedClasses: ["DoIt"]
  14477. }),
  14478. smalltalk.Compiler);
  14479. smalltalk.addMethod(
  14480. "_compileNode_",
  14481. smalltalk.method({
  14482. selector: "compileNode:",
  14483. category: 'compiling',
  14484. fn: function (aNode){
  14485. var self=this;
  14486. var generator,result;
  14487. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  14488. generator=_st(_st(self)._codeGeneratorClass())._new();
  14489. $1=generator;
  14490. _st($1)._source_(_st(self)._source());
  14491. $2=_st($1)._currentClass_(_st(self)._currentClass());
  14492. result=_st(generator)._compileNode_(aNode);
  14493. _st(self)._unknownVariables_([]);
  14494. $3=result;
  14495. return $3;
  14496. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result}, smalltalk.Compiler)})},
  14497. args: ["aNode"],
  14498. source: "compileNode: aNode\x0a\x09| generator result |\x0a\x09generator := self codeGeneratorClass new.\x0a\x09generator\x0a\x09\x09source: self source;\x0a\x09\x09currentClass: self currentClass.\x0a\x09result := generator compileNode: aNode.\x0a\x09self unknownVariables: #().\x0a\x09^result",
  14499. messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"],
  14500. referencedClasses: []
  14501. }),
  14502. smalltalk.Compiler);
  14503. smalltalk.addMethod(
  14504. "_currentClass",
  14505. smalltalk.method({
  14506. selector: "currentClass",
  14507. category: 'accessing',
  14508. fn: function (){
  14509. var self=this;
  14510. return smalltalk.withContext(function($ctx1) { var $1;
  14511. $1=self["@currentClass"];
  14512. return $1;
  14513. }, function($ctx1) {$ctx1.fill(self,"currentClass",{}, smalltalk.Compiler)})},
  14514. args: [],
  14515. source: "currentClass\x0a\x09^currentClass",
  14516. messageSends: [],
  14517. referencedClasses: []
  14518. }),
  14519. smalltalk.Compiler);
  14520. smalltalk.addMethod(
  14521. "_currentClass_",
  14522. smalltalk.method({
  14523. selector: "currentClass:",
  14524. category: 'accessing',
  14525. fn: function (aClass){
  14526. var self=this;
  14527. return smalltalk.withContext(function($ctx1) { self["@currentClass"]=aClass;
  14528. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass}, smalltalk.Compiler)})},
  14529. args: ["aClass"],
  14530. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  14531. messageSends: [],
  14532. referencedClasses: []
  14533. }),
  14534. smalltalk.Compiler);
  14535. smalltalk.addMethod(
  14536. "_eval_",
  14537. smalltalk.method({
  14538. selector: "eval:",
  14539. category: 'compiling',
  14540. fn: function (aString){
  14541. var self=this;
  14542. return smalltalk.withContext(function($ctx1) { return eval(aString);
  14543. return self}, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString}, smalltalk.Compiler)})},
  14544. args: ["aString"],
  14545. source: "eval: aString\x0a\x09<return eval(aString)>",
  14546. messageSends: [],
  14547. referencedClasses: []
  14548. }),
  14549. smalltalk.Compiler);
  14550. smalltalk.addMethod(
  14551. "_evaluateExpression_",
  14552. smalltalk.method({
  14553. selector: "evaluateExpression:",
  14554. category: 'compiling',
  14555. fn: function (aString){
  14556. var self=this;
  14557. var result;
  14558. return smalltalk.withContext(function($ctx1) { var $1;
  14559. _st((smalltalk.DoIt || DoIt))._addCompiledMethod_(_st(self)._eval_(_st(self)._compileExpression_(aString)));
  14560. result=_st(_st((smalltalk.DoIt || DoIt))._new())._doIt();
  14561. _st((smalltalk.DoIt || DoIt))._removeCompiledMethod_(_st(_st((smalltalk.DoIt || DoIt))._methodDictionary())._at_("doIt"));
  14562. $1=result;
  14563. return $1;
  14564. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString,result:result}, smalltalk.Compiler)})},
  14565. args: ["aString"],
  14566. source: "evaluateExpression: aString\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression and answer the returned object\x22\x0a\x09| result |\x0a\x09DoIt addCompiledMethod: (self eval: (self compileExpression: aString)).\x0a\x09result := DoIt new doIt.\x0a\x09DoIt removeCompiledMethod: (DoIt methodDictionary at: 'doIt').\x0a\x09^result",
  14567. messageSends: ["addCompiledMethod:", "eval:", "compileExpression:", "doIt", "new", "removeCompiledMethod:", "at:", "methodDictionary"],
  14568. referencedClasses: ["DoIt"]
  14569. }),
  14570. smalltalk.Compiler);
  14571. smalltalk.addMethod(
  14572. "_install_forClass_category_",
  14573. smalltalk.method({
  14574. selector: "install:forClass:category:",
  14575. category: 'compiling',
  14576. fn: function (aString,aBehavior,anotherString){
  14577. var self=this;
  14578. return smalltalk.withContext(function($ctx1) { var $1;
  14579. $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._installMethod_forClass_category_(_st(self)._eval_(_st(self)._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
  14580. return $1;
  14581. }, function($ctx1) {$ctx1.fill(self,"install:forClass:category:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString}, smalltalk.Compiler)})},
  14582. args: ["aString", "aBehavior", "anotherString"],
  14583. source: "install: aString forClass: aBehavior category: anotherString\x0a \x09^ ClassBuilder new\x0a \x09installMethod: (self eval: (self compile: aString forClass: aBehavior))\x0a forClass: aBehavior\x0a category: anotherString",
  14584. messageSends: ["installMethod:forClass:category:", "eval:", "compile:forClass:", "new"],
  14585. referencedClasses: ["ClassBuilder"]
  14586. }),
  14587. smalltalk.Compiler);
  14588. smalltalk.addMethod(
  14589. "_parse_",
  14590. smalltalk.method({
  14591. selector: "parse:",
  14592. category: 'compiling',
  14593. fn: function (aString){
  14594. var self=this;
  14595. return smalltalk.withContext(function($ctx1) { var $1;
  14596. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._parse_(aString);
  14597. return $1;
  14598. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString}, smalltalk.Compiler)})},
  14599. args: ["aString"],
  14600. source: "parse: aString\x0a ^Smalltalk current parse: aString",
  14601. messageSends: ["parse:", "current"],
  14602. referencedClasses: ["Smalltalk"]
  14603. }),
  14604. smalltalk.Compiler);
  14605. smalltalk.addMethod(
  14606. "_parseExpression_",
  14607. smalltalk.method({
  14608. selector: "parseExpression:",
  14609. category: 'compiling',
  14610. fn: function (aString){
  14611. var self=this;
  14612. return smalltalk.withContext(function($ctx1) { var $1;
  14613. $1=_st(self)._parse_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  14614. return $1;
  14615. }, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString}, smalltalk.Compiler)})},
  14616. args: ["aString"],
  14617. source: "parseExpression: aString\x0a ^self parse: 'doIt ^[', aString, '] value'",
  14618. messageSends: ["parse:", ","],
  14619. referencedClasses: []
  14620. }),
  14621. smalltalk.Compiler);
  14622. smalltalk.addMethod(
  14623. "_recompile_",
  14624. smalltalk.method({
  14625. selector: "recompile:",
  14626. category: 'compiling',
  14627. fn: function (aClass){
  14628. var self=this;
  14629. return smalltalk.withContext(function($ctx1) { var $1;
  14630. _st(_st(aClass)._methodDictionary())._do_((function(each){
  14631. return smalltalk.withContext(function($ctx2) { _st(console)._log_(_st(_st(_st(aClass)._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  14632. return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
  14633. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  14634. $1=_st(aClass)._isMetaclass();
  14635. if(! smalltalk.assert($1)){
  14636. _st(self)._recompile_(_st(aClass)._class());
  14637. };
  14638. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass}, smalltalk.Compiler)})},
  14639. args: ["aClass"],
  14640. source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each |\x0a\x09\x09console log: aClass name, ' >> ', each selector.\x0a\x09\x09self install: each source forClass: aClass category: each category].\x0a\x09\x22self setupClass: aClass.\x22\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]",
  14641. messageSends: ["do:", "log:", ",", "selector", "name", "install:forClass:category:", "source", "category", "methodDictionary", "ifFalse:", "recompile:", "class", "isMetaclass"],
  14642. referencedClasses: []
  14643. }),
  14644. smalltalk.Compiler);
  14645. smalltalk.addMethod(
  14646. "_recompileAll",
  14647. smalltalk.method({
  14648. selector: "recompileAll",
  14649. category: 'compiling',
  14650. fn: function (){
  14651. var self=this;
  14652. return smalltalk.withContext(function($ctx1) { var $1,$2;
  14653. _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
  14654. return smalltalk.withContext(function($ctx2) { $1=(smalltalk.Transcript || Transcript);
  14655. _st($1)._show_(each);
  14656. $2=_st($1)._cr();
  14657. $2;
  14658. return _st((function(){
  14659. return smalltalk.withContext(function($ctx3) { return _st(self)._recompile_(each);
  14660. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((100));
  14661. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  14662. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{}, smalltalk.Compiler)})},
  14663. args: [],
  14664. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]",
  14665. messageSends: ["do:", "show:", "cr", "valueWithTimeout:", "recompile:", "classes", "current"],
  14666. referencedClasses: ["Transcript", "Smalltalk"]
  14667. }),
  14668. smalltalk.Compiler);
  14669. smalltalk.addMethod(
  14670. "_source",
  14671. smalltalk.method({
  14672. selector: "source",
  14673. category: 'accessing',
  14674. fn: function (){
  14675. var self=this;
  14676. return smalltalk.withContext(function($ctx1) { var $2,$1;
  14677. $2=self["@source"];
  14678. if(($receiver = $2) == nil || $receiver == undefined){
  14679. $1="";
  14680. } else {
  14681. $1=$2;
  14682. };
  14683. return $1;
  14684. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.Compiler)})},
  14685. args: [],
  14686. source: "source\x0a\x09^source ifNil: ['']",
  14687. messageSends: ["ifNil:"],
  14688. referencedClasses: []
  14689. }),
  14690. smalltalk.Compiler);
  14691. smalltalk.addMethod(
  14692. "_source_",
  14693. smalltalk.method({
  14694. selector: "source:",
  14695. category: 'accessing',
  14696. fn: function (aString){
  14697. var self=this;
  14698. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  14699. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.Compiler)})},
  14700. args: ["aString"],
  14701. source: "source: aString\x0a\x09source := aString",
  14702. messageSends: [],
  14703. referencedClasses: []
  14704. }),
  14705. smalltalk.Compiler);
  14706. smalltalk.addMethod(
  14707. "_unknownVariables",
  14708. smalltalk.method({
  14709. selector: "unknownVariables",
  14710. category: 'accessing',
  14711. fn: function (){
  14712. var self=this;
  14713. return smalltalk.withContext(function($ctx1) { var $1;
  14714. $1=self["@unknownVariables"];
  14715. return $1;
  14716. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{}, smalltalk.Compiler)})},
  14717. args: [],
  14718. source: "unknownVariables\x0a\x09^unknownVariables",
  14719. messageSends: [],
  14720. referencedClasses: []
  14721. }),
  14722. smalltalk.Compiler);
  14723. smalltalk.addMethod(
  14724. "_unknownVariables_",
  14725. smalltalk.method({
  14726. selector: "unknownVariables:",
  14727. category: 'accessing',
  14728. fn: function (aCollection){
  14729. var self=this;
  14730. return smalltalk.withContext(function($ctx1) { self["@unknownVariables"]=aCollection;
  14731. return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection}, smalltalk.Compiler)})},
  14732. args: ["aCollection"],
  14733. source: "unknownVariables: aCollection\x0a\x09unknownVariables := aCollection",
  14734. messageSends: [],
  14735. referencedClasses: []
  14736. }),
  14737. smalltalk.Compiler);
  14738. smalltalk.addMethod(
  14739. "_recompile_",
  14740. smalltalk.method({
  14741. selector: "recompile:",
  14742. category: 'compiling',
  14743. fn: function (aClass){
  14744. var self=this;
  14745. return smalltalk.withContext(function($ctx1) { _st(_st(self)._new())._recompile_(aClass);
  14746. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass}, smalltalk.Compiler.klass)})},
  14747. args: ["aClass"],
  14748. source: "recompile: aClass\x0a\x09self new recompile: aClass",
  14749. messageSends: ["recompile:", "new"],
  14750. referencedClasses: []
  14751. }),
  14752. smalltalk.Compiler.klass);
  14753. smalltalk.addMethod(
  14754. "_recompileAll",
  14755. smalltalk.method({
  14756. selector: "recompileAll",
  14757. category: 'compiling',
  14758. fn: function (){
  14759. var self=this;
  14760. return smalltalk.withContext(function($ctx1) { _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
  14761. return smalltalk.withContext(function($ctx2) { return _st(self)._recompile_(each);
  14762. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  14763. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{}, smalltalk.Compiler.klass)})},
  14764. args: [],
  14765. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
  14766. messageSends: ["do:", "recompile:", "classes", "current"],
  14767. referencedClasses: ["Smalltalk"]
  14768. }),
  14769. smalltalk.Compiler.klass);
  14770. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  14771. smalltalk.DoIt.comment="`DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`."
  14772. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  14773. smalltalk.NodeVisitor.comment="I am the abstract super class of all AST node visitors."
  14774. smalltalk.addMethod(
  14775. "_visit_",
  14776. smalltalk.method({
  14777. selector: "visit:",
  14778. category: 'visiting',
  14779. fn: function (aNode){
  14780. var self=this;
  14781. return smalltalk.withContext(function($ctx1) { var $1;
  14782. $1=_st(aNode)._accept_(self);
  14783. return $1;
  14784. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14785. args: ["aNode"],
  14786. source: "visit: aNode\x0a\x09^ aNode accept: self",
  14787. messageSends: ["accept:"],
  14788. referencedClasses: []
  14789. }),
  14790. smalltalk.NodeVisitor);
  14791. smalltalk.addMethod(
  14792. "_visitAll_",
  14793. smalltalk.method({
  14794. selector: "visitAll:",
  14795. category: 'visiting',
  14796. fn: function (aCollection){
  14797. var self=this;
  14798. return smalltalk.withContext(function($ctx1) { var $1;
  14799. $1=_st(aCollection)._collect_((function(each){
  14800. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  14801. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  14802. return $1;
  14803. }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection}, smalltalk.NodeVisitor)})},
  14804. args: ["aCollection"],
  14805. source: "visitAll: aCollection\x0a\x09^ aCollection collect: [ :each | self visit: each ]",
  14806. messageSends: ["collect:", "visit:"],
  14807. referencedClasses: []
  14808. }),
  14809. smalltalk.NodeVisitor);
  14810. smalltalk.addMethod(
  14811. "_visitAssignmentNode_",
  14812. smalltalk.method({
  14813. selector: "visitAssignmentNode:",
  14814. category: 'visiting',
  14815. fn: function (aNode){
  14816. var self=this;
  14817. return smalltalk.withContext(function($ctx1) { var $1;
  14818. $1=_st(self)._visitNode_(aNode);
  14819. return $1;
  14820. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14821. args: ["aNode"],
  14822. source: "visitAssignmentNode: aNode\x0a\x09^ self visitNode: aNode",
  14823. messageSends: ["visitNode:"],
  14824. referencedClasses: []
  14825. }),
  14826. smalltalk.NodeVisitor);
  14827. smalltalk.addMethod(
  14828. "_visitBlockNode_",
  14829. smalltalk.method({
  14830. selector: "visitBlockNode:",
  14831. category: 'visiting',
  14832. fn: function (aNode){
  14833. var self=this;
  14834. return smalltalk.withContext(function($ctx1) { var $1;
  14835. $1=_st(self)._visitNode_(aNode);
  14836. return $1;
  14837. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14838. args: ["aNode"],
  14839. source: "visitBlockNode: aNode\x0a\x09^ self visitNode: aNode",
  14840. messageSends: ["visitNode:"],
  14841. referencedClasses: []
  14842. }),
  14843. smalltalk.NodeVisitor);
  14844. smalltalk.addMethod(
  14845. "_visitBlockSequenceNode_",
  14846. smalltalk.method({
  14847. selector: "visitBlockSequenceNode:",
  14848. category: 'visiting',
  14849. fn: function (aNode){
  14850. var self=this;
  14851. return smalltalk.withContext(function($ctx1) { var $1;
  14852. $1=_st(self)._visitSequenceNode_(aNode);
  14853. return $1;
  14854. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14855. args: ["aNode"],
  14856. source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
  14857. messageSends: ["visitSequenceNode:"],
  14858. referencedClasses: []
  14859. }),
  14860. smalltalk.NodeVisitor);
  14861. smalltalk.addMethod(
  14862. "_visitCascadeNode_",
  14863. smalltalk.method({
  14864. selector: "visitCascadeNode:",
  14865. category: 'visiting',
  14866. fn: function (aNode){
  14867. var self=this;
  14868. return smalltalk.withContext(function($ctx1) { var $1;
  14869. $1=_st(self)._visitNode_(aNode);
  14870. return $1;
  14871. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14872. args: ["aNode"],
  14873. source: "visitCascadeNode: aNode\x0a\x09^ self visitNode: aNode",
  14874. messageSends: ["visitNode:"],
  14875. referencedClasses: []
  14876. }),
  14877. smalltalk.NodeVisitor);
  14878. smalltalk.addMethod(
  14879. "_visitClassReferenceNode_",
  14880. smalltalk.method({
  14881. selector: "visitClassReferenceNode:",
  14882. category: 'visiting',
  14883. fn: function (aNode){
  14884. var self=this;
  14885. return smalltalk.withContext(function($ctx1) { var $1;
  14886. $1=_st(self)._visitVariableNode_(aNode);
  14887. return $1;
  14888. }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14889. args: ["aNode"],
  14890. source: "visitClassReferenceNode: aNode\x0a\x09^ self visitVariableNode: aNode",
  14891. messageSends: ["visitVariableNode:"],
  14892. referencedClasses: []
  14893. }),
  14894. smalltalk.NodeVisitor);
  14895. smalltalk.addMethod(
  14896. "_visitDynamicArrayNode_",
  14897. smalltalk.method({
  14898. selector: "visitDynamicArrayNode:",
  14899. category: 'visiting',
  14900. fn: function (aNode){
  14901. var self=this;
  14902. return smalltalk.withContext(function($ctx1) { var $1;
  14903. $1=_st(self)._visitNode_(aNode);
  14904. return $1;
  14905. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14906. args: ["aNode"],
  14907. source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitNode: aNode",
  14908. messageSends: ["visitNode:"],
  14909. referencedClasses: []
  14910. }),
  14911. smalltalk.NodeVisitor);
  14912. smalltalk.addMethod(
  14913. "_visitDynamicDictionaryNode_",
  14914. smalltalk.method({
  14915. selector: "visitDynamicDictionaryNode:",
  14916. category: 'visiting',
  14917. fn: function (aNode){
  14918. var self=this;
  14919. return smalltalk.withContext(function($ctx1) { var $1;
  14920. $1=_st(self)._visitNode_(aNode);
  14921. return $1;
  14922. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14923. args: ["aNode"],
  14924. source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitNode: aNode",
  14925. messageSends: ["visitNode:"],
  14926. referencedClasses: []
  14927. }),
  14928. smalltalk.NodeVisitor);
  14929. smalltalk.addMethod(
  14930. "_visitJSStatementNode_",
  14931. smalltalk.method({
  14932. selector: "visitJSStatementNode:",
  14933. category: 'visiting',
  14934. fn: function (aNode){
  14935. var self=this;
  14936. return smalltalk.withContext(function($ctx1) { var $1;
  14937. $1=_st(self)._visitNode_(aNode);
  14938. return $1;
  14939. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14940. args: ["aNode"],
  14941. source: "visitJSStatementNode: aNode\x0a\x09^ self visitNode: aNode",
  14942. messageSends: ["visitNode:"],
  14943. referencedClasses: []
  14944. }),
  14945. smalltalk.NodeVisitor);
  14946. smalltalk.addMethod(
  14947. "_visitMethodNode_",
  14948. smalltalk.method({
  14949. selector: "visitMethodNode:",
  14950. category: 'visiting',
  14951. fn: function (aNode){
  14952. var self=this;
  14953. return smalltalk.withContext(function($ctx1) { var $1;
  14954. $1=_st(self)._visitNode_(aNode);
  14955. return $1;
  14956. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14957. args: ["aNode"],
  14958. source: "visitMethodNode: aNode\x0a\x09^ self visitNode: aNode",
  14959. messageSends: ["visitNode:"],
  14960. referencedClasses: []
  14961. }),
  14962. smalltalk.NodeVisitor);
  14963. smalltalk.addMethod(
  14964. "_visitNode_",
  14965. smalltalk.method({
  14966. selector: "visitNode:",
  14967. category: 'visiting',
  14968. fn: function (aNode){
  14969. var self=this;
  14970. return smalltalk.withContext(function($ctx1) { var $1;
  14971. $1=_st(self)._visitAll_(_st(aNode)._nodes());
  14972. return $1;
  14973. }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14974. args: ["aNode"],
  14975. source: "visitNode: aNode\x0a\x09^ self visitAll: aNode nodes",
  14976. messageSends: ["visitAll:", "nodes"],
  14977. referencedClasses: []
  14978. }),
  14979. smalltalk.NodeVisitor);
  14980. smalltalk.addMethod(
  14981. "_visitReturnNode_",
  14982. smalltalk.method({
  14983. selector: "visitReturnNode:",
  14984. category: 'visiting',
  14985. fn: function (aNode){
  14986. var self=this;
  14987. return smalltalk.withContext(function($ctx1) { var $1;
  14988. $1=_st(self)._visitNode_(aNode);
  14989. return $1;
  14990. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  14991. args: ["aNode"],
  14992. source: "visitReturnNode: aNode\x0a\x09^ self visitNode: aNode",
  14993. messageSends: ["visitNode:"],
  14994. referencedClasses: []
  14995. }),
  14996. smalltalk.NodeVisitor);
  14997. smalltalk.addMethod(
  14998. "_visitSendNode_",
  14999. smalltalk.method({
  15000. selector: "visitSendNode:",
  15001. category: 'visiting',
  15002. fn: function (aNode){
  15003. var self=this;
  15004. return smalltalk.withContext(function($ctx1) { var $1;
  15005. $1=_st(self)._visitNode_(aNode);
  15006. return $1;
  15007. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  15008. args: ["aNode"],
  15009. source: "visitSendNode: aNode\x0a\x09^ self visitNode: aNode",
  15010. messageSends: ["visitNode:"],
  15011. referencedClasses: []
  15012. }),
  15013. smalltalk.NodeVisitor);
  15014. smalltalk.addMethod(
  15015. "_visitSequenceNode_",
  15016. smalltalk.method({
  15017. selector: "visitSequenceNode:",
  15018. category: 'visiting',
  15019. fn: function (aNode){
  15020. var self=this;
  15021. return smalltalk.withContext(function($ctx1) { var $1;
  15022. $1=_st(self)._visitNode_(aNode);
  15023. return $1;
  15024. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  15025. args: ["aNode"],
  15026. source: "visitSequenceNode: aNode\x0a\x09^ self visitNode: aNode",
  15027. messageSends: ["visitNode:"],
  15028. referencedClasses: []
  15029. }),
  15030. smalltalk.NodeVisitor);
  15031. smalltalk.addMethod(
  15032. "_visitValueNode_",
  15033. smalltalk.method({
  15034. selector: "visitValueNode:",
  15035. category: 'visiting',
  15036. fn: function (aNode){
  15037. var self=this;
  15038. return smalltalk.withContext(function($ctx1) { var $1;
  15039. $1=_st(self)._visitNode_(aNode);
  15040. return $1;
  15041. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  15042. args: ["aNode"],
  15043. source: "visitValueNode: aNode\x0a\x09^ self visitNode: aNode",
  15044. messageSends: ["visitNode:"],
  15045. referencedClasses: []
  15046. }),
  15047. smalltalk.NodeVisitor);
  15048. smalltalk.addMethod(
  15049. "_visitVariableNode_",
  15050. smalltalk.method({
  15051. selector: "visitVariableNode:",
  15052. category: 'visiting',
  15053. fn: function (aNode){
  15054. var self=this;
  15055. return smalltalk.withContext(function($ctx1) { var $1;
  15056. $1=_st(self)._visitNode_(aNode);
  15057. return $1;
  15058. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  15059. args: ["aNode"],
  15060. source: "visitVariableNode: aNode\x0a\x09^ self visitNode: aNode",
  15061. messageSends: ["visitNode:"],
  15062. referencedClasses: []
  15063. }),
  15064. smalltalk.NodeVisitor);
  15065. smalltalk.addClass('AbstractCodeGenerator', smalltalk.NodeVisitor, ['currentClass', 'source'], 'Compiler-Core');
  15066. smalltalk.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API."
  15067. smalltalk.addMethod(
  15068. "_classNameFor_",
  15069. smalltalk.method({
  15070. selector: "classNameFor:",
  15071. category: 'accessing',
  15072. fn: function (aClass){
  15073. var self=this;
  15074. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  15075. $2=_st(aClass)._isMetaclass();
  15076. if(smalltalk.assert($2)){
  15077. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
  15078. } else {
  15079. $3=_st(aClass)._isNil();
  15080. if(smalltalk.assert($3)){
  15081. $1="nil";
  15082. } else {
  15083. $1=_st(aClass)._name();
  15084. };
  15085. };
  15086. return $1;
  15087. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass}, smalltalk.AbstractCodeGenerator)})},
  15088. args: ["aClass"],
  15089. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  15090. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"],
  15091. referencedClasses: []
  15092. }),
  15093. smalltalk.AbstractCodeGenerator);
  15094. smalltalk.addMethod(
  15095. "_compileNode_",
  15096. smalltalk.method({
  15097. selector: "compileNode:",
  15098. category: 'compiling',
  15099. fn: function (aNode){
  15100. var self=this;
  15101. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  15102. return self}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode}, smalltalk.AbstractCodeGenerator)})},
  15103. args: ["aNode"],
  15104. source: "compileNode: aNode\x0a\x09self subclassResponsibility",
  15105. messageSends: ["subclassResponsibility"],
  15106. referencedClasses: []
  15107. }),
  15108. smalltalk.AbstractCodeGenerator);
  15109. smalltalk.addMethod(
  15110. "_currentClass",
  15111. smalltalk.method({
  15112. selector: "currentClass",
  15113. category: 'accessing',
  15114. fn: function (){
  15115. var self=this;
  15116. return smalltalk.withContext(function($ctx1) { var $1;
  15117. $1=self["@currentClass"];
  15118. return $1;
  15119. }, function($ctx1) {$ctx1.fill(self,"currentClass",{}, smalltalk.AbstractCodeGenerator)})},
  15120. args: [],
  15121. source: "currentClass\x0a\x09^currentClass",
  15122. messageSends: [],
  15123. referencedClasses: []
  15124. }),
  15125. smalltalk.AbstractCodeGenerator);
  15126. smalltalk.addMethod(
  15127. "_currentClass_",
  15128. smalltalk.method({
  15129. selector: "currentClass:",
  15130. category: 'accessing',
  15131. fn: function (aClass){
  15132. var self=this;
  15133. return smalltalk.withContext(function($ctx1) { self["@currentClass"]=aClass;
  15134. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass}, smalltalk.AbstractCodeGenerator)})},
  15135. args: ["aClass"],
  15136. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  15137. messageSends: [],
  15138. referencedClasses: []
  15139. }),
  15140. smalltalk.AbstractCodeGenerator);
  15141. smalltalk.addMethod(
  15142. "_pseudoVariables",
  15143. smalltalk.method({
  15144. selector: "pseudoVariables",
  15145. category: 'accessing',
  15146. fn: function (){
  15147. var self=this;
  15148. return smalltalk.withContext(function($ctx1) { return ["self", "super", "true", "false", "nil", "thisContext"];
  15149. }, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{}, smalltalk.AbstractCodeGenerator)})},
  15150. args: [],
  15151. source: "pseudoVariables\x0a\x09^#('self' 'super' 'true' 'false' 'nil' 'thisContext')",
  15152. messageSends: [],
  15153. referencedClasses: []
  15154. }),
  15155. smalltalk.AbstractCodeGenerator);
  15156. smalltalk.addMethod(
  15157. "_safeVariableNameFor_",
  15158. smalltalk.method({
  15159. selector: "safeVariableNameFor:",
  15160. category: 'accessing',
  15161. fn: function (aString){
  15162. var self=this;
  15163. return smalltalk.withContext(function($ctx1) { var $2,$1;
  15164. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(aString);
  15165. if(smalltalk.assert($2)){
  15166. $1=_st(aString).__comma("_");
  15167. } else {
  15168. $1=aString;
  15169. };
  15170. return $1;
  15171. }, function($ctx1) {$ctx1.fill(self,"safeVariableNameFor:",{aString:aString}, smalltalk.AbstractCodeGenerator)})},
  15172. args: ["aString"],
  15173. source: "safeVariableNameFor: aString\x0a\x09^(Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [aString, '_']\x0a\x09\x09ifFalse: [aString]",
  15174. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  15175. referencedClasses: ["Smalltalk"]
  15176. }),
  15177. smalltalk.AbstractCodeGenerator);
  15178. smalltalk.addMethod(
  15179. "_source",
  15180. smalltalk.method({
  15181. selector: "source",
  15182. category: 'accessing',
  15183. fn: function (){
  15184. var self=this;
  15185. return smalltalk.withContext(function($ctx1) { var $2,$1;
  15186. $2=self["@source"];
  15187. if(($receiver = $2) == nil || $receiver == undefined){
  15188. $1="";
  15189. } else {
  15190. $1=$2;
  15191. };
  15192. return $1;
  15193. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.AbstractCodeGenerator)})},
  15194. args: [],
  15195. source: "source\x0a\x09^source ifNil: ['']",
  15196. messageSends: ["ifNil:"],
  15197. referencedClasses: []
  15198. }),
  15199. smalltalk.AbstractCodeGenerator);
  15200. smalltalk.addMethod(
  15201. "_source_",
  15202. smalltalk.method({
  15203. selector: "source:",
  15204. category: 'accessing',
  15205. fn: function (aString){
  15206. var self=this;
  15207. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  15208. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.AbstractCodeGenerator)})},
  15209. args: ["aString"],
  15210. source: "source: aString\x0a\x09source := aString",
  15211. messageSends: [],
  15212. referencedClasses: []
  15213. }),
  15214. smalltalk.AbstractCodeGenerator);
  15215. smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler-Core');
  15216. smalltalk.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation."
  15217. smalltalk.addMethod(
  15218. "_compileNode_",
  15219. smalltalk.method({
  15220. selector: "compileNode:",
  15221. category: 'compiling',
  15222. fn: function (aNode){
  15223. var self=this;
  15224. var ir,stream;
  15225. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  15226. _st(_st(self)._semanticAnalyzer())._visit_(aNode);
  15227. ir=_st(_st(self)._translator())._visit_(aNode);
  15228. $2=_st(self)._irTranslator();
  15229. _st($2)._visit_(ir);
  15230. $3=_st($2)._contents();
  15231. $1=$3;
  15232. return $1;
  15233. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream}, smalltalk.CodeGenerator)})},
  15234. args: ["aNode"],
  15235. source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09^ self irTranslator\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
  15236. messageSends: ["visit:", "semanticAnalyzer", "translator", "irTranslator", "contents"],
  15237. referencedClasses: []
  15238. }),
  15239. smalltalk.CodeGenerator);
  15240. smalltalk.addMethod(
  15241. "_irTranslator",
  15242. smalltalk.method({
  15243. selector: "irTranslator",
  15244. category: 'compiling',
  15245. fn: function (){
  15246. var self=this;
  15247. return smalltalk.withContext(function($ctx1) { var $1;
  15248. $1=_st((smalltalk.IRJSTranslator || IRJSTranslator))._new();
  15249. return $1;
  15250. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{}, smalltalk.CodeGenerator)})},
  15251. args: [],
  15252. source: "irTranslator\x0a\x09^ IRJSTranslator new",
  15253. messageSends: ["new"],
  15254. referencedClasses: ["IRJSTranslator"]
  15255. }),
  15256. smalltalk.CodeGenerator);
  15257. smalltalk.addMethod(
  15258. "_semanticAnalyzer",
  15259. smalltalk.method({
  15260. selector: "semanticAnalyzer",
  15261. category: 'compiling',
  15262. fn: function (){
  15263. var self=this;
  15264. return smalltalk.withContext(function($ctx1) { var $1;
  15265. $1=_st((smalltalk.SemanticAnalyzer || SemanticAnalyzer))._on_(_st(self)._currentClass());
  15266. return $1;
  15267. }, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{}, smalltalk.CodeGenerator)})},
  15268. args: [],
  15269. source: "semanticAnalyzer\x0a\x09^ SemanticAnalyzer on: self currentClass",
  15270. messageSends: ["on:", "currentClass"],
  15271. referencedClasses: ["SemanticAnalyzer"]
  15272. }),
  15273. smalltalk.CodeGenerator);
  15274. smalltalk.addMethod(
  15275. "_translator",
  15276. smalltalk.method({
  15277. selector: "translator",
  15278. category: 'compiling',
  15279. fn: function (){
  15280. var self=this;
  15281. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  15282. $2=_st((smalltalk.IRASTTranslator || IRASTTranslator))._new();
  15283. _st($2)._source_(_st(self)._source());
  15284. _st($2)._theClass_(_st(self)._currentClass());
  15285. $3=_st($2)._yourself();
  15286. $1=$3;
  15287. return $1;
  15288. }, function($ctx1) {$ctx1.fill(self,"translator",{}, smalltalk.CodeGenerator)})},
  15289. args: [],
  15290. source: "translator\x0a\x09^ IRASTTranslator new\x0a\x09\x09source: self source;\x0a\x09\x09theClass: self currentClass;\x0a\x09\x09yourself",
  15291. messageSends: ["source:", "source", "new", "theClass:", "currentClass", "yourself"],
  15292. referencedClasses: ["IRASTTranslator"]
  15293. }),
  15294. smalltalk.CodeGenerator);
  15295. smalltalk.addPackage('Compiler-Exceptions', {});
  15296. smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
  15297. smalltalk.CompilerError.comment="I am the common superclass of all compiling errors."
  15298. smalltalk.addClass('ParseError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
  15299. smalltalk.ParseError.comment="Instance of ParseError are signaled on any parsing error. \x0aSee `Smalltalk >> #parse:`"
  15300. smalltalk.addClass('SemanticError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
  15301. smalltalk.SemanticError.comment="I represent an abstract semantic error thrown by the SemanticAnalyzer.\x0aSemantic errors can be unknown variable errors, etc.\x0aSee my subclasses for concrete errors.\x0a\x0aThe IDE should catch instances of Semantic error to deal with them when compiling"
  15302. smalltalk.addClass('InliningError', smalltalk.SemanticError, [], 'Compiler-Exceptions');
  15303. smalltalk.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`."
  15304. smalltalk.addClass('InvalidAssignmentError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  15305. smalltalk.InvalidAssignmentError.comment="I get signaled when a pseudo variable gets assigned."
  15306. smalltalk.addMethod(
  15307. "_messageText",
  15308. smalltalk.method({
  15309. selector: "messageText",
  15310. category: 'accessing',
  15311. fn: function (){
  15312. var self=this;
  15313. return smalltalk.withContext(function($ctx1) { var $1;
  15314. $1=_st(" Invalid assignment to variable: ").__comma(_st(self)._variableName());
  15315. return $1;
  15316. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.InvalidAssignmentError)})},
  15317. args: [],
  15318. source: "messageText\x0a\x09^ ' Invalid assignment to variable: ', self variableName",
  15319. messageSends: [",", "variableName"],
  15320. referencedClasses: []
  15321. }),
  15322. smalltalk.InvalidAssignmentError);
  15323. smalltalk.addMethod(
  15324. "_variableName",
  15325. smalltalk.method({
  15326. selector: "variableName",
  15327. category: 'accessing',
  15328. fn: function (){
  15329. var self=this;
  15330. return smalltalk.withContext(function($ctx1) { var $1;
  15331. $1=self["@variableName"];
  15332. return $1;
  15333. }, function($ctx1) {$ctx1.fill(self,"variableName",{}, smalltalk.InvalidAssignmentError)})},
  15334. args: [],
  15335. source: "variableName\x0a\x09^ variableName",
  15336. messageSends: [],
  15337. referencedClasses: []
  15338. }),
  15339. smalltalk.InvalidAssignmentError);
  15340. smalltalk.addMethod(
  15341. "_variableName_",
  15342. smalltalk.method({
  15343. selector: "variableName:",
  15344. category: 'accessing',
  15345. fn: function (aString){
  15346. var self=this;
  15347. return smalltalk.withContext(function($ctx1) { self["@variableName"]=aString;
  15348. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString}, smalltalk.InvalidAssignmentError)})},
  15349. args: ["aString"],
  15350. source: "variableName: aString\x0a\x09variableName := aString",
  15351. messageSends: [],
  15352. referencedClasses: []
  15353. }),
  15354. smalltalk.InvalidAssignmentError);
  15355. smalltalk.addClass('ShadowingVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  15356. smalltalk.ShadowingVariableError.comment="I get signaled when a variable in a block or method scope shadows a variable of the same name in an outer scope."
  15357. smalltalk.addMethod(
  15358. "_messageText",
  15359. smalltalk.method({
  15360. selector: "messageText",
  15361. category: 'accessing',
  15362. fn: function (){
  15363. var self=this;
  15364. return smalltalk.withContext(function($ctx1) { var $1;
  15365. $1=_st(_st("Variable shadowing error: ").__comma(_st(self)._variableName())).__comma(" is already defined");
  15366. return $1;
  15367. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.ShadowingVariableError)})},
  15368. args: [],
  15369. source: "messageText\x0a\x09^ 'Variable shadowing error: ', self variableName, ' is already defined'",
  15370. messageSends: [",", "variableName"],
  15371. referencedClasses: []
  15372. }),
  15373. smalltalk.ShadowingVariableError);
  15374. smalltalk.addMethod(
  15375. "_variableName",
  15376. smalltalk.method({
  15377. selector: "variableName",
  15378. category: 'accessing',
  15379. fn: function (){
  15380. var self=this;
  15381. return smalltalk.withContext(function($ctx1) { var $1;
  15382. $1=self["@variableName"];
  15383. return $1;
  15384. }, function($ctx1) {$ctx1.fill(self,"variableName",{}, smalltalk.ShadowingVariableError)})},
  15385. args: [],
  15386. source: "variableName\x0a\x09^ variableName",
  15387. messageSends: [],
  15388. referencedClasses: []
  15389. }),
  15390. smalltalk.ShadowingVariableError);
  15391. smalltalk.addMethod(
  15392. "_variableName_",
  15393. smalltalk.method({
  15394. selector: "variableName:",
  15395. category: 'accessing',
  15396. fn: function (aString){
  15397. var self=this;
  15398. return smalltalk.withContext(function($ctx1) { self["@variableName"]=aString;
  15399. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString}, smalltalk.ShadowingVariableError)})},
  15400. args: ["aString"],
  15401. source: "variableName: aString\x0a\x09variableName := aString",
  15402. messageSends: [],
  15403. referencedClasses: []
  15404. }),
  15405. smalltalk.ShadowingVariableError);
  15406. smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
  15407. smalltalk.UnknownVariableError.comment="I get signaled when a variable is not defined.\x0aThe default behavior is to allow it, as this is how Amber currently is able to seamlessly send messages to JavaScript objects."
  15408. smalltalk.addMethod(
  15409. "_messageText",
  15410. smalltalk.method({
  15411. selector: "messageText",
  15412. category: 'accessing',
  15413. fn: function (){
  15414. var self=this;
  15415. return smalltalk.withContext(function($ctx1) { var $1;
  15416. $1=_st(_st("Unknown Variable error: ").__comma(_st(self)._variableName())).__comma(" is not defined");
  15417. return $1;
  15418. }, function($ctx1) {$ctx1.fill(self,"messageText",{}, smalltalk.UnknownVariableError)})},
  15419. args: [],
  15420. source: "messageText\x0a\x09^ 'Unknown Variable error: ', self variableName, ' is not defined'",
  15421. messageSends: [",", "variableName"],
  15422. referencedClasses: []
  15423. }),
  15424. smalltalk.UnknownVariableError);
  15425. smalltalk.addMethod(
  15426. "_variableName",
  15427. smalltalk.method({
  15428. selector: "variableName",
  15429. category: 'accessing',
  15430. fn: function (){
  15431. var self=this;
  15432. return smalltalk.withContext(function($ctx1) { var $1;
  15433. $1=self["@variableName"];
  15434. return $1;
  15435. }, function($ctx1) {$ctx1.fill(self,"variableName",{}, smalltalk.UnknownVariableError)})},
  15436. args: [],
  15437. source: "variableName\x0a\x09^ variableName",
  15438. messageSends: [],
  15439. referencedClasses: []
  15440. }),
  15441. smalltalk.UnknownVariableError);
  15442. smalltalk.addMethod(
  15443. "_variableName_",
  15444. smalltalk.method({
  15445. selector: "variableName:",
  15446. category: 'accessing',
  15447. fn: function (aString){
  15448. var self=this;
  15449. return smalltalk.withContext(function($ctx1) { self["@variableName"]=aString;
  15450. return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString}, smalltalk.UnknownVariableError)})},
  15451. args: ["aString"],
  15452. source: "variableName: aString\x0a\x09variableName := aString",
  15453. messageSends: [],
  15454. referencedClasses: []
  15455. }),
  15456. smalltalk.UnknownVariableError);
  15457. smalltalk.addClass('RethrowErrorHandler', smalltalk.ErrorHandler, [], 'Compiler-Exceptions');
  15458. smalltalk.RethrowErrorHandler.comment="This class is used in the commandline version of the compiler.\x0aIt uses the handleError: message of ErrorHandler for printing the stacktrace and throws the error again as JS exception.\x0aAs a result Smalltalk errors are not swallowd by the Amber runtime and compilation can be aborted."
  15459. smalltalk.addMethod(
  15460. "_basicSignal_",
  15461. smalltalk.method({
  15462. selector: "basicSignal:",
  15463. category: 'error handling',
  15464. fn: function (anError){
  15465. var self=this;
  15466. return smalltalk.withContext(function($ctx1) { throw anError;
  15467. return self}, function($ctx1) {$ctx1.fill(self,"basicSignal:",{anError:anError}, smalltalk.RethrowErrorHandler)})},
  15468. args: ["anError"],
  15469. source: "basicSignal: anError\x0a\x09<throw anError>",
  15470. messageSends: [],
  15471. referencedClasses: []
  15472. }),
  15473. smalltalk.RethrowErrorHandler);
  15474. smalltalk.addMethod(
  15475. "_handleError_",
  15476. smalltalk.method({
  15477. selector: "handleError:",
  15478. category: 'error handling',
  15479. fn: function (anError){
  15480. var self=this;
  15481. return smalltalk.withContext(function($ctx1) { smalltalk.ErrorHandler.fn.prototype._handleError_.apply(_st(self), [anError]);
  15482. _st(self)._basicSignal_(anError);
  15483. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError}, smalltalk.RethrowErrorHandler)})},
  15484. args: ["anError"],
  15485. source: "handleError: anError\x0a\x09super handleError: anError.\x0a self basicSignal: anError",
  15486. messageSends: ["handleError:", "basicSignal:"],
  15487. referencedClasses: []
  15488. }),
  15489. smalltalk.RethrowErrorHandler);
  15490. smalltalk.addPackage('Compiler-AST', {});
  15491. smalltalk.addClass('Node', smalltalk.Object, ['position', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler-AST');
  15492. smalltalk.Node.comment="I am the abstract root class of the abstract syntax tree.\x0a\x0aposition: holds a point containing lline- and column number of the symbol location in the original source file"
  15493. smalltalk.addMethod(
  15494. "_accept_",
  15495. smalltalk.method({
  15496. selector: "accept:",
  15497. category: 'visiting',
  15498. fn: function (aVisitor){
  15499. var self=this;
  15500. return smalltalk.withContext(function($ctx1) { var $1;
  15501. $1=_st(aVisitor)._visitNode_(self);
  15502. return $1;
  15503. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.Node)})},
  15504. args: ["aVisitor"],
  15505. source: "accept: aVisitor\x0a\x09^ aVisitor visitNode: self",
  15506. messageSends: ["visitNode:"],
  15507. referencedClasses: []
  15508. }),
  15509. smalltalk.Node);
  15510. smalltalk.addMethod(
  15511. "_addNode_",
  15512. smalltalk.method({
  15513. selector: "addNode:",
  15514. category: 'accessing',
  15515. fn: function (aNode){
  15516. var self=this;
  15517. return smalltalk.withContext(function($ctx1) { _st(_st(self)._nodes())._add_(aNode);
  15518. return self}, function($ctx1) {$ctx1.fill(self,"addNode:",{aNode:aNode}, smalltalk.Node)})},
  15519. args: ["aNode"],
  15520. source: "addNode: aNode\x0a\x09self nodes add: aNode",
  15521. messageSends: ["add:", "nodes"],
  15522. referencedClasses: []
  15523. }),
  15524. smalltalk.Node);
  15525. smalltalk.addMethod(
  15526. "_isAssignmentNode",
  15527. smalltalk.method({
  15528. selector: "isAssignmentNode",
  15529. category: 'testing',
  15530. fn: function (){
  15531. var self=this;
  15532. return smalltalk.withContext(function($ctx1) { return false;
  15533. }, function($ctx1) {$ctx1.fill(self,"isAssignmentNode",{}, smalltalk.Node)})},
  15534. args: [],
  15535. source: "isAssignmentNode\x0a\x09^ false",
  15536. messageSends: [],
  15537. referencedClasses: []
  15538. }),
  15539. smalltalk.Node);
  15540. smalltalk.addMethod(
  15541. "_isBlockNode",
  15542. smalltalk.method({
  15543. selector: "isBlockNode",
  15544. category: 'testing',
  15545. fn: function (){
  15546. var self=this;
  15547. return smalltalk.withContext(function($ctx1) { return false;
  15548. }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{}, smalltalk.Node)})},
  15549. args: [],
  15550. source: "isBlockNode\x0a\x09^false",
  15551. messageSends: [],
  15552. referencedClasses: []
  15553. }),
  15554. smalltalk.Node);
  15555. smalltalk.addMethod(
  15556. "_isBlockSequenceNode",
  15557. smalltalk.method({
  15558. selector: "isBlockSequenceNode",
  15559. category: 'testing',
  15560. fn: function (){
  15561. var self=this;
  15562. return smalltalk.withContext(function($ctx1) { return false;
  15563. }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{}, smalltalk.Node)})},
  15564. args: [],
  15565. source: "isBlockSequenceNode\x0a\x09^false",
  15566. messageSends: [],
  15567. referencedClasses: []
  15568. }),
  15569. smalltalk.Node);
  15570. smalltalk.addMethod(
  15571. "_isImmutable",
  15572. smalltalk.method({
  15573. selector: "isImmutable",
  15574. category: 'testing',
  15575. fn: function (){
  15576. var self=this;
  15577. return smalltalk.withContext(function($ctx1) { return false;
  15578. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{}, smalltalk.Node)})},
  15579. args: [],
  15580. source: "isImmutable\x0a\x09^false",
  15581. messageSends: [],
  15582. referencedClasses: []
  15583. }),
  15584. smalltalk.Node);
  15585. smalltalk.addMethod(
  15586. "_isNode",
  15587. smalltalk.method({
  15588. selector: "isNode",
  15589. category: 'testing',
  15590. fn: function (){
  15591. var self=this;
  15592. return smalltalk.withContext(function($ctx1) { return true;
  15593. }, function($ctx1) {$ctx1.fill(self,"isNode",{}, smalltalk.Node)})},
  15594. args: [],
  15595. source: "isNode\x0a\x09^ true",
  15596. messageSends: [],
  15597. referencedClasses: []
  15598. }),
  15599. smalltalk.Node);
  15600. smalltalk.addMethod(
  15601. "_isReturnNode",
  15602. smalltalk.method({
  15603. selector: "isReturnNode",
  15604. category: 'testing',
  15605. fn: function (){
  15606. var self=this;
  15607. return smalltalk.withContext(function($ctx1) { return false;
  15608. }, function($ctx1) {$ctx1.fill(self,"isReturnNode",{}, smalltalk.Node)})},
  15609. args: [],
  15610. source: "isReturnNode\x0a\x09^false",
  15611. messageSends: [],
  15612. referencedClasses: []
  15613. }),
  15614. smalltalk.Node);
  15615. smalltalk.addMethod(
  15616. "_isSendNode",
  15617. smalltalk.method({
  15618. selector: "isSendNode",
  15619. category: 'testing',
  15620. fn: function (){
  15621. var self=this;
  15622. return smalltalk.withContext(function($ctx1) { return false;
  15623. }, function($ctx1) {$ctx1.fill(self,"isSendNode",{}, smalltalk.Node)})},
  15624. args: [],
  15625. source: "isSendNode\x0a\x09^false",
  15626. messageSends: [],
  15627. referencedClasses: []
  15628. }),
  15629. smalltalk.Node);
  15630. smalltalk.addMethod(
  15631. "_isValueNode",
  15632. smalltalk.method({
  15633. selector: "isValueNode",
  15634. category: 'testing',
  15635. fn: function (){
  15636. var self=this;
  15637. return smalltalk.withContext(function($ctx1) { return false;
  15638. }, function($ctx1) {$ctx1.fill(self,"isValueNode",{}, smalltalk.Node)})},
  15639. args: [],
  15640. source: "isValueNode\x0a\x09^false",
  15641. messageSends: [],
  15642. referencedClasses: []
  15643. }),
  15644. smalltalk.Node);
  15645. smalltalk.addMethod(
  15646. "_nodes",
  15647. smalltalk.method({
  15648. selector: "nodes",
  15649. category: 'accessing',
  15650. fn: function (){
  15651. var self=this;
  15652. return smalltalk.withContext(function($ctx1) { var $2,$1;
  15653. $2=self["@nodes"];
  15654. if(($receiver = $2) == nil || $receiver == undefined){
  15655. self["@nodes"]=_st((smalltalk.Array || Array))._new();
  15656. $1=self["@nodes"];
  15657. } else {
  15658. $1=$2;
  15659. };
  15660. return $1;
  15661. }, function($ctx1) {$ctx1.fill(self,"nodes",{}, smalltalk.Node)})},
  15662. args: [],
  15663. source: "nodes\x0a\x09^nodes ifNil: [nodes := Array new]",
  15664. messageSends: ["ifNil:", "new"],
  15665. referencedClasses: ["Array"]
  15666. }),
  15667. smalltalk.Node);
  15668. smalltalk.addMethod(
  15669. "_nodes_",
  15670. smalltalk.method({
  15671. selector: "nodes:",
  15672. category: 'building',
  15673. fn: function (aCollection){
  15674. var self=this;
  15675. return smalltalk.withContext(function($ctx1) { self["@nodes"]=aCollection;
  15676. return self}, function($ctx1) {$ctx1.fill(self,"nodes:",{aCollection:aCollection}, smalltalk.Node)})},
  15677. args: ["aCollection"],
  15678. source: "nodes: aCollection\x0a\x09nodes := aCollection",
  15679. messageSends: [],
  15680. referencedClasses: []
  15681. }),
  15682. smalltalk.Node);
  15683. smalltalk.addMethod(
  15684. "_position",
  15685. smalltalk.method({
  15686. selector: "position",
  15687. category: 'accessing',
  15688. fn: function (){
  15689. var self=this;
  15690. return smalltalk.withContext(function($ctx1) { var $2,$1;
  15691. $2=self["@position"];
  15692. if(($receiver = $2) == nil || $receiver == undefined){
  15693. self["@position"]=_st((0)).__at((0));
  15694. $1=self["@position"];
  15695. } else {
  15696. $1=$2;
  15697. };
  15698. return $1;
  15699. }, function($ctx1) {$ctx1.fill(self,"position",{}, smalltalk.Node)})},
  15700. args: [],
  15701. source: "position\x0a\x09^position ifNil: [position := 0@0]",
  15702. messageSends: ["ifNil:", "@"],
  15703. referencedClasses: []
  15704. }),
  15705. smalltalk.Node);
  15706. smalltalk.addMethod(
  15707. "_position_",
  15708. smalltalk.method({
  15709. selector: "position:",
  15710. category: 'building',
  15711. fn: function (aPosition){
  15712. var self=this;
  15713. return smalltalk.withContext(function($ctx1) { self["@position"]=aPosition;
  15714. return self}, function($ctx1) {$ctx1.fill(self,"position:",{aPosition:aPosition}, smalltalk.Node)})},
  15715. args: ["aPosition"],
  15716. source: "position: aPosition\x0a\x09position := aPosition",
  15717. messageSends: [],
  15718. referencedClasses: []
  15719. }),
  15720. smalltalk.Node);
  15721. smalltalk.addMethod(
  15722. "_shouldBeAliased",
  15723. smalltalk.method({
  15724. selector: "shouldBeAliased",
  15725. category: 'accessing',
  15726. fn: function (){
  15727. var self=this;
  15728. return smalltalk.withContext(function($ctx1) { var $2,$1;
  15729. $2=self["@shouldBeAliased"];
  15730. if(($receiver = $2) == nil || $receiver == undefined){
  15731. $1=false;
  15732. } else {
  15733. $1=$2;
  15734. };
  15735. return $1;
  15736. }, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{}, smalltalk.Node)})},
  15737. args: [],
  15738. source: "shouldBeAliased\x0a\x09^ shouldBeAliased ifNil: [ false ]",
  15739. messageSends: ["ifNil:"],
  15740. referencedClasses: []
  15741. }),
  15742. smalltalk.Node);
  15743. smalltalk.addMethod(
  15744. "_shouldBeAliased_",
  15745. smalltalk.method({
  15746. selector: "shouldBeAliased:",
  15747. category: 'accessing',
  15748. fn: function (aBoolean){
  15749. var self=this;
  15750. return smalltalk.withContext(function($ctx1) { self["@shouldBeAliased"]=aBoolean;
  15751. return self}, function($ctx1) {$ctx1.fill(self,"shouldBeAliased:",{aBoolean:aBoolean}, smalltalk.Node)})},
  15752. args: ["aBoolean"],
  15753. source: "shouldBeAliased: aBoolean\x0a\x09shouldBeAliased := aBoolean",
  15754. messageSends: [],
  15755. referencedClasses: []
  15756. }),
  15757. smalltalk.Node);
  15758. smalltalk.addMethod(
  15759. "_shouldBeInlined",
  15760. smalltalk.method({
  15761. selector: "shouldBeInlined",
  15762. category: 'accessing',
  15763. fn: function (){
  15764. var self=this;
  15765. return smalltalk.withContext(function($ctx1) { var $2,$1;
  15766. $2=self["@shouldBeInlined"];
  15767. if(($receiver = $2) == nil || $receiver == undefined){
  15768. $1=false;
  15769. } else {
  15770. $1=$2;
  15771. };
  15772. return $1;
  15773. }, function($ctx1) {$ctx1.fill(self,"shouldBeInlined",{}, smalltalk.Node)})},
  15774. args: [],
  15775. source: "shouldBeInlined\x0a\x09^ shouldBeInlined ifNil: [ false ]",
  15776. messageSends: ["ifNil:"],
  15777. referencedClasses: []
  15778. }),
  15779. smalltalk.Node);
  15780. smalltalk.addMethod(
  15781. "_shouldBeInlined_",
  15782. smalltalk.method({
  15783. selector: "shouldBeInlined:",
  15784. category: 'accessing',
  15785. fn: function (aBoolean){
  15786. var self=this;
  15787. return smalltalk.withContext(function($ctx1) { self["@shouldBeInlined"]=aBoolean;
  15788. return self}, function($ctx1) {$ctx1.fill(self,"shouldBeInlined:",{aBoolean:aBoolean}, smalltalk.Node)})},
  15789. args: ["aBoolean"],
  15790. source: "shouldBeInlined: aBoolean\x0a\x09shouldBeInlined := aBoolean",
  15791. messageSends: [],
  15792. referencedClasses: []
  15793. }),
  15794. smalltalk.Node);
  15795. smalltalk.addMethod(
  15796. "_subtreeNeedsAliasing",
  15797. smalltalk.method({
  15798. selector: "subtreeNeedsAliasing",
  15799. category: 'testing',
  15800. fn: function (){
  15801. var self=this;
  15802. return smalltalk.withContext(function($ctx1) { var $1;
  15803. $1=_st(_st(_st(self)._shouldBeAliased())._or_((function(){
  15804. return smalltalk.withContext(function($ctx2) { return _st(self)._shouldBeInlined();
  15805. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._or_((function(){
  15806. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._nodes())._detect_ifNone_((function(each){
  15807. return smalltalk.withContext(function($ctx3) { return _st(each)._subtreeNeedsAliasing();
  15808. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  15809. return smalltalk.withContext(function($ctx3) { return false;
  15810. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))).__tild_eq(false);
  15811. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  15812. return $1;
  15813. }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{}, smalltalk.Node)})},
  15814. args: [],
  15815. source: "subtreeNeedsAliasing\x0a ^(self shouldBeAliased or: [ self shouldBeInlined ]) or: [\x0a (self nodes detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ false ]) ~= false ]",
  15816. messageSends: ["or:", "~=", "detect:ifNone:", "subtreeNeedsAliasing", "nodes", "shouldBeInlined", "shouldBeAliased"],
  15817. referencedClasses: []
  15818. }),
  15819. smalltalk.Node);
  15820. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler-AST');
  15821. smalltalk.addMethod(
  15822. "_accept_",
  15823. smalltalk.method({
  15824. selector: "accept:",
  15825. category: 'visiting',
  15826. fn: function (aVisitor){
  15827. var self=this;
  15828. return smalltalk.withContext(function($ctx1) { var $1;
  15829. $1=_st(aVisitor)._visitAssignmentNode_(self);
  15830. return $1;
  15831. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.AssignmentNode)})},
  15832. args: ["aVisitor"],
  15833. source: "accept: aVisitor\x0a\x09^ aVisitor visitAssignmentNode: self",
  15834. messageSends: ["visitAssignmentNode:"],
  15835. referencedClasses: []
  15836. }),
  15837. smalltalk.AssignmentNode);
  15838. smalltalk.addMethod(
  15839. "_isAssignmentNode",
  15840. smalltalk.method({
  15841. selector: "isAssignmentNode",
  15842. category: 'testing',
  15843. fn: function (){
  15844. var self=this;
  15845. return smalltalk.withContext(function($ctx1) { return true;
  15846. }, function($ctx1) {$ctx1.fill(self,"isAssignmentNode",{}, smalltalk.AssignmentNode)})},
  15847. args: [],
  15848. source: "isAssignmentNode\x0a\x09^ true",
  15849. messageSends: [],
  15850. referencedClasses: []
  15851. }),
  15852. smalltalk.AssignmentNode);
  15853. smalltalk.addMethod(
  15854. "_left",
  15855. smalltalk.method({
  15856. selector: "left",
  15857. category: 'accessing',
  15858. fn: function (){
  15859. var self=this;
  15860. return smalltalk.withContext(function($ctx1) { var $1;
  15861. $1=self["@left"];
  15862. return $1;
  15863. }, function($ctx1) {$ctx1.fill(self,"left",{}, smalltalk.AssignmentNode)})},
  15864. args: [],
  15865. source: "left\x0a\x09^left",
  15866. messageSends: [],
  15867. referencedClasses: []
  15868. }),
  15869. smalltalk.AssignmentNode);
  15870. smalltalk.addMethod(
  15871. "_left_",
  15872. smalltalk.method({
  15873. selector: "left:",
  15874. category: 'accessing',
  15875. fn: function (aNode){
  15876. var self=this;
  15877. return smalltalk.withContext(function($ctx1) { self["@left"]=aNode;
  15878. return self}, function($ctx1) {$ctx1.fill(self,"left:",{aNode:aNode}, smalltalk.AssignmentNode)})},
  15879. args: ["aNode"],
  15880. source: "left: aNode\x0a\x09left := aNode",
  15881. messageSends: [],
  15882. referencedClasses: []
  15883. }),
  15884. smalltalk.AssignmentNode);
  15885. smalltalk.addMethod(
  15886. "_nodes",
  15887. smalltalk.method({
  15888. selector: "nodes",
  15889. category: 'accessing',
  15890. fn: function (){
  15891. var self=this;
  15892. return smalltalk.withContext(function($ctx1) { var $1;
  15893. $1=_st((smalltalk.Array || Array))._with_with_(_st(self)._left(),_st(self)._right());
  15894. return $1;
  15895. }, function($ctx1) {$ctx1.fill(self,"nodes",{}, smalltalk.AssignmentNode)})},
  15896. args: [],
  15897. source: "nodes\x0a\x09^ Array with: self left with: self right",
  15898. messageSends: ["with:with:", "left", "right"],
  15899. referencedClasses: ["Array"]
  15900. }),
  15901. smalltalk.AssignmentNode);
  15902. smalltalk.addMethod(
  15903. "_right",
  15904. smalltalk.method({
  15905. selector: "right",
  15906. category: 'accessing',
  15907. fn: function (){
  15908. var self=this;
  15909. return smalltalk.withContext(function($ctx1) { var $1;
  15910. $1=self["@right"];
  15911. return $1;
  15912. }, function($ctx1) {$ctx1.fill(self,"right",{}, smalltalk.AssignmentNode)})},
  15913. args: [],
  15914. source: "right\x0a\x09^right",
  15915. messageSends: [],
  15916. referencedClasses: []
  15917. }),
  15918. smalltalk.AssignmentNode);
  15919. smalltalk.addMethod(
  15920. "_right_",
  15921. smalltalk.method({
  15922. selector: "right:",
  15923. category: 'accessing',
  15924. fn: function (aNode){
  15925. var self=this;
  15926. return smalltalk.withContext(function($ctx1) { self["@right"]=aNode;
  15927. return self}, function($ctx1) {$ctx1.fill(self,"right:",{aNode:aNode}, smalltalk.AssignmentNode)})},
  15928. args: ["aNode"],
  15929. source: "right: aNode\x0a\x09right := aNode",
  15930. messageSends: [],
  15931. referencedClasses: []
  15932. }),
  15933. smalltalk.AssignmentNode);
  15934. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters', 'scope'], 'Compiler-AST');
  15935. smalltalk.addMethod(
  15936. "_accept_",
  15937. smalltalk.method({
  15938. selector: "accept:",
  15939. category: 'visiting',
  15940. fn: function (aVisitor){
  15941. var self=this;
  15942. return smalltalk.withContext(function($ctx1) { var $1;
  15943. $1=_st(aVisitor)._visitBlockNode_(self);
  15944. return $1;
  15945. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.BlockNode)})},
  15946. args: ["aVisitor"],
  15947. source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockNode: self",
  15948. messageSends: ["visitBlockNode:"],
  15949. referencedClasses: []
  15950. }),
  15951. smalltalk.BlockNode);
  15952. smalltalk.addMethod(
  15953. "_isBlockNode",
  15954. smalltalk.method({
  15955. selector: "isBlockNode",
  15956. category: 'testing',
  15957. fn: function (){
  15958. var self=this;
  15959. return smalltalk.withContext(function($ctx1) { return true;
  15960. }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{}, smalltalk.BlockNode)})},
  15961. args: [],
  15962. source: "isBlockNode\x0a\x09^true",
  15963. messageSends: [],
  15964. referencedClasses: []
  15965. }),
  15966. smalltalk.BlockNode);
  15967. smalltalk.addMethod(
  15968. "_parameters",
  15969. smalltalk.method({
  15970. selector: "parameters",
  15971. category: 'accessing',
  15972. fn: function (){
  15973. var self=this;
  15974. return smalltalk.withContext(function($ctx1) { var $2,$1;
  15975. $2=self["@parameters"];
  15976. if(($receiver = $2) == nil || $receiver == undefined){
  15977. self["@parameters"]=_st((smalltalk.Array || Array))._new();
  15978. $1=self["@parameters"];
  15979. } else {
  15980. $1=$2;
  15981. };
  15982. return $1;
  15983. }, function($ctx1) {$ctx1.fill(self,"parameters",{}, smalltalk.BlockNode)})},
  15984. args: [],
  15985. source: "parameters\x0a\x09^parameters ifNil: [parameters := Array new]",
  15986. messageSends: ["ifNil:", "new"],
  15987. referencedClasses: ["Array"]
  15988. }),
  15989. smalltalk.BlockNode);
  15990. smalltalk.addMethod(
  15991. "_parameters_",
  15992. smalltalk.method({
  15993. selector: "parameters:",
  15994. category: 'accessing',
  15995. fn: function (aCollection){
  15996. var self=this;
  15997. return smalltalk.withContext(function($ctx1) { self["@parameters"]=aCollection;
  15998. return self}, function($ctx1) {$ctx1.fill(self,"parameters:",{aCollection:aCollection}, smalltalk.BlockNode)})},
  15999. args: ["aCollection"],
  16000. source: "parameters: aCollection\x0a\x09parameters := aCollection",
  16001. messageSends: [],
  16002. referencedClasses: []
  16003. }),
  16004. smalltalk.BlockNode);
  16005. smalltalk.addMethod(
  16006. "_scope",
  16007. smalltalk.method({
  16008. selector: "scope",
  16009. category: 'accessing',
  16010. fn: function (){
  16011. var self=this;
  16012. return smalltalk.withContext(function($ctx1) { var $1;
  16013. $1=self["@scope"];
  16014. return $1;
  16015. }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.BlockNode)})},
  16016. args: [],
  16017. source: "scope\x0a\x09^ scope",
  16018. messageSends: [],
  16019. referencedClasses: []
  16020. }),
  16021. smalltalk.BlockNode);
  16022. smalltalk.addMethod(
  16023. "_scope_",
  16024. smalltalk.method({
  16025. selector: "scope:",
  16026. category: 'accessing',
  16027. fn: function (aLexicalScope){
  16028. var self=this;
  16029. return smalltalk.withContext(function($ctx1) { self["@scope"]=aLexicalScope;
  16030. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope}, smalltalk.BlockNode)})},
  16031. args: ["aLexicalScope"],
  16032. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  16033. messageSends: [],
  16034. referencedClasses: []
  16035. }),
  16036. smalltalk.BlockNode);
  16037. smalltalk.addMethod(
  16038. "_subtreeNeedsAliasing",
  16039. smalltalk.method({
  16040. selector: "subtreeNeedsAliasing",
  16041. category: 'testing',
  16042. fn: function (){
  16043. var self=this;
  16044. return smalltalk.withContext(function($ctx1) { var $1;
  16045. $1=_st(_st(self)._shouldBeAliased())._or_((function(){
  16046. return smalltalk.withContext(function($ctx2) { return _st(self)._shouldBeInlined();
  16047. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  16048. return $1;
  16049. }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{}, smalltalk.BlockNode)})},
  16050. args: [],
  16051. source: "subtreeNeedsAliasing\x0a ^ self shouldBeAliased or: [ self shouldBeInlined ]",
  16052. messageSends: ["or:", "shouldBeInlined", "shouldBeAliased"],
  16053. referencedClasses: []
  16054. }),
  16055. smalltalk.BlockNode);
  16056. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler-AST');
  16057. smalltalk.addMethod(
  16058. "_accept_",
  16059. smalltalk.method({
  16060. selector: "accept:",
  16061. category: 'visiting',
  16062. fn: function (aVisitor){
  16063. var self=this;
  16064. return smalltalk.withContext(function($ctx1) { var $1;
  16065. $1=_st(aVisitor)._visitCascadeNode_(self);
  16066. return $1;
  16067. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.CascadeNode)})},
  16068. args: ["aVisitor"],
  16069. source: "accept: aVisitor\x0a\x09^ aVisitor visitCascadeNode: self",
  16070. messageSends: ["visitCascadeNode:"],
  16071. referencedClasses: []
  16072. }),
  16073. smalltalk.CascadeNode);
  16074. smalltalk.addMethod(
  16075. "_receiver",
  16076. smalltalk.method({
  16077. selector: "receiver",
  16078. category: 'accessing',
  16079. fn: function (){
  16080. var self=this;
  16081. return smalltalk.withContext(function($ctx1) { var $1;
  16082. $1=self["@receiver"];
  16083. return $1;
  16084. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.CascadeNode)})},
  16085. args: [],
  16086. source: "receiver\x0a\x09^receiver",
  16087. messageSends: [],
  16088. referencedClasses: []
  16089. }),
  16090. smalltalk.CascadeNode);
  16091. smalltalk.addMethod(
  16092. "_receiver_",
  16093. smalltalk.method({
  16094. selector: "receiver:",
  16095. category: 'accessing',
  16096. fn: function (aNode){
  16097. var self=this;
  16098. return smalltalk.withContext(function($ctx1) { self["@receiver"]=aNode;
  16099. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode}, smalltalk.CascadeNode)})},
  16100. args: ["aNode"],
  16101. source: "receiver: aNode\x0a\x09receiver := aNode",
  16102. messageSends: [],
  16103. referencedClasses: []
  16104. }),
  16105. smalltalk.CascadeNode);
  16106. smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler-AST');
  16107. smalltalk.addMethod(
  16108. "_accept_",
  16109. smalltalk.method({
  16110. selector: "accept:",
  16111. category: 'visiting',
  16112. fn: function (aVisitor){
  16113. var self=this;
  16114. return smalltalk.withContext(function($ctx1) { var $1;
  16115. $1=_st(aVisitor)._visitDynamicArrayNode_(self);
  16116. return $1;
  16117. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.DynamicArrayNode)})},
  16118. args: ["aVisitor"],
  16119. source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicArrayNode: self",
  16120. messageSends: ["visitDynamicArrayNode:"],
  16121. referencedClasses: []
  16122. }),
  16123. smalltalk.DynamicArrayNode);
  16124. smalltalk.addClass('DynamicDictionaryNode', smalltalk.Node, [], 'Compiler-AST');
  16125. smalltalk.addMethod(
  16126. "_accept_",
  16127. smalltalk.method({
  16128. selector: "accept:",
  16129. category: 'visiting',
  16130. fn: function (aVisitor){
  16131. var self=this;
  16132. return smalltalk.withContext(function($ctx1) { var $1;
  16133. $1=_st(aVisitor)._visitDynamicDictionaryNode_(self);
  16134. return $1;
  16135. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.DynamicDictionaryNode)})},
  16136. args: ["aVisitor"],
  16137. source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicDictionaryNode: self",
  16138. messageSends: ["visitDynamicDictionaryNode:"],
  16139. referencedClasses: []
  16140. }),
  16141. smalltalk.DynamicDictionaryNode);
  16142. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler-AST');
  16143. smalltalk.addMethod(
  16144. "_accept_",
  16145. smalltalk.method({
  16146. selector: "accept:",
  16147. category: 'visiting',
  16148. fn: function (aVisitor){
  16149. var self=this;
  16150. return smalltalk.withContext(function($ctx1) { var $1;
  16151. $1=_st(aVisitor)._visitJSStatementNode_(self);
  16152. return $1;
  16153. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.JSStatementNode)})},
  16154. args: ["aVisitor"],
  16155. source: "accept: aVisitor\x0a\x09^ aVisitor visitJSStatementNode: self",
  16156. messageSends: ["visitJSStatementNode:"],
  16157. referencedClasses: []
  16158. }),
  16159. smalltalk.JSStatementNode);
  16160. smalltalk.addMethod(
  16161. "_source",
  16162. smalltalk.method({
  16163. selector: "source",
  16164. category: 'accessing',
  16165. fn: function (){
  16166. var self=this;
  16167. return smalltalk.withContext(function($ctx1) { var $2,$1;
  16168. $2=self["@source"];
  16169. if(($receiver = $2) == nil || $receiver == undefined){
  16170. $1="";
  16171. } else {
  16172. $1=$2;
  16173. };
  16174. return $1;
  16175. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.JSStatementNode)})},
  16176. args: [],
  16177. source: "source\x0a\x09^source ifNil: ['']",
  16178. messageSends: ["ifNil:"],
  16179. referencedClasses: []
  16180. }),
  16181. smalltalk.JSStatementNode);
  16182. smalltalk.addMethod(
  16183. "_source_",
  16184. smalltalk.method({
  16185. selector: "source:",
  16186. category: 'accessing',
  16187. fn: function (aString){
  16188. var self=this;
  16189. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  16190. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.JSStatementNode)})},
  16191. args: ["aString"],
  16192. source: "source: aString\x0a\x09source := aString",
  16193. messageSends: [],
  16194. referencedClasses: []
  16195. }),
  16196. smalltalk.JSStatementNode);
  16197. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source', 'scope', 'classReferences', 'messageSends', 'superSends'], 'Compiler-AST');
  16198. smalltalk.addMethod(
  16199. "_accept_",
  16200. smalltalk.method({
  16201. selector: "accept:",
  16202. category: 'visiting',
  16203. fn: function (aVisitor){
  16204. var self=this;
  16205. return smalltalk.withContext(function($ctx1) { var $1;
  16206. $1=_st(aVisitor)._visitMethodNode_(self);
  16207. return $1;
  16208. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.MethodNode)})},
  16209. args: ["aVisitor"],
  16210. source: "accept: aVisitor\x0a\x09^ aVisitor visitMethodNode: self",
  16211. messageSends: ["visitMethodNode:"],
  16212. referencedClasses: []
  16213. }),
  16214. smalltalk.MethodNode);
  16215. smalltalk.addMethod(
  16216. "_arguments",
  16217. smalltalk.method({
  16218. selector: "arguments",
  16219. category: 'accessing',
  16220. fn: function (){
  16221. var self=this;
  16222. return smalltalk.withContext(function($ctx1) { var $2,$1;
  16223. $2=self["@arguments"];
  16224. if(($receiver = $2) == nil || $receiver == undefined){
  16225. $1=[];
  16226. } else {
  16227. $1=$2;
  16228. };
  16229. return $1;
  16230. }, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.MethodNode)})},
  16231. args: [],
  16232. source: "arguments\x0a\x09^arguments ifNil: [#()]",
  16233. messageSends: ["ifNil:"],
  16234. referencedClasses: []
  16235. }),
  16236. smalltalk.MethodNode);
  16237. smalltalk.addMethod(
  16238. "_arguments_",
  16239. smalltalk.method({
  16240. selector: "arguments:",
  16241. category: 'accessing',
  16242. fn: function (aCollection){
  16243. var self=this;
  16244. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  16245. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.MethodNode)})},
  16246. args: ["aCollection"],
  16247. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  16248. messageSends: [],
  16249. referencedClasses: []
  16250. }),
  16251. smalltalk.MethodNode);
  16252. smalltalk.addMethod(
  16253. "_classReferences",
  16254. smalltalk.method({
  16255. selector: "classReferences",
  16256. category: 'accessing',
  16257. fn: function (){
  16258. var self=this;
  16259. return smalltalk.withContext(function($ctx1) { var $1;
  16260. $1=self["@classReferences"];
  16261. return $1;
  16262. }, function($ctx1) {$ctx1.fill(self,"classReferences",{}, smalltalk.MethodNode)})},
  16263. args: [],
  16264. source: "classReferences\x0a\x09^ classReferences",
  16265. messageSends: [],
  16266. referencedClasses: []
  16267. }),
  16268. smalltalk.MethodNode);
  16269. smalltalk.addMethod(
  16270. "_classReferences_",
  16271. smalltalk.method({
  16272. selector: "classReferences:",
  16273. category: 'accessing',
  16274. fn: function (aCollection){
  16275. var self=this;
  16276. return smalltalk.withContext(function($ctx1) { self["@classReferences"]=aCollection;
  16277. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection}, smalltalk.MethodNode)})},
  16278. args: ["aCollection"],
  16279. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  16280. messageSends: [],
  16281. referencedClasses: []
  16282. }),
  16283. smalltalk.MethodNode);
  16284. smalltalk.addMethod(
  16285. "_messageSends",
  16286. smalltalk.method({
  16287. selector: "messageSends",
  16288. category: 'accessing',
  16289. fn: function (){
  16290. var self=this;
  16291. return smalltalk.withContext(function($ctx1) { var $1;
  16292. $1=self["@messageSends"];
  16293. return $1;
  16294. }, function($ctx1) {$ctx1.fill(self,"messageSends",{}, smalltalk.MethodNode)})},
  16295. args: [],
  16296. source: "messageSends\x0a\x09^ messageSends",
  16297. messageSends: [],
  16298. referencedClasses: []
  16299. }),
  16300. smalltalk.MethodNode);
  16301. smalltalk.addMethod(
  16302. "_messageSends_",
  16303. smalltalk.method({
  16304. selector: "messageSends:",
  16305. category: 'accessing',
  16306. fn: function (aCollection){
  16307. var self=this;
  16308. return smalltalk.withContext(function($ctx1) { self["@messageSends"]=aCollection;
  16309. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection}, smalltalk.MethodNode)})},
  16310. args: ["aCollection"],
  16311. source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
  16312. messageSends: [],
  16313. referencedClasses: []
  16314. }),
  16315. smalltalk.MethodNode);
  16316. smalltalk.addMethod(
  16317. "_scope",
  16318. smalltalk.method({
  16319. selector: "scope",
  16320. category: 'accessing',
  16321. fn: function (){
  16322. var self=this;
  16323. return smalltalk.withContext(function($ctx1) { var $1;
  16324. $1=self["@scope"];
  16325. return $1;
  16326. }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.MethodNode)})},
  16327. args: [],
  16328. source: "scope\x0a\x09^ scope",
  16329. messageSends: [],
  16330. referencedClasses: []
  16331. }),
  16332. smalltalk.MethodNode);
  16333. smalltalk.addMethod(
  16334. "_scope_",
  16335. smalltalk.method({
  16336. selector: "scope:",
  16337. category: 'accessing',
  16338. fn: function (aMethodScope){
  16339. var self=this;
  16340. return smalltalk.withContext(function($ctx1) { self["@scope"]=aMethodScope;
  16341. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aMethodScope:aMethodScope}, smalltalk.MethodNode)})},
  16342. args: ["aMethodScope"],
  16343. source: "scope: aMethodScope\x0a\x09scope := aMethodScope",
  16344. messageSends: [],
  16345. referencedClasses: []
  16346. }),
  16347. smalltalk.MethodNode);
  16348. smalltalk.addMethod(
  16349. "_selector",
  16350. smalltalk.method({
  16351. selector: "selector",
  16352. category: 'accessing',
  16353. fn: function (){
  16354. var self=this;
  16355. return smalltalk.withContext(function($ctx1) { var $1;
  16356. $1=self["@selector"];
  16357. return $1;
  16358. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.MethodNode)})},
  16359. args: [],
  16360. source: "selector\x0a\x09^selector",
  16361. messageSends: [],
  16362. referencedClasses: []
  16363. }),
  16364. smalltalk.MethodNode);
  16365. smalltalk.addMethod(
  16366. "_selector_",
  16367. smalltalk.method({
  16368. selector: "selector:",
  16369. category: 'accessing',
  16370. fn: function (aString){
  16371. var self=this;
  16372. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  16373. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.MethodNode)})},
  16374. args: ["aString"],
  16375. source: "selector: aString\x0a\x09selector := aString",
  16376. messageSends: [],
  16377. referencedClasses: []
  16378. }),
  16379. smalltalk.MethodNode);
  16380. smalltalk.addMethod(
  16381. "_source",
  16382. smalltalk.method({
  16383. selector: "source",
  16384. category: 'accessing',
  16385. fn: function (){
  16386. var self=this;
  16387. return smalltalk.withContext(function($ctx1) { var $1;
  16388. $1=self["@source"];
  16389. return $1;
  16390. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.MethodNode)})},
  16391. args: [],
  16392. source: "source\x0a\x09^source",
  16393. messageSends: [],
  16394. referencedClasses: []
  16395. }),
  16396. smalltalk.MethodNode);
  16397. smalltalk.addMethod(
  16398. "_source_",
  16399. smalltalk.method({
  16400. selector: "source:",
  16401. category: 'accessing',
  16402. fn: function (aString){
  16403. var self=this;
  16404. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  16405. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.MethodNode)})},
  16406. args: ["aString"],
  16407. source: "source: aString\x0a\x09source := aString",
  16408. messageSends: [],
  16409. referencedClasses: []
  16410. }),
  16411. smalltalk.MethodNode);
  16412. smalltalk.addMethod(
  16413. "_superSends",
  16414. smalltalk.method({
  16415. selector: "superSends",
  16416. category: 'accessing',
  16417. fn: function (){
  16418. var self=this;
  16419. return smalltalk.withContext(function($ctx1) { var $1;
  16420. $1=self["@superSends"];
  16421. return $1;
  16422. }, function($ctx1) {$ctx1.fill(self,"superSends",{}, smalltalk.MethodNode)})},
  16423. args: [],
  16424. source: "superSends\x0a\x09^ superSends",
  16425. messageSends: [],
  16426. referencedClasses: []
  16427. }),
  16428. smalltalk.MethodNode);
  16429. smalltalk.addMethod(
  16430. "_superSends_",
  16431. smalltalk.method({
  16432. selector: "superSends:",
  16433. category: 'accessing',
  16434. fn: function (aCollection){
  16435. var self=this;
  16436. return smalltalk.withContext(function($ctx1) { self["@superSends"]=aCollection;
  16437. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection}, smalltalk.MethodNode)})},
  16438. args: ["aCollection"],
  16439. source: "superSends: aCollection\x0a\x09superSends := aCollection",
  16440. messageSends: [],
  16441. referencedClasses: []
  16442. }),
  16443. smalltalk.MethodNode);
  16444. smalltalk.addClass('ReturnNode', smalltalk.Node, ['scope'], 'Compiler-AST');
  16445. smalltalk.addMethod(
  16446. "_accept_",
  16447. smalltalk.method({
  16448. selector: "accept:",
  16449. category: 'visiting',
  16450. fn: function (aVisitor){
  16451. var self=this;
  16452. return smalltalk.withContext(function($ctx1) { var $1;
  16453. $1=_st(aVisitor)._visitReturnNode_(self);
  16454. return $1;
  16455. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.ReturnNode)})},
  16456. args: ["aVisitor"],
  16457. source: "accept: aVisitor\x0a\x09^ aVisitor visitReturnNode: self",
  16458. messageSends: ["visitReturnNode:"],
  16459. referencedClasses: []
  16460. }),
  16461. smalltalk.ReturnNode);
  16462. smalltalk.addMethod(
  16463. "_isReturnNode",
  16464. smalltalk.method({
  16465. selector: "isReturnNode",
  16466. category: 'testing',
  16467. fn: function (){
  16468. var self=this;
  16469. return smalltalk.withContext(function($ctx1) { return true;
  16470. }, function($ctx1) {$ctx1.fill(self,"isReturnNode",{}, smalltalk.ReturnNode)})},
  16471. args: [],
  16472. source: "isReturnNode\x0a\x09^ true",
  16473. messageSends: [],
  16474. referencedClasses: []
  16475. }),
  16476. smalltalk.ReturnNode);
  16477. smalltalk.addMethod(
  16478. "_nonLocalReturn",
  16479. smalltalk.method({
  16480. selector: "nonLocalReturn",
  16481. category: 'testing',
  16482. fn: function (){
  16483. var self=this;
  16484. return smalltalk.withContext(function($ctx1) { var $1;
  16485. $1=_st(_st(_st(self)._scope())._isMethodScope())._not();
  16486. return $1;
  16487. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturn",{}, smalltalk.ReturnNode)})},
  16488. args: [],
  16489. source: "nonLocalReturn\x0a\x09^ self scope isMethodScope not",
  16490. messageSends: ["not", "isMethodScope", "scope"],
  16491. referencedClasses: []
  16492. }),
  16493. smalltalk.ReturnNode);
  16494. smalltalk.addMethod(
  16495. "_scope",
  16496. smalltalk.method({
  16497. selector: "scope",
  16498. category: 'accessing',
  16499. fn: function (){
  16500. var self=this;
  16501. return smalltalk.withContext(function($ctx1) { var $1;
  16502. $1=self["@scope"];
  16503. return $1;
  16504. }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.ReturnNode)})},
  16505. args: [],
  16506. source: "scope\x0a\x09^ scope",
  16507. messageSends: [],
  16508. referencedClasses: []
  16509. }),
  16510. smalltalk.ReturnNode);
  16511. smalltalk.addMethod(
  16512. "_scope_",
  16513. smalltalk.method({
  16514. selector: "scope:",
  16515. category: 'accessing',
  16516. fn: function (aLexicalScope){
  16517. var self=this;
  16518. return smalltalk.withContext(function($ctx1) { self["@scope"]=aLexicalScope;
  16519. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope}, smalltalk.ReturnNode)})},
  16520. args: ["aLexicalScope"],
  16521. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  16522. messageSends: [],
  16523. referencedClasses: []
  16524. }),
  16525. smalltalk.ReturnNode);
  16526. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver', 'superSend', 'index'], 'Compiler-AST');
  16527. smalltalk.addMethod(
  16528. "_accept_",
  16529. smalltalk.method({
  16530. selector: "accept:",
  16531. category: 'visiting',
  16532. fn: function (aVisitor){
  16533. var self=this;
  16534. return smalltalk.withContext(function($ctx1) { var $1;
  16535. $1=_st(aVisitor)._visitSendNode_(self);
  16536. return $1;
  16537. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.SendNode)})},
  16538. args: ["aVisitor"],
  16539. source: "accept: aVisitor\x0a\x09^ aVisitor visitSendNode: self",
  16540. messageSends: ["visitSendNode:"],
  16541. referencedClasses: []
  16542. }),
  16543. smalltalk.SendNode);
  16544. smalltalk.addMethod(
  16545. "_arguments",
  16546. smalltalk.method({
  16547. selector: "arguments",
  16548. category: 'accessing',
  16549. fn: function (){
  16550. var self=this;
  16551. return smalltalk.withContext(function($ctx1) { var $2,$1;
  16552. $2=self["@arguments"];
  16553. if(($receiver = $2) == nil || $receiver == undefined){
  16554. self["@arguments"]=[];
  16555. $1=self["@arguments"];
  16556. } else {
  16557. $1=$2;
  16558. };
  16559. return $1;
  16560. }, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.SendNode)})},
  16561. args: [],
  16562. source: "arguments\x0a\x09^arguments ifNil: [arguments := #()]",
  16563. messageSends: ["ifNil:"],
  16564. referencedClasses: []
  16565. }),
  16566. smalltalk.SendNode);
  16567. smalltalk.addMethod(
  16568. "_arguments_",
  16569. smalltalk.method({
  16570. selector: "arguments:",
  16571. category: 'accessing',
  16572. fn: function (aCollection){
  16573. var self=this;
  16574. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  16575. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.SendNode)})},
  16576. args: ["aCollection"],
  16577. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  16578. messageSends: [],
  16579. referencedClasses: []
  16580. }),
  16581. smalltalk.SendNode);
  16582. smalltalk.addMethod(
  16583. "_cascadeNodeWithMessages_",
  16584. smalltalk.method({
  16585. selector: "cascadeNodeWithMessages:",
  16586. category: 'accessing',
  16587. fn: function (aCollection){
  16588. var self=this;
  16589. var first;
  16590. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$5,$3;
  16591. $1=_st((smalltalk.SendNode || SendNode))._new();
  16592. _st($1)._selector_(_st(self)._selector());
  16593. _st($1)._arguments_(_st(self)._arguments());
  16594. $2=_st($1)._yourself();
  16595. first=$2;
  16596. $4=_st((smalltalk.CascadeNode || CascadeNode))._new();
  16597. _st($4)._receiver_(_st(self)._receiver());
  16598. _st($4)._nodes_(_st(_st((smalltalk.Array || Array))._with_(first)).__comma(aCollection));
  16599. $5=_st($4)._yourself();
  16600. $3=$5;
  16601. return $3;
  16602. }, function($ctx1) {$ctx1.fill(self,"cascadeNodeWithMessages:",{aCollection:aCollection,first:first}, smalltalk.SendNode)})},
  16603. args: ["aCollection"],
  16604. source: "cascadeNodeWithMessages: aCollection\x0a\x09| first |\x0a\x09first := SendNode new\x0a\x09 selector: self selector;\x0a\x09 arguments: self arguments;\x0a\x09 yourself.\x0a\x09^CascadeNode new\x0a\x09 receiver: self receiver;\x0a\x09 nodes: (Array with: first), aCollection;\x0a\x09 yourself",
  16605. messageSends: ["selector:", "selector", "new", "arguments:", "arguments", "yourself", "receiver:", "receiver", "nodes:", ",", "with:"],
  16606. referencedClasses: ["SendNode", "CascadeNode", "Array"]
  16607. }),
  16608. smalltalk.SendNode);
  16609. smalltalk.addMethod(
  16610. "_index",
  16611. smalltalk.method({
  16612. selector: "index",
  16613. category: 'accessing',
  16614. fn: function (){
  16615. var self=this;
  16616. return smalltalk.withContext(function($ctx1) { var $1;
  16617. $1=self["@index"];
  16618. return $1;
  16619. }, function($ctx1) {$ctx1.fill(self,"index",{}, smalltalk.SendNode)})},
  16620. args: [],
  16621. source: "index\x0a\x09^ index",
  16622. messageSends: [],
  16623. referencedClasses: []
  16624. }),
  16625. smalltalk.SendNode);
  16626. smalltalk.addMethod(
  16627. "_index_",
  16628. smalltalk.method({
  16629. selector: "index:",
  16630. category: 'accessing',
  16631. fn: function (anInteger){
  16632. var self=this;
  16633. return smalltalk.withContext(function($ctx1) { self["@index"]=anInteger;
  16634. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger}, smalltalk.SendNode)})},
  16635. args: ["anInteger"],
  16636. source: "index: anInteger\x0a\x09index := anInteger",
  16637. messageSends: [],
  16638. referencedClasses: []
  16639. }),
  16640. smalltalk.SendNode);
  16641. smalltalk.addMethod(
  16642. "_isSendNode",
  16643. smalltalk.method({
  16644. selector: "isSendNode",
  16645. category: 'testing',
  16646. fn: function (){
  16647. var self=this;
  16648. return smalltalk.withContext(function($ctx1) { return true;
  16649. }, function($ctx1) {$ctx1.fill(self,"isSendNode",{}, smalltalk.SendNode)})},
  16650. args: [],
  16651. source: "isSendNode\x0a\x09^ true",
  16652. messageSends: [],
  16653. referencedClasses: []
  16654. }),
  16655. smalltalk.SendNode);
  16656. smalltalk.addMethod(
  16657. "_nodes",
  16658. smalltalk.method({
  16659. selector: "nodes",
  16660. category: 'accessing',
  16661. fn: function (){
  16662. var self=this;
  16663. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  16664. $2=_st((smalltalk.Array || Array))._withAll_(_st(self)._arguments());
  16665. _st($2)._add_(_st(self)._receiver());
  16666. $3=_st($2)._yourself();
  16667. $1=$3;
  16668. return $1;
  16669. }, function($ctx1) {$ctx1.fill(self,"nodes",{}, smalltalk.SendNode)})},
  16670. args: [],
  16671. source: "nodes\x0a\x09^ (Array withAll: self arguments)\x0a\x09\x09add: self receiver;\x0a\x09\x09yourself",
  16672. messageSends: ["add:", "receiver", "withAll:", "arguments", "yourself"],
  16673. referencedClasses: ["Array"]
  16674. }),
  16675. smalltalk.SendNode);
  16676. smalltalk.addMethod(
  16677. "_receiver",
  16678. smalltalk.method({
  16679. selector: "receiver",
  16680. category: 'accessing',
  16681. fn: function (){
  16682. var self=this;
  16683. return smalltalk.withContext(function($ctx1) { var $1;
  16684. $1=self["@receiver"];
  16685. return $1;
  16686. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.SendNode)})},
  16687. args: [],
  16688. source: "receiver\x0a\x09^receiver",
  16689. messageSends: [],
  16690. referencedClasses: []
  16691. }),
  16692. smalltalk.SendNode);
  16693. smalltalk.addMethod(
  16694. "_receiver_",
  16695. smalltalk.method({
  16696. selector: "receiver:",
  16697. category: 'accessing',
  16698. fn: function (aNode){
  16699. var self=this;
  16700. return smalltalk.withContext(function($ctx1) { self["@receiver"]=aNode;
  16701. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode}, smalltalk.SendNode)})},
  16702. args: ["aNode"],
  16703. source: "receiver: aNode\x0a\x09receiver := aNode",
  16704. messageSends: [],
  16705. referencedClasses: []
  16706. }),
  16707. smalltalk.SendNode);
  16708. smalltalk.addMethod(
  16709. "_selector",
  16710. smalltalk.method({
  16711. selector: "selector",
  16712. category: 'accessing',
  16713. fn: function (){
  16714. var self=this;
  16715. return smalltalk.withContext(function($ctx1) { var $1;
  16716. $1=self["@selector"];
  16717. return $1;
  16718. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.SendNode)})},
  16719. args: [],
  16720. source: "selector\x0a\x09^selector",
  16721. messageSends: [],
  16722. referencedClasses: []
  16723. }),
  16724. smalltalk.SendNode);
  16725. smalltalk.addMethod(
  16726. "_selector_",
  16727. smalltalk.method({
  16728. selector: "selector:",
  16729. category: 'accessing',
  16730. fn: function (aString){
  16731. var self=this;
  16732. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  16733. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.SendNode)})},
  16734. args: ["aString"],
  16735. source: "selector: aString\x0a\x09selector := aString",
  16736. messageSends: [],
  16737. referencedClasses: []
  16738. }),
  16739. smalltalk.SendNode);
  16740. smalltalk.addMethod(
  16741. "_superSend",
  16742. smalltalk.method({
  16743. selector: "superSend",
  16744. category: 'accessing',
  16745. fn: function (){
  16746. var self=this;
  16747. return smalltalk.withContext(function($ctx1) { var $2,$1;
  16748. $2=self["@superSend"];
  16749. if(($receiver = $2) == nil || $receiver == undefined){
  16750. $1=false;
  16751. } else {
  16752. $1=$2;
  16753. };
  16754. return $1;
  16755. }, function($ctx1) {$ctx1.fill(self,"superSend",{}, smalltalk.SendNode)})},
  16756. args: [],
  16757. source: "superSend\x0a\x09^ superSend ifNil: [ false ]",
  16758. messageSends: ["ifNil:"],
  16759. referencedClasses: []
  16760. }),
  16761. smalltalk.SendNode);
  16762. smalltalk.addMethod(
  16763. "_superSend_",
  16764. smalltalk.method({
  16765. selector: "superSend:",
  16766. category: 'accessing',
  16767. fn: function (aBoolean){
  16768. var self=this;
  16769. return smalltalk.withContext(function($ctx1) { self["@superSend"]=aBoolean;
  16770. return self}, function($ctx1) {$ctx1.fill(self,"superSend:",{aBoolean:aBoolean}, smalltalk.SendNode)})},
  16771. args: ["aBoolean"],
  16772. source: "superSend: aBoolean\x0a\x09superSend := aBoolean",
  16773. messageSends: [],
  16774. referencedClasses: []
  16775. }),
  16776. smalltalk.SendNode);
  16777. smalltalk.addMethod(
  16778. "_valueForReceiver_",
  16779. smalltalk.method({
  16780. selector: "valueForReceiver:",
  16781. category: 'accessing',
  16782. fn: function (anObject){
  16783. var self=this;
  16784. return smalltalk.withContext(function($ctx1) { var $2,$3,$5,$4,$6,$1;
  16785. $2=_st((smalltalk.SendNode || SendNode))._new();
  16786. $3=$2;
  16787. $5=_st(self)._receiver();
  16788. if(($receiver = $5) == nil || $receiver == undefined){
  16789. $4=anObject;
  16790. } else {
  16791. $4=_st(_st(self)._receiver())._valueForReceiver_(anObject);
  16792. };
  16793. _st($3)._receiver_($4);
  16794. _st($2)._selector_(_st(self)._selector());
  16795. _st($2)._arguments_(_st(self)._arguments());
  16796. $6=_st($2)._yourself();
  16797. $1=$6;
  16798. return $1;
  16799. }, function($ctx1) {$ctx1.fill(self,"valueForReceiver:",{anObject:anObject}, smalltalk.SendNode)})},
  16800. args: ["anObject"],
  16801. source: "valueForReceiver: anObject\x0a\x09^SendNode new\x0a\x09 receiver: (self receiver \x0a\x09\x09ifNil: [anObject]\x0a\x09\x09ifNotNil: [self receiver valueForReceiver: anObject]);\x0a\x09 selector: self selector;\x0a\x09 arguments: self arguments;\x0a\x09 yourself",
  16802. messageSends: ["receiver:", "ifNil:ifNotNil:", "valueForReceiver:", "receiver", "new", "selector:", "selector", "arguments:", "arguments", "yourself"],
  16803. referencedClasses: ["SendNode"]
  16804. }),
  16805. smalltalk.SendNode);
  16806. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps', 'scope'], 'Compiler-AST');
  16807. smalltalk.addMethod(
  16808. "_accept_",
  16809. smalltalk.method({
  16810. selector: "accept:",
  16811. category: 'visiting',
  16812. fn: function (aVisitor){
  16813. var self=this;
  16814. return smalltalk.withContext(function($ctx1) { var $1;
  16815. $1=_st(aVisitor)._visitSequenceNode_(self);
  16816. return $1;
  16817. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.SequenceNode)})},
  16818. args: ["aVisitor"],
  16819. source: "accept: aVisitor\x0a\x09^ aVisitor visitSequenceNode: self",
  16820. messageSends: ["visitSequenceNode:"],
  16821. referencedClasses: []
  16822. }),
  16823. smalltalk.SequenceNode);
  16824. smalltalk.addMethod(
  16825. "_asBlockSequenceNode",
  16826. smalltalk.method({
  16827. selector: "asBlockSequenceNode",
  16828. category: 'testing',
  16829. fn: function (){
  16830. var self=this;
  16831. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  16832. $2=_st((smalltalk.BlockSequenceNode || BlockSequenceNode))._new();
  16833. _st($2)._nodes_(_st(self)._nodes());
  16834. _st($2)._temps_(_st(self)._temps());
  16835. $3=_st($2)._yourself();
  16836. $1=$3;
  16837. return $1;
  16838. }, function($ctx1) {$ctx1.fill(self,"asBlockSequenceNode",{}, smalltalk.SequenceNode)})},
  16839. args: [],
  16840. source: "asBlockSequenceNode\x0a\x09^BlockSequenceNode new\x0a\x09 nodes: self nodes;\x0a\x09 temps: self temps;\x0a\x09 yourself",
  16841. messageSends: ["nodes:", "nodes", "new", "temps:", "temps", "yourself"],
  16842. referencedClasses: ["BlockSequenceNode"]
  16843. }),
  16844. smalltalk.SequenceNode);
  16845. smalltalk.addMethod(
  16846. "_scope",
  16847. smalltalk.method({
  16848. selector: "scope",
  16849. category: 'accessing',
  16850. fn: function (){
  16851. var self=this;
  16852. return smalltalk.withContext(function($ctx1) { var $1;
  16853. $1=self["@scope"];
  16854. return $1;
  16855. }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.SequenceNode)})},
  16856. args: [],
  16857. source: "scope\x0a\x09^ scope",
  16858. messageSends: [],
  16859. referencedClasses: []
  16860. }),
  16861. smalltalk.SequenceNode);
  16862. smalltalk.addMethod(
  16863. "_scope_",
  16864. smalltalk.method({
  16865. selector: "scope:",
  16866. category: 'accessing',
  16867. fn: function (aLexicalScope){
  16868. var self=this;
  16869. return smalltalk.withContext(function($ctx1) { self["@scope"]=aLexicalScope;
  16870. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope}, smalltalk.SequenceNode)})},
  16871. args: ["aLexicalScope"],
  16872. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  16873. messageSends: [],
  16874. referencedClasses: []
  16875. }),
  16876. smalltalk.SequenceNode);
  16877. smalltalk.addMethod(
  16878. "_temps",
  16879. smalltalk.method({
  16880. selector: "temps",
  16881. category: 'accessing',
  16882. fn: function (){
  16883. var self=this;
  16884. return smalltalk.withContext(function($ctx1) { var $2,$1;
  16885. $2=self["@temps"];
  16886. if(($receiver = $2) == nil || $receiver == undefined){
  16887. $1=[];
  16888. } else {
  16889. $1=$2;
  16890. };
  16891. return $1;
  16892. }, function($ctx1) {$ctx1.fill(self,"temps",{}, smalltalk.SequenceNode)})},
  16893. args: [],
  16894. source: "temps\x0a\x09^temps ifNil: [#()]",
  16895. messageSends: ["ifNil:"],
  16896. referencedClasses: []
  16897. }),
  16898. smalltalk.SequenceNode);
  16899. smalltalk.addMethod(
  16900. "_temps_",
  16901. smalltalk.method({
  16902. selector: "temps:",
  16903. category: 'accessing',
  16904. fn: function (aCollection){
  16905. var self=this;
  16906. return smalltalk.withContext(function($ctx1) { self["@temps"]=aCollection;
  16907. return self}, function($ctx1) {$ctx1.fill(self,"temps:",{aCollection:aCollection}, smalltalk.SequenceNode)})},
  16908. args: ["aCollection"],
  16909. source: "temps: aCollection\x0a\x09temps := aCollection",
  16910. messageSends: [],
  16911. referencedClasses: []
  16912. }),
  16913. smalltalk.SequenceNode);
  16914. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler-AST');
  16915. smalltalk.addMethod(
  16916. "_accept_",
  16917. smalltalk.method({
  16918. selector: "accept:",
  16919. category: 'visiting',
  16920. fn: function (aVisitor){
  16921. var self=this;
  16922. return smalltalk.withContext(function($ctx1) { var $1;
  16923. $1=_st(aVisitor)._visitBlockSequenceNode_(self);
  16924. return $1;
  16925. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.BlockSequenceNode)})},
  16926. args: ["aVisitor"],
  16927. source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockSequenceNode: self",
  16928. messageSends: ["visitBlockSequenceNode:"],
  16929. referencedClasses: []
  16930. }),
  16931. smalltalk.BlockSequenceNode);
  16932. smalltalk.addMethod(
  16933. "_isBlockSequenceNode",
  16934. smalltalk.method({
  16935. selector: "isBlockSequenceNode",
  16936. category: 'testing',
  16937. fn: function (){
  16938. var self=this;
  16939. return smalltalk.withContext(function($ctx1) { return true;
  16940. }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{}, smalltalk.BlockSequenceNode)})},
  16941. args: [],
  16942. source: "isBlockSequenceNode\x0a\x09^true",
  16943. messageSends: [],
  16944. referencedClasses: []
  16945. }),
  16946. smalltalk.BlockSequenceNode);
  16947. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler-AST');
  16948. smalltalk.addMethod(
  16949. "_accept_",
  16950. smalltalk.method({
  16951. selector: "accept:",
  16952. category: 'visiting',
  16953. fn: function (aVisitor){
  16954. var self=this;
  16955. return smalltalk.withContext(function($ctx1) { var $1;
  16956. $1=_st(aVisitor)._visitValueNode_(self);
  16957. return $1;
  16958. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.ValueNode)})},
  16959. args: ["aVisitor"],
  16960. source: "accept: aVisitor\x0a\x09^ aVisitor visitValueNode: self",
  16961. messageSends: ["visitValueNode:"],
  16962. referencedClasses: []
  16963. }),
  16964. smalltalk.ValueNode);
  16965. smalltalk.addMethod(
  16966. "_isImmutable",
  16967. smalltalk.method({
  16968. selector: "isImmutable",
  16969. category: 'testing',
  16970. fn: function (){
  16971. var self=this;
  16972. return smalltalk.withContext(function($ctx1) { return true;
  16973. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{}, smalltalk.ValueNode)})},
  16974. args: [],
  16975. source: "isImmutable\x0a\x09^true",
  16976. messageSends: [],
  16977. referencedClasses: []
  16978. }),
  16979. smalltalk.ValueNode);
  16980. smalltalk.addMethod(
  16981. "_isValueNode",
  16982. smalltalk.method({
  16983. selector: "isValueNode",
  16984. category: 'testing',
  16985. fn: function (){
  16986. var self=this;
  16987. return smalltalk.withContext(function($ctx1) { return true;
  16988. }, function($ctx1) {$ctx1.fill(self,"isValueNode",{}, smalltalk.ValueNode)})},
  16989. args: [],
  16990. source: "isValueNode\x0a\x09^true",
  16991. messageSends: [],
  16992. referencedClasses: []
  16993. }),
  16994. smalltalk.ValueNode);
  16995. smalltalk.addMethod(
  16996. "_value",
  16997. smalltalk.method({
  16998. selector: "value",
  16999. category: 'accessing',
  17000. fn: function (){
  17001. var self=this;
  17002. return smalltalk.withContext(function($ctx1) { var $1;
  17003. $1=self["@value"];
  17004. return $1;
  17005. }, function($ctx1) {$ctx1.fill(self,"value",{}, smalltalk.ValueNode)})},
  17006. args: [],
  17007. source: "value\x0a\x09^value",
  17008. messageSends: [],
  17009. referencedClasses: []
  17010. }),
  17011. smalltalk.ValueNode);
  17012. smalltalk.addMethod(
  17013. "_value_",
  17014. smalltalk.method({
  17015. selector: "value:",
  17016. category: 'accessing',
  17017. fn: function (anObject){
  17018. var self=this;
  17019. return smalltalk.withContext(function($ctx1) { self["@value"]=anObject;
  17020. return self}, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject}, smalltalk.ValueNode)})},
  17021. args: ["anObject"],
  17022. source: "value: anObject\x0a\x09value := anObject",
  17023. messageSends: [],
  17024. referencedClasses: []
  17025. }),
  17026. smalltalk.ValueNode);
  17027. smalltalk.addClass('VariableNode', smalltalk.ValueNode, ['assigned', 'binding'], 'Compiler-AST');
  17028. smalltalk.addMethod(
  17029. "_accept_",
  17030. smalltalk.method({
  17031. selector: "accept:",
  17032. category: 'visiting',
  17033. fn: function (aVisitor){
  17034. var self=this;
  17035. return smalltalk.withContext(function($ctx1) { var $1;
  17036. $1=_st(aVisitor)._visitVariableNode_(self);
  17037. return $1;
  17038. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.VariableNode)})},
  17039. args: ["aVisitor"],
  17040. source: "accept: aVisitor\x0a\x09^ aVisitor visitVariableNode: self",
  17041. messageSends: ["visitVariableNode:"],
  17042. referencedClasses: []
  17043. }),
  17044. smalltalk.VariableNode);
  17045. smalltalk.addMethod(
  17046. "_alias",
  17047. smalltalk.method({
  17048. selector: "alias",
  17049. category: 'accessing',
  17050. fn: function (){
  17051. var self=this;
  17052. return smalltalk.withContext(function($ctx1) { var $1;
  17053. $1=_st(_st(self)._binding())._alias();
  17054. return $1;
  17055. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.VariableNode)})},
  17056. args: [],
  17057. source: "alias\x0a\x09^ self binding alias",
  17058. messageSends: ["alias", "binding"],
  17059. referencedClasses: []
  17060. }),
  17061. smalltalk.VariableNode);
  17062. smalltalk.addMethod(
  17063. "_assigned",
  17064. smalltalk.method({
  17065. selector: "assigned",
  17066. category: 'accessing',
  17067. fn: function (){
  17068. var self=this;
  17069. return smalltalk.withContext(function($ctx1) { var $2,$1;
  17070. $2=self["@assigned"];
  17071. if(($receiver = $2) == nil || $receiver == undefined){
  17072. $1=false;
  17073. } else {
  17074. $1=$2;
  17075. };
  17076. return $1;
  17077. }, function($ctx1) {$ctx1.fill(self,"assigned",{}, smalltalk.VariableNode)})},
  17078. args: [],
  17079. source: "assigned\x0a\x09^assigned ifNil: [false]",
  17080. messageSends: ["ifNil:"],
  17081. referencedClasses: []
  17082. }),
  17083. smalltalk.VariableNode);
  17084. smalltalk.addMethod(
  17085. "_assigned_",
  17086. smalltalk.method({
  17087. selector: "assigned:",
  17088. category: 'accessing',
  17089. fn: function (aBoolean){
  17090. var self=this;
  17091. return smalltalk.withContext(function($ctx1) { self["@assigned"]=aBoolean;
  17092. return self}, function($ctx1) {$ctx1.fill(self,"assigned:",{aBoolean:aBoolean}, smalltalk.VariableNode)})},
  17093. args: ["aBoolean"],
  17094. source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
  17095. messageSends: [],
  17096. referencedClasses: []
  17097. }),
  17098. smalltalk.VariableNode);
  17099. smalltalk.addMethod(
  17100. "_beAssigned",
  17101. smalltalk.method({
  17102. selector: "beAssigned",
  17103. category: 'accessing',
  17104. fn: function (){
  17105. var self=this;
  17106. return smalltalk.withContext(function($ctx1) { _st(_st(self)._binding())._validateAssignment();
  17107. self["@assigned"]=true;
  17108. return self}, function($ctx1) {$ctx1.fill(self,"beAssigned",{}, smalltalk.VariableNode)})},
  17109. args: [],
  17110. source: "beAssigned\x0a\x09self binding validateAssignment.\x0a\x09assigned := true",
  17111. messageSends: ["validateAssignment", "binding"],
  17112. referencedClasses: []
  17113. }),
  17114. smalltalk.VariableNode);
  17115. smalltalk.addMethod(
  17116. "_binding",
  17117. smalltalk.method({
  17118. selector: "binding",
  17119. category: 'accessing',
  17120. fn: function (){
  17121. var self=this;
  17122. return smalltalk.withContext(function($ctx1) { var $1;
  17123. $1=self["@binding"];
  17124. return $1;
  17125. }, function($ctx1) {$ctx1.fill(self,"binding",{}, smalltalk.VariableNode)})},
  17126. args: [],
  17127. source: "binding\x0a\x09^ binding",
  17128. messageSends: [],
  17129. referencedClasses: []
  17130. }),
  17131. smalltalk.VariableNode);
  17132. smalltalk.addMethod(
  17133. "_binding_",
  17134. smalltalk.method({
  17135. selector: "binding:",
  17136. category: 'accessing',
  17137. fn: function (aScopeVar){
  17138. var self=this;
  17139. return smalltalk.withContext(function($ctx1) { self["@binding"]=aScopeVar;
  17140. return self}, function($ctx1) {$ctx1.fill(self,"binding:",{aScopeVar:aScopeVar}, smalltalk.VariableNode)})},
  17141. args: ["aScopeVar"],
  17142. source: "binding: aScopeVar\x0a\x09binding := aScopeVar",
  17143. messageSends: [],
  17144. referencedClasses: []
  17145. }),
  17146. smalltalk.VariableNode);
  17147. smalltalk.addMethod(
  17148. "_isImmutable",
  17149. smalltalk.method({
  17150. selector: "isImmutable",
  17151. category: 'testing',
  17152. fn: function (){
  17153. var self=this;
  17154. return smalltalk.withContext(function($ctx1) { return false;
  17155. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{}, smalltalk.VariableNode)})},
  17156. args: [],
  17157. source: "isImmutable\x0a\x09^false",
  17158. messageSends: [],
  17159. referencedClasses: []
  17160. }),
  17161. smalltalk.VariableNode);
  17162. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler-AST');
  17163. smalltalk.addMethod(
  17164. "_accept_",
  17165. smalltalk.method({
  17166. selector: "accept:",
  17167. category: 'visiting',
  17168. fn: function (aVisitor){
  17169. var self=this;
  17170. return smalltalk.withContext(function($ctx1) { var $1;
  17171. $1=_st(aVisitor)._visitClassReferenceNode_(self);
  17172. return $1;
  17173. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.ClassReferenceNode)})},
  17174. args: ["aVisitor"],
  17175. source: "accept: aVisitor\x0a\x09^ aVisitor visitClassReferenceNode: self",
  17176. messageSends: ["visitClassReferenceNode:"],
  17177. referencedClasses: []
  17178. }),
  17179. smalltalk.ClassReferenceNode);
  17180. smalltalk.addMethod(
  17181. "_isNode",
  17182. smalltalk.method({
  17183. selector: "isNode",
  17184. category: '*Compiler-AST',
  17185. fn: function (){
  17186. var self=this;
  17187. return smalltalk.withContext(function($ctx1) { return false;
  17188. }, function($ctx1) {$ctx1.fill(self,"isNode",{}, smalltalk.Object)})},
  17189. args: [],
  17190. source: "isNode\x0a\x09^ false",
  17191. messageSends: [],
  17192. referencedClasses: []
  17193. }),
  17194. smalltalk.Object);
  17195. smalltalk.addPackage('Compiler-IR', {});
  17196. smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
  17197. smalltalk.IRASTTranslator.comment="I am the AST (abstract syntax tree) visitor responsible for building the intermediate representation graph.\x0aI rely on a builder object, instance of IRBuilder."
  17198. smalltalk.addMethod(
  17199. "_alias_",
  17200. smalltalk.method({
  17201. selector: "alias:",
  17202. category: 'visiting',
  17203. fn: function (aNode){
  17204. var self=this;
  17205. var variable;
  17206. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7;
  17207. $1=_st(aNode)._isImmutable();
  17208. if(smalltalk.assert($1)){
  17209. $2=_st(self)._visit_(aNode);
  17210. return $2;
  17211. };
  17212. $3=_st((smalltalk.IRVariable || IRVariable))._new();
  17213. _st($3)._variable_(_st(_st((smalltalk.AliasVar || AliasVar))._new())._name_(_st("$").__comma(_st(self)._nextAlias())));
  17214. $4=_st($3)._yourself();
  17215. variable=$4;
  17216. $5=_st((smalltalk.IRAssignment || IRAssignment))._new();
  17217. _st($5)._add_(variable);
  17218. _st($5)._add_(_st(self)._visit_(aNode));
  17219. $6=_st($5)._yourself();
  17220. _st(_st(self)._sequence())._add_($6);
  17221. _st(_st(_st(self)._method())._internalVariables())._add_(variable);
  17222. $7=variable;
  17223. return $7;
  17224. }, function($ctx1) {$ctx1.fill(self,"alias:",{aNode:aNode,variable:variable}, smalltalk.IRASTTranslator)})},
  17225. args: ["aNode"],
  17226. source: "alias: aNode\x0a\x09| variable |\x0a\x0a\x09aNode isImmutable ifTrue: [ ^ self visit: aNode ].\x0a\x0a\x09variable := IRVariable new \x0a\x09\x09variable: (AliasVar new name: '$', self nextAlias); \x0a\x09\x09yourself.\x0a\x0a\x09self sequence add: (IRAssignment new\x0a\x09\x09add: variable;\x0a\x09\x09add: (self visit: aNode);\x0a\x09\x09yourself).\x0a\x0a\x09self method internalVariables add: variable.\x0a\x0a\x09^ variable",
  17227. messageSends: ["ifTrue:", "visit:", "isImmutable", "variable:", "name:", ",", "nextAlias", "new", "yourself", "add:", "sequence", "internalVariables", "method"],
  17228. referencedClasses: ["AliasVar", "IRVariable", "IRAssignment"]
  17229. }),
  17230. smalltalk.IRASTTranslator);
  17231. smalltalk.addMethod(
  17232. "_aliasTemporally_",
  17233. smalltalk.method({
  17234. selector: "aliasTemporally:",
  17235. category: 'visiting',
  17236. fn: function (aCollection){
  17237. var self=this;
  17238. var threshold,result;
  17239. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$3,$5;
  17240. threshold=(0);
  17241. _st(aCollection)._withIndexDo_((function(each,i){
  17242. return smalltalk.withContext(function($ctx2) { $1=_st(each)._subtreeNeedsAliasing();
  17243. if(smalltalk.assert($1)){
  17244. threshold=i;
  17245. return threshold;
  17246. };
  17247. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  17248. result=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  17249. _st(aCollection)._withIndexDo_((function(each,i){
  17250. return smalltalk.withContext(function($ctx2) { $2=result;
  17251. $4=_st(i).__lt_eq(threshold);
  17252. if(smalltalk.assert($4)){
  17253. $3=_st(self)._alias_(each);
  17254. } else {
  17255. $3=_st(self)._visit_(each);
  17256. };
  17257. return _st($2)._add_($3);
  17258. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  17259. $5=result;
  17260. return $5;
  17261. }, function($ctx1) {$ctx1.fill(self,"aliasTemporally:",{aCollection:aCollection,threshold:threshold,result:result}, smalltalk.IRASTTranslator)})},
  17262. args: ["aCollection"],
  17263. source: "aliasTemporally: aCollection\x0a\x09\x22https://github.com/NicolasPetton/amber/issues/296\x0a \x0a If a node is aliased, all preceding ones are aliased as well.\x0a The tree is iterated twice. First we get the aliasing dependency, \x0a then the aliasing itself is done\x22\x0a\x0a\x09| threshold result |\x0a threshold := 0.\x0a \x0a aCollection withIndexDo: [ :each :i |\x0a each subtreeNeedsAliasing\x0a\x09\x09 ifTrue: [ threshold := i ]].\x0a\x0a\x09result := OrderedCollection new.\x0a\x09aCollection withIndexDo: [ :each :i | \x0a\x09\x09result add: (i <= threshold\x0a\x09\x09\x09ifTrue: [ self alias: each ]\x0a\x09\x09\x09ifFalse: [ self visit: each ])].\x0a\x0a ^result",
  17264. messageSends: ["withIndexDo:", "ifTrue:", "subtreeNeedsAliasing", "new", "add:", "ifTrue:ifFalse:", "alias:", "visit:", "<="],
  17265. referencedClasses: ["OrderedCollection"]
  17266. }),
  17267. smalltalk.IRASTTranslator);
  17268. smalltalk.addMethod(
  17269. "_method",
  17270. smalltalk.method({
  17271. selector: "method",
  17272. category: 'accessing',
  17273. fn: function (){
  17274. var self=this;
  17275. return smalltalk.withContext(function($ctx1) { var $1;
  17276. $1=self["@method"];
  17277. return $1;
  17278. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.IRASTTranslator)})},
  17279. args: [],
  17280. source: "method\x0a\x09^ method",
  17281. messageSends: [],
  17282. referencedClasses: []
  17283. }),
  17284. smalltalk.IRASTTranslator);
  17285. smalltalk.addMethod(
  17286. "_method_",
  17287. smalltalk.method({
  17288. selector: "method:",
  17289. category: 'accessing',
  17290. fn: function (anIRMethod){
  17291. var self=this;
  17292. return smalltalk.withContext(function($ctx1) { self["@method"]=anIRMethod;
  17293. return self}, function($ctx1) {$ctx1.fill(self,"method:",{anIRMethod:anIRMethod}, smalltalk.IRASTTranslator)})},
  17294. args: ["anIRMethod"],
  17295. source: "method: anIRMethod\x0a\x09method := anIRMethod",
  17296. messageSends: [],
  17297. referencedClasses: []
  17298. }),
  17299. smalltalk.IRASTTranslator);
  17300. smalltalk.addMethod(
  17301. "_nextAlias",
  17302. smalltalk.method({
  17303. selector: "nextAlias",
  17304. category: 'accessing',
  17305. fn: function (){
  17306. var self=this;
  17307. return smalltalk.withContext(function($ctx1) { var $1,$2;
  17308. $1=self["@nextAlias"];
  17309. if(($receiver = $1) == nil || $receiver == undefined){
  17310. self["@nextAlias"]=(0);
  17311. self["@nextAlias"];
  17312. } else {
  17313. $1;
  17314. };
  17315. self["@nextAlias"]=_st(self["@nextAlias"]).__plus((1));
  17316. $2=_st(self["@nextAlias"])._asString();
  17317. return $2;
  17318. }, function($ctx1) {$ctx1.fill(self,"nextAlias",{}, smalltalk.IRASTTranslator)})},
  17319. args: [],
  17320. source: "nextAlias\x0a\x09nextAlias ifNil: [ nextAlias := 0 ].\x0a\x09nextAlias := nextAlias + 1.\x0a\x09^ nextAlias asString",
  17321. messageSends: ["ifNil:", "+", "asString"],
  17322. referencedClasses: []
  17323. }),
  17324. smalltalk.IRASTTranslator);
  17325. smalltalk.addMethod(
  17326. "_sequence",
  17327. smalltalk.method({
  17328. selector: "sequence",
  17329. category: 'accessing',
  17330. fn: function (){
  17331. var self=this;
  17332. return smalltalk.withContext(function($ctx1) { var $1;
  17333. $1=self["@sequence"];
  17334. return $1;
  17335. }, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRASTTranslator)})},
  17336. args: [],
  17337. source: "sequence\x0a\x09^ sequence",
  17338. messageSends: [],
  17339. referencedClasses: []
  17340. }),
  17341. smalltalk.IRASTTranslator);
  17342. smalltalk.addMethod(
  17343. "_sequence_",
  17344. smalltalk.method({
  17345. selector: "sequence:",
  17346. category: 'accessing',
  17347. fn: function (anIRSequence){
  17348. var self=this;
  17349. return smalltalk.withContext(function($ctx1) { self["@sequence"]=anIRSequence;
  17350. return self}, function($ctx1) {$ctx1.fill(self,"sequence:",{anIRSequence:anIRSequence}, smalltalk.IRASTTranslator)})},
  17351. args: ["anIRSequence"],
  17352. source: "sequence: anIRSequence\x0a\x09sequence := anIRSequence",
  17353. messageSends: [],
  17354. referencedClasses: []
  17355. }),
  17356. smalltalk.IRASTTranslator);
  17357. smalltalk.addMethod(
  17358. "_source",
  17359. smalltalk.method({
  17360. selector: "source",
  17361. category: 'accessing',
  17362. fn: function (){
  17363. var self=this;
  17364. return smalltalk.withContext(function($ctx1) { var $1;
  17365. $1=self["@source"];
  17366. return $1;
  17367. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.IRASTTranslator)})},
  17368. args: [],
  17369. source: "source\x0a\x09^ source",
  17370. messageSends: [],
  17371. referencedClasses: []
  17372. }),
  17373. smalltalk.IRASTTranslator);
  17374. smalltalk.addMethod(
  17375. "_source_",
  17376. smalltalk.method({
  17377. selector: "source:",
  17378. category: 'accessing',
  17379. fn: function (aString){
  17380. var self=this;
  17381. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  17382. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.IRASTTranslator)})},
  17383. args: ["aString"],
  17384. source: "source: aString\x0a\x09source := aString",
  17385. messageSends: [],
  17386. referencedClasses: []
  17387. }),
  17388. smalltalk.IRASTTranslator);
  17389. smalltalk.addMethod(
  17390. "_theClass",
  17391. smalltalk.method({
  17392. selector: "theClass",
  17393. category: 'accessing',
  17394. fn: function (){
  17395. var self=this;
  17396. return smalltalk.withContext(function($ctx1) { var $1;
  17397. $1=self["@theClass"];
  17398. return $1;
  17399. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.IRASTTranslator)})},
  17400. args: [],
  17401. source: "theClass\x0a\x09^ theClass",
  17402. messageSends: [],
  17403. referencedClasses: []
  17404. }),
  17405. smalltalk.IRASTTranslator);
  17406. smalltalk.addMethod(
  17407. "_theClass_",
  17408. smalltalk.method({
  17409. selector: "theClass:",
  17410. category: 'accessing',
  17411. fn: function (aClass){
  17412. var self=this;
  17413. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  17414. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.IRASTTranslator)})},
  17415. args: ["aClass"],
  17416. source: "theClass: aClass\x0a\x09theClass := aClass",
  17417. messageSends: [],
  17418. referencedClasses: []
  17419. }),
  17420. smalltalk.IRASTTranslator);
  17421. smalltalk.addMethod(
  17422. "_visitAssignmentNode_",
  17423. smalltalk.method({
  17424. selector: "visitAssignmentNode:",
  17425. category: 'visiting',
  17426. fn: function (aNode){
  17427. var self=this;
  17428. var left,right,assignment;
  17429. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  17430. right=_st(self)._visit_(_st(aNode)._right());
  17431. left=_st(self)._visit_(_st(aNode)._left());
  17432. $1=_st((smalltalk.IRAssignment || IRAssignment))._new();
  17433. _st($1)._add_(left);
  17434. _st($1)._add_(right);
  17435. $2=_st($1)._yourself();
  17436. _st(_st(self)._sequence())._add_($2);
  17437. $3=left;
  17438. return $3;
  17439. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,left:left,right:right,assignment:assignment}, smalltalk.IRASTTranslator)})},
  17440. args: ["aNode"],
  17441. source: "visitAssignmentNode: aNode\x0a\x09| left right assignment |\x0a\x09right := self visit: aNode right.\x0a\x09left := self visit: aNode left.\x0a\x09self sequence add: (IRAssignment new \x0a\x09\x09add: left;\x0a\x09\x09add: right;\x0a\x09\x09yourself).\x0a\x09^ left",
  17442. messageSends: ["visit:", "right", "left", "add:", "new", "yourself", "sequence"],
  17443. referencedClasses: ["IRAssignment"]
  17444. }),
  17445. smalltalk.IRASTTranslator);
  17446. smalltalk.addMethod(
  17447. "_visitBlockNode_",
  17448. smalltalk.method({
  17449. selector: "visitBlockNode:",
  17450. category: 'visiting',
  17451. fn: function (aNode){
  17452. var self=this;
  17453. var closure;
  17454. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  17455. $1=_st((smalltalk.IRClosure || IRClosure))._new();
  17456. _st($1)._arguments_(_st(aNode)._parameters());
  17457. _st($1)._scope_(_st(aNode)._scope());
  17458. $2=_st($1)._yourself();
  17459. closure=$2;
  17460. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  17461. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  17462. _st($3)._name_(_st(each)._name());
  17463. _st($3)._scope_(_st(aNode)._scope());
  17464. $4=_st($3)._yourself();
  17465. return _st(closure)._add_($4);
  17466. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17467. _st(_st(aNode)._nodes())._do_((function(each){
  17468. return smalltalk.withContext(function($ctx2) { return _st(closure)._add_(_st(self)._visit_(each));
  17469. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17470. $5=closure;
  17471. return $5;
  17472. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,closure:closure}, smalltalk.IRASTTranslator)})},
  17473. args: ["aNode"],
  17474. source: "visitBlockNode: aNode\x0a\x09| closure |\x0a\x09closure := IRClosure new\x0a\x09\x09arguments: aNode parameters;\x0a\x09\x09scope: aNode scope;\x0a\x09\x09yourself.\x0a\x09aNode scope temps do: [ :each |\x0a\x09\x09closure add: (IRTempDeclaration new \x0a\x09\x09\x09name: each name;\x0a scope: aNode scope;\x0a\x09\x09\x09yourself) ].\x0a\x09aNode nodes do: [ :each | closure add: (self visit: each) ].\x0a\x09^ closure",
  17475. messageSends: ["arguments:", "parameters", "new", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "temps", "visit:", "nodes"],
  17476. referencedClasses: ["IRClosure", "IRTempDeclaration"]
  17477. }),
  17478. smalltalk.IRASTTranslator);
  17479. smalltalk.addMethod(
  17480. "_visitBlockSequenceNode_",
  17481. smalltalk.method({
  17482. selector: "visitBlockSequenceNode:",
  17483. category: 'visiting',
  17484. fn: function (aNode){
  17485. var self=this;
  17486. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$1;
  17487. $1=_st(self)._withSequence_do_(_st((smalltalk.IRBlockSequence || IRBlockSequence))._new(),(function(){
  17488. return smalltalk.withContext(function($ctx2) { return _st(_st(aNode)._nodes())._ifNotEmpty_((function(){
  17489. return smalltalk.withContext(function($ctx3) { _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  17490. return smalltalk.withContext(function($ctx4) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  17491. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  17492. $2=_st(_st(_st(aNode)._nodes())._last())._isReturnNode();
  17493. if(smalltalk.assert($2)){
  17494. return _st(_st(self)._sequence())._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  17495. } else {
  17496. $3=_st((smalltalk.IRBlockReturn || IRBlockReturn))._new();
  17497. _st($3)._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  17498. $4=_st($3)._yourself();
  17499. return _st(_st(self)._sequence())._add_($4);
  17500. };
  17501. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  17502. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  17503. return $1;
  17504. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  17505. args: ["aNode"],
  17506. source: "visitBlockSequenceNode: aNode\x0a\x09^ self\x0a\x09\x09withSequence: IRBlockSequence new\x0a\x09\x09do: [ \x0a\x09\x09\x09aNode nodes ifNotEmpty: [\x0a\x09\x09\x09\x09aNode nodes allButLast do: [ :each | \x0a\x09\x09\x09\x09\x09self sequence add: (self visit: each) ].\x0a\x09\x09\x09\x09aNode nodes last isReturnNode \x0a\x09\x09\x09\x09\x09ifFalse: [ self sequence add: (IRBlockReturn new add: (self visit: aNode nodes last); yourself) ]\x0a\x09\x09\x09\x09\x09ifTrue: [ self sequence add: (self visit: aNode nodes last) ]]]",
  17507. messageSends: ["withSequence:do:", "new", "ifNotEmpty:", "do:", "add:", "visit:", "sequence", "allButLast", "nodes", "ifFalse:ifTrue:", "last", "yourself", "isReturnNode"],
  17508. referencedClasses: ["IRBlockSequence", "IRBlockReturn"]
  17509. }),
  17510. smalltalk.IRASTTranslator);
  17511. smalltalk.addMethod(
  17512. "_visitCascadeNode_",
  17513. smalltalk.method({
  17514. selector: "visitCascadeNode:",
  17515. category: 'visiting',
  17516. fn: function (aNode){
  17517. var self=this;
  17518. var alias;
  17519. return smalltalk.withContext(function($ctx1) { var $1,$2;
  17520. $1=_st(_st(aNode)._receiver())._isImmutable();
  17521. if(! smalltalk.assert($1)){
  17522. alias=_st(self)._alias_(_st(aNode)._receiver());
  17523. alias;
  17524. _st(_st(aNode)._nodes())._do_((function(each){
  17525. return smalltalk.withContext(function($ctx2) { return _st(each)._receiver_(_st(_st((smalltalk.VariableNode || VariableNode))._new())._binding_(_st(alias)._variable()));
  17526. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17527. };
  17528. _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  17529. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  17530. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17531. $2=_st(self)._alias_(_st(_st(aNode)._nodes())._last());
  17532. return $2;
  17533. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode,alias:alias}, smalltalk.IRASTTranslator)})},
  17534. args: ["aNode"],
  17535. source: "visitCascadeNode: aNode\x0a\x09| alias |\x0a\x0a\x09aNode receiver isImmutable ifFalse: [ \x0a\x09\x09alias := self alias: aNode receiver.\x0a\x09\x09aNode nodes do: [ :each |\x0a\x09\x09\x09each receiver: (VariableNode new binding: alias variable) ]].\x0a\x0a\x09aNode nodes allButLast do: [ :each |\x0a\x09\x09self sequence add: (self visit: each) ].\x0a\x0a\x09^ self alias: aNode nodes last",
  17536. messageSends: ["ifFalse:", "alias:", "receiver", "do:", "receiver:", "binding:", "variable", "new", "nodes", "isImmutable", "add:", "visit:", "sequence", "allButLast", "last"],
  17537. referencedClasses: ["VariableNode"]
  17538. }),
  17539. smalltalk.IRASTTranslator);
  17540. smalltalk.addMethod(
  17541. "_visitDynamicArrayNode_",
  17542. smalltalk.method({
  17543. selector: "visitDynamicArrayNode:",
  17544. category: 'visiting',
  17545. fn: function (aNode){
  17546. var self=this;
  17547. var array;
  17548. return smalltalk.withContext(function($ctx1) { var $1;
  17549. array=_st((smalltalk.IRDynamicArray || IRDynamicArray))._new();
  17550. _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  17551. return smalltalk.withContext(function($ctx2) { return _st(array)._add_(each);
  17552. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17553. $1=array;
  17554. return $1;
  17555. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array}, smalltalk.IRASTTranslator)})},
  17556. args: ["aNode"],
  17557. source: "visitDynamicArrayNode: aNode\x0a\x09| array |\x0a\x09array := IRDynamicArray new.\x0a\x09(self aliasTemporally: aNode nodes) do: [:each | array add: each].\x0a\x09^ array",
  17558. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"],
  17559. referencedClasses: ["IRDynamicArray"]
  17560. }),
  17561. smalltalk.IRASTTranslator);
  17562. smalltalk.addMethod(
  17563. "_visitDynamicDictionaryNode_",
  17564. smalltalk.method({
  17565. selector: "visitDynamicDictionaryNode:",
  17566. category: 'visiting',
  17567. fn: function (aNode){
  17568. var self=this;
  17569. var dictionary;
  17570. return smalltalk.withContext(function($ctx1) { var $1;
  17571. dictionary=_st((smalltalk.IRDynamicDictionary || IRDynamicDictionary))._new();
  17572. _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  17573. return smalltalk.withContext(function($ctx2) { return _st(dictionary)._add_(each);
  17574. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17575. $1=dictionary;
  17576. return $1;
  17577. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,dictionary:dictionary}, smalltalk.IRASTTranslator)})},
  17578. args: ["aNode"],
  17579. source: "visitDynamicDictionaryNode: aNode\x0a\x09| dictionary |\x0a\x09dictionary := IRDynamicDictionary new.\x0a (self aliasTemporally: aNode nodes) do: [:each | dictionary add: each].\x0a\x09^ dictionary",
  17580. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"],
  17581. referencedClasses: ["IRDynamicDictionary"]
  17582. }),
  17583. smalltalk.IRASTTranslator);
  17584. smalltalk.addMethod(
  17585. "_visitJSStatementNode_",
  17586. smalltalk.method({
  17587. selector: "visitJSStatementNode:",
  17588. category: 'visiting',
  17589. fn: function (aNode){
  17590. var self=this;
  17591. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  17592. $2=_st((smalltalk.IRVerbatim || IRVerbatim))._new();
  17593. _st($2)._source_(_st(aNode)._source());
  17594. $3=_st($2)._yourself();
  17595. $1=$3;
  17596. return $1;
  17597. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  17598. args: ["aNode"],
  17599. source: "visitJSStatementNode: aNode\x0a\x09^ IRVerbatim new\x0a\x09\x09source: aNode source;\x0a\x09\x09yourself",
  17600. messageSends: ["source:", "source", "new", "yourself"],
  17601. referencedClasses: ["IRVerbatim"]
  17602. }),
  17603. smalltalk.IRASTTranslator);
  17604. smalltalk.addMethod(
  17605. "_visitMethodNode_",
  17606. smalltalk.method({
  17607. selector: "visitMethodNode:",
  17608. category: 'visiting',
  17609. fn: function (aNode){
  17610. var self=this;
  17611. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  17612. $1=_st((smalltalk.IRMethod || IRMethod))._new();
  17613. _st($1)._source_(_st(self)._source());
  17614. _st($1)._theClass_(_st(self)._theClass());
  17615. _st($1)._arguments_(_st(aNode)._arguments());
  17616. _st($1)._selector_(_st(aNode)._selector());
  17617. _st($1)._messageSends_(_st(aNode)._messageSends());
  17618. _st($1)._superSends_(_st(aNode)._superSends());
  17619. _st($1)._classReferences_(_st(aNode)._classReferences());
  17620. _st($1)._scope_(_st(aNode)._scope());
  17621. $2=_st($1)._yourself();
  17622. _st(self)._method_($2);
  17623. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  17624. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  17625. _st($3)._name_(_st(each)._name());
  17626. _st($3)._scope_(_st(aNode)._scope());
  17627. $4=_st($3)._yourself();
  17628. return _st(_st(self)._method())._add_($4);
  17629. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17630. _st(_st(aNode)._nodes())._do_((function(each){
  17631. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._method())._add_(_st(self)._visit_(each));
  17632. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17633. $5=_st(_st(aNode)._scope())._hasLocalReturn();
  17634. if(! smalltalk.assert($5)){
  17635. $6=_st((smalltalk.IRVariable || IRVariable))._new();
  17636. _st($6)._variable_(_st(_st(_st(aNode)._scope())._pseudoVars())._at_("self"));
  17637. $7=_st($6)._yourself();
  17638. _st(_st(_st(self)._method())._add_(_st((smalltalk.IRReturn || IRReturn))._new()))._add_($7);
  17639. };
  17640. $8=_st(self)._method();
  17641. return $8;
  17642. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  17643. args: ["aNode"],
  17644. source: "visitMethodNode: aNode\x0a\x0a\x09self method: (IRMethod new\x0a\x09\x09source: self source;\x0a theClass: self theClass;\x0a\x09\x09arguments: aNode arguments;\x0a\x09\x09selector: aNode selector;\x0a\x09\x09messageSends: aNode messageSends;\x0a superSends: aNode superSends;\x0a\x09\x09classReferences: aNode classReferences;\x0a\x09\x09scope: aNode scope;\x0a\x09\x09yourself).\x0a\x0a\x09aNode scope temps do: [ :each |\x0a\x09\x09self method add: (IRTempDeclaration new\x0a\x09\x09\x09name: each name;\x0a scope: aNode scope;\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09aNode nodes do: [ :each | self method add: (self visit: each) ].\x0a\x0a\x09aNode scope hasLocalReturn ifFalse: [\x0a\x09\x09(self method add: IRReturn new) add: (IRVariable new\x0a\x09\x09\x09variable: (aNode scope pseudoVars at: 'self');\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09^ self method",
  17645. messageSends: ["method:", "source:", "source", "new", "theClass:", "theClass", "arguments:", "arguments", "selector:", "selector", "messageSends:", "messageSends", "superSends:", "superSends", "classReferences:", "classReferences", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "method", "temps", "visit:", "nodes", "ifFalse:", "variable:", "at:", "pseudoVars", "hasLocalReturn"],
  17646. referencedClasses: ["IRMethod", "IRTempDeclaration", "IRVariable", "IRReturn"]
  17647. }),
  17648. smalltalk.IRASTTranslator);
  17649. smalltalk.addMethod(
  17650. "_visitReturnNode_",
  17651. smalltalk.method({
  17652. selector: "visitReturnNode:",
  17653. category: 'visiting',
  17654. fn: function (aNode){
  17655. var self=this;
  17656. var return_;
  17657. return smalltalk.withContext(function($ctx1) { var $1,$2;
  17658. $1=_st(aNode)._nonLocalReturn();
  17659. if(smalltalk.assert($1)){
  17660. return_=_st((smalltalk.IRNonLocalReturn || IRNonLocalReturn))._new();
  17661. } else {
  17662. return_=_st((smalltalk.IRReturn || IRReturn))._new();
  17663. };
  17664. _st(return_)._scope_(_st(aNode)._scope());
  17665. _st(_st(aNode)._nodes())._do_((function(each){
  17666. return smalltalk.withContext(function($ctx2) { return _st(return_)._add_(_st(self)._alias_(each));
  17667. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17668. $2=return_;
  17669. return $2;
  17670. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode,return_:return_}, smalltalk.IRASTTranslator)})},
  17671. args: ["aNode"],
  17672. source: "visitReturnNode: aNode\x0a\x09| return |\x0a\x09return := aNode nonLocalReturn \x0a\x09\x09ifTrue: [ IRNonLocalReturn new ]\x0a\x09\x09ifFalse: [ IRReturn new ].\x0a\x09return scope: aNode scope.\x0a\x09aNode nodes do: [ :each |\x0a\x09\x09return add: (self alias: each) ].\x0a\x09^ return",
  17673. messageSends: ["ifTrue:ifFalse:", "new", "nonLocalReturn", "scope:", "scope", "do:", "add:", "alias:", "nodes"],
  17674. referencedClasses: ["IRNonLocalReturn", "IRReturn"]
  17675. }),
  17676. smalltalk.IRASTTranslator);
  17677. smalltalk.addMethod(
  17678. "_visitSendNode_",
  17679. smalltalk.method({
  17680. selector: "visitSendNode:",
  17681. category: 'visiting',
  17682. fn: function (aNode){
  17683. var self=this;
  17684. var send,all,receiver,arguments;
  17685. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  17686. send=_st((smalltalk.IRSend || IRSend))._new();
  17687. $1=send;
  17688. _st($1)._selector_(_st(aNode)._selector());
  17689. $2=_st($1)._index_(_st(aNode)._index());
  17690. $3=_st(aNode)._superSend();
  17691. if(smalltalk.assert($3)){
  17692. _st(send)._classSend_(_st(_st(self)._theClass())._superclass());
  17693. };
  17694. all=_st(self)._aliasTemporally_(_st([_st(aNode)._receiver()]).__comma(_st(aNode)._arguments()));
  17695. receiver=_st(all)._first();
  17696. arguments=_st(all)._allButFirst();
  17697. _st(send)._add_(receiver);
  17698. _st(arguments)._do_((function(each){
  17699. return smalltalk.withContext(function($ctx2) { return _st(send)._add_(each);
  17700. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  17701. $4=send;
  17702. return $4;
  17703. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,send:send,all:all,receiver:receiver,arguments:arguments}, smalltalk.IRASTTranslator)})},
  17704. args: ["aNode"],
  17705. source: "visitSendNode: aNode\x0a\x09| send all receiver arguments |\x0a\x09send := IRSend new.\x0a\x09send \x0a\x09\x09selector: aNode selector;\x0a\x09\x09index: aNode index.\x0a\x09aNode superSend ifTrue: [ send classSend: self theClass superclass ].\x0a \x0a all := self aliasTemporally: { aNode receiver }, aNode arguments.\x0a\x09receiver := all first.\x0a\x09arguments := all allButFirst.\x0a\x0a\x09send add: receiver.\x0a\x09arguments do: [ :each | send add: each ].\x0a\x0a\x09^ send",
  17706. messageSends: ["new", "selector:", "selector", "index:", "index", "ifTrue:", "classSend:", "superclass", "theClass", "superSend", "aliasTemporally:", ",", "arguments", "receiver", "first", "allButFirst", "add:", "do:"],
  17707. referencedClasses: ["IRSend"]
  17708. }),
  17709. smalltalk.IRASTTranslator);
  17710. smalltalk.addMethod(
  17711. "_visitSequenceNode_",
  17712. smalltalk.method({
  17713. selector: "visitSequenceNode:",
  17714. category: 'visiting',
  17715. fn: function (aNode){
  17716. var self=this;
  17717. return smalltalk.withContext(function($ctx1) { var $2,$1;
  17718. $1=_st(self)._withSequence_do_(_st((smalltalk.IRSequence || IRSequence))._new(),(function(){
  17719. return smalltalk.withContext(function($ctx2) { return _st(_st(aNode)._nodes())._do_((function(each){
  17720. var instruction;
  17721. return smalltalk.withContext(function($ctx3) { instruction=_st(self)._visit_(each);
  17722. instruction;
  17723. $2=_st(instruction)._isVariable();
  17724. if(! smalltalk.assert($2)){
  17725. return _st(_st(self)._sequence())._add_(instruction);
  17726. };
  17727. }, function($ctx3) {$ctx3.fillBlock({each:each,instruction:instruction},$ctx1)})}));
  17728. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  17729. return $1;
  17730. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  17731. args: ["aNode"],
  17732. source: "visitSequenceNode: aNode\x0a\x09^ self \x0a\x09\x09withSequence: IRSequence new \x09\x0a\x09\x09do: [\x0a\x09\x09\x09aNode nodes do: [ :each | | instruction |\x0a\x09\x09\x09\x09instruction := self visit: each.\x0a\x09\x09\x09\x09instruction isVariable ifFalse: [\x0a\x09\x09\x09\x09\x09self sequence add: instruction ]]]",
  17733. messageSends: ["withSequence:do:", "new", "do:", "visit:", "ifFalse:", "add:", "sequence", "isVariable", "nodes"],
  17734. referencedClasses: ["IRSequence"]
  17735. }),
  17736. smalltalk.IRASTTranslator);
  17737. smalltalk.addMethod(
  17738. "_visitValueNode_",
  17739. smalltalk.method({
  17740. selector: "visitValueNode:",
  17741. category: 'visiting',
  17742. fn: function (aNode){
  17743. var self=this;
  17744. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  17745. $2=_st((smalltalk.IRValue || IRValue))._new();
  17746. _st($2)._value_(_st(aNode)._value());
  17747. $3=_st($2)._yourself();
  17748. $1=$3;
  17749. return $1;
  17750. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  17751. args: ["aNode"],
  17752. source: "visitValueNode: aNode\x0a\x09^ IRValue new \x0a\x09\x09value: aNode value; \x0a\x09\x09yourself",
  17753. messageSends: ["value:", "value", "new", "yourself"],
  17754. referencedClasses: ["IRValue"]
  17755. }),
  17756. smalltalk.IRASTTranslator);
  17757. smalltalk.addMethod(
  17758. "_visitVariableNode_",
  17759. smalltalk.method({
  17760. selector: "visitVariableNode:",
  17761. category: 'visiting',
  17762. fn: function (aNode){
  17763. var self=this;
  17764. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  17765. $2=_st((smalltalk.IRVariable || IRVariable))._new();
  17766. _st($2)._variable_(_st(aNode)._binding());
  17767. $3=_st($2)._yourself();
  17768. $1=$3;
  17769. return $1;
  17770. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  17771. args: ["aNode"],
  17772. source: "visitVariableNode: aNode\x0a\x09^ IRVariable new \x0a\x09\x09variable: aNode binding; \x0a\x09\x09yourself",
  17773. messageSends: ["variable:", "binding", "new", "yourself"],
  17774. referencedClasses: ["IRVariable"]
  17775. }),
  17776. smalltalk.IRASTTranslator);
  17777. smalltalk.addMethod(
  17778. "_withSequence_do_",
  17779. smalltalk.method({
  17780. selector: "withSequence:do:",
  17781. category: 'accessing',
  17782. fn: function (aSequence,aBlock){
  17783. var self=this;
  17784. var outerSequence;
  17785. return smalltalk.withContext(function($ctx1) { var $1;
  17786. outerSequence=_st(self)._sequence();
  17787. _st(self)._sequence_(aSequence);
  17788. _st(aBlock)._value();
  17789. _st(self)._sequence_(outerSequence);
  17790. $1=aSequence;
  17791. return $1;
  17792. }, function($ctx1) {$ctx1.fill(self,"withSequence:do:",{aSequence:aSequence,aBlock:aBlock,outerSequence:outerSequence}, smalltalk.IRASTTranslator)})},
  17793. args: ["aSequence", "aBlock"],
  17794. source: "withSequence: aSequence do: aBlock\x0a\x09| outerSequence |\x0a\x09outerSequence := self sequence.\x0a\x09self sequence: aSequence.\x0a\x09aBlock value.\x0a\x09self sequence: outerSequence.\x0a\x09^ aSequence",
  17795. messageSends: ["sequence", "sequence:", "value"],
  17796. referencedClasses: []
  17797. }),
  17798. smalltalk.IRASTTranslator);
  17799. smalltalk.addClass('IRInstruction', smalltalk.Object, ['parent', 'instructions'], 'Compiler-IR');
  17800. smalltalk.IRInstruction.comment="I am the abstract root class of the IR (intermediate representation) instructions class hierarchy.\x0aThe IR graph is used to emit JavaScript code using a JSStream."
  17801. smalltalk.addMethod(
  17802. "_accept_",
  17803. smalltalk.method({
  17804. selector: "accept:",
  17805. category: 'visiting',
  17806. fn: function (aVisitor){
  17807. var self=this;
  17808. return smalltalk.withContext(function($ctx1) { var $1;
  17809. $1=_st(aVisitor)._visitIRInstruction_(self);
  17810. return $1;
  17811. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInstruction)})},
  17812. args: ["aVisitor"],
  17813. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInstruction: self",
  17814. messageSends: ["visitIRInstruction:"],
  17815. referencedClasses: []
  17816. }),
  17817. smalltalk.IRInstruction);
  17818. smalltalk.addMethod(
  17819. "_add_",
  17820. smalltalk.method({
  17821. selector: "add:",
  17822. category: 'building',
  17823. fn: function (anObject){
  17824. var self=this;
  17825. return smalltalk.withContext(function($ctx1) { var $1;
  17826. _st(anObject)._parent_(self);
  17827. $1=_st(_st(self)._instructions())._add_(anObject);
  17828. return $1;
  17829. }, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject}, smalltalk.IRInstruction)})},
  17830. args: ["anObject"],
  17831. source: "add: anObject\x0a\x09anObject parent: self.\x0a\x09^ self instructions add: anObject",
  17832. messageSends: ["parent:", "add:", "instructions"],
  17833. referencedClasses: []
  17834. }),
  17835. smalltalk.IRInstruction);
  17836. smalltalk.addMethod(
  17837. "_canBeAssigned",
  17838. smalltalk.method({
  17839. selector: "canBeAssigned",
  17840. category: 'testing',
  17841. fn: function (){
  17842. var self=this;
  17843. return smalltalk.withContext(function($ctx1) { return true;
  17844. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{}, smalltalk.IRInstruction)})},
  17845. args: [],
  17846. source: "canBeAssigned\x0a\x09^ true",
  17847. messageSends: [],
  17848. referencedClasses: []
  17849. }),
  17850. smalltalk.IRInstruction);
  17851. smalltalk.addMethod(
  17852. "_instructions",
  17853. smalltalk.method({
  17854. selector: "instructions",
  17855. category: 'accessing',
  17856. fn: function (){
  17857. var self=this;
  17858. return smalltalk.withContext(function($ctx1) { var $2,$1;
  17859. $2=self["@instructions"];
  17860. if(($receiver = $2) == nil || $receiver == undefined){
  17861. self["@instructions"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  17862. $1=self["@instructions"];
  17863. } else {
  17864. $1=$2;
  17865. };
  17866. return $1;
  17867. }, function($ctx1) {$ctx1.fill(self,"instructions",{}, smalltalk.IRInstruction)})},
  17868. args: [],
  17869. source: "instructions\x0a\x09^ instructions ifNil: [ instructions := OrderedCollection new ]",
  17870. messageSends: ["ifNil:", "new"],
  17871. referencedClasses: ["OrderedCollection"]
  17872. }),
  17873. smalltalk.IRInstruction);
  17874. smalltalk.addMethod(
  17875. "_isClosure",
  17876. smalltalk.method({
  17877. selector: "isClosure",
  17878. category: 'testing',
  17879. fn: function (){
  17880. var self=this;
  17881. return smalltalk.withContext(function($ctx1) { return false;
  17882. }, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRInstruction)})},
  17883. args: [],
  17884. source: "isClosure\x0a\x09^ false",
  17885. messageSends: [],
  17886. referencedClasses: []
  17887. }),
  17888. smalltalk.IRInstruction);
  17889. smalltalk.addMethod(
  17890. "_isInlined",
  17891. smalltalk.method({
  17892. selector: "isInlined",
  17893. category: 'testing',
  17894. fn: function (){
  17895. var self=this;
  17896. return smalltalk.withContext(function($ctx1) { return false;
  17897. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInstruction)})},
  17898. args: [],
  17899. source: "isInlined\x0a\x09^ false",
  17900. messageSends: [],
  17901. referencedClasses: []
  17902. }),
  17903. smalltalk.IRInstruction);
  17904. smalltalk.addMethod(
  17905. "_isLocalReturn",
  17906. smalltalk.method({
  17907. selector: "isLocalReturn",
  17908. category: 'testing',
  17909. fn: function (){
  17910. var self=this;
  17911. return smalltalk.withContext(function($ctx1) { return false;
  17912. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{}, smalltalk.IRInstruction)})},
  17913. args: [],
  17914. source: "isLocalReturn\x0a\x09^ false",
  17915. messageSends: [],
  17916. referencedClasses: []
  17917. }),
  17918. smalltalk.IRInstruction);
  17919. smalltalk.addMethod(
  17920. "_isMethod",
  17921. smalltalk.method({
  17922. selector: "isMethod",
  17923. category: 'testing',
  17924. fn: function (){
  17925. var self=this;
  17926. return smalltalk.withContext(function($ctx1) { return false;
  17927. }, function($ctx1) {$ctx1.fill(self,"isMethod",{}, smalltalk.IRInstruction)})},
  17928. args: [],
  17929. source: "isMethod\x0a\x09^ false",
  17930. messageSends: [],
  17931. referencedClasses: []
  17932. }),
  17933. smalltalk.IRInstruction);
  17934. smalltalk.addMethod(
  17935. "_isReturn",
  17936. smalltalk.method({
  17937. selector: "isReturn",
  17938. category: 'testing',
  17939. fn: function (){
  17940. var self=this;
  17941. return smalltalk.withContext(function($ctx1) { return false;
  17942. }, function($ctx1) {$ctx1.fill(self,"isReturn",{}, smalltalk.IRInstruction)})},
  17943. args: [],
  17944. source: "isReturn\x0a\x09^ false",
  17945. messageSends: [],
  17946. referencedClasses: []
  17947. }),
  17948. smalltalk.IRInstruction);
  17949. smalltalk.addMethod(
  17950. "_isSend",
  17951. smalltalk.method({
  17952. selector: "isSend",
  17953. category: 'testing',
  17954. fn: function (){
  17955. var self=this;
  17956. return smalltalk.withContext(function($ctx1) { return false;
  17957. }, function($ctx1) {$ctx1.fill(self,"isSend",{}, smalltalk.IRInstruction)})},
  17958. args: [],
  17959. source: "isSend\x0a\x09^ false",
  17960. messageSends: [],
  17961. referencedClasses: []
  17962. }),
  17963. smalltalk.IRInstruction);
  17964. smalltalk.addMethod(
  17965. "_isSequence",
  17966. smalltalk.method({
  17967. selector: "isSequence",
  17968. category: 'testing',
  17969. fn: function (){
  17970. var self=this;
  17971. return smalltalk.withContext(function($ctx1) { return false;
  17972. }, function($ctx1) {$ctx1.fill(self,"isSequence",{}, smalltalk.IRInstruction)})},
  17973. args: [],
  17974. source: "isSequence\x0a\x09^ false",
  17975. messageSends: [],
  17976. referencedClasses: []
  17977. }),
  17978. smalltalk.IRInstruction);
  17979. smalltalk.addMethod(
  17980. "_isTempDeclaration",
  17981. smalltalk.method({
  17982. selector: "isTempDeclaration",
  17983. category: 'testing',
  17984. fn: function (){
  17985. var self=this;
  17986. return smalltalk.withContext(function($ctx1) { return false;
  17987. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{}, smalltalk.IRInstruction)})},
  17988. args: [],
  17989. source: "isTempDeclaration\x0a\x09^ false",
  17990. messageSends: [],
  17991. referencedClasses: []
  17992. }),
  17993. smalltalk.IRInstruction);
  17994. smalltalk.addMethod(
  17995. "_isVariable",
  17996. smalltalk.method({
  17997. selector: "isVariable",
  17998. category: 'testing',
  17999. fn: function (){
  18000. var self=this;
  18001. return smalltalk.withContext(function($ctx1) { return false;
  18002. }, function($ctx1) {$ctx1.fill(self,"isVariable",{}, smalltalk.IRInstruction)})},
  18003. args: [],
  18004. source: "isVariable\x0a\x09^ false",
  18005. messageSends: [],
  18006. referencedClasses: []
  18007. }),
  18008. smalltalk.IRInstruction);
  18009. smalltalk.addMethod(
  18010. "_method",
  18011. smalltalk.method({
  18012. selector: "method",
  18013. category: 'accessing',
  18014. fn: function (){
  18015. var self=this;
  18016. return smalltalk.withContext(function($ctx1) { var $1;
  18017. $1=_st(_st(self)._parent())._method();
  18018. return $1;
  18019. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.IRInstruction)})},
  18020. args: [],
  18021. source: "method\x0a\x09^ self parent method",
  18022. messageSends: ["method", "parent"],
  18023. referencedClasses: []
  18024. }),
  18025. smalltalk.IRInstruction);
  18026. smalltalk.addMethod(
  18027. "_parent",
  18028. smalltalk.method({
  18029. selector: "parent",
  18030. category: 'accessing',
  18031. fn: function (){
  18032. var self=this;
  18033. return smalltalk.withContext(function($ctx1) { var $1;
  18034. $1=self["@parent"];
  18035. return $1;
  18036. }, function($ctx1) {$ctx1.fill(self,"parent",{}, smalltalk.IRInstruction)})},
  18037. args: [],
  18038. source: "parent\x0a\x09^ parent",
  18039. messageSends: [],
  18040. referencedClasses: []
  18041. }),
  18042. smalltalk.IRInstruction);
  18043. smalltalk.addMethod(
  18044. "_parent_",
  18045. smalltalk.method({
  18046. selector: "parent:",
  18047. category: 'accessing',
  18048. fn: function (anIRInstruction){
  18049. var self=this;
  18050. return smalltalk.withContext(function($ctx1) { self["@parent"]=anIRInstruction;
  18051. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{anIRInstruction:anIRInstruction}, smalltalk.IRInstruction)})},
  18052. args: ["anIRInstruction"],
  18053. source: "parent: anIRInstruction\x0a\x09parent := anIRInstruction",
  18054. messageSends: [],
  18055. referencedClasses: []
  18056. }),
  18057. smalltalk.IRInstruction);
  18058. smalltalk.addMethod(
  18059. "_remove",
  18060. smalltalk.method({
  18061. selector: "remove",
  18062. category: 'building',
  18063. fn: function (){
  18064. var self=this;
  18065. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._remove_(self);
  18066. return self}, function($ctx1) {$ctx1.fill(self,"remove",{}, smalltalk.IRInstruction)})},
  18067. args: [],
  18068. source: "remove\x0a\x09self parent remove: self",
  18069. messageSends: ["remove:", "parent"],
  18070. referencedClasses: []
  18071. }),
  18072. smalltalk.IRInstruction);
  18073. smalltalk.addMethod(
  18074. "_remove_",
  18075. smalltalk.method({
  18076. selector: "remove:",
  18077. category: 'building',
  18078. fn: function (anIRInstruction){
  18079. var self=this;
  18080. return smalltalk.withContext(function($ctx1) { _st(_st(self)._instructions())._remove_(anIRInstruction);
  18081. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anIRInstruction:anIRInstruction}, smalltalk.IRInstruction)})},
  18082. args: ["anIRInstruction"],
  18083. source: "remove: anIRInstruction\x0a\x09self instructions remove: anIRInstruction",
  18084. messageSends: ["remove:", "instructions"],
  18085. referencedClasses: []
  18086. }),
  18087. smalltalk.IRInstruction);
  18088. smalltalk.addMethod(
  18089. "_replace_with_",
  18090. smalltalk.method({
  18091. selector: "replace:with:",
  18092. category: 'building',
  18093. fn: function (anIRInstruction,anotherIRInstruction){
  18094. var self=this;
  18095. return smalltalk.withContext(function($ctx1) { _st(anotherIRInstruction)._parent_(self);
  18096. _st(_st(self)._instructions())._at_put_(_st(_st(self)._instructions())._indexOf_(anIRInstruction),anotherIRInstruction);
  18097. return self}, function($ctx1) {$ctx1.fill(self,"replace:with:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRInstruction)})},
  18098. args: ["anIRInstruction", "anotherIRInstruction"],
  18099. source: "replace: anIRInstruction with: anotherIRInstruction\x0a\x09anotherIRInstruction parent: self.\x0a\x09self instructions \x0a\x09\x09at: (self instructions indexOf: anIRInstruction)\x0a\x09\x09put: anotherIRInstruction",
  18100. messageSends: ["parent:", "at:put:", "indexOf:", "instructions"],
  18101. referencedClasses: []
  18102. }),
  18103. smalltalk.IRInstruction);
  18104. smalltalk.addMethod(
  18105. "_replaceWith_",
  18106. smalltalk.method({
  18107. selector: "replaceWith:",
  18108. category: 'building',
  18109. fn: function (anIRInstruction){
  18110. var self=this;
  18111. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._replace_with_(self,anIRInstruction);
  18112. return self}, function($ctx1) {$ctx1.fill(self,"replaceWith:",{anIRInstruction:anIRInstruction}, smalltalk.IRInstruction)})},
  18113. args: ["anIRInstruction"],
  18114. source: "replaceWith: anIRInstruction\x0a\x09self parent replace: self with: anIRInstruction",
  18115. messageSends: ["replace:with:", "parent"],
  18116. referencedClasses: []
  18117. }),
  18118. smalltalk.IRInstruction);
  18119. smalltalk.addMethod(
  18120. "_on_",
  18121. smalltalk.method({
  18122. selector: "on:",
  18123. category: 'instance creation',
  18124. fn: function (aBuilder){
  18125. var self=this;
  18126. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  18127. $2=_st(self)._new();
  18128. _st($2)._builder_(aBuilder);
  18129. $3=_st($2)._yourself();
  18130. $1=$3;
  18131. return $1;
  18132. }, function($ctx1) {$ctx1.fill(self,"on:",{aBuilder:aBuilder}, smalltalk.IRInstruction.klass)})},
  18133. args: ["aBuilder"],
  18134. source: "on: aBuilder\x0a\x09^ self new\x0a\x09\x09builder: aBuilder;\x0a\x09\x09yourself",
  18135. messageSends: ["builder:", "new", "yourself"],
  18136. referencedClasses: []
  18137. }),
  18138. smalltalk.IRInstruction.klass);
  18139. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  18140. smalltalk.addMethod(
  18141. "_accept_",
  18142. smalltalk.method({
  18143. selector: "accept:",
  18144. category: 'visiting',
  18145. fn: function (aVisitor){
  18146. var self=this;
  18147. return smalltalk.withContext(function($ctx1) { var $1;
  18148. $1=_st(aVisitor)._visitIRAssignment_(self);
  18149. return $1;
  18150. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRAssignment)})},
  18151. args: ["aVisitor"],
  18152. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRAssignment: self",
  18153. messageSends: ["visitIRAssignment:"],
  18154. referencedClasses: []
  18155. }),
  18156. smalltalk.IRAssignment);
  18157. smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler-IR');
  18158. smalltalk.addMethod(
  18159. "_accept_",
  18160. smalltalk.method({
  18161. selector: "accept:",
  18162. category: 'visiting',
  18163. fn: function (aVisitor){
  18164. var self=this;
  18165. return smalltalk.withContext(function($ctx1) { var $1;
  18166. $1=_st(aVisitor)._visitIRDynamicArray_(self);
  18167. return $1;
  18168. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRDynamicArray)})},
  18169. args: ["aVisitor"],
  18170. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicArray: self",
  18171. messageSends: ["visitIRDynamicArray:"],
  18172. referencedClasses: []
  18173. }),
  18174. smalltalk.IRDynamicArray);
  18175. smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler-IR');
  18176. smalltalk.addMethod(
  18177. "_accept_",
  18178. smalltalk.method({
  18179. selector: "accept:",
  18180. category: 'visiting',
  18181. fn: function (aVisitor){
  18182. var self=this;
  18183. return smalltalk.withContext(function($ctx1) { var $1;
  18184. $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
  18185. return $1;
  18186. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRDynamicDictionary)})},
  18187. args: ["aVisitor"],
  18188. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicDictionary: self",
  18189. messageSends: ["visitIRDynamicDictionary:"],
  18190. referencedClasses: []
  18191. }),
  18192. smalltalk.IRDynamicDictionary);
  18193. smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler-IR');
  18194. smalltalk.addMethod(
  18195. "_scope",
  18196. smalltalk.method({
  18197. selector: "scope",
  18198. category: 'accessing',
  18199. fn: function (){
  18200. var self=this;
  18201. return smalltalk.withContext(function($ctx1) { var $1;
  18202. $1=self["@scope"];
  18203. return $1;
  18204. }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.IRScopedInstruction)})},
  18205. args: [],
  18206. source: "scope\x0a\x09^ scope",
  18207. messageSends: [],
  18208. referencedClasses: []
  18209. }),
  18210. smalltalk.IRScopedInstruction);
  18211. smalltalk.addMethod(
  18212. "_scope_",
  18213. smalltalk.method({
  18214. selector: "scope:",
  18215. category: 'accessing',
  18216. fn: function (aScope){
  18217. var self=this;
  18218. return smalltalk.withContext(function($ctx1) { self["@scope"]=aScope;
  18219. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRScopedInstruction)})},
  18220. args: ["aScope"],
  18221. source: "scope: aScope\x0a\x09scope := aScope",
  18222. messageSends: [],
  18223. referencedClasses: []
  18224. }),
  18225. smalltalk.IRScopedInstruction);
  18226. smalltalk.addClass('IRClosureInstruction', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  18227. smalltalk.addMethod(
  18228. "_arguments",
  18229. smalltalk.method({
  18230. selector: "arguments",
  18231. category: 'accessing',
  18232. fn: function (){
  18233. var self=this;
  18234. return smalltalk.withContext(function($ctx1) { var $2,$1;
  18235. $2=self["@arguments"];
  18236. if(($receiver = $2) == nil || $receiver == undefined){
  18237. $1=[];
  18238. } else {
  18239. $1=$2;
  18240. };
  18241. return $1;
  18242. }, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRClosureInstruction)})},
  18243. args: [],
  18244. source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
  18245. messageSends: ["ifNil:"],
  18246. referencedClasses: []
  18247. }),
  18248. smalltalk.IRClosureInstruction);
  18249. smalltalk.addMethod(
  18250. "_arguments_",
  18251. smalltalk.method({
  18252. selector: "arguments:",
  18253. category: 'accessing',
  18254. fn: function (aCollection){
  18255. var self=this;
  18256. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  18257. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRClosureInstruction)})},
  18258. args: ["aCollection"],
  18259. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  18260. messageSends: [],
  18261. referencedClasses: []
  18262. }),
  18263. smalltalk.IRClosureInstruction);
  18264. smalltalk.addMethod(
  18265. "_locals",
  18266. smalltalk.method({
  18267. selector: "locals",
  18268. category: 'accessing',
  18269. fn: function (){
  18270. var self=this;
  18271. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  18272. $2=_st(_st(self)._arguments())._copy();
  18273. _st($2)._addAll_(_st(_st(self)._tempDeclarations())._collect_((function(each){
  18274. return smalltalk.withContext(function($ctx2) { return _st(each)._name();
  18275. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  18276. $3=_st($2)._yourself();
  18277. $1=$3;
  18278. return $1;
  18279. }, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRClosureInstruction)})},
  18280. args: [],
  18281. source: "locals\x0a\x09^ self arguments copy\x0a \x09addAll: (self tempDeclarations collect: [ :each | each name ]); \x0a yourself",
  18282. messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"],
  18283. referencedClasses: []
  18284. }),
  18285. smalltalk.IRClosureInstruction);
  18286. smalltalk.addMethod(
  18287. "_scope_",
  18288. smalltalk.method({
  18289. selector: "scope:",
  18290. category: 'accessing',
  18291. fn: function (aScope){
  18292. var self=this;
  18293. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  18294. _st(aScope)._instruction_(self);
  18295. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRClosureInstruction)})},
  18296. args: ["aScope"],
  18297. source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
  18298. messageSends: ["scope:", "instruction:"],
  18299. referencedClasses: []
  18300. }),
  18301. smalltalk.IRClosureInstruction);
  18302. smalltalk.addMethod(
  18303. "_tempDeclarations",
  18304. smalltalk.method({
  18305. selector: "tempDeclarations",
  18306. category: 'accessing',
  18307. fn: function (){
  18308. var self=this;
  18309. return smalltalk.withContext(function($ctx1) { var $1;
  18310. $1=_st(_st(self)._instructions())._select_((function(each){
  18311. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  18312. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  18313. return $1;
  18314. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRClosureInstruction)})},
  18315. args: [],
  18316. source: "tempDeclarations\x0a\x09^ self instructions select: [ :each | \x0a \x09each isTempDeclaration ]",
  18317. messageSends: ["select:", "isTempDeclaration", "instructions"],
  18318. referencedClasses: []
  18319. }),
  18320. smalltalk.IRClosureInstruction);
  18321. smalltalk.addClass('IRClosure', smalltalk.IRClosureInstruction, [], 'Compiler-IR');
  18322. smalltalk.addMethod(
  18323. "_accept_",
  18324. smalltalk.method({
  18325. selector: "accept:",
  18326. category: 'visiting',
  18327. fn: function (aVisitor){
  18328. var self=this;
  18329. return smalltalk.withContext(function($ctx1) { var $1;
  18330. $1=_st(aVisitor)._visitIRClosure_(self);
  18331. return $1;
  18332. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRClosure)})},
  18333. args: ["aVisitor"],
  18334. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRClosure: self",
  18335. messageSends: ["visitIRClosure:"],
  18336. referencedClasses: []
  18337. }),
  18338. smalltalk.IRClosure);
  18339. smalltalk.addMethod(
  18340. "_isClosure",
  18341. smalltalk.method({
  18342. selector: "isClosure",
  18343. category: 'testing',
  18344. fn: function (){
  18345. var self=this;
  18346. return smalltalk.withContext(function($ctx1) { return true;
  18347. }, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRClosure)})},
  18348. args: [],
  18349. source: "isClosure\x0a\x09^ true",
  18350. messageSends: [],
  18351. referencedClasses: []
  18352. }),
  18353. smalltalk.IRClosure);
  18354. smalltalk.addMethod(
  18355. "_sequence",
  18356. smalltalk.method({
  18357. selector: "sequence",
  18358. category: 'accessing',
  18359. fn: function (){
  18360. var self=this;
  18361. return smalltalk.withContext(function($ctx1) { var $1;
  18362. $1=_st(_st(self)._instructions())._last();
  18363. return $1;
  18364. }, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRClosure)})},
  18365. args: [],
  18366. source: "sequence\x0a\x09^ self instructions last",
  18367. messageSends: ["last", "instructions"],
  18368. referencedClasses: []
  18369. }),
  18370. smalltalk.IRClosure);
  18371. smalltalk.addClass('IRMethod', smalltalk.IRClosureInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'internalVariables'], 'Compiler-IR');
  18372. smalltalk.IRMethod.comment="I am a method instruction"
  18373. smalltalk.addMethod(
  18374. "_accept_",
  18375. smalltalk.method({
  18376. selector: "accept:",
  18377. category: 'visiting',
  18378. fn: function (aVisitor){
  18379. var self=this;
  18380. return smalltalk.withContext(function($ctx1) { var $1;
  18381. $1=_st(aVisitor)._visitIRMethod_(self);
  18382. return $1;
  18383. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRMethod)})},
  18384. args: ["aVisitor"],
  18385. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRMethod: self",
  18386. messageSends: ["visitIRMethod:"],
  18387. referencedClasses: []
  18388. }),
  18389. smalltalk.IRMethod);
  18390. smalltalk.addMethod(
  18391. "_classReferences",
  18392. smalltalk.method({
  18393. selector: "classReferences",
  18394. category: 'accessing',
  18395. fn: function (){
  18396. var self=this;
  18397. return smalltalk.withContext(function($ctx1) { var $1;
  18398. $1=self["@classReferences"];
  18399. return $1;
  18400. }, function($ctx1) {$ctx1.fill(self,"classReferences",{}, smalltalk.IRMethod)})},
  18401. args: [],
  18402. source: "classReferences\x0a\x09^ classReferences",
  18403. messageSends: [],
  18404. referencedClasses: []
  18405. }),
  18406. smalltalk.IRMethod);
  18407. smalltalk.addMethod(
  18408. "_classReferences_",
  18409. smalltalk.method({
  18410. selector: "classReferences:",
  18411. category: 'accessing',
  18412. fn: function (aCollection){
  18413. var self=this;
  18414. return smalltalk.withContext(function($ctx1) { self["@classReferences"]=aCollection;
  18415. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  18416. args: ["aCollection"],
  18417. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  18418. messageSends: [],
  18419. referencedClasses: []
  18420. }),
  18421. smalltalk.IRMethod);
  18422. smalltalk.addMethod(
  18423. "_internalVariables",
  18424. smalltalk.method({
  18425. selector: "internalVariables",
  18426. category: 'accessing',
  18427. fn: function (){
  18428. var self=this;
  18429. return smalltalk.withContext(function($ctx1) { var $2,$1;
  18430. $2=self["@internalVariables"];
  18431. if(($receiver = $2) == nil || $receiver == undefined){
  18432. self["@internalVariables"]=_st((smalltalk.Set || Set))._new();
  18433. $1=self["@internalVariables"];
  18434. } else {
  18435. $1=$2;
  18436. };
  18437. return $1;
  18438. }, function($ctx1) {$ctx1.fill(self,"internalVariables",{}, smalltalk.IRMethod)})},
  18439. args: [],
  18440. source: "internalVariables\x0a\x09^ internalVariables ifNil: [ internalVariables := Set new ]",
  18441. messageSends: ["ifNil:", "new"],
  18442. referencedClasses: ["Set"]
  18443. }),
  18444. smalltalk.IRMethod);
  18445. smalltalk.addMethod(
  18446. "_isMethod",
  18447. smalltalk.method({
  18448. selector: "isMethod",
  18449. category: 'accessing',
  18450. fn: function (){
  18451. var self=this;
  18452. return smalltalk.withContext(function($ctx1) { return true;
  18453. }, function($ctx1) {$ctx1.fill(self,"isMethod",{}, smalltalk.IRMethod)})},
  18454. args: [],
  18455. source: "isMethod\x0a\x09^ true",
  18456. messageSends: [],
  18457. referencedClasses: []
  18458. }),
  18459. smalltalk.IRMethod);
  18460. smalltalk.addMethod(
  18461. "_messageSends",
  18462. smalltalk.method({
  18463. selector: "messageSends",
  18464. category: 'accessing',
  18465. fn: function (){
  18466. var self=this;
  18467. return smalltalk.withContext(function($ctx1) { var $1;
  18468. $1=self["@messageSends"];
  18469. return $1;
  18470. }, function($ctx1) {$ctx1.fill(self,"messageSends",{}, smalltalk.IRMethod)})},
  18471. args: [],
  18472. source: "messageSends\x0a\x09^ messageSends",
  18473. messageSends: [],
  18474. referencedClasses: []
  18475. }),
  18476. smalltalk.IRMethod);
  18477. smalltalk.addMethod(
  18478. "_messageSends_",
  18479. smalltalk.method({
  18480. selector: "messageSends:",
  18481. category: 'accessing',
  18482. fn: function (aCollection){
  18483. var self=this;
  18484. return smalltalk.withContext(function($ctx1) { self["@messageSends"]=aCollection;
  18485. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  18486. args: ["aCollection"],
  18487. source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
  18488. messageSends: [],
  18489. referencedClasses: []
  18490. }),
  18491. smalltalk.IRMethod);
  18492. smalltalk.addMethod(
  18493. "_method",
  18494. smalltalk.method({
  18495. selector: "method",
  18496. category: 'accessing',
  18497. fn: function (){
  18498. var self=this;
  18499. return smalltalk.withContext(function($ctx1) { var $1;
  18500. $1=self;
  18501. return $1;
  18502. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.IRMethod)})},
  18503. args: [],
  18504. source: "method\x0a\x09^ self",
  18505. messageSends: [],
  18506. referencedClasses: []
  18507. }),
  18508. smalltalk.IRMethod);
  18509. smalltalk.addMethod(
  18510. "_selector",
  18511. smalltalk.method({
  18512. selector: "selector",
  18513. category: 'accessing',
  18514. fn: function (){
  18515. var self=this;
  18516. return smalltalk.withContext(function($ctx1) { var $1;
  18517. $1=self["@selector"];
  18518. return $1;
  18519. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.IRMethod)})},
  18520. args: [],
  18521. source: "selector\x0a\x09^ selector",
  18522. messageSends: [],
  18523. referencedClasses: []
  18524. }),
  18525. smalltalk.IRMethod);
  18526. smalltalk.addMethod(
  18527. "_selector_",
  18528. smalltalk.method({
  18529. selector: "selector:",
  18530. category: 'accessing',
  18531. fn: function (aString){
  18532. var self=this;
  18533. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  18534. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.IRMethod)})},
  18535. args: ["aString"],
  18536. source: "selector: aString\x0a\x09selector := aString",
  18537. messageSends: [],
  18538. referencedClasses: []
  18539. }),
  18540. smalltalk.IRMethod);
  18541. smalltalk.addMethod(
  18542. "_source",
  18543. smalltalk.method({
  18544. selector: "source",
  18545. category: 'accessing',
  18546. fn: function (){
  18547. var self=this;
  18548. return smalltalk.withContext(function($ctx1) { var $1;
  18549. $1=self["@source"];
  18550. return $1;
  18551. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.IRMethod)})},
  18552. args: [],
  18553. source: "source\x0a\x09^ source",
  18554. messageSends: [],
  18555. referencedClasses: []
  18556. }),
  18557. smalltalk.IRMethod);
  18558. smalltalk.addMethod(
  18559. "_source_",
  18560. smalltalk.method({
  18561. selector: "source:",
  18562. category: 'accessing',
  18563. fn: function (aString){
  18564. var self=this;
  18565. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  18566. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.IRMethod)})},
  18567. args: ["aString"],
  18568. source: "source: aString\x0a\x09source := aString",
  18569. messageSends: [],
  18570. referencedClasses: []
  18571. }),
  18572. smalltalk.IRMethod);
  18573. smalltalk.addMethod(
  18574. "_superSends",
  18575. smalltalk.method({
  18576. selector: "superSends",
  18577. category: 'accessing',
  18578. fn: function (){
  18579. var self=this;
  18580. return smalltalk.withContext(function($ctx1) { var $1;
  18581. $1=self["@superSends"];
  18582. return $1;
  18583. }, function($ctx1) {$ctx1.fill(self,"superSends",{}, smalltalk.IRMethod)})},
  18584. args: [],
  18585. source: "superSends\x0a\x09^ superSends",
  18586. messageSends: [],
  18587. referencedClasses: []
  18588. }),
  18589. smalltalk.IRMethod);
  18590. smalltalk.addMethod(
  18591. "_superSends_",
  18592. smalltalk.method({
  18593. selector: "superSends:",
  18594. category: 'accessing',
  18595. fn: function (aCollection){
  18596. var self=this;
  18597. return smalltalk.withContext(function($ctx1) { self["@superSends"]=aCollection;
  18598. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  18599. args: ["aCollection"],
  18600. source: "superSends: aCollection\x0a\x09superSends := aCollection",
  18601. messageSends: [],
  18602. referencedClasses: []
  18603. }),
  18604. smalltalk.IRMethod);
  18605. smalltalk.addMethod(
  18606. "_theClass",
  18607. smalltalk.method({
  18608. selector: "theClass",
  18609. category: 'accessing',
  18610. fn: function (){
  18611. var self=this;
  18612. return smalltalk.withContext(function($ctx1) { var $1;
  18613. $1=self["@theClass"];
  18614. return $1;
  18615. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.IRMethod)})},
  18616. args: [],
  18617. source: "theClass\x0a\x09^ theClass",
  18618. messageSends: [],
  18619. referencedClasses: []
  18620. }),
  18621. smalltalk.IRMethod);
  18622. smalltalk.addMethod(
  18623. "_theClass_",
  18624. smalltalk.method({
  18625. selector: "theClass:",
  18626. category: 'accessing',
  18627. fn: function (aClass){
  18628. var self=this;
  18629. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  18630. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.IRMethod)})},
  18631. args: ["aClass"],
  18632. source: "theClass: aClass\x0a\x09theClass := aClass",
  18633. messageSends: [],
  18634. referencedClasses: []
  18635. }),
  18636. smalltalk.IRMethod);
  18637. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  18638. smalltalk.IRReturn.comment="I am a local return instruction."
  18639. smalltalk.addMethod(
  18640. "_accept_",
  18641. smalltalk.method({
  18642. selector: "accept:",
  18643. category: 'visiting',
  18644. fn: function (aVisitor){
  18645. var self=this;
  18646. return smalltalk.withContext(function($ctx1) { var $1;
  18647. $1=_st(aVisitor)._visitIRReturn_(self);
  18648. return $1;
  18649. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRReturn)})},
  18650. args: ["aVisitor"],
  18651. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRReturn: self",
  18652. messageSends: ["visitIRReturn:"],
  18653. referencedClasses: []
  18654. }),
  18655. smalltalk.IRReturn);
  18656. smalltalk.addMethod(
  18657. "_canBeAssigned",
  18658. smalltalk.method({
  18659. selector: "canBeAssigned",
  18660. category: 'testing',
  18661. fn: function (){
  18662. var self=this;
  18663. return smalltalk.withContext(function($ctx1) { return false;
  18664. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{}, smalltalk.IRReturn)})},
  18665. args: [],
  18666. source: "canBeAssigned\x0a\x09^ false",
  18667. messageSends: [],
  18668. referencedClasses: []
  18669. }),
  18670. smalltalk.IRReturn);
  18671. smalltalk.addMethod(
  18672. "_isBlockReturn",
  18673. smalltalk.method({
  18674. selector: "isBlockReturn",
  18675. category: 'testing',
  18676. fn: function (){
  18677. var self=this;
  18678. return smalltalk.withContext(function($ctx1) { return false;
  18679. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{}, smalltalk.IRReturn)})},
  18680. args: [],
  18681. source: "isBlockReturn\x0a\x09^ false",
  18682. messageSends: [],
  18683. referencedClasses: []
  18684. }),
  18685. smalltalk.IRReturn);
  18686. smalltalk.addMethod(
  18687. "_isLocalReturn",
  18688. smalltalk.method({
  18689. selector: "isLocalReturn",
  18690. category: 'testing',
  18691. fn: function (){
  18692. var self=this;
  18693. return smalltalk.withContext(function($ctx1) { return true;
  18694. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{}, smalltalk.IRReturn)})},
  18695. args: [],
  18696. source: "isLocalReturn\x0a\x09^ true",
  18697. messageSends: [],
  18698. referencedClasses: []
  18699. }),
  18700. smalltalk.IRReturn);
  18701. smalltalk.addMethod(
  18702. "_isNonLocalReturn",
  18703. smalltalk.method({
  18704. selector: "isNonLocalReturn",
  18705. category: 'testing',
  18706. fn: function (){
  18707. var self=this;
  18708. return smalltalk.withContext(function($ctx1) { var $1;
  18709. $1=_st(_st(self)._isLocalReturn())._not();
  18710. return $1;
  18711. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn",{}, smalltalk.IRReturn)})},
  18712. args: [],
  18713. source: "isNonLocalReturn\x0a\x09^ self isLocalReturn not",
  18714. messageSends: ["not", "isLocalReturn"],
  18715. referencedClasses: []
  18716. }),
  18717. smalltalk.IRReturn);
  18718. smalltalk.addMethod(
  18719. "_isReturn",
  18720. smalltalk.method({
  18721. selector: "isReturn",
  18722. category: 'testing',
  18723. fn: function (){
  18724. var self=this;
  18725. return smalltalk.withContext(function($ctx1) { return true;
  18726. }, function($ctx1) {$ctx1.fill(self,"isReturn",{}, smalltalk.IRReturn)})},
  18727. args: [],
  18728. source: "isReturn\x0a\x09^ true",
  18729. messageSends: [],
  18730. referencedClasses: []
  18731. }),
  18732. smalltalk.IRReturn);
  18733. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  18734. smalltalk.IRBlockReturn.comment="Smalltalk blocks return their last statement. I am a implicit block return instruction."
  18735. smalltalk.addMethod(
  18736. "_accept_",
  18737. smalltalk.method({
  18738. selector: "accept:",
  18739. category: 'visiting',
  18740. fn: function (aVisitor){
  18741. var self=this;
  18742. return smalltalk.withContext(function($ctx1) { var $1;
  18743. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  18744. return $1;
  18745. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRBlockReturn)})},
  18746. args: ["aVisitor"],
  18747. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockReturn: self",
  18748. messageSends: ["visitIRBlockReturn:"],
  18749. referencedClasses: []
  18750. }),
  18751. smalltalk.IRBlockReturn);
  18752. smalltalk.addMethod(
  18753. "_isBlockReturn",
  18754. smalltalk.method({
  18755. selector: "isBlockReturn",
  18756. category: 'testing',
  18757. fn: function (){
  18758. var self=this;
  18759. return smalltalk.withContext(function($ctx1) { return true;
  18760. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{}, smalltalk.IRBlockReturn)})},
  18761. args: [],
  18762. source: "isBlockReturn\x0a\x09^ true",
  18763. messageSends: [],
  18764. referencedClasses: []
  18765. }),
  18766. smalltalk.IRBlockReturn);
  18767. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  18768. smalltalk.IRNonLocalReturn.comment="I am a non local return instruction.\x0aNon local returns are handled using a try/catch JS statement.\x0a\x0aSee IRNonLocalReturnHandling class"
  18769. smalltalk.addMethod(
  18770. "_accept_",
  18771. smalltalk.method({
  18772. selector: "accept:",
  18773. category: 'visiting',
  18774. fn: function (aVisitor){
  18775. var self=this;
  18776. return smalltalk.withContext(function($ctx1) { var $1;
  18777. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  18778. return $1;
  18779. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRNonLocalReturn)})},
  18780. args: ["aVisitor"],
  18781. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRNonLocalReturn: self",
  18782. messageSends: ["visitIRNonLocalReturn:"],
  18783. referencedClasses: []
  18784. }),
  18785. smalltalk.IRNonLocalReturn);
  18786. smalltalk.addMethod(
  18787. "_isLocalReturn",
  18788. smalltalk.method({
  18789. selector: "isLocalReturn",
  18790. category: 'testing',
  18791. fn: function (){
  18792. var self=this;
  18793. return smalltalk.withContext(function($ctx1) { return false;
  18794. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{}, smalltalk.IRNonLocalReturn)})},
  18795. args: [],
  18796. source: "isLocalReturn\x0a\x09^ false",
  18797. messageSends: [],
  18798. referencedClasses: []
  18799. }),
  18800. smalltalk.IRNonLocalReturn);
  18801. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  18802. smalltalk.addMethod(
  18803. "_accept_",
  18804. smalltalk.method({
  18805. selector: "accept:",
  18806. category: 'visiting',
  18807. fn: function (aVisitor){
  18808. var self=this;
  18809. return smalltalk.withContext(function($ctx1) { var $1;
  18810. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  18811. return $1;
  18812. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRTempDeclaration)})},
  18813. args: ["aVisitor"],
  18814. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRTempDeclaration: self",
  18815. messageSends: ["visitIRTempDeclaration:"],
  18816. referencedClasses: []
  18817. }),
  18818. smalltalk.IRTempDeclaration);
  18819. smalltalk.addMethod(
  18820. "_isTempDeclaration",
  18821. smalltalk.method({
  18822. selector: "isTempDeclaration",
  18823. category: 'testing',
  18824. fn: function (){
  18825. var self=this;
  18826. return smalltalk.withContext(function($ctx1) { return true;
  18827. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{}, smalltalk.IRTempDeclaration)})},
  18828. args: [],
  18829. source: "isTempDeclaration\x0a\x09^ true",
  18830. messageSends: [],
  18831. referencedClasses: []
  18832. }),
  18833. smalltalk.IRTempDeclaration);
  18834. smalltalk.addMethod(
  18835. "_name",
  18836. smalltalk.method({
  18837. selector: "name",
  18838. category: 'accessing',
  18839. fn: function (){
  18840. var self=this;
  18841. return smalltalk.withContext(function($ctx1) { var $1;
  18842. $1=self["@name"];
  18843. return $1;
  18844. }, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.IRTempDeclaration)})},
  18845. args: [],
  18846. source: "name\x0a\x09^ name",
  18847. messageSends: [],
  18848. referencedClasses: []
  18849. }),
  18850. smalltalk.IRTempDeclaration);
  18851. smalltalk.addMethod(
  18852. "_name_",
  18853. smalltalk.method({
  18854. selector: "name:",
  18855. category: 'accessing',
  18856. fn: function (aString){
  18857. var self=this;
  18858. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  18859. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString}, smalltalk.IRTempDeclaration)})},
  18860. args: ["aString"],
  18861. source: "name: aString\x0a\x09name := aString",
  18862. messageSends: [],
  18863. referencedClasses: []
  18864. }),
  18865. smalltalk.IRTempDeclaration);
  18866. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  18867. smalltalk.IRSend.comment="I am a message send instruction."
  18868. smalltalk.addMethod(
  18869. "_accept_",
  18870. smalltalk.method({
  18871. selector: "accept:",
  18872. category: 'visiting',
  18873. fn: function (aVisitor){
  18874. var self=this;
  18875. return smalltalk.withContext(function($ctx1) { var $1;
  18876. $1=_st(aVisitor)._visitIRSend_(self);
  18877. return $1;
  18878. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRSend)})},
  18879. args: ["aVisitor"],
  18880. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSend: self",
  18881. messageSends: ["visitIRSend:"],
  18882. referencedClasses: []
  18883. }),
  18884. smalltalk.IRSend);
  18885. smalltalk.addMethod(
  18886. "_classSend",
  18887. smalltalk.method({
  18888. selector: "classSend",
  18889. category: 'accessing',
  18890. fn: function (){
  18891. var self=this;
  18892. return smalltalk.withContext(function($ctx1) { var $1;
  18893. $1=self["@classSend"];
  18894. return $1;
  18895. }, function($ctx1) {$ctx1.fill(self,"classSend",{}, smalltalk.IRSend)})},
  18896. args: [],
  18897. source: "classSend\x0a\x09^ classSend",
  18898. messageSends: [],
  18899. referencedClasses: []
  18900. }),
  18901. smalltalk.IRSend);
  18902. smalltalk.addMethod(
  18903. "_classSend_",
  18904. smalltalk.method({
  18905. selector: "classSend:",
  18906. category: 'accessing',
  18907. fn: function (aClass){
  18908. var self=this;
  18909. return smalltalk.withContext(function($ctx1) { self["@classSend"]=aClass;
  18910. return self}, function($ctx1) {$ctx1.fill(self,"classSend:",{aClass:aClass}, smalltalk.IRSend)})},
  18911. args: ["aClass"],
  18912. source: "classSend: aClass\x0a\x09classSend := aClass",
  18913. messageSends: [],
  18914. referencedClasses: []
  18915. }),
  18916. smalltalk.IRSend);
  18917. smalltalk.addMethod(
  18918. "_index",
  18919. smalltalk.method({
  18920. selector: "index",
  18921. category: 'accessing',
  18922. fn: function (){
  18923. var self=this;
  18924. return smalltalk.withContext(function($ctx1) { var $1;
  18925. $1=self["@index"];
  18926. return $1;
  18927. }, function($ctx1) {$ctx1.fill(self,"index",{}, smalltalk.IRSend)})},
  18928. args: [],
  18929. source: "index\x0a\x09^ index",
  18930. messageSends: [],
  18931. referencedClasses: []
  18932. }),
  18933. smalltalk.IRSend);
  18934. smalltalk.addMethod(
  18935. "_index_",
  18936. smalltalk.method({
  18937. selector: "index:",
  18938. category: 'accessing',
  18939. fn: function (anInteger){
  18940. var self=this;
  18941. return smalltalk.withContext(function($ctx1) { self["@index"]=anInteger;
  18942. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger}, smalltalk.IRSend)})},
  18943. args: ["anInteger"],
  18944. source: "index: anInteger\x0a\x09index := anInteger",
  18945. messageSends: [],
  18946. referencedClasses: []
  18947. }),
  18948. smalltalk.IRSend);
  18949. smalltalk.addMethod(
  18950. "_isSend",
  18951. smalltalk.method({
  18952. selector: "isSend",
  18953. category: 'testing',
  18954. fn: function (){
  18955. var self=this;
  18956. return smalltalk.withContext(function($ctx1) { return true;
  18957. }, function($ctx1) {$ctx1.fill(self,"isSend",{}, smalltalk.IRSend)})},
  18958. args: [],
  18959. source: "isSend\x0a\x09^ true",
  18960. messageSends: [],
  18961. referencedClasses: []
  18962. }),
  18963. smalltalk.IRSend);
  18964. smalltalk.addMethod(
  18965. "_javascriptSelector",
  18966. smalltalk.method({
  18967. selector: "javascriptSelector",
  18968. category: 'accessing',
  18969. fn: function (){
  18970. var self=this;
  18971. return smalltalk.withContext(function($ctx1) { var $2,$1;
  18972. $2=_st(self)._classSend();
  18973. if(($receiver = $2) == nil || $receiver == undefined){
  18974. $1=_st(_st(self)._selector())._asSelector();
  18975. } else {
  18976. $1=_st(_st(self)._selector())._asSuperSelector();
  18977. };
  18978. return $1;
  18979. }, function($ctx1) {$ctx1.fill(self,"javascriptSelector",{}, smalltalk.IRSend)})},
  18980. args: [],
  18981. source: "javascriptSelector\x0a\x09^ self classSend \x0a \x09ifNil: [ self selector asSelector ]\x0a \x09ifNotNil: [ self selector asSuperSelector ]",
  18982. messageSends: ["ifNil:ifNotNil:", "asSelector", "selector", "asSuperSelector", "classSend"],
  18983. referencedClasses: []
  18984. }),
  18985. smalltalk.IRSend);
  18986. smalltalk.addMethod(
  18987. "_selector",
  18988. smalltalk.method({
  18989. selector: "selector",
  18990. category: 'accessing',
  18991. fn: function (){
  18992. var self=this;
  18993. return smalltalk.withContext(function($ctx1) { var $1;
  18994. $1=self["@selector"];
  18995. return $1;
  18996. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.IRSend)})},
  18997. args: [],
  18998. source: "selector\x0a\x09^ selector",
  18999. messageSends: [],
  19000. referencedClasses: []
  19001. }),
  19002. smalltalk.IRSend);
  19003. smalltalk.addMethod(
  19004. "_selector_",
  19005. smalltalk.method({
  19006. selector: "selector:",
  19007. category: 'accessing',
  19008. fn: function (aString){
  19009. var self=this;
  19010. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  19011. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.IRSend)})},
  19012. args: ["aString"],
  19013. source: "selector: aString\x0a\x09selector := aString",
  19014. messageSends: [],
  19015. referencedClasses: []
  19016. }),
  19017. smalltalk.IRSend);
  19018. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  19019. smalltalk.addMethod(
  19020. "_accept_",
  19021. smalltalk.method({
  19022. selector: "accept:",
  19023. category: 'visiting',
  19024. fn: function (aVisitor){
  19025. var self=this;
  19026. return smalltalk.withContext(function($ctx1) { var $1;
  19027. $1=_st(aVisitor)._visitIRSequence_(self);
  19028. return $1;
  19029. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRSequence)})},
  19030. args: ["aVisitor"],
  19031. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSequence: self",
  19032. messageSends: ["visitIRSequence:"],
  19033. referencedClasses: []
  19034. }),
  19035. smalltalk.IRSequence);
  19036. smalltalk.addMethod(
  19037. "_isSequence",
  19038. smalltalk.method({
  19039. selector: "isSequence",
  19040. category: 'testing',
  19041. fn: function (){
  19042. var self=this;
  19043. return smalltalk.withContext(function($ctx1) { return true;
  19044. }, function($ctx1) {$ctx1.fill(self,"isSequence",{}, smalltalk.IRSequence)})},
  19045. args: [],
  19046. source: "isSequence\x0a\x09^ true",
  19047. messageSends: [],
  19048. referencedClasses: []
  19049. }),
  19050. smalltalk.IRSequence);
  19051. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  19052. smalltalk.addMethod(
  19053. "_accept_",
  19054. smalltalk.method({
  19055. selector: "accept:",
  19056. category: 'visiting',
  19057. fn: function (aVisitor){
  19058. var self=this;
  19059. return smalltalk.withContext(function($ctx1) { var $1;
  19060. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  19061. return $1;
  19062. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRBlockSequence)})},
  19063. args: ["aVisitor"],
  19064. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockSequence: self",
  19065. messageSends: ["visitIRBlockSequence:"],
  19066. referencedClasses: []
  19067. }),
  19068. smalltalk.IRBlockSequence);
  19069. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  19070. smalltalk.IRValue.comment="I am the simplest possible instruction. I represent a value."
  19071. smalltalk.addMethod(
  19072. "_accept_",
  19073. smalltalk.method({
  19074. selector: "accept:",
  19075. category: 'visiting',
  19076. fn: function (aVisitor){
  19077. var self=this;
  19078. return smalltalk.withContext(function($ctx1) { var $1;
  19079. $1=_st(aVisitor)._visitIRValue_(self);
  19080. return $1;
  19081. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRValue)})},
  19082. args: ["aVisitor"],
  19083. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRValue: self",
  19084. messageSends: ["visitIRValue:"],
  19085. referencedClasses: []
  19086. }),
  19087. smalltalk.IRValue);
  19088. smalltalk.addMethod(
  19089. "_value",
  19090. smalltalk.method({
  19091. selector: "value",
  19092. category: 'accessing',
  19093. fn: function (){
  19094. var self=this;
  19095. return smalltalk.withContext(function($ctx1) { var $1;
  19096. $1=self["@value"];
  19097. return $1;
  19098. }, function($ctx1) {$ctx1.fill(self,"value",{}, smalltalk.IRValue)})},
  19099. args: [],
  19100. source: "value\x0a\x09^value",
  19101. messageSends: [],
  19102. referencedClasses: []
  19103. }),
  19104. smalltalk.IRValue);
  19105. smalltalk.addMethod(
  19106. "_value_",
  19107. smalltalk.method({
  19108. selector: "value:",
  19109. category: 'accessing',
  19110. fn: function (aString){
  19111. var self=this;
  19112. return smalltalk.withContext(function($ctx1) { self["@value"]=aString;
  19113. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString}, smalltalk.IRValue)})},
  19114. args: ["aString"],
  19115. source: "value: aString\x0a\x09value := aString",
  19116. messageSends: [],
  19117. referencedClasses: []
  19118. }),
  19119. smalltalk.IRValue);
  19120. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  19121. smalltalk.IRVariable.comment="I am a variable instruction."
  19122. smalltalk.addMethod(
  19123. "_accept_",
  19124. smalltalk.method({
  19125. selector: "accept:",
  19126. category: 'visiting',
  19127. fn: function (aVisitor){
  19128. var self=this;
  19129. return smalltalk.withContext(function($ctx1) { var $1;
  19130. $1=_st(aVisitor)._visitIRVariable_(self);
  19131. return $1;
  19132. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRVariable)})},
  19133. args: ["aVisitor"],
  19134. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVariable: self",
  19135. messageSends: ["visitIRVariable:"],
  19136. referencedClasses: []
  19137. }),
  19138. smalltalk.IRVariable);
  19139. smalltalk.addMethod(
  19140. "_isVariable",
  19141. smalltalk.method({
  19142. selector: "isVariable",
  19143. category: 'testing',
  19144. fn: function (){
  19145. var self=this;
  19146. return smalltalk.withContext(function($ctx1) { return true;
  19147. }, function($ctx1) {$ctx1.fill(self,"isVariable",{}, smalltalk.IRVariable)})},
  19148. args: [],
  19149. source: "isVariable\x0a\x09^ true",
  19150. messageSends: [],
  19151. referencedClasses: []
  19152. }),
  19153. smalltalk.IRVariable);
  19154. smalltalk.addMethod(
  19155. "_variable",
  19156. smalltalk.method({
  19157. selector: "variable",
  19158. category: 'accessing',
  19159. fn: function (){
  19160. var self=this;
  19161. return smalltalk.withContext(function($ctx1) { var $1;
  19162. $1=self["@variable"];
  19163. return $1;
  19164. }, function($ctx1) {$ctx1.fill(self,"variable",{}, smalltalk.IRVariable)})},
  19165. args: [],
  19166. source: "variable\x0a\x09^ variable",
  19167. messageSends: [],
  19168. referencedClasses: []
  19169. }),
  19170. smalltalk.IRVariable);
  19171. smalltalk.addMethod(
  19172. "_variable_",
  19173. smalltalk.method({
  19174. selector: "variable:",
  19175. category: 'accessing',
  19176. fn: function (aScopeVariable){
  19177. var self=this;
  19178. return smalltalk.withContext(function($ctx1) { self["@variable"]=aScopeVariable;
  19179. return self}, function($ctx1) {$ctx1.fill(self,"variable:",{aScopeVariable:aScopeVariable}, smalltalk.IRVariable)})},
  19180. args: ["aScopeVariable"],
  19181. source: "variable: aScopeVariable\x0a\x09variable := aScopeVariable",
  19182. messageSends: [],
  19183. referencedClasses: []
  19184. }),
  19185. smalltalk.IRVariable);
  19186. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  19187. smalltalk.addMethod(
  19188. "_accept_",
  19189. smalltalk.method({
  19190. selector: "accept:",
  19191. category: 'visiting',
  19192. fn: function (aVisitor){
  19193. var self=this;
  19194. return smalltalk.withContext(function($ctx1) { var $1;
  19195. $1=_st(aVisitor)._visitIRVerbatim_(self);
  19196. return $1;
  19197. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRVerbatim)})},
  19198. args: ["aVisitor"],
  19199. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVerbatim: self",
  19200. messageSends: ["visitIRVerbatim:"],
  19201. referencedClasses: []
  19202. }),
  19203. smalltalk.IRVerbatim);
  19204. smalltalk.addMethod(
  19205. "_source",
  19206. smalltalk.method({
  19207. selector: "source",
  19208. category: 'accessing',
  19209. fn: function (){
  19210. var self=this;
  19211. return smalltalk.withContext(function($ctx1) { var $1;
  19212. $1=self["@source"];
  19213. return $1;
  19214. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.IRVerbatim)})},
  19215. args: [],
  19216. source: "source\x0a\x09^ source",
  19217. messageSends: [],
  19218. referencedClasses: []
  19219. }),
  19220. smalltalk.IRVerbatim);
  19221. smalltalk.addMethod(
  19222. "_source_",
  19223. smalltalk.method({
  19224. selector: "source:",
  19225. category: 'accessing',
  19226. fn: function (aString){
  19227. var self=this;
  19228. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  19229. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.IRVerbatim)})},
  19230. args: ["aString"],
  19231. source: "source: aString\x0a\x09source := aString",
  19232. messageSends: [],
  19233. referencedClasses: []
  19234. }),
  19235. smalltalk.IRVerbatim);
  19236. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  19237. smalltalk.addMethod(
  19238. "_visit_",
  19239. smalltalk.method({
  19240. selector: "visit:",
  19241. category: 'visiting',
  19242. fn: function (anIRInstruction){
  19243. var self=this;
  19244. return smalltalk.withContext(function($ctx1) { var $1;
  19245. $1=_st(anIRInstruction)._accept_(self);
  19246. return $1;
  19247. }, function($ctx1) {$ctx1.fill(self,"visit:",{anIRInstruction:anIRInstruction}, smalltalk.IRVisitor)})},
  19248. args: ["anIRInstruction"],
  19249. source: "visit: anIRInstruction\x0a\x09^ anIRInstruction accept: self",
  19250. messageSends: ["accept:"],
  19251. referencedClasses: []
  19252. }),
  19253. smalltalk.IRVisitor);
  19254. smalltalk.addMethod(
  19255. "_visitIRAssignment_",
  19256. smalltalk.method({
  19257. selector: "visitIRAssignment:",
  19258. category: 'visiting',
  19259. fn: function (anIRAssignment){
  19260. var self=this;
  19261. return smalltalk.withContext(function($ctx1) { var $1;
  19262. $1=_st(self)._visitIRInstruction_(anIRAssignment);
  19263. return $1;
  19264. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRVisitor)})},
  19265. args: ["anIRAssignment"],
  19266. source: "visitIRAssignment: anIRAssignment\x0a\x09^ self visitIRInstruction: anIRAssignment",
  19267. messageSends: ["visitIRInstruction:"],
  19268. referencedClasses: []
  19269. }),
  19270. smalltalk.IRVisitor);
  19271. smalltalk.addMethod(
  19272. "_visitIRBlockReturn_",
  19273. smalltalk.method({
  19274. selector: "visitIRBlockReturn:",
  19275. category: 'visiting',
  19276. fn: function (anIRBlockReturn){
  19277. var self=this;
  19278. return smalltalk.withContext(function($ctx1) { var $1;
  19279. $1=_st(self)._visitIRReturn_(anIRBlockReturn);
  19280. return $1;
  19281. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:",{anIRBlockReturn:anIRBlockReturn}, smalltalk.IRVisitor)})},
  19282. args: ["anIRBlockReturn"],
  19283. source: "visitIRBlockReturn: anIRBlockReturn\x0a\x09^ self visitIRReturn: anIRBlockReturn",
  19284. messageSends: ["visitIRReturn:"],
  19285. referencedClasses: []
  19286. }),
  19287. smalltalk.IRVisitor);
  19288. smalltalk.addMethod(
  19289. "_visitIRBlockSequence_",
  19290. smalltalk.method({
  19291. selector: "visitIRBlockSequence:",
  19292. category: 'visiting',
  19293. fn: function (anIRBlockSequence){
  19294. var self=this;
  19295. return smalltalk.withContext(function($ctx1) { var $1;
  19296. $1=_st(self)._visitIRSequence_(anIRBlockSequence);
  19297. return $1;
  19298. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:",{anIRBlockSequence:anIRBlockSequence}, smalltalk.IRVisitor)})},
  19299. args: ["anIRBlockSequence"],
  19300. source: "visitIRBlockSequence: anIRBlockSequence\x0a\x09^ self visitIRSequence: anIRBlockSequence",
  19301. messageSends: ["visitIRSequence:"],
  19302. referencedClasses: []
  19303. }),
  19304. smalltalk.IRVisitor);
  19305. smalltalk.addMethod(
  19306. "_visitIRClosure_",
  19307. smalltalk.method({
  19308. selector: "visitIRClosure:",
  19309. category: 'visiting',
  19310. fn: function (anIRClosure){
  19311. var self=this;
  19312. return smalltalk.withContext(function($ctx1) { var $1;
  19313. $1=_st(self)._visitIRInstruction_(anIRClosure);
  19314. return $1;
  19315. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure}, smalltalk.IRVisitor)})},
  19316. args: ["anIRClosure"],
  19317. source: "visitIRClosure: anIRClosure\x0a\x09^ self visitIRInstruction: anIRClosure",
  19318. messageSends: ["visitIRInstruction:"],
  19319. referencedClasses: []
  19320. }),
  19321. smalltalk.IRVisitor);
  19322. smalltalk.addMethod(
  19323. "_visitIRDynamicArray_",
  19324. smalltalk.method({
  19325. selector: "visitIRDynamicArray:",
  19326. category: 'visiting',
  19327. fn: function (anIRDynamicArray){
  19328. var self=this;
  19329. return smalltalk.withContext(function($ctx1) { var $1;
  19330. $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
  19331. return $1;
  19332. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray}, smalltalk.IRVisitor)})},
  19333. args: ["anIRDynamicArray"],
  19334. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09^ self visitIRInstruction: anIRDynamicArray",
  19335. messageSends: ["visitIRInstruction:"],
  19336. referencedClasses: []
  19337. }),
  19338. smalltalk.IRVisitor);
  19339. smalltalk.addMethod(
  19340. "_visitIRDynamicDictionary_",
  19341. smalltalk.method({
  19342. selector: "visitIRDynamicDictionary:",
  19343. category: 'visiting',
  19344. fn: function (anIRDynamicDictionary){
  19345. var self=this;
  19346. return smalltalk.withContext(function($ctx1) { var $1;
  19347. $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
  19348. return $1;
  19349. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary}, smalltalk.IRVisitor)})},
  19350. args: ["anIRDynamicDictionary"],
  19351. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09^ self visitIRInstruction: anIRDynamicDictionary",
  19352. messageSends: ["visitIRInstruction:"],
  19353. referencedClasses: []
  19354. }),
  19355. smalltalk.IRVisitor);
  19356. smalltalk.addMethod(
  19357. "_visitIRInlinedClosure_",
  19358. smalltalk.method({
  19359. selector: "visitIRInlinedClosure:",
  19360. category: 'visiting',
  19361. fn: function (anIRInlinedClosure){
  19362. var self=this;
  19363. return smalltalk.withContext(function($ctx1) { var $1;
  19364. $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
  19365. return $1;
  19366. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure}, smalltalk.IRVisitor)})},
  19367. args: ["anIRInlinedClosure"],
  19368. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09^ self visitIRClosure: anIRInlinedClosure",
  19369. messageSends: ["visitIRClosure:"],
  19370. referencedClasses: []
  19371. }),
  19372. smalltalk.IRVisitor);
  19373. smalltalk.addMethod(
  19374. "_visitIRInlinedSequence_",
  19375. smalltalk.method({
  19376. selector: "visitIRInlinedSequence:",
  19377. category: 'visiting',
  19378. fn: function (anIRInlinedSequence){
  19379. var self=this;
  19380. return smalltalk.withContext(function($ctx1) { var $1;
  19381. $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
  19382. return $1;
  19383. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence}, smalltalk.IRVisitor)})},
  19384. args: ["anIRInlinedSequence"],
  19385. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09^ self visitIRSequence: anIRInlinedSequence",
  19386. messageSends: ["visitIRSequence:"],
  19387. referencedClasses: []
  19388. }),
  19389. smalltalk.IRVisitor);
  19390. smalltalk.addMethod(
  19391. "_visitIRInstruction_",
  19392. smalltalk.method({
  19393. selector: "visitIRInstruction:",
  19394. category: 'visiting',
  19395. fn: function (anIRInstruction){
  19396. var self=this;
  19397. return smalltalk.withContext(function($ctx1) { var $1;
  19398. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  19399. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  19400. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  19401. $1=anIRInstruction;
  19402. return $1;
  19403. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:",{anIRInstruction:anIRInstruction}, smalltalk.IRVisitor)})},
  19404. args: ["anIRInstruction"],
  19405. source: "visitIRInstruction: anIRInstruction\x0a\x09anIRInstruction instructions do: [ :each | self visit: each ].\x0a\x09^ anIRInstruction",
  19406. messageSends: ["do:", "visit:", "instructions"],
  19407. referencedClasses: []
  19408. }),
  19409. smalltalk.IRVisitor);
  19410. smalltalk.addMethod(
  19411. "_visitIRMethod_",
  19412. smalltalk.method({
  19413. selector: "visitIRMethod:",
  19414. category: 'visiting',
  19415. fn: function (anIRMethod){
  19416. var self=this;
  19417. return smalltalk.withContext(function($ctx1) { var $1;
  19418. $1=_st(self)._visitIRInstruction_(anIRMethod);
  19419. return $1;
  19420. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod}, smalltalk.IRVisitor)})},
  19421. args: ["anIRMethod"],
  19422. source: "visitIRMethod: anIRMethod\x0a\x09^ self visitIRInstruction: anIRMethod",
  19423. messageSends: ["visitIRInstruction:"],
  19424. referencedClasses: []
  19425. }),
  19426. smalltalk.IRVisitor);
  19427. smalltalk.addMethod(
  19428. "_visitIRNonLocalReturn_",
  19429. smalltalk.method({
  19430. selector: "visitIRNonLocalReturn:",
  19431. category: 'visiting',
  19432. fn: function (anIRNonLocalReturn){
  19433. var self=this;
  19434. return smalltalk.withContext(function($ctx1) { var $1;
  19435. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
  19436. return $1;
  19437. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn}, smalltalk.IRVisitor)})},
  19438. args: ["anIRNonLocalReturn"],
  19439. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self visitIRInstruction: anIRNonLocalReturn",
  19440. messageSends: ["visitIRInstruction:"],
  19441. referencedClasses: []
  19442. }),
  19443. smalltalk.IRVisitor);
  19444. smalltalk.addMethod(
  19445. "_visitIRNonLocalReturnHandling_",
  19446. smalltalk.method({
  19447. selector: "visitIRNonLocalReturnHandling:",
  19448. category: 'visiting',
  19449. fn: function (anIRNonLocalReturnHandling){
  19450. var self=this;
  19451. return smalltalk.withContext(function($ctx1) { var $1;
  19452. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
  19453. return $1;
  19454. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:",{anIRNonLocalReturnHandling:anIRNonLocalReturnHandling}, smalltalk.IRVisitor)})},
  19455. args: ["anIRNonLocalReturnHandling"],
  19456. source: "visitIRNonLocalReturnHandling: anIRNonLocalReturnHandling\x0a\x09^ self visitIRInstruction: anIRNonLocalReturnHandling",
  19457. messageSends: ["visitIRInstruction:"],
  19458. referencedClasses: []
  19459. }),
  19460. smalltalk.IRVisitor);
  19461. smalltalk.addMethod(
  19462. "_visitIRReturn_",
  19463. smalltalk.method({
  19464. selector: "visitIRReturn:",
  19465. category: 'visiting',
  19466. fn: function (anIRReturn){
  19467. var self=this;
  19468. return smalltalk.withContext(function($ctx1) { var $1;
  19469. $1=_st(self)._visitIRInstruction_(anIRReturn);
  19470. return $1;
  19471. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn}, smalltalk.IRVisitor)})},
  19472. args: ["anIRReturn"],
  19473. source: "visitIRReturn: anIRReturn\x0a\x09^ self visitIRInstruction: anIRReturn",
  19474. messageSends: ["visitIRInstruction:"],
  19475. referencedClasses: []
  19476. }),
  19477. smalltalk.IRVisitor);
  19478. smalltalk.addMethod(
  19479. "_visitIRSend_",
  19480. smalltalk.method({
  19481. selector: "visitIRSend:",
  19482. category: 'visiting',
  19483. fn: function (anIRSend){
  19484. var self=this;
  19485. return smalltalk.withContext(function($ctx1) { var $1;
  19486. $1=_st(self)._visitIRInstruction_(anIRSend);
  19487. return $1;
  19488. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend}, smalltalk.IRVisitor)})},
  19489. args: ["anIRSend"],
  19490. source: "visitIRSend: anIRSend\x0a\x09^ self visitIRInstruction: anIRSend",
  19491. messageSends: ["visitIRInstruction:"],
  19492. referencedClasses: []
  19493. }),
  19494. smalltalk.IRVisitor);
  19495. smalltalk.addMethod(
  19496. "_visitIRSequence_",
  19497. smalltalk.method({
  19498. selector: "visitIRSequence:",
  19499. category: 'visiting',
  19500. fn: function (anIRSequence){
  19501. var self=this;
  19502. return smalltalk.withContext(function($ctx1) { var $1;
  19503. $1=_st(self)._visitIRInstruction_(anIRSequence);
  19504. return $1;
  19505. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence}, smalltalk.IRVisitor)})},
  19506. args: ["anIRSequence"],
  19507. source: "visitIRSequence: anIRSequence\x0a\x09^ self visitIRInstruction: anIRSequence",
  19508. messageSends: ["visitIRInstruction:"],
  19509. referencedClasses: []
  19510. }),
  19511. smalltalk.IRVisitor);
  19512. smalltalk.addMethod(
  19513. "_visitIRTempDeclaration_",
  19514. smalltalk.method({
  19515. selector: "visitIRTempDeclaration:",
  19516. category: 'visiting',
  19517. fn: function (anIRTempDeclaration){
  19518. var self=this;
  19519. return smalltalk.withContext(function($ctx1) { var $1;
  19520. $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
  19521. return $1;
  19522. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration}, smalltalk.IRVisitor)})},
  19523. args: ["anIRTempDeclaration"],
  19524. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09^ self visitIRInstruction: anIRTempDeclaration",
  19525. messageSends: ["visitIRInstruction:"],
  19526. referencedClasses: []
  19527. }),
  19528. smalltalk.IRVisitor);
  19529. smalltalk.addMethod(
  19530. "_visitIRValue_",
  19531. smalltalk.method({
  19532. selector: "visitIRValue:",
  19533. category: 'visiting',
  19534. fn: function (anIRValue){
  19535. var self=this;
  19536. return smalltalk.withContext(function($ctx1) { var $1;
  19537. $1=_st(self)._visitIRInstruction_(anIRValue);
  19538. return $1;
  19539. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue}, smalltalk.IRVisitor)})},
  19540. args: ["anIRValue"],
  19541. source: "visitIRValue: anIRValue\x0a\x09^ self visitIRInstruction: anIRValue",
  19542. messageSends: ["visitIRInstruction:"],
  19543. referencedClasses: []
  19544. }),
  19545. smalltalk.IRVisitor);
  19546. smalltalk.addMethod(
  19547. "_visitIRVariable_",
  19548. smalltalk.method({
  19549. selector: "visitIRVariable:",
  19550. category: 'visiting',
  19551. fn: function (anIRVariable){
  19552. var self=this;
  19553. return smalltalk.withContext(function($ctx1) { var $1;
  19554. $1=_st(self)._visitIRInstruction_(anIRVariable);
  19555. return $1;
  19556. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable}, smalltalk.IRVisitor)})},
  19557. args: ["anIRVariable"],
  19558. source: "visitIRVariable: anIRVariable\x0a\x09^ self visitIRInstruction: anIRVariable",
  19559. messageSends: ["visitIRInstruction:"],
  19560. referencedClasses: []
  19561. }),
  19562. smalltalk.IRVisitor);
  19563. smalltalk.addMethod(
  19564. "_visitIRVerbatim_",
  19565. smalltalk.method({
  19566. selector: "visitIRVerbatim:",
  19567. category: 'visiting',
  19568. fn: function (anIRVerbatim){
  19569. var self=this;
  19570. return smalltalk.withContext(function($ctx1) { var $1;
  19571. $1=_st(self)._visitIRInstruction_(anIRVerbatim);
  19572. return $1;
  19573. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim}, smalltalk.IRVisitor)})},
  19574. args: ["anIRVerbatim"],
  19575. source: "visitIRVerbatim: anIRVerbatim\x0a\x09^ self visitIRInstruction: anIRVerbatim",
  19576. messageSends: ["visitIRInstruction:"],
  19577. referencedClasses: []
  19578. }),
  19579. smalltalk.IRVisitor);
  19580. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  19581. smalltalk.addMethod(
  19582. "_contents",
  19583. smalltalk.method({
  19584. selector: "contents",
  19585. category: 'accessing',
  19586. fn: function (){
  19587. var self=this;
  19588. return smalltalk.withContext(function($ctx1) { var $1;
  19589. $1=_st(_st(self)._stream())._contents();
  19590. return $1;
  19591. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.IRJSTranslator)})},
  19592. args: [],
  19593. source: "contents\x0a\x09^ self stream contents",
  19594. messageSends: ["contents", "stream"],
  19595. referencedClasses: []
  19596. }),
  19597. smalltalk.IRJSTranslator);
  19598. smalltalk.addMethod(
  19599. "_initialize",
  19600. smalltalk.method({
  19601. selector: "initialize",
  19602. category: 'initialization',
  19603. fn: function (){
  19604. var self=this;
  19605. return smalltalk.withContext(function($ctx1) { smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  19606. self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
  19607. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.IRJSTranslator)})},
  19608. args: [],
  19609. source: "initialize\x0a\x09super initialize.\x0a\x09stream := JSStream new.",
  19610. messageSends: ["initialize", "new"],
  19611. referencedClasses: ["JSStream"]
  19612. }),
  19613. smalltalk.IRJSTranslator);
  19614. smalltalk.addMethod(
  19615. "_stream",
  19616. smalltalk.method({
  19617. selector: "stream",
  19618. category: 'accessing',
  19619. fn: function (){
  19620. var self=this;
  19621. return smalltalk.withContext(function($ctx1) { var $1;
  19622. $1=self["@stream"];
  19623. return $1;
  19624. }, function($ctx1) {$ctx1.fill(self,"stream",{}, smalltalk.IRJSTranslator)})},
  19625. args: [],
  19626. source: "stream\x0a\x09^ stream",
  19627. messageSends: [],
  19628. referencedClasses: []
  19629. }),
  19630. smalltalk.IRJSTranslator);
  19631. smalltalk.addMethod(
  19632. "_stream_",
  19633. smalltalk.method({
  19634. selector: "stream:",
  19635. category: 'accessing',
  19636. fn: function (aStream){
  19637. var self=this;
  19638. return smalltalk.withContext(function($ctx1) { self["@stream"]=aStream;
  19639. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.IRJSTranslator)})},
  19640. args: ["aStream"],
  19641. source: "stream: aStream\x0a\x09stream := aStream",
  19642. messageSends: [],
  19643. referencedClasses: []
  19644. }),
  19645. smalltalk.IRJSTranslator);
  19646. smalltalk.addMethod(
  19647. "_visitIRAssignment_",
  19648. smalltalk.method({
  19649. selector: "visitIRAssignment:",
  19650. category: 'visiting',
  19651. fn: function (anIRAssignment){
  19652. var self=this;
  19653. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
  19654. _st(_st(self)._stream())._nextPutAssignment();
  19655. _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
  19656. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRJSTranslator)})},
  19657. args: ["anIRAssignment"],
  19658. source: "visitIRAssignment: anIRAssignment\x0a\x09self visit: anIRAssignment instructions first.\x0a\x09self stream nextPutAssignment.\x0a\x09self visit: anIRAssignment instructions last.",
  19659. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"],
  19660. referencedClasses: []
  19661. }),
  19662. smalltalk.IRJSTranslator);
  19663. smalltalk.addMethod(
  19664. "_visitIRClosure_",
  19665. smalltalk.method({
  19666. selector: "visitIRClosure:",
  19667. category: 'visiting',
  19668. fn: function (anIRClosure){
  19669. var self=this;
  19670. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
  19671. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  19672. return smalltalk.withContext(function($ctx3) { return _st(_st(each)._name())._asVariableName();
  19673. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})})));
  19674. return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  19675. return smalltalk.withContext(function($ctx3) { return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  19676. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  19677. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),_st(anIRClosure)._arguments());
  19678. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure}, smalltalk.IRJSTranslator)})},
  19679. args: ["anIRClosure"],
  19680. source: "visitIRClosure: anIRClosure\x0a\x09self stream \x0a\x09\x09nextPutClosureWith: [ \x0a \x09self stream nextPutVars: (anIRClosure tempDeclarations collect: [ :each |\x0a \x09\x09\x09\x09each name asVariableName ]).\x0a \x09self stream \x0a \x09nextPutBlockContextFor: anIRClosure\x0a during: [ super visitIRClosure: anIRClosure ] ]\x0a\x09\x09arguments: anIRClosure arguments",
  19681. messageSends: ["nextPutClosureWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"],
  19682. referencedClasses: []
  19683. }),
  19684. smalltalk.IRJSTranslator);
  19685. smalltalk.addMethod(
  19686. "_visitIRDynamicArray_",
  19687. smalltalk.method({
  19688. selector: "visitIRDynamicArray:",
  19689. category: 'visiting',
  19690. fn: function (anIRDynamicArray){
  19691. var self=this;
  19692. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("[");
  19693. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  19694. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  19695. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  19696. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  19697. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19698. _st(self["@stream"])._nextPutAll_("]");
  19699. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray}, smalltalk.IRJSTranslator)})},
  19700. args: ["anIRDynamicArray"],
  19701. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09self stream nextPutAll: '['.\x0a\x09anIRDynamicArray instructions\x0a\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ']'",
  19702. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  19703. referencedClasses: []
  19704. }),
  19705. smalltalk.IRJSTranslator);
  19706. smalltalk.addMethod(
  19707. "_visitIRDynamicDictionary_",
  19708. smalltalk.method({
  19709. selector: "visitIRDynamicDictionary:",
  19710. category: 'visiting',
  19711. fn: function (anIRDynamicDictionary){
  19712. var self=this;
  19713. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
  19714. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  19715. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  19716. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  19717. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  19718. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19719. _st(_st(self)._stream())._nextPutAll_("])");
  19720. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary}, smalltalk.IRJSTranslator)})},
  19721. args: ["anIRDynamicDictionary"],
  19722. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09self stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.\x0a\x09\x09anIRDynamicDictionary instructions \x0a\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09separatedBy: [self stream nextPutAll: ',' ].\x0a\x09self stream nextPutAll: '])'",
  19723. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  19724. referencedClasses: []
  19725. }),
  19726. smalltalk.IRJSTranslator);
  19727. smalltalk.addMethod(
  19728. "_visitIRMethod_",
  19729. smalltalk.method({
  19730. selector: "visitIRMethod:",
  19731. category: 'visiting',
  19732. fn: function (anIRMethod){
  19733. var self=this;
  19734. return smalltalk.withContext(function($ctx1) { var $1,$2;
  19735. _st(_st(self)._stream())._nextPutMethodDeclaration_with_(anIRMethod,(function(){
  19736. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutFunctionWith_arguments_((function(){
  19737. return smalltalk.withContext(function($ctx3) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  19738. return smalltalk.withContext(function($ctx4) { return _st(_st(each)._name())._asVariableName();
  19739. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})));
  19740. return _st(_st(self)._stream())._nextPutContextFor_during_(anIRMethod,(function(){
  19741. return smalltalk.withContext(function($ctx4) { $1=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  19742. if(smalltalk.assert($1)){
  19743. _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  19744. return smalltalk.withContext(function($ctx5) { return _st(_st(each)._variable())._alias();
  19745. }, function($ctx5) {$ctx5.fillBlock({each:each},$ctx1)})})));
  19746. };
  19747. $2=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  19748. if(smalltalk.assert($2)){
  19749. return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  19750. return smalltalk.withContext(function($ctx5) { return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  19751. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  19752. } else {
  19753. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  19754. };
  19755. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  19756. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),_st(anIRMethod)._arguments());
  19757. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19758. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod}, smalltalk.IRJSTranslator)})},
  19759. args: ["anIRMethod"],
  19760. source: "visitIRMethod: anIRMethod\x0a\x0a\x09self stream\x0a\x09\x09nextPutMethodDeclaration: anIRMethod \x0a\x09\x09with: [ self stream \x0a\x09\x09\x09nextPutFunctionWith: [ \x0a \x09self stream nextPutVars: (anIRMethod tempDeclarations collect: [ :each |\x0a \x09\x09\x09\x09each name asVariableName ]).\x0a \x09self stream nextPutContextFor: anIRMethod during: [\x0a\x09\x09\x09\x09anIRMethod internalVariables notEmpty ifTrue: [\x0a\x09\x09\x09\x09\x09self stream nextPutVars: (anIRMethod internalVariables asArray collect: [ :each |\x0a\x09\x09\x09\x09\x09\x09each variable alias ]) ].\x0a\x09\x09\x09\x09anIRMethod scope hasNonLocalReturn \x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09self stream nextPutNonLocalReturnHandlingWith: [\x0a\x09\x09\x09\x09\x09\x09\x09super visitIRMethod: anIRMethod ]]\x0a\x09\x09\x09\x09\x09ifFalse: [ super visitIRMethod: anIRMethod ]]]\x0a\x09\x09\x09arguments: anIRMethod arguments ]",
  19761. messageSends: ["nextPutMethodDeclaration:with:", "nextPutFunctionWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutContextFor:during:", "ifTrue:", "alias", "variable", "asArray", "internalVariables", "notEmpty", "ifTrue:ifFalse:", "nextPutNonLocalReturnHandlingWith:", "visitIRMethod:", "hasNonLocalReturn", "scope", "arguments"],
  19762. referencedClasses: []
  19763. }),
  19764. smalltalk.IRJSTranslator);
  19765. smalltalk.addMethod(
  19766. "_visitIRNonLocalReturn_",
  19767. smalltalk.method({
  19768. selector: "visitIRNonLocalReturn:",
  19769. category: 'visiting',
  19770. fn: function (anIRNonLocalReturn){
  19771. var self=this;
  19772. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  19773. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  19774. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19775. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn}, smalltalk.IRJSTranslator)})},
  19776. args: ["anIRNonLocalReturn"],
  19777. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09self stream nextPutNonLocalReturnWith: [\x0a\x09\x09super visitIRNonLocalReturn: anIRNonLocalReturn ]",
  19778. messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"],
  19779. referencedClasses: []
  19780. }),
  19781. smalltalk.IRJSTranslator);
  19782. smalltalk.addMethod(
  19783. "_visitIRReturn_",
  19784. smalltalk.method({
  19785. selector: "visitIRReturn:",
  19786. category: 'visiting',
  19787. fn: function (anIRReturn){
  19788. var self=this;
  19789. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutReturnWith_((function(){
  19790. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  19791. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19792. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn}, smalltalk.IRJSTranslator)})},
  19793. args: ["anIRReturn"],
  19794. source: "visitIRReturn: anIRReturn\x0a\x09self stream nextPutReturnWith: [\x0a\x09\x09super visitIRReturn: anIRReturn ]",
  19795. messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"],
  19796. referencedClasses: []
  19797. }),
  19798. smalltalk.IRJSTranslator);
  19799. smalltalk.addMethod(
  19800. "_visitIRSend_",
  19801. smalltalk.method({
  19802. selector: "visitIRSend:",
  19803. category: 'visiting',
  19804. fn: function (anIRSend){
  19805. var self=this;
  19806. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  19807. $1=_st(anIRSend)._classSend();
  19808. if(($receiver = $1) == nil || $receiver == undefined){
  19809. _st(_st(self)._stream())._nextPutAll_("_st(");
  19810. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  19811. _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  19812. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  19813. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  19814. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  19815. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  19816. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19817. _st(_st(self)._stream())._nextPutAll_(")");
  19818. } else {
  19819. $2=_st(self)._stream();
  19820. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  19821. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  19822. $3=_st($2)._nextPutAll_("_st(");
  19823. $3;
  19824. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  19825. _st(_st(self)._stream())._nextPutAll_("), [");
  19826. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  19827. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  19828. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  19829. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  19830. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19831. _st(_st(self)._stream())._nextPutAll_("])");
  19832. };
  19833. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend}, smalltalk.IRJSTranslator)})},
  19834. args: ["anIRSend"],
  19835. source: "visitIRSend: anIRSend\x0a\x09anIRSend classSend \x0a \x09ifNil: [\x0a\x09\x09\x09self stream nextPutAll: '_st('.\x0a\x09\x09\x09self visit: anIRSend instructions first.\x0a \x09\x09 \x09self stream nextPutAll: ').', anIRSend selector asSelector, '('.\x0a\x09\x09\x09anIRSend instructions allButFirst\x0a\x09\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09ifNotNil: [ \x0a\x09\x09\x09self stream \x0a \x09nextPutAll: anIRSend classSend asJavascript, '.fn.prototype.';\x0a\x09\x09\x09\x09nextPutAll: anIRSend selector asSelector, '.apply(';\x0a\x09\x09\x09\x09nextPutAll: '_st('.\x0a\x09\x09\x09self visit: anIRSend instructions first.\x0a\x09\x09\x09self stream nextPutAll: '), ['.\x0a\x09\x09\x09anIRSend instructions allButFirst\x0a\x09\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09\x09\x09self stream nextPutAll: '])' ]",
  19836. messageSends: ["ifNil:ifNotNil:", "nextPutAll:", "stream", "visit:", "first", "instructions", ",", "asSelector", "selector", "do:separatedBy:", "allButFirst", "asJavascript", "classSend"],
  19837. referencedClasses: []
  19838. }),
  19839. smalltalk.IRJSTranslator);
  19840. smalltalk.addMethod(
  19841. "_visitIRSequence_",
  19842. smalltalk.method({
  19843. selector: "visitIRSequence:",
  19844. category: 'visiting',
  19845. fn: function (anIRSequence){
  19846. var self=this;
  19847. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutSequenceWith_((function(){
  19848. return smalltalk.withContext(function($ctx2) { return _st(_st(anIRSequence)._instructions())._do_((function(each){
  19849. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
  19850. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  19851. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19852. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence}, smalltalk.IRJSTranslator)})},
  19853. args: ["anIRSequence"],
  19854. source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence instructions do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: (self visit: each) ]]",
  19855. messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
  19856. referencedClasses: []
  19857. }),
  19858. smalltalk.IRJSTranslator);
  19859. smalltalk.addMethod(
  19860. "_visitIRTempDeclaration_",
  19861. smalltalk.method({
  19862. selector: "visitIRTempDeclaration:",
  19863. category: 'visiting',
  19864. fn: function (anIRTempDeclaration){
  19865. var self=this;
  19866. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration}, smalltalk.IRJSTranslator)})},
  19867. args: ["anIRTempDeclaration"],
  19868. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09\x22self stream \x0a \x09nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';'; \x0a lf\x22",
  19869. messageSends: [],
  19870. referencedClasses: []
  19871. }),
  19872. smalltalk.IRJSTranslator);
  19873. smalltalk.addMethod(
  19874. "_visitIRValue_",
  19875. smalltalk.method({
  19876. selector: "visitIRValue:",
  19877. category: 'visiting',
  19878. fn: function (anIRValue){
  19879. var self=this;
  19880. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  19881. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue}, smalltalk.IRJSTranslator)})},
  19882. args: ["anIRValue"],
  19883. source: "visitIRValue: anIRValue\x0a\x09self stream nextPutAll: anIRValue value asJavascript",
  19884. messageSends: ["nextPutAll:", "asJavascript", "value", "stream"],
  19885. referencedClasses: []
  19886. }),
  19887. smalltalk.IRJSTranslator);
  19888. smalltalk.addMethod(
  19889. "_visitIRVariable_",
  19890. smalltalk.method({
  19891. selector: "visitIRVariable:",
  19892. category: 'visiting',
  19893. fn: function (anIRVariable){
  19894. var self=this;
  19895. return smalltalk.withContext(function($ctx1) { var $1;
  19896. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  19897. if(smalltalk.assert($1)){
  19898. _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
  19899. } else {
  19900. _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  19901. };
  19902. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable}, smalltalk.IRJSTranslator)})},
  19903. args: ["anIRVariable"],
  19904. source: "visitIRVariable: anIRVariable\x0a\x09anIRVariable variable name = 'thisContext'\x0a \x09ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]\x0a \x09ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]",
  19905. messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"],
  19906. referencedClasses: []
  19907. }),
  19908. smalltalk.IRJSTranslator);
  19909. smalltalk.addMethod(
  19910. "_visitIRVerbatim_",
  19911. smalltalk.method({
  19912. selector: "visitIRVerbatim:",
  19913. category: 'visiting',
  19914. fn: function (anIRVerbatim){
  19915. var self=this;
  19916. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  19917. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  19918. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  19919. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim}, smalltalk.IRJSTranslator)})},
  19920. args: ["anIRVerbatim"],
  19921. source: "visitIRVerbatim: anIRVerbatim\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self stream nextPutAll: anIRVerbatim source ]",
  19922. messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"],
  19923. referencedClasses: []
  19924. }),
  19925. smalltalk.IRJSTranslator);
  19926. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  19927. smalltalk.addMethod(
  19928. "_contents",
  19929. smalltalk.method({
  19930. selector: "contents",
  19931. category: 'accessing',
  19932. fn: function (){
  19933. var self=this;
  19934. return smalltalk.withContext(function($ctx1) { var $1;
  19935. $1=_st(self["@stream"])._contents();
  19936. return $1;
  19937. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.JSStream)})},
  19938. args: [],
  19939. source: "contents\x0a\x09^ stream contents",
  19940. messageSends: ["contents"],
  19941. referencedClasses: []
  19942. }),
  19943. smalltalk.JSStream);
  19944. smalltalk.addMethod(
  19945. "_initialize",
  19946. smalltalk.method({
  19947. selector: "initialize",
  19948. category: 'initialization',
  19949. fn: function (){
  19950. var self=this;
  19951. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  19952. self["@stream"]=_st("")._writeStream();
  19953. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.JSStream)})},
  19954. args: [],
  19955. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream.",
  19956. messageSends: ["initialize", "writeStream"],
  19957. referencedClasses: []
  19958. }),
  19959. smalltalk.JSStream);
  19960. smalltalk.addMethod(
  19961. "_lf",
  19962. smalltalk.method({
  19963. selector: "lf",
  19964. category: 'streaming',
  19965. fn: function (){
  19966. var self=this;
  19967. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._lf();
  19968. return self}, function($ctx1) {$ctx1.fill(self,"lf",{}, smalltalk.JSStream)})},
  19969. args: [],
  19970. source: "lf\x0a\x09stream lf",
  19971. messageSends: ["lf"],
  19972. referencedClasses: []
  19973. }),
  19974. smalltalk.JSStream);
  19975. smalltalk.addMethod(
  19976. "_nextPut_",
  19977. smalltalk.method({
  19978. selector: "nextPut:",
  19979. category: 'streaming',
  19980. fn: function (aString){
  19981. var self=this;
  19982. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPut_(aString);
  19983. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString}, smalltalk.JSStream)})},
  19984. args: ["aString"],
  19985. source: "nextPut: aString\x0a\x09stream nextPut: aString",
  19986. messageSends: ["nextPut:"],
  19987. referencedClasses: []
  19988. }),
  19989. smalltalk.JSStream);
  19990. smalltalk.addMethod(
  19991. "_nextPutAll_",
  19992. smalltalk.method({
  19993. selector: "nextPutAll:",
  19994. category: 'streaming',
  19995. fn: function (aString){
  19996. var self=this;
  19997. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_(aString);
  19998. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString}, smalltalk.JSStream)})},
  19999. args: ["aString"],
  20000. source: "nextPutAll: aString\x0a\x09stream nextPutAll: aString",
  20001. messageSends: ["nextPutAll:"],
  20002. referencedClasses: []
  20003. }),
  20004. smalltalk.JSStream);
  20005. smalltalk.addMethod(
  20006. "_nextPutAssignment",
  20007. smalltalk.method({
  20008. selector: "nextPutAssignment",
  20009. category: 'streaming',
  20010. fn: function (){
  20011. var self=this;
  20012. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("=");
  20013. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment",{}, smalltalk.JSStream)})},
  20014. args: [],
  20015. source: "nextPutAssignment\x0a\x09stream nextPutAll: '='",
  20016. messageSends: ["nextPutAll:"],
  20017. referencedClasses: []
  20018. }),
  20019. smalltalk.JSStream);
  20020. smalltalk.addMethod(
  20021. "_nextPutBlockContextFor_during_",
  20022. smalltalk.method({
  20023. selector: "nextPutBlockContextFor:during:",
  20024. category: 'streaming',
  20025. fn: function (anIRClosure,aBlock){
  20026. var self=this;
  20027. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  20028. $1=self;
  20029. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  20030. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  20031. _st(aBlock)._value();
  20032. $3=self;
  20033. _st($3)._nextPutAll_(_st(_st("}, function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  20034. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock({"));
  20035. _st(_st(anIRClosure)._locals())._do_separatedBy_((function(each){
  20036. return smalltalk.withContext(function($ctx2) { $5=self;
  20037. _st($5)._nextPutAll_(_st(each)._asVariableName());
  20038. _st($5)._nextPutAll_(":");
  20039. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  20040. return $6;
  20041. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  20042. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  20043. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20044. $7=self;
  20045. _st($7)._nextPutAll_("},");
  20046. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(anIRClosure)._method())._scope())._alias()).__comma(")})"));
  20047. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:",{anIRClosure:anIRClosure,aBlock:aBlock}, smalltalk.JSStream)})},
  20048. args: ["anIRClosure", "aBlock"],
  20049. source: "nextPutBlockContextFor: anIRClosure during: aBlock\x0a\x09self \x0a \x09nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') {'; \x0a nextPutAll: String cr.\x0a \x0a aBlock value.\x0a \x0a self \x0a \x09nextPutAll: '}, function(', anIRClosure scope alias, ') {';\x0a nextPutAll: anIRClosure scope alias, '.fillBlock({'.\x0a \x0a anIRClosure locals \x0a \x09do: [ :each |\x0a \x09\x09self \x0a \x09\x09nextPutAll: each asVariableName;\x0a \x09 \x09nextPutAll: ':';\x0a \x09\x09nextPutAll: each asVariableName]\x0a\x09\x09separatedBy: [ self nextPutAll: ',' ].\x0a \x0a self\x0a \x09nextPutAll: '},';\x0a nextPutAll: anIRClosure method scope alias, ')})'",
  20050. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "do:separatedBy:", "asVariableName", "locals", "method"],
  20051. referencedClasses: ["String"]
  20052. }),
  20053. smalltalk.JSStream);
  20054. smalltalk.addMethod(
  20055. "_nextPutClosureWith_arguments_",
  20056. smalltalk.method({
  20057. selector: "nextPutClosureWith:arguments:",
  20058. category: 'streaming',
  20059. fn: function (aBlock,anArray){
  20060. var self=this;
  20061. return smalltalk.withContext(function($ctx1) { var $1,$2;
  20062. _st(self["@stream"])._nextPutAll_("(function(");
  20063. _st(anArray)._do_separatedBy_((function(each){
  20064. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  20065. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  20066. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  20067. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20068. $1=self["@stream"];
  20069. _st($1)._nextPutAll_("){");
  20070. $2=_st($1)._lf();
  20071. _st(aBlock)._value();
  20072. _st(self["@stream"])._nextPutAll_("})");
  20073. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:",{aBlock:aBlock,anArray:anArray}, smalltalk.JSStream)})},
  20074. args: ["aBlock", "anArray"],
  20075. source: "nextPutClosureWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: '(function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each asVariableName ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '})'",
  20076. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  20077. referencedClasses: []
  20078. }),
  20079. smalltalk.JSStream);
  20080. smalltalk.addMethod(
  20081. "_nextPutContextFor_during_",
  20082. smalltalk.method({
  20083. selector: "nextPutContextFor:during:",
  20084. category: 'streaming',
  20085. fn: function (aMethod,aBlock){
  20086. var self=this;
  20087. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  20088. $1=self;
  20089. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  20090. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  20091. _st(aBlock)._value();
  20092. $3=self;
  20093. _st($3)._nextPutAll_(_st(_st(_st("}, function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  20094. $4=_st($3)._nextPutAll_(_st(_st(".fill(self,").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(",{"));
  20095. _st(_st(aMethod)._locals())._do_separatedBy_((function(each){
  20096. return smalltalk.withContext(function($ctx2) { $5=self;
  20097. _st($5)._nextPutAll_(_st(each)._asVariableName());
  20098. _st($5)._nextPutAll_(":");
  20099. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  20100. return $6;
  20101. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  20102. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  20103. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20104. $7=self;
  20105. _st($7)._nextPutAll_("}, ");
  20106. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  20107. $8=_st($7)._nextPutAll_(")})");
  20108. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:",{aMethod:aMethod,aBlock:aBlock}, smalltalk.JSStream)})},
  20109. args: ["aMethod", "aBlock"],
  20110. source: "nextPutContextFor: aMethod during: aBlock\x0a\x09self \x0a \x09nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { '; \x0a nextPutAll: String cr.\x0a aBlock value.\x0a \x0a self \x0a \x09nextPutAll: '}, function(', aMethod scope alias, ') {', aMethod scope alias; \x0a nextPutAll: '.fill(self,', aMethod selector asJavascript, ',{'.\x0a\x0a aMethod locals \x0a \x09do: [ :each |\x0a \x09\x09self \x0a \x09\x09nextPutAll: each asVariableName;\x0a \x09 \x09nextPutAll: ':';\x0a \x09\x09nextPutAll: each asVariableName]\x0a\x09\x09separatedBy: [ self nextPutAll: ',' ].\x0a \x0a self\x0a \x09nextPutAll: '}, ';\x0a nextPutAll: aMethod theClass asJavascript;\x0a nextPutAll: ')})'",
  20111. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "locals", "theClass"],
  20112. referencedClasses: ["String"]
  20113. }),
  20114. smalltalk.JSStream);
  20115. smalltalk.addMethod(
  20116. "_nextPutFunctionWith_arguments_",
  20117. smalltalk.method({
  20118. selector: "nextPutFunctionWith:arguments:",
  20119. category: 'streaming',
  20120. fn: function (aBlock,anArray){
  20121. var self=this;
  20122. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  20123. _st(self["@stream"])._nextPutAll_("fn: function(");
  20124. _st(anArray)._do_separatedBy_((function(each){
  20125. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  20126. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  20127. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  20128. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20129. $1=self["@stream"];
  20130. _st($1)._nextPutAll_("){");
  20131. $2=_st($1)._lf();
  20132. $3=self["@stream"];
  20133. _st($3)._nextPutAll_("var self=this;");
  20134. $4=_st($3)._lf();
  20135. _st(aBlock)._value();
  20136. _st(self["@stream"])._nextPutAll_("}");
  20137. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:",{aBlock:aBlock,anArray:anArray}, smalltalk.JSStream)})},
  20138. args: ["aBlock", "anArray"],
  20139. source: "nextPutFunctionWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each asVariableName ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09stream nextPutAll: 'var self=this;'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '}'",
  20140. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  20141. referencedClasses: []
  20142. }),
  20143. smalltalk.JSStream);
  20144. smalltalk.addMethod(
  20145. "_nextPutIf_with_",
  20146. smalltalk.method({
  20147. selector: "nextPutIf:with:",
  20148. category: 'streaming',
  20149. fn: function (aBlock,anotherBlock){
  20150. var self=this;
  20151. return smalltalk.withContext(function($ctx1) { var $1,$2;
  20152. _st(self["@stream"])._nextPutAll_("if(");
  20153. _st(aBlock)._value();
  20154. $1=self["@stream"];
  20155. _st($1)._nextPutAll_("){");
  20156. $2=_st($1)._lf();
  20157. _st(anotherBlock)._value();
  20158. _st(self["@stream"])._nextPutAll_("}");
  20159. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.JSStream)})},
  20160. args: ["aBlock", "anotherBlock"],
  20161. source: "nextPutIf: aBlock with: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
  20162. messageSends: ["nextPutAll:", "value", "lf"],
  20163. referencedClasses: []
  20164. }),
  20165. smalltalk.JSStream);
  20166. smalltalk.addMethod(
  20167. "_nextPutIfElse_with_with_",
  20168. smalltalk.method({
  20169. selector: "nextPutIfElse:with:with:",
  20170. category: 'streaming',
  20171. fn: function (aBlock,ifBlock,elseBlock){
  20172. var self=this;
  20173. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  20174. _st(self["@stream"])._nextPutAll_("if(");
  20175. _st(aBlock)._value();
  20176. $1=self["@stream"];
  20177. _st($1)._nextPutAll_("){");
  20178. $2=_st($1)._lf();
  20179. _st(ifBlock)._value();
  20180. $3=self["@stream"];
  20181. _st($3)._nextPutAll_("} else {");
  20182. $4=_st($3)._lf();
  20183. _st(elseBlock)._value();
  20184. _st(self["@stream"])._nextPutAll_("}");
  20185. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock}, smalltalk.JSStream)})},
  20186. args: ["aBlock", "ifBlock", "elseBlock"],
  20187. source: "nextPutIfElse: aBlock with: ifBlock with: elseBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09ifBlock value.\x0a\x09stream nextPutAll: '} else {'; lf.\x0a\x09elseBlock value.\x0a\x09stream nextPutAll: '}'",
  20188. messageSends: ["nextPutAll:", "value", "lf"],
  20189. referencedClasses: []
  20190. }),
  20191. smalltalk.JSStream);
  20192. smalltalk.addMethod(
  20193. "_nextPutMethodDeclaration_with_",
  20194. smalltalk.method({
  20195. selector: "nextPutMethodDeclaration:with:",
  20196. category: 'streaming',
  20197. fn: function (aMethod,aBlock){
  20198. var self=this;
  20199. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  20200. $1=self["@stream"];
  20201. _st($1)._nextPutAll_("smalltalk.method({");
  20202. _st($1)._lf();
  20203. _st($1)._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
  20204. _st($1)._lf();
  20205. _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  20206. $2=_st($1)._lf();
  20207. _st(aBlock)._value();
  20208. $3=self["@stream"];
  20209. _st($3)._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
  20210. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  20211. _st($3)._lf();
  20212. _st($3)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  20213. return smalltalk.withContext(function($ctx2) { return _st(each)._value();
  20214. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asArray())._asJavascript())).__comma(","));
  20215. _st($3)._lf();
  20216. $4=_st($3)._nextPutAll_("referencedClasses: [");
  20217. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  20218. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  20219. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  20220. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  20221. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20222. $5=self["@stream"];
  20223. _st($5)._nextPutAll_("]");
  20224. $6=_st($5)._nextPutAll_("})");
  20225. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:",{aMethod:aMethod,aBlock:aBlock}, smalltalk.JSStream)})},
  20226. args: ["aMethod", "aBlock"],
  20227. source: "nextPutMethodDeclaration: aMethod with: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'smalltalk.method({'; lf;\x0a\x09\x09nextPutAll: 'selector: \x22', aMethod selector, '\x22,'; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf. \x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: aMethod messageSends asArray asJavascript, ','; lf;\x0a nextPutAll: 'args: ', (aMethod arguments collect: [ :each | each value ]) asArray asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09aMethod classReferences \x0a\x09\x09do: [:each | stream nextPutAll: each asJavascript]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream \x0a\x09\x09nextPutAll: ']';\x0a\x09\x09nextPutAll: '})'",
  20228. messageSends: ["nextPutAll:", "lf", ",", "selector", "asJavascript", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"],
  20229. referencedClasses: ["String"]
  20230. }),
  20231. smalltalk.JSStream);
  20232. smalltalk.addMethod(
  20233. "_nextPutNonLocalReturnHandlingWith_",
  20234. smalltalk.method({
  20235. selector: "nextPutNonLocalReturnHandlingWith:",
  20236. category: 'streaming',
  20237. fn: function (aBlock){
  20238. var self=this;
  20239. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  20240. $1=self["@stream"];
  20241. _st($1)._nextPutAll_("var $early={};");
  20242. _st($1)._lf();
  20243. _st($1)._nextPutAll_("try {");
  20244. $2=_st($1)._lf();
  20245. _st(aBlock)._value();
  20246. $3=self["@stream"];
  20247. _st($3)._nextPutAll_("}");
  20248. _st($3)._lf();
  20249. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  20250. $4=_st($3)._lf();
  20251. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  20252. args: ["aBlock"],
  20253. source: "nextPutNonLocalReturnHandlingWith: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'var $early={};'; lf;\x0a\x09\x09nextPutAll: 'try {'; lf.\x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: '}'; lf;\x0a\x09\x09nextPutAll: 'catch(e) {if(e===$early)return e[0]; throw e}'; lf",
  20254. messageSends: ["nextPutAll:", "lf", "value"],
  20255. referencedClasses: []
  20256. }),
  20257. smalltalk.JSStream);
  20258. smalltalk.addMethod(
  20259. "_nextPutNonLocalReturnWith_",
  20260. smalltalk.method({
  20261. selector: "nextPutNonLocalReturnWith:",
  20262. category: 'streaming',
  20263. fn: function (aBlock){
  20264. var self=this;
  20265. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("throw $early=[");
  20266. _st(aBlock)._value();
  20267. _st(self["@stream"])._nextPutAll_("]");
  20268. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  20269. args: ["aBlock"],
  20270. source: "nextPutNonLocalReturnWith: aBlock\x0a\x09stream nextPutAll: 'throw $early=['.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ']'",
  20271. messageSends: ["nextPutAll:", "value"],
  20272. referencedClasses: []
  20273. }),
  20274. smalltalk.JSStream);
  20275. smalltalk.addMethod(
  20276. "_nextPutReturn",
  20277. smalltalk.method({
  20278. selector: "nextPutReturn",
  20279. category: 'streaming',
  20280. fn: function (){
  20281. var self=this;
  20282. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("return ");
  20283. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn",{}, smalltalk.JSStream)})},
  20284. args: [],
  20285. source: "nextPutReturn\x0a\x09stream nextPutAll: 'return '",
  20286. messageSends: ["nextPutAll:"],
  20287. referencedClasses: []
  20288. }),
  20289. smalltalk.JSStream);
  20290. smalltalk.addMethod(
  20291. "_nextPutReturnWith_",
  20292. smalltalk.method({
  20293. selector: "nextPutReturnWith:",
  20294. category: 'streaming',
  20295. fn: function (aBlock){
  20296. var self=this;
  20297. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutReturn();
  20298. _st(aBlock)._value();
  20299. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  20300. args: ["aBlock"],
  20301. source: "nextPutReturnWith: aBlock\x0a\x09self nextPutReturn.\x0a\x09aBlock value",
  20302. messageSends: ["nextPutReturn", "value"],
  20303. referencedClasses: []
  20304. }),
  20305. smalltalk.JSStream);
  20306. smalltalk.addMethod(
  20307. "_nextPutSequenceWith_",
  20308. smalltalk.method({
  20309. selector: "nextPutSequenceWith:",
  20310. category: 'streaming',
  20311. fn: function (aBlock){
  20312. var self=this;
  20313. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value();
  20314. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  20315. args: ["aBlock"],
  20316. source: "nextPutSequenceWith: aBlock\x0a\x09\x22stream \x0a\x09\x09nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf.\x22\x0a\x09aBlock value.\x0a\x09\x22stream \x0a\x09\x09nextPutAll: '};'; lf\x22",
  20317. messageSends: ["value"],
  20318. referencedClasses: []
  20319. }),
  20320. smalltalk.JSStream);
  20321. smalltalk.addMethod(
  20322. "_nextPutStatement_with_",
  20323. smalltalk.method({
  20324. selector: "nextPutStatement:with:",
  20325. category: 'streaming',
  20326. fn: function (anInteger,aBlock){
  20327. var self=this;
  20328. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  20329. $1=self["@stream"];
  20330. _st($1)._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
  20331. $2=_st($1)._lf();
  20332. _st(self)._nextPutStatementWith_(aBlock);
  20333. $3=self["@stream"];
  20334. _st($3)._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  20335. $4=_st($3)._lf();
  20336. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:",{anInteger:anInteger,aBlock:aBlock}, smalltalk.JSStream)})},
  20337. args: ["anInteger", "aBlock"],
  20338. source: "nextPutStatement: anInteger with: aBlock\x0a\x09stream nextPutAll: 'case ', anInteger asString, ':'; lf.\x0a\x09self nextPutStatementWith: aBlock.\x0a\x09stream nextPutAll: 'smalltalk.thisContext.pc=', (anInteger + 1) asString, ';'; lf",
  20339. messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"],
  20340. referencedClasses: []
  20341. }),
  20342. smalltalk.JSStream);
  20343. smalltalk.addMethod(
  20344. "_nextPutStatementWith_",
  20345. smalltalk.method({
  20346. selector: "nextPutStatementWith:",
  20347. category: 'streaming',
  20348. fn: function (aBlock){
  20349. var self=this;
  20350. return smalltalk.withContext(function($ctx1) { var $1,$2;
  20351. _st(aBlock)._value();
  20352. $1=self["@stream"];
  20353. _st($1)._nextPutAll_(";");
  20354. $2=_st($1)._lf();
  20355. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  20356. args: ["aBlock"],
  20357. source: "nextPutStatementWith: aBlock\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ';'; lf",
  20358. messageSends: ["value", "nextPutAll:", "lf"],
  20359. referencedClasses: []
  20360. }),
  20361. smalltalk.JSStream);
  20362. smalltalk.addMethod(
  20363. "_nextPutVar_",
  20364. smalltalk.method({
  20365. selector: "nextPutVar:",
  20366. category: 'streaming',
  20367. fn: function (aString){
  20368. var self=this;
  20369. return smalltalk.withContext(function($ctx1) { var $1,$2;
  20370. $1=self["@stream"];
  20371. _st($1)._nextPutAll_(_st(_st("var ").__comma(aString)).__comma(";"));
  20372. $2=_st($1)._lf();
  20373. return self}, function($ctx1) {$ctx1.fill(self,"nextPutVar:",{aString:aString}, smalltalk.JSStream)})},
  20374. args: ["aString"],
  20375. source: "nextPutVar: aString\x0a\x09stream nextPutAll: 'var ', aString, ';'; lf",
  20376. messageSends: ["nextPutAll:", ",", "lf"],
  20377. referencedClasses: []
  20378. }),
  20379. smalltalk.JSStream);
  20380. smalltalk.addMethod(
  20381. "_nextPutVars_",
  20382. smalltalk.method({
  20383. selector: "nextPutVars:",
  20384. category: 'streaming',
  20385. fn: function (aCollection){
  20386. var self=this;
  20387. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  20388. var $early={};
  20389. try {
  20390. _st(aCollection)._ifEmpty_((function(){
  20391. return smalltalk.withContext(function($ctx2) { $1=self;
  20392. throw $early=[$1];
  20393. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20394. _st(self["@stream"])._nextPutAll_("var ");
  20395. _st(aCollection)._do_separatedBy_((function(each){
  20396. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(each);
  20397. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  20398. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  20399. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20400. $2=self["@stream"];
  20401. _st($2)._nextPutAll_(";");
  20402. $3=_st($2)._lf();
  20403. return self}
  20404. catch(e) {if(e===$early)return e[0]; throw e}
  20405. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:",{aCollection:aCollection}, smalltalk.JSStream)})},
  20406. args: ["aCollection"],
  20407. source: "nextPutVars: aCollection\x0a\x09aCollection ifEmpty: [ ^self ].\x0a \x0a\x09stream nextPutAll: 'var '.\x0a\x09aCollection \x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ';'; lf",
  20408. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"],
  20409. referencedClasses: []
  20410. }),
  20411. smalltalk.JSStream);
  20412. smalltalk.addMethod(
  20413. "_appendToInstruction_",
  20414. smalltalk.method({
  20415. selector: "appendToInstruction:",
  20416. category: '*Compiler-IR',
  20417. fn: function (anIRInstruction){
  20418. var self=this;
  20419. return smalltalk.withContext(function($ctx1) { _st(anIRInstruction)._appendBlock_(self);
  20420. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:",{anIRInstruction:anIRInstruction}, smalltalk.BlockClosure)})},
  20421. args: ["anIRInstruction"],
  20422. source: "appendToInstruction: anIRInstruction\x0a anIRInstruction appendBlock: self",
  20423. messageSends: ["appendBlock:"],
  20424. referencedClasses: []
  20425. }),
  20426. smalltalk.BlockClosure);
  20427. smalltalk.addMethod(
  20428. "_asVariableName",
  20429. smalltalk.method({
  20430. selector: "asVariableName",
  20431. category: '*Compiler-IR',
  20432. fn: function (){
  20433. var self=this;
  20434. return smalltalk.withContext(function($ctx1) { var $2,$1;
  20435. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
  20436. if(smalltalk.assert($2)){
  20437. $1=_st(self).__comma("_");
  20438. } else {
  20439. $1=self;
  20440. };
  20441. return $1;
  20442. }, function($ctx1) {$ctx1.fill(self,"asVariableName",{}, smalltalk.String)})},
  20443. args: [],
  20444. source: "asVariableName\x0a\x09^ (Smalltalk current reservedWords includes: self)\x0a\x09\x09ifTrue: [ self, '_' ]\x0a\x09\x09ifFalse: [ self ]",
  20445. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  20446. referencedClasses: ["Smalltalk"]
  20447. }),
  20448. smalltalk.String);
  20449. smalltalk.addPackage('Compiler-Inlining', {});
  20450. smalltalk.addClass('IRInlinedAssignment', smalltalk.IRAssignment, [], 'Compiler-Inlining');
  20451. smalltalk.IRInlinedAssignment.comment="I represent an inlined assignment instruction."
  20452. smalltalk.addMethod(
  20453. "_accept_",
  20454. smalltalk.method({
  20455. selector: "accept:",
  20456. category: 'visiting',
  20457. fn: function (aVisitor){
  20458. var self=this;
  20459. return smalltalk.withContext(function($ctx1) { var $1;
  20460. $1=_st(aVisitor)._visitIRInlinedAssignment_(self);
  20461. return $1;
  20462. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedAssignment)})},
  20463. args: ["aVisitor"],
  20464. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedAssignment: self",
  20465. messageSends: ["visitIRInlinedAssignment:"],
  20466. referencedClasses: []
  20467. }),
  20468. smalltalk.IRInlinedAssignment);
  20469. smalltalk.addMethod(
  20470. "_isInlined",
  20471. smalltalk.method({
  20472. selector: "isInlined",
  20473. category: 'testing',
  20474. fn: function (){
  20475. var self=this;
  20476. return smalltalk.withContext(function($ctx1) { return true;
  20477. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedAssignment)})},
  20478. args: [],
  20479. source: "isInlined\x0a\x09^ true",
  20480. messageSends: [],
  20481. referencedClasses: []
  20482. }),
  20483. smalltalk.IRInlinedAssignment);
  20484. smalltalk.addClass('IRInlinedClosure', smalltalk.IRClosure, [], 'Compiler-Inlining');
  20485. smalltalk.IRInlinedClosure.comment="I represent an inlined closure instruction."
  20486. smalltalk.addMethod(
  20487. "_accept_",
  20488. smalltalk.method({
  20489. selector: "accept:",
  20490. category: 'visiting',
  20491. fn: function (aVisitor){
  20492. var self=this;
  20493. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedClosure_(self);
  20494. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedClosure)})},
  20495. args: ["aVisitor"],
  20496. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedClosure: self",
  20497. messageSends: ["visitIRInlinedClosure:"],
  20498. referencedClasses: []
  20499. }),
  20500. smalltalk.IRInlinedClosure);
  20501. smalltalk.addMethod(
  20502. "_isInlined",
  20503. smalltalk.method({
  20504. selector: "isInlined",
  20505. category: 'testing',
  20506. fn: function (){
  20507. var self=this;
  20508. return smalltalk.withContext(function($ctx1) { return true;
  20509. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedClosure)})},
  20510. args: [],
  20511. source: "isInlined\x0a\x09^ true",
  20512. messageSends: [],
  20513. referencedClasses: []
  20514. }),
  20515. smalltalk.IRInlinedClosure);
  20516. smalltalk.addClass('IRInlinedReturn', smalltalk.IRReturn, [], 'Compiler-Inlining');
  20517. smalltalk.IRInlinedReturn.comment="I represent an inlined local return instruction."
  20518. smalltalk.addMethod(
  20519. "_accept_",
  20520. smalltalk.method({
  20521. selector: "accept:",
  20522. category: 'visiting',
  20523. fn: function (aVisitor){
  20524. var self=this;
  20525. return smalltalk.withContext(function($ctx1) { var $1;
  20526. $1=_st(aVisitor)._visitIRInlinedReturn_(self);
  20527. return $1;
  20528. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedReturn)})},
  20529. args: ["aVisitor"],
  20530. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedReturn: self",
  20531. messageSends: ["visitIRInlinedReturn:"],
  20532. referencedClasses: []
  20533. }),
  20534. smalltalk.IRInlinedReturn);
  20535. smalltalk.addMethod(
  20536. "_isInlined",
  20537. smalltalk.method({
  20538. selector: "isInlined",
  20539. category: 'testing',
  20540. fn: function (){
  20541. var self=this;
  20542. return smalltalk.withContext(function($ctx1) { return true;
  20543. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedReturn)})},
  20544. args: [],
  20545. source: "isInlined\x0a\x09^ true",
  20546. messageSends: [],
  20547. referencedClasses: []
  20548. }),
  20549. smalltalk.IRInlinedReturn);
  20550. smalltalk.addClass('IRInlinedNonLocalReturn', smalltalk.IRInlinedReturn, [], 'Compiler-Inlining');
  20551. smalltalk.IRInlinedNonLocalReturn.comment="I represent an inlined non local return instruction."
  20552. smalltalk.addMethod(
  20553. "_accept_",
  20554. smalltalk.method({
  20555. selector: "accept:",
  20556. category: 'visiting',
  20557. fn: function (aVisitor){
  20558. var self=this;
  20559. return smalltalk.withContext(function($ctx1) { var $1;
  20560. $1=_st(aVisitor)._visitIRInlinedNonLocalReturn_(self);
  20561. return $1;
  20562. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedNonLocalReturn)})},
  20563. args: ["aVisitor"],
  20564. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedNonLocalReturn: self",
  20565. messageSends: ["visitIRInlinedNonLocalReturn:"],
  20566. referencedClasses: []
  20567. }),
  20568. smalltalk.IRInlinedNonLocalReturn);
  20569. smalltalk.addMethod(
  20570. "_isInlined",
  20571. smalltalk.method({
  20572. selector: "isInlined",
  20573. category: 'testing',
  20574. fn: function (){
  20575. var self=this;
  20576. return smalltalk.withContext(function($ctx1) { return true;
  20577. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedNonLocalReturn)})},
  20578. args: [],
  20579. source: "isInlined\x0a\x09^ true",
  20580. messageSends: [],
  20581. referencedClasses: []
  20582. }),
  20583. smalltalk.IRInlinedNonLocalReturn);
  20584. smalltalk.addClass('IRInlinedSend', smalltalk.IRSend, [], 'Compiler-Inlining');
  20585. smalltalk.IRInlinedSend.comment="I am the abstract super class of inlined message send instructions."
  20586. smalltalk.addMethod(
  20587. "_accept_",
  20588. smalltalk.method({
  20589. selector: "accept:",
  20590. category: 'visiting',
  20591. fn: function (aVisitor){
  20592. var self=this;
  20593. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitInlinedSend_(self);
  20594. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedSend)})},
  20595. args: ["aVisitor"],
  20596. source: "accept: aVisitor\x0a\x09aVisitor visitInlinedSend: self",
  20597. messageSends: ["visitInlinedSend:"],
  20598. referencedClasses: []
  20599. }),
  20600. smalltalk.IRInlinedSend);
  20601. smalltalk.addMethod(
  20602. "_isInlined",
  20603. smalltalk.method({
  20604. selector: "isInlined",
  20605. category: 'testing',
  20606. fn: function (){
  20607. var self=this;
  20608. return smalltalk.withContext(function($ctx1) { return true;
  20609. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedSend)})},
  20610. args: [],
  20611. source: "isInlined\x0a\x09^ true",
  20612. messageSends: [],
  20613. referencedClasses: []
  20614. }),
  20615. smalltalk.IRInlinedSend);
  20616. smalltalk.addClass('IRInlinedIfFalse', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
  20617. smalltalk.addMethod(
  20618. "_accept_",
  20619. smalltalk.method({
  20620. selector: "accept:",
  20621. category: 'visiting',
  20622. fn: function (aVisitor){
  20623. var self=this;
  20624. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedIfFalse_(self);
  20625. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedIfFalse)})},
  20626. args: ["aVisitor"],
  20627. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfFalse: self",
  20628. messageSends: ["visitIRInlinedIfFalse:"],
  20629. referencedClasses: []
  20630. }),
  20631. smalltalk.IRInlinedIfFalse);
  20632. smalltalk.addClass('IRInlinedIfNilIfNotNil', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
  20633. smalltalk.addMethod(
  20634. "_accept_",
  20635. smalltalk.method({
  20636. selector: "accept:",
  20637. category: 'visiting',
  20638. fn: function (aVisitor){
  20639. var self=this;
  20640. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedIfNilIfNotNil_(self);
  20641. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedIfNilIfNotNil)})},
  20642. args: ["aVisitor"],
  20643. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfNilIfNotNil: self",
  20644. messageSends: ["visitIRInlinedIfNilIfNotNil:"],
  20645. referencedClasses: []
  20646. }),
  20647. smalltalk.IRInlinedIfNilIfNotNil);
  20648. smalltalk.addClass('IRInlinedIfTrue', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
  20649. smalltalk.addMethod(
  20650. "_accept_",
  20651. smalltalk.method({
  20652. selector: "accept:",
  20653. category: 'visiting',
  20654. fn: function (aVisitor){
  20655. var self=this;
  20656. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedIfTrue_(self);
  20657. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedIfTrue)})},
  20658. args: ["aVisitor"],
  20659. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrue: self",
  20660. messageSends: ["visitIRInlinedIfTrue:"],
  20661. referencedClasses: []
  20662. }),
  20663. smalltalk.IRInlinedIfTrue);
  20664. smalltalk.addClass('IRInlinedIfTrueIfFalse', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
  20665. smalltalk.addMethod(
  20666. "_accept_",
  20667. smalltalk.method({
  20668. selector: "accept:",
  20669. category: 'visiting',
  20670. fn: function (aVisitor){
  20671. var self=this;
  20672. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedIfTrueIfFalse_(self);
  20673. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedIfTrueIfFalse)})},
  20674. args: ["aVisitor"],
  20675. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrueIfFalse: self",
  20676. messageSends: ["visitIRInlinedIfTrueIfFalse:"],
  20677. referencedClasses: []
  20678. }),
  20679. smalltalk.IRInlinedIfTrueIfFalse);
  20680. smalltalk.addClass('IRInlinedSequence', smalltalk.IRBlockSequence, [], 'Compiler-Inlining');
  20681. smalltalk.IRInlinedSequence.comment="I represent a (block) sequence inside an inlined closure instruction (instance of `IRInlinedClosure`)."
  20682. smalltalk.addMethod(
  20683. "_accept_",
  20684. smalltalk.method({
  20685. selector: "accept:",
  20686. category: 'visiting',
  20687. fn: function (aVisitor){
  20688. var self=this;
  20689. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedSequence_(self);
  20690. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedSequence)})},
  20691. args: ["aVisitor"],
  20692. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedSequence: self",
  20693. messageSends: ["visitIRInlinedSequence:"],
  20694. referencedClasses: []
  20695. }),
  20696. smalltalk.IRInlinedSequence);
  20697. smalltalk.addMethod(
  20698. "_isInlined",
  20699. smalltalk.method({
  20700. selector: "isInlined",
  20701. category: 'testing',
  20702. fn: function (){
  20703. var self=this;
  20704. return smalltalk.withContext(function($ctx1) { return true;
  20705. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedSequence)})},
  20706. args: [],
  20707. source: "isInlined\x0a\x09^ true",
  20708. messageSends: [],
  20709. referencedClasses: []
  20710. }),
  20711. smalltalk.IRInlinedSequence);
  20712. smalltalk.addClass('IRInliner', smalltalk.IRVisitor, [], 'Compiler-Inlining');
  20713. smalltalk.IRInliner.comment="I visit an IR tree, inlining message sends and block closures.\x0a\x0aMessage selectors that can be inlined are answered by `IRSendInliner >> #inlinedSelectors`"
  20714. smalltalk.addMethod(
  20715. "_assignmentInliner",
  20716. smalltalk.method({
  20717. selector: "assignmentInliner",
  20718. category: 'factory',
  20719. fn: function (){
  20720. var self=this;
  20721. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  20722. $2=_st((smalltalk.IRAssignmentInliner || IRAssignmentInliner))._new();
  20723. _st($2)._translator_(self);
  20724. $3=_st($2)._yourself();
  20725. $1=$3;
  20726. return $1;
  20727. }, function($ctx1) {$ctx1.fill(self,"assignmentInliner",{}, smalltalk.IRInliner)})},
  20728. args: [],
  20729. source: "assignmentInliner\x0a\x09^ IRAssignmentInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  20730. messageSends: ["translator:", "new", "yourself"],
  20731. referencedClasses: ["IRAssignmentInliner"]
  20732. }),
  20733. smalltalk.IRInliner);
  20734. smalltalk.addMethod(
  20735. "_nonLocalReturnInliner",
  20736. smalltalk.method({
  20737. selector: "nonLocalReturnInliner",
  20738. category: 'factory',
  20739. fn: function (){
  20740. var self=this;
  20741. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  20742. $2=_st((smalltalk.IRNonLocalReturnInliner || IRNonLocalReturnInliner))._new();
  20743. _st($2)._translator_(self);
  20744. $3=_st($2)._yourself();
  20745. $1=$3;
  20746. return $1;
  20747. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturnInliner",{}, smalltalk.IRInliner)})},
  20748. args: [],
  20749. source: "nonLocalReturnInliner\x0a\x09^ IRNonLocalReturnInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  20750. messageSends: ["translator:", "new", "yourself"],
  20751. referencedClasses: ["IRNonLocalReturnInliner"]
  20752. }),
  20753. smalltalk.IRInliner);
  20754. smalltalk.addMethod(
  20755. "_returnInliner",
  20756. smalltalk.method({
  20757. selector: "returnInliner",
  20758. category: 'factory',
  20759. fn: function (){
  20760. var self=this;
  20761. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  20762. $2=_st((smalltalk.IRReturnInliner || IRReturnInliner))._new();
  20763. _st($2)._translator_(self);
  20764. $3=_st($2)._yourself();
  20765. $1=$3;
  20766. return $1;
  20767. }, function($ctx1) {$ctx1.fill(self,"returnInliner",{}, smalltalk.IRInliner)})},
  20768. args: [],
  20769. source: "returnInliner\x0a\x09^ IRReturnInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  20770. messageSends: ["translator:", "new", "yourself"],
  20771. referencedClasses: ["IRReturnInliner"]
  20772. }),
  20773. smalltalk.IRInliner);
  20774. smalltalk.addMethod(
  20775. "_sendInliner",
  20776. smalltalk.method({
  20777. selector: "sendInliner",
  20778. category: 'factory',
  20779. fn: function (){
  20780. var self=this;
  20781. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  20782. $2=_st((smalltalk.IRSendInliner || IRSendInliner))._new();
  20783. _st($2)._translator_(self);
  20784. $3=_st($2)._yourself();
  20785. $1=$3;
  20786. return $1;
  20787. }, function($ctx1) {$ctx1.fill(self,"sendInliner",{}, smalltalk.IRInliner)})},
  20788. args: [],
  20789. source: "sendInliner\x0a\x09^ IRSendInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  20790. messageSends: ["translator:", "new", "yourself"],
  20791. referencedClasses: ["IRSendInliner"]
  20792. }),
  20793. smalltalk.IRInliner);
  20794. smalltalk.addMethod(
  20795. "_shouldInlineAssignment_",
  20796. smalltalk.method({
  20797. selector: "shouldInlineAssignment:",
  20798. category: 'testing',
  20799. fn: function (anIRAssignment){
  20800. var self=this;
  20801. return smalltalk.withContext(function($ctx1) { var $1;
  20802. $1=_st(_st(_st(anIRAssignment)._isInlined())._not())._and_((function(){
  20803. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(_st(anIRAssignment)._instructions())._last())._isSend())._and_((function(){
  20804. return smalltalk.withContext(function($ctx3) { return _st(self)._shouldInlineSend_(_st(_st(anIRAssignment)._instructions())._last());
  20805. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  20806. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20807. return $1;
  20808. }, function($ctx1) {$ctx1.fill(self,"shouldInlineAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRInliner)})},
  20809. args: ["anIRAssignment"],
  20810. source: "shouldInlineAssignment: anIRAssignment\x0a\x09^ anIRAssignment isInlined not and: [ \x0a\x09\x09anIRAssignment instructions last isSend and: [\x09\x0a\x09\x09\x09self shouldInlineSend: (anIRAssignment instructions last) ]]",
  20811. messageSends: ["and:", "shouldInlineSend:", "last", "instructions", "isSend", "not", "isInlined"],
  20812. referencedClasses: []
  20813. }),
  20814. smalltalk.IRInliner);
  20815. smalltalk.addMethod(
  20816. "_shouldInlineReturn_",
  20817. smalltalk.method({
  20818. selector: "shouldInlineReturn:",
  20819. category: 'testing',
  20820. fn: function (anIRReturn){
  20821. var self=this;
  20822. return smalltalk.withContext(function($ctx1) { var $1;
  20823. $1=_st(_st(_st(anIRReturn)._isInlined())._not())._and_((function(){
  20824. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(_st(anIRReturn)._instructions())._first())._isSend())._and_((function(){
  20825. return smalltalk.withContext(function($ctx3) { return _st(self)._shouldInlineSend_(_st(_st(anIRReturn)._instructions())._first());
  20826. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  20827. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20828. return $1;
  20829. }, function($ctx1) {$ctx1.fill(self,"shouldInlineReturn:",{anIRReturn:anIRReturn}, smalltalk.IRInliner)})},
  20830. args: ["anIRReturn"],
  20831. source: "shouldInlineReturn: anIRReturn\x0a\x09^ anIRReturn isInlined not and: [ \x0a\x09\x09anIRReturn instructions first isSend and: [\x09\x0a\x09\x09\x09self shouldInlineSend: (anIRReturn instructions first) ]]",
  20832. messageSends: ["and:", "shouldInlineSend:", "first", "instructions", "isSend", "not", "isInlined"],
  20833. referencedClasses: []
  20834. }),
  20835. smalltalk.IRInliner);
  20836. smalltalk.addMethod(
  20837. "_shouldInlineSend_",
  20838. smalltalk.method({
  20839. selector: "shouldInlineSend:",
  20840. category: 'testing',
  20841. fn: function (anIRSend){
  20842. var self=this;
  20843. return smalltalk.withContext(function($ctx1) { var $1;
  20844. $1=_st(_st(_st(anIRSend)._isInlined())._not())._and_((function(){
  20845. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.IRSendInliner || IRSendInliner))._shouldInline_(anIRSend);
  20846. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  20847. return $1;
  20848. }, function($ctx1) {$ctx1.fill(self,"shouldInlineSend:",{anIRSend:anIRSend}, smalltalk.IRInliner)})},
  20849. args: ["anIRSend"],
  20850. source: "shouldInlineSend: anIRSend\x0a\x09^ anIRSend isInlined not and: [\x0a\x09\x09IRSendInliner shouldInline: anIRSend ]",
  20851. messageSends: ["and:", "shouldInline:", "not", "isInlined"],
  20852. referencedClasses: ["IRSendInliner"]
  20853. }),
  20854. smalltalk.IRInliner);
  20855. smalltalk.addMethod(
  20856. "_transformNonLocalReturn_",
  20857. smalltalk.method({
  20858. selector: "transformNonLocalReturn:",
  20859. category: 'visiting',
  20860. fn: function (anIRNonLocalReturn){
  20861. var self=this;
  20862. var localReturn;
  20863. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  20864. $1=_st(_st(anIRNonLocalReturn)._scope())._canInlineNonLocalReturns();
  20865. if(smalltalk.assert($1)){
  20866. _st(_st(_st(anIRNonLocalReturn)._scope())._methodScope())._removeNonLocalReturn_(_st(anIRNonLocalReturn)._scope());
  20867. $2=_st((smalltalk.IRReturn || IRReturn))._new();
  20868. _st($2)._scope_(_st(anIRNonLocalReturn)._scope());
  20869. $3=_st($2)._yourself();
  20870. localReturn=$3;
  20871. localReturn;
  20872. _st(_st(anIRNonLocalReturn)._instructions())._do_((function(each){
  20873. return smalltalk.withContext(function($ctx2) { return _st(localReturn)._add_(each);
  20874. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  20875. _st(anIRNonLocalReturn)._replaceWith_(localReturn);
  20876. $4=localReturn;
  20877. return $4;
  20878. };
  20879. $5=smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  20880. return $5;
  20881. }, function($ctx1) {$ctx1.fill(self,"transformNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn,localReturn:localReturn}, smalltalk.IRInliner)})},
  20882. args: ["anIRNonLocalReturn"],
  20883. source: "transformNonLocalReturn: anIRNonLocalReturn\x0a\x09\x22Replace a non local return into a local return\x22\x0a\x0a\x09| localReturn |\x0a\x09anIRNonLocalReturn scope canInlineNonLocalReturns ifTrue: [\x0a\x09\x09anIRNonLocalReturn scope methodScope removeNonLocalReturn: anIRNonLocalReturn scope.\x0a\x09\x09localReturn := IRReturn new\x0a\x09\x09\x09scope: anIRNonLocalReturn scope;\x0a\x09\x09\x09yourself.\x0a\x09\x09anIRNonLocalReturn instructions do: [ :each |\x0a\x09\x09\x09localReturn add: each ].\x0a\x09\x09anIRNonLocalReturn replaceWith: localReturn.\x0a\x09\x09^ localReturn ].\x0a\x09^ super visitIRNonLocalReturn: anIRNonLocalReturn",
  20884. messageSends: ["ifTrue:", "removeNonLocalReturn:", "scope", "methodScope", "scope:", "new", "yourself", "do:", "add:", "instructions", "replaceWith:", "canInlineNonLocalReturns", "visitIRNonLocalReturn:"],
  20885. referencedClasses: ["IRReturn"]
  20886. }),
  20887. smalltalk.IRInliner);
  20888. smalltalk.addMethod(
  20889. "_visitIRAssignment_",
  20890. smalltalk.method({
  20891. selector: "visitIRAssignment:",
  20892. category: 'visiting',
  20893. fn: function (anIRAssignment){
  20894. var self=this;
  20895. return smalltalk.withContext(function($ctx1) { var $2,$1;
  20896. $2=_st(self)._shouldInlineAssignment_(anIRAssignment);
  20897. if(smalltalk.assert($2)){
  20898. $1=_st(_st(self)._assignmentInliner())._inlineAssignment_(anIRAssignment);
  20899. } else {
  20900. $1=smalltalk.IRVisitor.fn.prototype._visitIRAssignment_.apply(_st(self), [anIRAssignment]);
  20901. };
  20902. return $1;
  20903. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRInliner)})},
  20904. args: ["anIRAssignment"],
  20905. source: "visitIRAssignment: anIRAssignment\x0a\x09^ (self shouldInlineAssignment: anIRAssignment) \x0a\x09\x09ifTrue: [ self assignmentInliner inlineAssignment: anIRAssignment ]\x0a\x09\x09ifFalse: [ super visitIRAssignment: anIRAssignment ]",
  20906. messageSends: ["ifTrue:ifFalse:", "inlineAssignment:", "assignmentInliner", "visitIRAssignment:", "shouldInlineAssignment:"],
  20907. referencedClasses: []
  20908. }),
  20909. smalltalk.IRInliner);
  20910. smalltalk.addMethod(
  20911. "_visitIRNonLocalReturn_",
  20912. smalltalk.method({
  20913. selector: "visitIRNonLocalReturn:",
  20914. category: 'visiting',
  20915. fn: function (anIRNonLocalReturn){
  20916. var self=this;
  20917. return smalltalk.withContext(function($ctx1) { var $2,$1;
  20918. $2=_st(self)._shouldInlineReturn_(anIRNonLocalReturn);
  20919. if(smalltalk.assert($2)){
  20920. $1=_st(_st(self)._nonLocalReturnInliner())._inlineReturn_(anIRNonLocalReturn);
  20921. } else {
  20922. $1=_st(self)._transformNonLocalReturn_(anIRNonLocalReturn);
  20923. };
  20924. return $1;
  20925. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn}, smalltalk.IRInliner)})},
  20926. args: ["anIRNonLocalReturn"],
  20927. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ (self shouldInlineReturn: anIRNonLocalReturn) \x0a\x09\x09ifTrue: [ self nonLocalReturnInliner inlineReturn: anIRNonLocalReturn ]\x0a\x09\x09ifFalse: [ self transformNonLocalReturn: anIRNonLocalReturn ]",
  20928. messageSends: ["ifTrue:ifFalse:", "inlineReturn:", "nonLocalReturnInliner", "transformNonLocalReturn:", "shouldInlineReturn:"],
  20929. referencedClasses: []
  20930. }),
  20931. smalltalk.IRInliner);
  20932. smalltalk.addMethod(
  20933. "_visitIRReturn_",
  20934. smalltalk.method({
  20935. selector: "visitIRReturn:",
  20936. category: 'visiting',
  20937. fn: function (anIRReturn){
  20938. var self=this;
  20939. return smalltalk.withContext(function($ctx1) { var $2,$1;
  20940. $2=_st(self)._shouldInlineReturn_(anIRReturn);
  20941. if(smalltalk.assert($2)){
  20942. $1=_st(_st(self)._returnInliner())._inlineReturn_(anIRReturn);
  20943. } else {
  20944. $1=smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  20945. };
  20946. return $1;
  20947. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn}, smalltalk.IRInliner)})},
  20948. args: ["anIRReturn"],
  20949. source: "visitIRReturn: anIRReturn\x0a\x09^ (self shouldInlineReturn: anIRReturn) \x0a\x09\x09ifTrue: [ self returnInliner inlineReturn: anIRReturn ]\x0a\x09\x09ifFalse: [ super visitIRReturn: anIRReturn ]",
  20950. messageSends: ["ifTrue:ifFalse:", "inlineReturn:", "returnInliner", "visitIRReturn:", "shouldInlineReturn:"],
  20951. referencedClasses: []
  20952. }),
  20953. smalltalk.IRInliner);
  20954. smalltalk.addMethod(
  20955. "_visitIRSend_",
  20956. smalltalk.method({
  20957. selector: "visitIRSend:",
  20958. category: 'visiting',
  20959. fn: function (anIRSend){
  20960. var self=this;
  20961. return smalltalk.withContext(function($ctx1) { var $2,$1;
  20962. $2=_st(self)._shouldInlineSend_(anIRSend);
  20963. if(smalltalk.assert($2)){
  20964. $1=_st(_st(self)._sendInliner())._inlineSend_(anIRSend);
  20965. } else {
  20966. $1=smalltalk.IRVisitor.fn.prototype._visitIRSend_.apply(_st(self), [anIRSend]);
  20967. };
  20968. return $1;
  20969. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend}, smalltalk.IRInliner)})},
  20970. args: ["anIRSend"],
  20971. source: "visitIRSend: anIRSend\x0a\x09^ (self shouldInlineSend: anIRSend)\x0a\x09\x09ifTrue: [ self sendInliner inlineSend: anIRSend ]\x0a\x09\x09ifFalse: [ super visitIRSend: anIRSend ]",
  20972. messageSends: ["ifTrue:ifFalse:", "inlineSend:", "sendInliner", "visitIRSend:", "shouldInlineSend:"],
  20973. referencedClasses: []
  20974. }),
  20975. smalltalk.IRInliner);
  20976. smalltalk.addClass('IRInliningJSTranslator', smalltalk.IRJSTranslator, [], 'Compiler-Inlining');
  20977. smalltalk.IRInliningJSTranslator.comment="I am a specialized JavaScript translator able to write inlined IR instructions to JavaScript stream (`JSStream` instance)."
  20978. smalltalk.addMethod(
  20979. "_visitIRInlinedAssignment_",
  20980. smalltalk.method({
  20981. selector: "visitIRInlinedAssignment:",
  20982. category: 'visiting',
  20983. fn: function (anIRInlinedAssignment){
  20984. var self=this;
  20985. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRInlinedAssignment)._instructions())._last());
  20986. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedAssignment:",{anIRInlinedAssignment:anIRInlinedAssignment}, smalltalk.IRInliningJSTranslator)})},
  20987. args: ["anIRInlinedAssignment"],
  20988. source: "visitIRInlinedAssignment: anIRInlinedAssignment\x0a\x09self visit: anIRInlinedAssignment instructions last",
  20989. messageSends: ["visit:", "last", "instructions"],
  20990. referencedClasses: []
  20991. }),
  20992. smalltalk.IRInliningJSTranslator);
  20993. smalltalk.addMethod(
  20994. "_visitIRInlinedClosure_",
  20995. smalltalk.method({
  20996. selector: "visitIRInlinedClosure:",
  20997. category: 'visiting',
  20998. fn: function (anIRInlinedClosure){
  20999. var self=this;
  21000. return smalltalk.withContext(function($ctx1) { _st(_st(anIRInlinedClosure)._instructions())._do_((function(each){
  21001. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  21002. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  21003. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure}, smalltalk.IRInliningJSTranslator)})},
  21004. args: ["anIRInlinedClosure"],
  21005. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09anIRInlinedClosure instructions do: [ :each |\x0a\x09\x09self visit: each ]",
  21006. messageSends: ["do:", "visit:", "instructions"],
  21007. referencedClasses: []
  21008. }),
  21009. smalltalk.IRInliningJSTranslator);
  21010. smalltalk.addMethod(
  21011. "_visitIRInlinedIfFalse_",
  21012. smalltalk.method({
  21013. selector: "visitIRInlinedIfFalse:",
  21014. category: 'visiting',
  21015. fn: function (anIRInlinedIfFalse){
  21016. var self=this;
  21017. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIf_with_((function(){
  21018. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("! smalltalk.assert(");
  21019. _st(self)._visit_(_st(_st(anIRInlinedIfFalse)._instructions())._first());
  21020. return _st(_st(self)._stream())._nextPutAll_(")");
  21021. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  21022. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfFalse)._instructions())._last());
  21023. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21024. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfFalse:",{anIRInlinedIfFalse:anIRInlinedIfFalse}, smalltalk.IRInliningJSTranslator)})},
  21025. args: ["anIRInlinedIfFalse"],
  21026. source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: '! smalltalk.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfFalse instructions last ]",
  21027. messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
  21028. referencedClasses: []
  21029. }),
  21030. smalltalk.IRInliningJSTranslator);
  21031. smalltalk.addMethod(
  21032. "_visitIRInlinedIfNil_",
  21033. smalltalk.method({
  21034. selector: "visitIRInlinedIfNil:",
  21035. category: 'visiting',
  21036. fn: function (anIRInlinedIfNil){
  21037. var self=this;
  21038. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIf_with_((function(){
  21039. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("($receiver = ");
  21040. _st(self)._visit_(_st(_st(anIRInlinedIfNil)._instructions())._first());
  21041. return _st(_st(self)._stream())._nextPutAll_(") == nil || $receiver == undefined");
  21042. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  21043. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfNil)._instructions())._last());
  21044. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21045. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfNil:",{anIRInlinedIfNil:anIRInlinedIfNil}, smalltalk.IRInliningJSTranslator)})},
  21046. args: ["anIRInlinedIfNil"],
  21047. source: "visitIRInlinedIfNil: anIRInlinedIfNil\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: '($receiver = '. \x0a\x09\x09self visit: anIRInlinedIfNil instructions first.\x0a\x09\x09self stream nextPutAll: ') == nil || $receiver == undefined' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNil instructions last ]",
  21048. messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
  21049. referencedClasses: []
  21050. }),
  21051. smalltalk.IRInliningJSTranslator);
  21052. smalltalk.addMethod(
  21053. "_visitIRInlinedIfNilIfNotNil_",
  21054. smalltalk.method({
  21055. selector: "visitIRInlinedIfNilIfNotNil:",
  21056. category: 'visiting',
  21057. fn: function (anIRInlinedIfNilIfNotNil){
  21058. var self=this;
  21059. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIfElse_with_with_((function(){
  21060. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("($receiver = ");
  21061. _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._first());
  21062. return _st(_st(self)._stream())._nextPutAll_(") == nil || $receiver == undefined");
  21063. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  21064. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._second());
  21065. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  21066. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._third());
  21067. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21068. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfNilIfNotNil:",{anIRInlinedIfNilIfNotNil:anIRInlinedIfNilIfNotNil}, smalltalk.IRInliningJSTranslator)})},
  21069. args: ["anIRInlinedIfNilIfNotNil"],
  21070. source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream \x0a\x09\x09nextPutIfElse: [ \x0a\x09\x09\x09self stream nextPutAll: '($receiver = '. \x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil instructions first.\x0a\x09\x09\x09self stream nextPutAll: ') == nil || $receiver == undefined' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]",
  21071. messageSends: ["nextPutIfElse:with:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "second", "third"],
  21072. referencedClasses: []
  21073. }),
  21074. smalltalk.IRInliningJSTranslator);
  21075. smalltalk.addMethod(
  21076. "_visitIRInlinedIfTrue_",
  21077. smalltalk.method({
  21078. selector: "visitIRInlinedIfTrue:",
  21079. category: 'visiting',
  21080. fn: function (anIRInlinedIfTrue){
  21081. var self=this;
  21082. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIf_with_((function(){
  21083. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("smalltalk.assert(");
  21084. _st(self)._visit_(_st(_st(anIRInlinedIfTrue)._instructions())._first());
  21085. return _st(_st(self)._stream())._nextPutAll_(")");
  21086. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  21087. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfTrue)._instructions())._last());
  21088. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21089. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfTrue:",{anIRInlinedIfTrue:anIRInlinedIfTrue}, smalltalk.IRInliningJSTranslator)})},
  21090. args: ["anIRInlinedIfTrue"],
  21091. source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: 'smalltalk.assert('. \x0a\x09\x09self visit: anIRInlinedIfTrue instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrue instructions last ]",
  21092. messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
  21093. referencedClasses: []
  21094. }),
  21095. smalltalk.IRInliningJSTranslator);
  21096. smalltalk.addMethod(
  21097. "_visitIRInlinedIfTrueIfFalse_",
  21098. smalltalk.method({
  21099. selector: "visitIRInlinedIfTrueIfFalse:",
  21100. category: 'visiting',
  21101. fn: function (anIRInlinedIfTrueIfFalse){
  21102. var self=this;
  21103. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIfElse_with_with_((function(){
  21104. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("smalltalk.assert(");
  21105. _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._first());
  21106. return _st(_st(self)._stream())._nextPutAll_(")");
  21107. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  21108. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._second());
  21109. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  21110. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._third());
  21111. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21112. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfTrueIfFalse:",{anIRInlinedIfTrueIfFalse:anIRInlinedIfTrueIfFalse}, smalltalk.IRInliningJSTranslator)})},
  21113. args: ["anIRInlinedIfTrueIfFalse"],
  21114. source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream \x0a\x09\x09nextPutIfElse: [ \x0a\x09\x09\x09self stream nextPutAll: 'smalltalk.assert('. \x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse instructions first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]",
  21115. messageSends: ["nextPutIfElse:with:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "second", "third"],
  21116. referencedClasses: []
  21117. }),
  21118. smalltalk.IRInliningJSTranslator);
  21119. smalltalk.addMethod(
  21120. "_visitIRInlinedNonLocalReturn_",
  21121. smalltalk.method({
  21122. selector: "visitIRInlinedNonLocalReturn:",
  21123. category: 'visiting',
  21124. fn: function (anIRInlinedReturn){
  21125. var self=this;
  21126. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  21127. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedReturn)._instructions())._last());
  21128. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21129. _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  21130. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21131. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedNonLocalReturn:",{anIRInlinedReturn:anIRInlinedReturn}, smalltalk.IRInliningJSTranslator)})},
  21132. args: ["anIRInlinedReturn"],
  21133. source: "visitIRInlinedNonLocalReturn: anIRInlinedReturn\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self visit: anIRInlinedReturn instructions last ].\x0a\x09self stream nextPutNonLocalReturnWith: [ ]",
  21134. messageSends: ["nextPutStatementWith:", "visit:", "last", "instructions", "stream", "nextPutNonLocalReturnWith:"],
  21135. referencedClasses: []
  21136. }),
  21137. smalltalk.IRInliningJSTranslator);
  21138. smalltalk.addMethod(
  21139. "_visitIRInlinedReturn_",
  21140. smalltalk.method({
  21141. selector: "visitIRInlinedReturn:",
  21142. category: 'visiting',
  21143. fn: function (anIRInlinedReturn){
  21144. var self=this;
  21145. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRInlinedReturn)._instructions())._last());
  21146. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedReturn:",{anIRInlinedReturn:anIRInlinedReturn}, smalltalk.IRInliningJSTranslator)})},
  21147. args: ["anIRInlinedReturn"],
  21148. source: "visitIRInlinedReturn: anIRInlinedReturn\x0a\x09self visit: anIRInlinedReturn instructions last",
  21149. messageSends: ["visit:", "last", "instructions"],
  21150. referencedClasses: []
  21151. }),
  21152. smalltalk.IRInliningJSTranslator);
  21153. smalltalk.addMethod(
  21154. "_visitIRInlinedSequence_",
  21155. smalltalk.method({
  21156. selector: "visitIRInlinedSequence:",
  21157. category: 'visiting',
  21158. fn: function (anIRInlinedSequence){
  21159. var self=this;
  21160. return smalltalk.withContext(function($ctx1) { _st(_st(anIRInlinedSequence)._instructions())._do_((function(each){
  21161. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutStatementWith_((function(){
  21162. return smalltalk.withContext(function($ctx3) { return _st(self)._visit_(each);
  21163. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  21164. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  21165. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence}, smalltalk.IRInliningJSTranslator)})},
  21166. args: ["anIRInlinedSequence"],
  21167. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence instructions do: [ :each | \x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
  21168. messageSends: ["do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
  21169. referencedClasses: []
  21170. }),
  21171. smalltalk.IRInliningJSTranslator);
  21172. smalltalk.addClass('IRSendInliner', smalltalk.Object, ['send', 'translator'], 'Compiler-Inlining');
  21173. smalltalk.IRSendInliner.comment="I inline some message sends and block closure arguments. I heavily rely on #perform: to dispatch inlining methods."
  21174. smalltalk.addMethod(
  21175. "_ifFalse_",
  21176. smalltalk.method({
  21177. selector: "ifFalse:",
  21178. category: 'inlining',
  21179. fn: function (anIRInstruction){
  21180. var self=this;
  21181. return smalltalk.withContext(function($ctx1) { var $1;
  21182. $1=_st(self)._inlinedSend_with_(_st((smalltalk.IRInlinedIfFalse || IRInlinedIfFalse))._new(),anIRInstruction);
  21183. return $1;
  21184. }, function($ctx1) {$ctx1.fill(self,"ifFalse:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner)})},
  21185. args: ["anIRInstruction"],
  21186. source: "ifFalse: anIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfFalse new with: anIRInstruction",
  21187. messageSends: ["inlinedSend:with:", "new"],
  21188. referencedClasses: ["IRInlinedIfFalse"]
  21189. }),
  21190. smalltalk.IRSendInliner);
  21191. smalltalk.addMethod(
  21192. "_ifFalse_ifTrue_",
  21193. smalltalk.method({
  21194. selector: "ifFalse:ifTrue:",
  21195. category: 'inlining',
  21196. fn: function (anIRInstruction,anotherIRInstruction){
  21197. var self=this;
  21198. return smalltalk.withContext(function($ctx1) { var $1;
  21199. $1=_st(self)._perform_withArguments_(smalltalk.symbolFor("ifTrue:ifFalse:"),[anotherIRInstruction,anIRInstruction]);
  21200. return $1;
  21201. }, function($ctx1) {$ctx1.fill(self,"ifFalse:ifTrue:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRSendInliner)})},
  21202. args: ["anIRInstruction", "anotherIRInstruction"],
  21203. source: "ifFalse: anIRInstruction ifTrue: anotherIRInstruction\x0a\x09^ self perform: #ifTrue:ifFalse: withArguments: { anotherIRInstruction. anIRInstruction }",
  21204. messageSends: ["perform:withArguments:"],
  21205. referencedClasses: []
  21206. }),
  21207. smalltalk.IRSendInliner);
  21208. smalltalk.addMethod(
  21209. "_ifNil_",
  21210. smalltalk.method({
  21211. selector: "ifNil:",
  21212. category: 'inlining',
  21213. fn: function (anIRInstruction){
  21214. var self=this;
  21215. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$5,$1;
  21216. $2=_st((smalltalk.IRClosure || IRClosure))._new();
  21217. _st($2)._scope_(_st(_st(anIRInstruction)._scope())._copy());
  21218. $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
  21219. _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
  21220. $4=_st($3)._yourself();
  21221. _st($2)._add_($4);
  21222. $5=_st($2)._yourself();
  21223. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anIRInstruction,$5);
  21224. return $1;
  21225. }, function($ctx1) {$ctx1.fill(self,"ifNil:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner)})},
  21226. args: ["anIRInstruction"],
  21227. source: "ifNil: anIRInstruction\x0a\x09^ self \x0a\x09\x09inlinedSend: IRInlinedIfNilIfNotNil new \x0a\x09\x09with: anIRInstruction\x0a\x09\x09with: (IRClosure new\x0a\x09\x09\x09scope: anIRInstruction scope copy;\x0a\x09\x09\x09add: (IRBlockSequence new\x0a\x09\x09\x09\x09add: self send instructions first;\x0a\x09\x09\x09\x09yourself);\x0a\x09\x09\x09yourself)",
  21228. messageSends: ["inlinedSend:with:with:", "new", "scope:", "copy", "scope", "add:", "first", "instructions", "send", "yourself"],
  21229. referencedClasses: ["IRInlinedIfNilIfNotNil", "IRClosure", "IRBlockSequence"]
  21230. }),
  21231. smalltalk.IRSendInliner);
  21232. smalltalk.addMethod(
  21233. "_ifNil_ifNotNil_",
  21234. smalltalk.method({
  21235. selector: "ifNil:ifNotNil:",
  21236. category: 'inlining',
  21237. fn: function (anIRInstruction,anotherIRInstruction){
  21238. var self=this;
  21239. return smalltalk.withContext(function($ctx1) { var $1;
  21240. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anIRInstruction,anotherIRInstruction);
  21241. return $1;
  21242. }, function($ctx1) {$ctx1.fill(self,"ifNil:ifNotNil:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRSendInliner)})},
  21243. args: ["anIRInstruction", "anotherIRInstruction"],
  21244. source: "ifNil: anIRInstruction ifNotNil: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfNilIfNotNil new with: anIRInstruction with: anotherIRInstruction",
  21245. messageSends: ["inlinedSend:with:with:", "new"],
  21246. referencedClasses: ["IRInlinedIfNilIfNotNil"]
  21247. }),
  21248. smalltalk.IRSendInliner);
  21249. smalltalk.addMethod(
  21250. "_ifNotNil_",
  21251. smalltalk.method({
  21252. selector: "ifNotNil:",
  21253. category: 'inlining',
  21254. fn: function (anIRInstruction){
  21255. var self=this;
  21256. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$5,$1;
  21257. $2=_st((smalltalk.IRClosure || IRClosure))._new();
  21258. _st($2)._scope_(_st(_st(anIRInstruction)._scope())._copy());
  21259. $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
  21260. _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
  21261. $4=_st($3)._yourself();
  21262. _st($2)._add_($4);
  21263. $5=_st($2)._yourself();
  21264. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),$5,anIRInstruction);
  21265. return $1;
  21266. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner)})},
  21267. args: ["anIRInstruction"],
  21268. source: "ifNotNil: anIRInstruction\x0a\x09^ self \x0a\x09\x09inlinedSend: IRInlinedIfNilIfNotNil new\x0a\x09\x09with: (IRClosure new\x0a\x09\x09\x09scope: anIRInstruction scope copy;\x0a\x09\x09\x09add: (IRBlockSequence new\x0a\x09\x09\x09\x09add: self send instructions first;\x0a\x09\x09\x09\x09yourself);\x0a\x09\x09\x09yourself)\x0a\x09\x09with: anIRInstruction",
  21269. messageSends: ["inlinedSend:with:with:", "new", "scope:", "copy", "scope", "add:", "first", "instructions", "send", "yourself"],
  21270. referencedClasses: ["IRInlinedIfNilIfNotNil", "IRClosure", "IRBlockSequence"]
  21271. }),
  21272. smalltalk.IRSendInliner);
  21273. smalltalk.addMethod(
  21274. "_ifNotNil_ifNil_",
  21275. smalltalk.method({
  21276. selector: "ifNotNil:ifNil:",
  21277. category: 'inlining',
  21278. fn: function (anIRInstruction,anotherIRInstruction){
  21279. var self=this;
  21280. return smalltalk.withContext(function($ctx1) { var $1;
  21281. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anotherIRInstruction,anIRInstruction);
  21282. return $1;
  21283. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:ifNil:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRSendInliner)})},
  21284. args: ["anIRInstruction", "anotherIRInstruction"],
  21285. source: "ifNotNil: anIRInstruction ifNil: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfNilIfNotNil new with: anotherIRInstruction with: anIRInstruction",
  21286. messageSends: ["inlinedSend:with:with:", "new"],
  21287. referencedClasses: ["IRInlinedIfNilIfNotNil"]
  21288. }),
  21289. smalltalk.IRSendInliner);
  21290. smalltalk.addMethod(
  21291. "_ifTrue_",
  21292. smalltalk.method({
  21293. selector: "ifTrue:",
  21294. category: 'inlining',
  21295. fn: function (anIRInstruction){
  21296. var self=this;
  21297. return smalltalk.withContext(function($ctx1) { var $1;
  21298. $1=_st(self)._inlinedSend_with_(_st((smalltalk.IRInlinedIfTrue || IRInlinedIfTrue))._new(),anIRInstruction);
  21299. return $1;
  21300. }, function($ctx1) {$ctx1.fill(self,"ifTrue:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner)})},
  21301. args: ["anIRInstruction"],
  21302. source: "ifTrue: anIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfTrue new with: anIRInstruction",
  21303. messageSends: ["inlinedSend:with:", "new"],
  21304. referencedClasses: ["IRInlinedIfTrue"]
  21305. }),
  21306. smalltalk.IRSendInliner);
  21307. smalltalk.addMethod(
  21308. "_ifTrue_ifFalse_",
  21309. smalltalk.method({
  21310. selector: "ifTrue:ifFalse:",
  21311. category: 'inlining',
  21312. fn: function (anIRInstruction,anotherIRInstruction){
  21313. var self=this;
  21314. return smalltalk.withContext(function($ctx1) { var $1;
  21315. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfTrueIfFalse || IRInlinedIfTrueIfFalse))._new(),anIRInstruction,anotherIRInstruction);
  21316. return $1;
  21317. }, function($ctx1) {$ctx1.fill(self,"ifTrue:ifFalse:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRSendInliner)})},
  21318. args: ["anIRInstruction", "anotherIRInstruction"],
  21319. source: "ifTrue: anIRInstruction ifFalse: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfTrueIfFalse new with: anIRInstruction with: anotherIRInstruction",
  21320. messageSends: ["inlinedSend:with:with:", "new"],
  21321. referencedClasses: ["IRInlinedIfTrueIfFalse"]
  21322. }),
  21323. smalltalk.IRSendInliner);
  21324. smalltalk.addMethod(
  21325. "_inlineClosure_",
  21326. smalltalk.method({
  21327. selector: "inlineClosure:",
  21328. category: 'inlining',
  21329. fn: function (anIRClosure){
  21330. var self=this;
  21331. var inlinedClosure,sequence,statements;
  21332. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  21333. inlinedClosure=_st(self)._inlinedClosure();
  21334. _st(inlinedClosure)._scope_(_st(anIRClosure)._scope());
  21335. _st(_st(anIRClosure)._instructions())._do_((function(each){
  21336. return smalltalk.withContext(function($ctx2) { $1=_st(each)._isSequence();
  21337. if(! smalltalk.assert($1)){
  21338. return _st(inlinedClosure)._add_(each);
  21339. };
  21340. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  21341. sequence=_st(self)._inlinedSequence();
  21342. _st(inlinedClosure)._add_(sequence);
  21343. statements=_st(_st(_st(anIRClosure)._instructions())._last())._instructions();
  21344. _st(statements)._ifNotEmpty_((function(){
  21345. return smalltalk.withContext(function($ctx2) { _st(_st(statements)._allButLast())._do_((function(each){
  21346. return smalltalk.withContext(function($ctx3) { return _st(sequence)._add_(each);
  21347. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  21348. $2=_st(_st(_st(statements)._last())._isReturn())._and_((function(){
  21349. return smalltalk.withContext(function($ctx3) { return _st(_st(statements)._last())._isBlockReturn();
  21350. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  21351. if(smalltalk.assert($2)){
  21352. return _st(sequence)._add_(_st(_st(_st(statements)._last())._instructions())._first());
  21353. } else {
  21354. return _st(sequence)._add_(_st(statements)._last());
  21355. };
  21356. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21357. $3=inlinedClosure;
  21358. return $3;
  21359. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,sequence:sequence,statements:statements}, smalltalk.IRSendInliner)})},
  21360. args: ["anIRClosure"],
  21361. source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure sequence statements |\x0a\x0a\x09inlinedClosure := self inlinedClosure.\x0a\x09inlinedClosure scope: anIRClosure scope.\x0a\x0a\x09\x22Add the possible temp declarations\x22\x0a\x09anIRClosure instructions do: [ :each | \x0a\x09\x09each isSequence ifFalse: [\x0a\x09\x09\x09inlinedClosure add: each ]].\x0a\x0a\x09\x22Add a block sequence\x22\x0a\x09sequence := self inlinedSequence.\x0a\x09inlinedClosure add: sequence.\x0a\x0a\x09\x22Get all the statements\x22\x0a\x09statements := anIRClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements allButLast do: [ :each | sequence add: each ].\x0a\x0a\x09\x09\x22Inlined closures don't have implicit local returns\x22\x0a\x09\x09(statements last isReturn and: [ statements last isBlockReturn ])\x0a\x09\x09\x09ifTrue: [ sequence add: statements last instructions first ]\x0a\x09\x09\x09ifFalse: [ sequence add: statements last ] ].\x0a\x0a\x09^ inlinedClosure",
  21362. messageSends: ["inlinedClosure", "scope:", "scope", "do:", "ifFalse:", "add:", "isSequence", "instructions", "inlinedSequence", "last", "ifNotEmpty:", "allButLast", "ifTrue:ifFalse:", "first", "and:", "isBlockReturn", "isReturn"],
  21363. referencedClasses: []
  21364. }),
  21365. smalltalk.IRSendInliner);
  21366. smalltalk.addMethod(
  21367. "_inlineSend_",
  21368. smalltalk.method({
  21369. selector: "inlineSend:",
  21370. category: 'inlining',
  21371. fn: function (anIRSend){
  21372. var self=this;
  21373. return smalltalk.withContext(function($ctx1) { var $1;
  21374. _st(self)._send_(anIRSend);
  21375. $1=_st(self)._perform_withArguments_(_st(_st(self)._send())._selector(),_st(_st(_st(self)._send())._instructions())._allButFirst());
  21376. return $1;
  21377. }, function($ctx1) {$ctx1.fill(self,"inlineSend:",{anIRSend:anIRSend}, smalltalk.IRSendInliner)})},
  21378. args: ["anIRSend"],
  21379. source: "inlineSend: anIRSend\x0a\x09self send: anIRSend.\x0a\x09^ self \x0a\x09\x09perform: self send selector \x0a\x09\x09withArguments: self send instructions allButFirst",
  21380. messageSends: ["send:", "perform:withArguments:", "selector", "send", "allButFirst", "instructions"],
  21381. referencedClasses: []
  21382. }),
  21383. smalltalk.IRSendInliner);
  21384. smalltalk.addMethod(
  21385. "_inlinedClosure",
  21386. smalltalk.method({
  21387. selector: "inlinedClosure",
  21388. category: 'factory',
  21389. fn: function (){
  21390. var self=this;
  21391. return smalltalk.withContext(function($ctx1) { var $1;
  21392. $1=_st((smalltalk.IRInlinedClosure || IRInlinedClosure))._new();
  21393. return $1;
  21394. }, function($ctx1) {$ctx1.fill(self,"inlinedClosure",{}, smalltalk.IRSendInliner)})},
  21395. args: [],
  21396. source: "inlinedClosure\x0a\x09^ IRInlinedClosure new",
  21397. messageSends: ["new"],
  21398. referencedClasses: ["IRInlinedClosure"]
  21399. }),
  21400. smalltalk.IRSendInliner);
  21401. smalltalk.addMethod(
  21402. "_inlinedSend_with_",
  21403. smalltalk.method({
  21404. selector: "inlinedSend:with:",
  21405. category: 'inlining',
  21406. fn: function (inlinedSend,anIRInstruction){
  21407. var self=this;
  21408. var inlinedClosure;
  21409. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  21410. $1=_st(anIRInstruction)._isClosure();
  21411. if(! smalltalk.assert($1)){
  21412. _st(self)._inliningError_("Message argument should be a block");
  21413. };
  21414. $2=_st(_st(_st(anIRInstruction)._arguments())._size()).__eq((0));
  21415. if(! smalltalk.assert($2)){
  21416. _st(self)._inliningError_("Inlined block should have zero argument");
  21417. };
  21418. inlinedClosure=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anIRInstruction));
  21419. $3=inlinedSend;
  21420. _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
  21421. $4=_st($3)._add_(inlinedClosure);
  21422. _st(_st(self)._send())._replaceWith_(inlinedSend);
  21423. $5=inlinedSend;
  21424. return $5;
  21425. }, function($ctx1) {$ctx1.fill(self,"inlinedSend:with:",{inlinedSend:inlinedSend,anIRInstruction:anIRInstruction,inlinedClosure:inlinedClosure}, smalltalk.IRSendInliner)})},
  21426. args: ["inlinedSend", "anIRInstruction"],
  21427. source: "inlinedSend: inlinedSend with: anIRInstruction\x0a\x09| inlinedClosure |\x0a\x0a\x09anIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09inlinedClosure := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send instructions first;\x0a\x09\x09add: inlinedClosure.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x0a\x09^ inlinedSend",
  21428. messageSends: ["ifFalse:", "inliningError:", "isClosure", "=", "size", "arguments", "visit:", "inlineClosure:", "translator", "add:", "first", "instructions", "send", "replaceWith:"],
  21429. referencedClasses: []
  21430. }),
  21431. smalltalk.IRSendInliner);
  21432. smalltalk.addMethod(
  21433. "_inlinedSend_with_with_",
  21434. smalltalk.method({
  21435. selector: "inlinedSend:with:with:",
  21436. category: 'inlining',
  21437. fn: function (inlinedSend,anIRInstruction,anotherIRInstruction){
  21438. var self=this;
  21439. var inlinedClosure1,inlinedClosure2;
  21440. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7;
  21441. $1=_st(anIRInstruction)._isClosure();
  21442. if(! smalltalk.assert($1)){
  21443. _st(self)._inliningError_("Message argument should be a block");
  21444. };
  21445. $2=_st(_st(_st(anIRInstruction)._arguments())._size()).__eq((0));
  21446. if(! smalltalk.assert($2)){
  21447. _st(self)._inliningError_("Inlined block should have zero argument");
  21448. };
  21449. $3=_st(anotherIRInstruction)._isClosure();
  21450. if(! smalltalk.assert($3)){
  21451. _st(self)._inliningError_("Message argument should be a block");
  21452. };
  21453. $4=_st(_st(_st(anotherIRInstruction)._arguments())._size()).__eq((0));
  21454. if(! smalltalk.assert($4)){
  21455. _st(self)._inliningError_("Inlined block should have zero argument");
  21456. };
  21457. inlinedClosure1=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anIRInstruction));
  21458. inlinedClosure2=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anotherIRInstruction));
  21459. $5=inlinedSend;
  21460. _st($5)._add_(_st(_st(_st(self)._send())._instructions())._first());
  21461. _st($5)._add_(inlinedClosure1);
  21462. $6=_st($5)._add_(inlinedClosure2);
  21463. _st(_st(self)._send())._replaceWith_(inlinedSend);
  21464. $7=inlinedSend;
  21465. return $7;
  21466. }, function($ctx1) {$ctx1.fill(self,"inlinedSend:with:with:",{inlinedSend:inlinedSend,anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction,inlinedClosure1:inlinedClosure1,inlinedClosure2:inlinedClosure2}, smalltalk.IRSendInliner)})},
  21467. args: ["inlinedSend", "anIRInstruction", "anotherIRInstruction"],
  21468. source: "inlinedSend: inlinedSend with: anIRInstruction with: anotherIRInstruction\x0a\x09| inlinedClosure1 inlinedClosure2 |\x0a\x0a\x09anIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09anotherIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anotherIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09inlinedClosure1 := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x09inlinedClosure2 := self translator visit: (self inlineClosure: anotherIRInstruction).\x0a\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send instructions first;\x0a\x09\x09add: inlinedClosure1;\x0a\x09\x09add: inlinedClosure2.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x09^ inlinedSend",
  21469. messageSends: ["ifFalse:", "inliningError:", "isClosure", "=", "size", "arguments", "visit:", "inlineClosure:", "translator", "add:", "first", "instructions", "send", "replaceWith:"],
  21470. referencedClasses: []
  21471. }),
  21472. smalltalk.IRSendInliner);
  21473. smalltalk.addMethod(
  21474. "_inlinedSequence",
  21475. smalltalk.method({
  21476. selector: "inlinedSequence",
  21477. category: 'factory',
  21478. fn: function (){
  21479. var self=this;
  21480. return smalltalk.withContext(function($ctx1) { var $1;
  21481. $1=_st((smalltalk.IRInlinedSequence || IRInlinedSequence))._new();
  21482. return $1;
  21483. }, function($ctx1) {$ctx1.fill(self,"inlinedSequence",{}, smalltalk.IRSendInliner)})},
  21484. args: [],
  21485. source: "inlinedSequence\x0a\x09^ IRInlinedSequence new",
  21486. messageSends: ["new"],
  21487. referencedClasses: ["IRInlinedSequence"]
  21488. }),
  21489. smalltalk.IRSendInliner);
  21490. smalltalk.addMethod(
  21491. "_inliningError_",
  21492. smalltalk.method({
  21493. selector: "inliningError:",
  21494. category: 'error handling',
  21495. fn: function (aString){
  21496. var self=this;
  21497. return smalltalk.withContext(function($ctx1) { _st((smalltalk.InliningError || InliningError))._signal_(aString);
  21498. return self}, function($ctx1) {$ctx1.fill(self,"inliningError:",{aString:aString}, smalltalk.IRSendInliner)})},
  21499. args: ["aString"],
  21500. source: "inliningError: aString\x0a\x09InliningError signal: aString",
  21501. messageSends: ["signal:"],
  21502. referencedClasses: ["InliningError"]
  21503. }),
  21504. smalltalk.IRSendInliner);
  21505. smalltalk.addMethod(
  21506. "_send",
  21507. smalltalk.method({
  21508. selector: "send",
  21509. category: 'accessing',
  21510. fn: function (){
  21511. var self=this;
  21512. return smalltalk.withContext(function($ctx1) { var $1;
  21513. $1=self["@send"];
  21514. return $1;
  21515. }, function($ctx1) {$ctx1.fill(self,"send",{}, smalltalk.IRSendInliner)})},
  21516. args: [],
  21517. source: "send\x0a\x09^ send",
  21518. messageSends: [],
  21519. referencedClasses: []
  21520. }),
  21521. smalltalk.IRSendInliner);
  21522. smalltalk.addMethod(
  21523. "_send_",
  21524. smalltalk.method({
  21525. selector: "send:",
  21526. category: 'accessing',
  21527. fn: function (anIRSend){
  21528. var self=this;
  21529. return smalltalk.withContext(function($ctx1) { self["@send"]=anIRSend;
  21530. return self}, function($ctx1) {$ctx1.fill(self,"send:",{anIRSend:anIRSend}, smalltalk.IRSendInliner)})},
  21531. args: ["anIRSend"],
  21532. source: "send: anIRSend\x0a\x09send := anIRSend",
  21533. messageSends: [],
  21534. referencedClasses: []
  21535. }),
  21536. smalltalk.IRSendInliner);
  21537. smalltalk.addMethod(
  21538. "_translator",
  21539. smalltalk.method({
  21540. selector: "translator",
  21541. category: 'accessing',
  21542. fn: function (){
  21543. var self=this;
  21544. return smalltalk.withContext(function($ctx1) { var $1;
  21545. $1=self["@translator"];
  21546. return $1;
  21547. }, function($ctx1) {$ctx1.fill(self,"translator",{}, smalltalk.IRSendInliner)})},
  21548. args: [],
  21549. source: "translator\x0a\x09^ translator",
  21550. messageSends: [],
  21551. referencedClasses: []
  21552. }),
  21553. smalltalk.IRSendInliner);
  21554. smalltalk.addMethod(
  21555. "_translator_",
  21556. smalltalk.method({
  21557. selector: "translator:",
  21558. category: 'accessing',
  21559. fn: function (anASTTranslator){
  21560. var self=this;
  21561. return smalltalk.withContext(function($ctx1) { self["@translator"]=anASTTranslator;
  21562. return self}, function($ctx1) {$ctx1.fill(self,"translator:",{anASTTranslator:anASTTranslator}, smalltalk.IRSendInliner)})},
  21563. args: ["anASTTranslator"],
  21564. source: "translator: anASTTranslator\x0a\x09translator := anASTTranslator",
  21565. messageSends: [],
  21566. referencedClasses: []
  21567. }),
  21568. smalltalk.IRSendInliner);
  21569. smalltalk.addMethod(
  21570. "_inlinedSelectors",
  21571. smalltalk.method({
  21572. selector: "inlinedSelectors",
  21573. category: 'accessing',
  21574. fn: function (){
  21575. var self=this;
  21576. return smalltalk.withContext(function($ctx1) { return ["ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:", "ifNil:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil"];
  21577. }, function($ctx1) {$ctx1.fill(self,"inlinedSelectors",{}, smalltalk.IRSendInliner.klass)})},
  21578. args: [],
  21579. source: "inlinedSelectors\x0a\x09^ #('ifTrue:' 'ifFalse:' 'ifTrue:ifFalse:' 'ifFalse:ifTrue:' 'ifNil:' 'ifNotNil:' 'ifNil:ifNotNil:' 'ifNotNil:ifNil')",
  21580. messageSends: [],
  21581. referencedClasses: []
  21582. }),
  21583. smalltalk.IRSendInliner.klass);
  21584. smalltalk.addMethod(
  21585. "_shouldInline_",
  21586. smalltalk.method({
  21587. selector: "shouldInline:",
  21588. category: 'accessing',
  21589. fn: function (anIRInstruction){
  21590. var self=this;
  21591. return smalltalk.withContext(function($ctx1) { var $1,$2;
  21592. var $early={};
  21593. try {
  21594. $1=_st(_st(self)._inlinedSelectors())._includes_(_st(anIRInstruction)._selector());
  21595. if(! smalltalk.assert($1)){
  21596. return false;
  21597. };
  21598. _st(_st(_st(anIRInstruction)._instructions())._allButFirst())._do_((function(each){
  21599. return smalltalk.withContext(function($ctx2) { $2=_st(each)._isClosure();
  21600. if(! smalltalk.assert($2)){
  21601. throw $early=[false];
  21602. };
  21603. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  21604. return true;
  21605. }
  21606. catch(e) {if(e===$early)return e[0]; throw e}
  21607. }, function($ctx1) {$ctx1.fill(self,"shouldInline:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner.klass)})},
  21608. args: ["anIRInstruction"],
  21609. source: "shouldInline: anIRInstruction\x0a\x09(self inlinedSelectors includes: anIRInstruction selector) ifFalse: [ ^ false ].\x0a\x09anIRInstruction instructions allButFirst do: [ :each |\x0a\x09\x09each isClosure ifFalse: [ ^ false ]].\x0a\x09^ true",
  21610. messageSends: ["ifFalse:", "includes:", "selector", "inlinedSelectors", "do:", "isClosure", "allButFirst", "instructions"],
  21611. referencedClasses: []
  21612. }),
  21613. smalltalk.IRSendInliner.klass);
  21614. smalltalk.addClass('IRAssignmentInliner', smalltalk.IRSendInliner, ['assignment'], 'Compiler-Inlining');
  21615. smalltalk.IRAssignmentInliner.comment="I inline message sends together with assignments by moving them around into the inline closure instructions. \x0a\x0a##Example\x0a\x0a\x09foo\x0a\x09\x09| a |\x0a\x09\x09a := true ifTrue: [ 1 ]\x0a\x0aWill produce:\x0a\x0a\x09if(smalltalk.assert(true) {\x0a\x09\x09a = 1;\x0a\x09};"
  21616. smalltalk.addMethod(
  21617. "_assignment",
  21618. smalltalk.method({
  21619. selector: "assignment",
  21620. category: 'accessing',
  21621. fn: function (){
  21622. var self=this;
  21623. return smalltalk.withContext(function($ctx1) { var $1;
  21624. $1=self["@assignment"];
  21625. return $1;
  21626. }, function($ctx1) {$ctx1.fill(self,"assignment",{}, smalltalk.IRAssignmentInliner)})},
  21627. args: [],
  21628. source: "assignment\x0a\x09^ assignment",
  21629. messageSends: [],
  21630. referencedClasses: []
  21631. }),
  21632. smalltalk.IRAssignmentInliner);
  21633. smalltalk.addMethod(
  21634. "_assignment_",
  21635. smalltalk.method({
  21636. selector: "assignment:",
  21637. category: 'accessing',
  21638. fn: function (aNode){
  21639. var self=this;
  21640. return smalltalk.withContext(function($ctx1) { self["@assignment"]=aNode;
  21641. return self}, function($ctx1) {$ctx1.fill(self,"assignment:",{aNode:aNode}, smalltalk.IRAssignmentInliner)})},
  21642. args: ["aNode"],
  21643. source: "assignment: aNode\x0a\x09assignment := aNode",
  21644. messageSends: [],
  21645. referencedClasses: []
  21646. }),
  21647. smalltalk.IRAssignmentInliner);
  21648. smalltalk.addMethod(
  21649. "_inlineAssignment_",
  21650. smalltalk.method({
  21651. selector: "inlineAssignment:",
  21652. category: 'inlining',
  21653. fn: function (anIRAssignment){
  21654. var self=this;
  21655. var inlinedAssignment;
  21656. return smalltalk.withContext(function($ctx1) { var $1;
  21657. _st(self)._assignment_(anIRAssignment);
  21658. inlinedAssignment=_st((smalltalk.IRInlinedAssignment || IRInlinedAssignment))._new();
  21659. _st(_st(anIRAssignment)._instructions())._do_((function(each){
  21660. return smalltalk.withContext(function($ctx2) { return _st(inlinedAssignment)._add_(each);
  21661. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  21662. _st(anIRAssignment)._replaceWith_(inlinedAssignment);
  21663. _st(self)._inlineSend_(_st(_st(inlinedAssignment)._instructions())._last());
  21664. $1=inlinedAssignment;
  21665. return $1;
  21666. }, function($ctx1) {$ctx1.fill(self,"inlineAssignment:",{anIRAssignment:anIRAssignment,inlinedAssignment:inlinedAssignment}, smalltalk.IRAssignmentInliner)})},
  21667. args: ["anIRAssignment"],
  21668. source: "inlineAssignment: anIRAssignment\x0a\x09| inlinedAssignment |\x0a\x09self assignment: anIRAssignment.\x0a\x09inlinedAssignment := IRInlinedAssignment new.\x0a\x09anIRAssignment instructions do: [ :each |\x0a\x09\x09inlinedAssignment add: each ].\x0a\x09anIRAssignment replaceWith: inlinedAssignment.\x0a\x09self inlineSend: inlinedAssignment instructions last.\x0a\x09^ inlinedAssignment",
  21669. messageSends: ["assignment:", "new", "do:", "add:", "instructions", "replaceWith:", "inlineSend:", "last"],
  21670. referencedClasses: ["IRInlinedAssignment"]
  21671. }),
  21672. smalltalk.IRAssignmentInliner);
  21673. smalltalk.addMethod(
  21674. "_inlineClosure_",
  21675. smalltalk.method({
  21676. selector: "inlineClosure:",
  21677. category: 'inlining',
  21678. fn: function (anIRClosure){
  21679. var self=this;
  21680. var inlinedClosure,statements;
  21681. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  21682. inlinedClosure=smalltalk.IRSendInliner.fn.prototype._inlineClosure_.apply(_st(self), [anIRClosure]);
  21683. statements=_st(_st(_st(inlinedClosure)._instructions())._last())._instructions();
  21684. _st(statements)._ifNotEmpty_((function(){
  21685. return smalltalk.withContext(function($ctx2) { $1=_st(_st(statements)._last())._canBeAssigned();
  21686. if(smalltalk.assert($1)){
  21687. $2=_st((smalltalk.IRAssignment || IRAssignment))._new();
  21688. _st($2)._add_(_st(_st(_st(self)._assignment())._instructions())._first());
  21689. _st($2)._add_(_st(_st(statements)._last())._copy());
  21690. $3=_st($2)._yourself();
  21691. return _st(_st(statements)._last())._replaceWith_($3);
  21692. };
  21693. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21694. $4=inlinedClosure;
  21695. return $4;
  21696. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,statements:statements}, smalltalk.IRAssignmentInliner)})},
  21697. args: ["anIRClosure"],
  21698. source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last canBeAssigned ifTrue: [\x0a\x09\x09\x09statements last replaceWith: (IRAssignment new\x0a\x09\x09\x09\x09add: self assignment instructions first;\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself) ] ].\x0a\x0a\x09^ inlinedClosure",
  21699. messageSends: ["inlineClosure:", "instructions", "last", "ifNotEmpty:", "ifTrue:", "replaceWith:", "add:", "first", "assignment", "new", "copy", "yourself", "canBeAssigned"],
  21700. referencedClasses: ["IRAssignment"]
  21701. }),
  21702. smalltalk.IRAssignmentInliner);
  21703. smalltalk.addClass('IRNonLocalReturnInliner', smalltalk.IRSendInliner, [], 'Compiler-Inlining');
  21704. smalltalk.addMethod(
  21705. "_inlineClosure_",
  21706. smalltalk.method({
  21707. selector: "inlineClosure:",
  21708. category: 'inlining',
  21709. fn: function (anIRClosure){
  21710. var self=this;
  21711. return smalltalk.withContext(function($ctx1) { var $1;
  21712. $1=smalltalk.IRSendInliner.fn.prototype._inlineCLosure_.apply(_st(self), [anIRClosure]);
  21713. return $1;
  21714. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure}, smalltalk.IRNonLocalReturnInliner)})},
  21715. args: ["anIRClosure"],
  21716. source: "inlineClosure: anIRClosure\x0a\x09\x22| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last replaceWith: (IRNonLocalReturn new\x0a\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09^ inlinedClosure\x22\x0a\x0a\x09^ super inlineCLosure: anIRClosure",
  21717. messageSends: ["inlineCLosure:"],
  21718. referencedClasses: []
  21719. }),
  21720. smalltalk.IRNonLocalReturnInliner);
  21721. smalltalk.addMethod(
  21722. "_inlinedReturn",
  21723. smalltalk.method({
  21724. selector: "inlinedReturn",
  21725. category: 'factory',
  21726. fn: function (){
  21727. var self=this;
  21728. return smalltalk.withContext(function($ctx1) { var $1;
  21729. $1=_st((smalltalk.IRInlinedNonLocalReturn || IRInlinedNonLocalReturn))._new();
  21730. return $1;
  21731. }, function($ctx1) {$ctx1.fill(self,"inlinedReturn",{}, smalltalk.IRNonLocalReturnInliner)})},
  21732. args: [],
  21733. source: "inlinedReturn\x0a\x09^ IRInlinedNonLocalReturn new",
  21734. messageSends: ["new"],
  21735. referencedClasses: ["IRInlinedNonLocalReturn"]
  21736. }),
  21737. smalltalk.IRNonLocalReturnInliner);
  21738. smalltalk.addClass('IRReturnInliner', smalltalk.IRSendInliner, [], 'Compiler-Inlining');
  21739. smalltalk.IRReturnInliner.comment="I inline message sends with inlined closure together with a return instruction."
  21740. smalltalk.addMethod(
  21741. "_inlineClosure_",
  21742. smalltalk.method({
  21743. selector: "inlineClosure:",
  21744. category: 'inlining',
  21745. fn: function (anIRClosure){
  21746. var self=this;
  21747. var closure,statements;
  21748. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  21749. closure=smalltalk.IRSendInliner.fn.prototype._inlineClosure_.apply(_st(self), [anIRClosure]);
  21750. statements=_st(_st(_st(closure)._instructions())._last())._instructions();
  21751. _st(statements)._ifNotEmpty_((function(){
  21752. return smalltalk.withContext(function($ctx2) { $1=_st(_st(statements)._last())._isReturn();
  21753. if(! smalltalk.assert($1)){
  21754. $2=_st((smalltalk.IRReturn || IRReturn))._new();
  21755. _st($2)._add_(_st(_st(statements)._last())._copy());
  21756. $3=_st($2)._yourself();
  21757. return _st(_st(statements)._last())._replaceWith_($3);
  21758. };
  21759. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21760. $4=closure;
  21761. return $4;
  21762. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,closure:closure,statements:statements}, smalltalk.IRReturnInliner)})},
  21763. args: ["anIRClosure"],
  21764. source: "inlineClosure: anIRClosure\x0a\x09| closure statements |\x0a\x0a\x09closure := super inlineClosure: anIRClosure.\x0a\x09statements := closure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last isReturn\x0a\x09\x09\x09ifFalse: [ statements last replaceWith: (IRReturn new\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself)] ].\x0a\x0a\x09^ closure",
  21765. messageSends: ["inlineClosure:", "instructions", "last", "ifNotEmpty:", "ifFalse:", "replaceWith:", "add:", "copy", "new", "yourself", "isReturn"],
  21766. referencedClasses: ["IRReturn"]
  21767. }),
  21768. smalltalk.IRReturnInliner);
  21769. smalltalk.addMethod(
  21770. "_inlineReturn_",
  21771. smalltalk.method({
  21772. selector: "inlineReturn:",
  21773. category: 'inlining',
  21774. fn: function (anIRReturn){
  21775. var self=this;
  21776. var return_;
  21777. return smalltalk.withContext(function($ctx1) { var $1;
  21778. return_=_st(self)._inlinedReturn();
  21779. _st(_st(anIRReturn)._instructions())._do_((function(each){
  21780. return smalltalk.withContext(function($ctx2) { return _st(return_)._add_(each);
  21781. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  21782. _st(anIRReturn)._replaceWith_(return_);
  21783. _st(self)._inlineSend_(_st(_st(return_)._instructions())._last());
  21784. $1=return_;
  21785. return $1;
  21786. }, function($ctx1) {$ctx1.fill(self,"inlineReturn:",{anIRReturn:anIRReturn,return_:return_}, smalltalk.IRReturnInliner)})},
  21787. args: ["anIRReturn"],
  21788. source: "inlineReturn: anIRReturn\x0a\x09| return |\x0a\x09return := self inlinedReturn.\x0a\x09anIRReturn instructions do: [ :each |\x0a\x09\x09return add: each ].\x0a\x09anIRReturn replaceWith: return.\x0a\x09self inlineSend: return instructions last.\x0a\x09^ return",
  21789. messageSends: ["inlinedReturn", "do:", "add:", "instructions", "replaceWith:", "inlineSend:", "last"],
  21790. referencedClasses: []
  21791. }),
  21792. smalltalk.IRReturnInliner);
  21793. smalltalk.addMethod(
  21794. "_inlinedReturn",
  21795. smalltalk.method({
  21796. selector: "inlinedReturn",
  21797. category: 'factory',
  21798. fn: function (){
  21799. var self=this;
  21800. return smalltalk.withContext(function($ctx1) { var $1;
  21801. $1=_st((smalltalk.IRInlinedReturn || IRInlinedReturn))._new();
  21802. return $1;
  21803. }, function($ctx1) {$ctx1.fill(self,"inlinedReturn",{}, smalltalk.IRReturnInliner)})},
  21804. args: [],
  21805. source: "inlinedReturn\x0a\x09^ IRInlinedReturn new",
  21806. messageSends: ["new"],
  21807. referencedClasses: ["IRInlinedReturn"]
  21808. }),
  21809. smalltalk.IRReturnInliner);
  21810. smalltalk.addClass('InliningCodeGenerator', smalltalk.CodeGenerator, [], 'Compiler-Inlining');
  21811. smalltalk.InliningCodeGenerator.comment="I am a specialized code generator that uses inlining to produce more optimized JavaScript output"
  21812. smalltalk.addMethod(
  21813. "_compileNode_",
  21814. smalltalk.method({
  21815. selector: "compileNode:",
  21816. category: 'compiling',
  21817. fn: function (aNode){
  21818. var self=this;
  21819. var ir,stream;
  21820. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  21821. _st(_st(self)._semanticAnalyzer())._visit_(aNode);
  21822. ir=_st(_st(self)._translator())._visit_(aNode);
  21823. _st(_st(self)._inliner())._visit_(ir);
  21824. $2=_st(self)._irTranslator();
  21825. _st($2)._visit_(ir);
  21826. $3=_st($2)._contents();
  21827. $1=$3;
  21828. return $1;
  21829. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream}, smalltalk.InliningCodeGenerator)})},
  21830. args: ["aNode"],
  21831. source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09self inliner visit: ir.\x0a\x0a\x09^ self irTranslator\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
  21832. messageSends: ["visit:", "semanticAnalyzer", "translator", "inliner", "irTranslator", "contents"],
  21833. referencedClasses: []
  21834. }),
  21835. smalltalk.InliningCodeGenerator);
  21836. smalltalk.addMethod(
  21837. "_inliner",
  21838. smalltalk.method({
  21839. selector: "inliner",
  21840. category: 'compiling',
  21841. fn: function (){
  21842. var self=this;
  21843. return smalltalk.withContext(function($ctx1) { var $1;
  21844. $1=_st((smalltalk.IRInliner || IRInliner))._new();
  21845. return $1;
  21846. }, function($ctx1) {$ctx1.fill(self,"inliner",{}, smalltalk.InliningCodeGenerator)})},
  21847. args: [],
  21848. source: "inliner\x0a\x09^ IRInliner new",
  21849. messageSends: ["new"],
  21850. referencedClasses: ["IRInliner"]
  21851. }),
  21852. smalltalk.InliningCodeGenerator);
  21853. smalltalk.addMethod(
  21854. "_irTranslator",
  21855. smalltalk.method({
  21856. selector: "irTranslator",
  21857. category: 'compiling',
  21858. fn: function (){
  21859. var self=this;
  21860. return smalltalk.withContext(function($ctx1) { var $1;
  21861. $1=_st((smalltalk.IRInliningJSTranslator || IRInliningJSTranslator))._new();
  21862. return $1;
  21863. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{}, smalltalk.InliningCodeGenerator)})},
  21864. args: [],
  21865. source: "irTranslator\x0a\x09^ IRInliningJSTranslator new",
  21866. messageSends: ["new"],
  21867. referencedClasses: ["IRInliningJSTranslator"]
  21868. }),
  21869. smalltalk.InliningCodeGenerator);
  21870. smalltalk.addPackage('Compiler-Semantic', {});
  21871. smalltalk.addClass('LexicalScope', smalltalk.Object, ['node', 'instruction', 'temps', 'args', 'outerScope'], 'Compiler-Semantic');
  21872. smalltalk.LexicalScope.comment="I represent a lexical scope where variable names are associated with ScopeVars\x0aInstances are used for block scopes. Method scopes are instances of MethodLexicalScope.\x0a\x0aI am attached to a ScopeVar and method/block nodes.\x0aEach context (method/closure) get a fresh scope that inherits from its outer scope."
  21873. smalltalk.addMethod(
  21874. "_addArg_",
  21875. smalltalk.method({
  21876. selector: "addArg:",
  21877. category: 'adding',
  21878. fn: function (aString){
  21879. var self=this;
  21880. return smalltalk.withContext(function($ctx1) { _st(_st(self)._args())._at_put_(aString,_st((smalltalk.ArgVar || ArgVar))._on_(aString));
  21881. _st(_st(_st(self)._args())._at_(aString))._scope_(self);
  21882. return self}, function($ctx1) {$ctx1.fill(self,"addArg:",{aString:aString}, smalltalk.LexicalScope)})},
  21883. args: ["aString"],
  21884. source: "addArg: aString\x0a\x09self args at: aString put: (ArgVar on: aString).\x0a\x09(self args at: aString) scope: self",
  21885. messageSends: ["at:put:", "on:", "args", "scope:", "at:"],
  21886. referencedClasses: ["ArgVar"]
  21887. }),
  21888. smalltalk.LexicalScope);
  21889. smalltalk.addMethod(
  21890. "_addTemp_",
  21891. smalltalk.method({
  21892. selector: "addTemp:",
  21893. category: 'adding',
  21894. fn: function (aString){
  21895. var self=this;
  21896. return smalltalk.withContext(function($ctx1) { _st(_st(self)._temps())._at_put_(aString,_st((smalltalk.TempVar || TempVar))._on_(aString));
  21897. _st(_st(_st(self)._temps())._at_(aString))._scope_(self);
  21898. return self}, function($ctx1) {$ctx1.fill(self,"addTemp:",{aString:aString}, smalltalk.LexicalScope)})},
  21899. args: ["aString"],
  21900. source: "addTemp: aString\x0a\x09self temps at: aString put: (TempVar on: aString).\x0a\x09(self temps at: aString) scope: self",
  21901. messageSends: ["at:put:", "on:", "temps", "scope:", "at:"],
  21902. referencedClasses: ["TempVar"]
  21903. }),
  21904. smalltalk.LexicalScope);
  21905. smalltalk.addMethod(
  21906. "_alias",
  21907. smalltalk.method({
  21908. selector: "alias",
  21909. category: 'accessing',
  21910. fn: function (){
  21911. var self=this;
  21912. return smalltalk.withContext(function($ctx1) { var $1;
  21913. $1=_st("$ctx").__comma(_st(_st(self)._scopeLevel())._asString());
  21914. return $1;
  21915. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.LexicalScope)})},
  21916. args: [],
  21917. source: "alias\x0a\x09^ '$ctx', self scopeLevel asString",
  21918. messageSends: [",", "asString", "scopeLevel"],
  21919. referencedClasses: []
  21920. }),
  21921. smalltalk.LexicalScope);
  21922. smalltalk.addMethod(
  21923. "_allVariableNames",
  21924. smalltalk.method({
  21925. selector: "allVariableNames",
  21926. category: 'accessing',
  21927. fn: function (){
  21928. var self=this;
  21929. return smalltalk.withContext(function($ctx1) { var $1;
  21930. $1=_st(_st(_st(self)._args())._keys()).__comma(_st(_st(self)._temps())._keys());
  21931. return $1;
  21932. }, function($ctx1) {$ctx1.fill(self,"allVariableNames",{}, smalltalk.LexicalScope)})},
  21933. args: [],
  21934. source: "allVariableNames\x0a\x09^ self args keys, self temps keys",
  21935. messageSends: [",", "keys", "temps", "args"],
  21936. referencedClasses: []
  21937. }),
  21938. smalltalk.LexicalScope);
  21939. smalltalk.addMethod(
  21940. "_args",
  21941. smalltalk.method({
  21942. selector: "args",
  21943. category: 'accessing',
  21944. fn: function (){
  21945. var self=this;
  21946. return smalltalk.withContext(function($ctx1) { var $2,$1;
  21947. $2=self["@args"];
  21948. if(($receiver = $2) == nil || $receiver == undefined){
  21949. self["@args"]=_st((smalltalk.Dictionary || Dictionary))._new();
  21950. $1=self["@args"];
  21951. } else {
  21952. $1=$2;
  21953. };
  21954. return $1;
  21955. }, function($ctx1) {$ctx1.fill(self,"args",{}, smalltalk.LexicalScope)})},
  21956. args: [],
  21957. source: "args\x0a\x09^ args ifNil: [ args := Dictionary new ]",
  21958. messageSends: ["ifNil:", "new"],
  21959. referencedClasses: ["Dictionary"]
  21960. }),
  21961. smalltalk.LexicalScope);
  21962. smalltalk.addMethod(
  21963. "_bindingFor_",
  21964. smalltalk.method({
  21965. selector: "bindingFor:",
  21966. category: 'accessing',
  21967. fn: function (aStringOrNode){
  21968. var self=this;
  21969. return smalltalk.withContext(function($ctx1) { var $1;
  21970. $1=_st(_st(self)._pseudoVars())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  21971. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._args())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  21972. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._temps())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  21973. return smalltalk.withContext(function($ctx4) { return nil;
  21974. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  21975. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  21976. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21977. return $1;
  21978. }, function($ctx1) {$ctx1.fill(self,"bindingFor:",{aStringOrNode:aStringOrNode}, smalltalk.LexicalScope)})},
  21979. args: ["aStringOrNode"],
  21980. source: "bindingFor: aStringOrNode\x0a\x09^ self pseudoVars at: aStringOrNode value ifAbsent: [ \x0a\x09\x09self args at: aStringOrNode value ifAbsent: [\x0a\x09\x09\x09self temps at: aStringOrNode value ifAbsent: [ nil ]]]",
  21981. messageSends: ["at:ifAbsent:", "value", "temps", "args", "pseudoVars"],
  21982. referencedClasses: []
  21983. }),
  21984. smalltalk.LexicalScope);
  21985. smalltalk.addMethod(
  21986. "_canInlineNonLocalReturns",
  21987. smalltalk.method({
  21988. selector: "canInlineNonLocalReturns",
  21989. category: 'testing',
  21990. fn: function (){
  21991. var self=this;
  21992. return smalltalk.withContext(function($ctx1) { var $1;
  21993. $1=_st(_st(self)._isInlined())._and_((function(){
  21994. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._outerScope())._canInlineNonLocalReturns();
  21995. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  21996. return $1;
  21997. }, function($ctx1) {$ctx1.fill(self,"canInlineNonLocalReturns",{}, smalltalk.LexicalScope)})},
  21998. args: [],
  21999. source: "canInlineNonLocalReturns\x0a\x09^ self isInlined and: [ self outerScope canInlineNonLocalReturns ]",
  22000. messageSends: ["and:", "canInlineNonLocalReturns", "outerScope", "isInlined"],
  22001. referencedClasses: []
  22002. }),
  22003. smalltalk.LexicalScope);
  22004. smalltalk.addMethod(
  22005. "_instruction",
  22006. smalltalk.method({
  22007. selector: "instruction",
  22008. category: 'accessing',
  22009. fn: function (){
  22010. var self=this;
  22011. return smalltalk.withContext(function($ctx1) { var $1;
  22012. $1=self["@instruction"];
  22013. return $1;
  22014. }, function($ctx1) {$ctx1.fill(self,"instruction",{}, smalltalk.LexicalScope)})},
  22015. args: [],
  22016. source: "instruction\x0a\x09^ instruction",
  22017. messageSends: [],
  22018. referencedClasses: []
  22019. }),
  22020. smalltalk.LexicalScope);
  22021. smalltalk.addMethod(
  22022. "_instruction_",
  22023. smalltalk.method({
  22024. selector: "instruction:",
  22025. category: 'accessing',
  22026. fn: function (anIRInstruction){
  22027. var self=this;
  22028. return smalltalk.withContext(function($ctx1) { self["@instruction"]=anIRInstruction;
  22029. return self}, function($ctx1) {$ctx1.fill(self,"instruction:",{anIRInstruction:anIRInstruction}, smalltalk.LexicalScope)})},
  22030. args: ["anIRInstruction"],
  22031. source: "instruction: anIRInstruction\x0a\x09instruction := anIRInstruction",
  22032. messageSends: [],
  22033. referencedClasses: []
  22034. }),
  22035. smalltalk.LexicalScope);
  22036. smalltalk.addMethod(
  22037. "_isBlockScope",
  22038. smalltalk.method({
  22039. selector: "isBlockScope",
  22040. category: 'testing',
  22041. fn: function (){
  22042. var self=this;
  22043. return smalltalk.withContext(function($ctx1) { var $1;
  22044. $1=_st(_st(self)._isMethodScope())._not();
  22045. return $1;
  22046. }, function($ctx1) {$ctx1.fill(self,"isBlockScope",{}, smalltalk.LexicalScope)})},
  22047. args: [],
  22048. source: "isBlockScope\x0a\x09^ self isMethodScope not",
  22049. messageSends: ["not", "isMethodScope"],
  22050. referencedClasses: []
  22051. }),
  22052. smalltalk.LexicalScope);
  22053. smalltalk.addMethod(
  22054. "_isInlined",
  22055. smalltalk.method({
  22056. selector: "isInlined",
  22057. category: 'testing',
  22058. fn: function (){
  22059. var self=this;
  22060. return smalltalk.withContext(function($ctx1) { var $1;
  22061. $1=_st(_st(_st(self)._instruction())._notNil())._and_((function(){
  22062. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._instruction())._isInlined();
  22063. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  22064. return $1;
  22065. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.LexicalScope)})},
  22066. args: [],
  22067. source: "isInlined\x0a\x09^ self instruction notNil and: [\x0a \x09self instruction isInlined ]",
  22068. messageSends: ["and:", "isInlined", "instruction", "notNil"],
  22069. referencedClasses: []
  22070. }),
  22071. smalltalk.LexicalScope);
  22072. smalltalk.addMethod(
  22073. "_isMethodScope",
  22074. smalltalk.method({
  22075. selector: "isMethodScope",
  22076. category: 'testing',
  22077. fn: function (){
  22078. var self=this;
  22079. return smalltalk.withContext(function($ctx1) { return false;
  22080. }, function($ctx1) {$ctx1.fill(self,"isMethodScope",{}, smalltalk.LexicalScope)})},
  22081. args: [],
  22082. source: "isMethodScope\x0a\x09^ false",
  22083. messageSends: [],
  22084. referencedClasses: []
  22085. }),
  22086. smalltalk.LexicalScope);
  22087. smalltalk.addMethod(
  22088. "_lookupVariable_",
  22089. smalltalk.method({
  22090. selector: "lookupVariable:",
  22091. category: 'accessing',
  22092. fn: function (aNode){
  22093. var self=this;
  22094. var lookup;
  22095. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  22096. lookup=_st(self)._bindingFor_(aNode);
  22097. $1=lookup;
  22098. if(($receiver = $1) == nil || $receiver == undefined){
  22099. $2=_st(self)._outerScope();
  22100. if(($receiver = $2) == nil || $receiver == undefined){
  22101. lookup=$2;
  22102. } else {
  22103. lookup=_st(_st(self)._outerScope())._lookupVariable_(aNode);
  22104. };
  22105. lookup;
  22106. } else {
  22107. $1;
  22108. };
  22109. $3=lookup;
  22110. return $3;
  22111. }, function($ctx1) {$ctx1.fill(self,"lookupVariable:",{aNode:aNode,lookup:lookup}, smalltalk.LexicalScope)})},
  22112. args: ["aNode"],
  22113. source: "lookupVariable: aNode\x0a\x09| lookup |\x0a\x09lookup := (self bindingFor: aNode).\x0a\x09lookup ifNil: [\x0a\x09\x09lookup := self outerScope ifNotNil: [ \x0a\x09\x09\x09(self outerScope lookupVariable: aNode) ]].\x0a\x09^ lookup",
  22114. messageSends: ["bindingFor:", "ifNil:", "ifNotNil:", "lookupVariable:", "outerScope"],
  22115. referencedClasses: []
  22116. }),
  22117. smalltalk.LexicalScope);
  22118. smalltalk.addMethod(
  22119. "_methodScope",
  22120. smalltalk.method({
  22121. selector: "methodScope",
  22122. category: 'accessing',
  22123. fn: function (){
  22124. var self=this;
  22125. return smalltalk.withContext(function($ctx1) { var $2,$1;
  22126. $2=_st(self)._outerScope();
  22127. if(($receiver = $2) == nil || $receiver == undefined){
  22128. $1=$2;
  22129. } else {
  22130. $1=_st(_st(self)._outerScope())._methodScope();
  22131. };
  22132. return $1;
  22133. }, function($ctx1) {$ctx1.fill(self,"methodScope",{}, smalltalk.LexicalScope)})},
  22134. args: [],
  22135. source: "methodScope\x0a\x09^ self outerScope ifNotNil: [\x0a\x09\x09self outerScope methodScope ]",
  22136. messageSends: ["ifNotNil:", "methodScope", "outerScope"],
  22137. referencedClasses: []
  22138. }),
  22139. smalltalk.LexicalScope);
  22140. smalltalk.addMethod(
  22141. "_node",
  22142. smalltalk.method({
  22143. selector: "node",
  22144. category: 'accessing',
  22145. fn: function (){
  22146. var self=this;
  22147. return smalltalk.withContext(function($ctx1) { var $1;
  22148. $1=self["@node"];
  22149. return $1;
  22150. }, function($ctx1) {$ctx1.fill(self,"node",{}, smalltalk.LexicalScope)})},
  22151. args: [],
  22152. source: "node\x0a\x09\x22Answer the node in which I am defined\x22\x0a\x09\x0a\x09^ node",
  22153. messageSends: [],
  22154. referencedClasses: []
  22155. }),
  22156. smalltalk.LexicalScope);
  22157. smalltalk.addMethod(
  22158. "_node_",
  22159. smalltalk.method({
  22160. selector: "node:",
  22161. category: 'accessing',
  22162. fn: function (aNode){
  22163. var self=this;
  22164. return smalltalk.withContext(function($ctx1) { self["@node"]=aNode;
  22165. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode}, smalltalk.LexicalScope)})},
  22166. args: ["aNode"],
  22167. source: "node: aNode\x0a\x09node := aNode",
  22168. messageSends: [],
  22169. referencedClasses: []
  22170. }),
  22171. smalltalk.LexicalScope);
  22172. smalltalk.addMethod(
  22173. "_outerScope",
  22174. smalltalk.method({
  22175. selector: "outerScope",
  22176. category: 'accessing',
  22177. fn: function (){
  22178. var self=this;
  22179. return smalltalk.withContext(function($ctx1) { var $1;
  22180. $1=self["@outerScope"];
  22181. return $1;
  22182. }, function($ctx1) {$ctx1.fill(self,"outerScope",{}, smalltalk.LexicalScope)})},
  22183. args: [],
  22184. source: "outerScope\x0a\x09^ outerScope",
  22185. messageSends: [],
  22186. referencedClasses: []
  22187. }),
  22188. smalltalk.LexicalScope);
  22189. smalltalk.addMethod(
  22190. "_outerScope_",
  22191. smalltalk.method({
  22192. selector: "outerScope:",
  22193. category: 'accessing',
  22194. fn: function (aLexicalScope){
  22195. var self=this;
  22196. return smalltalk.withContext(function($ctx1) { self["@outerScope"]=aLexicalScope;
  22197. return self}, function($ctx1) {$ctx1.fill(self,"outerScope:",{aLexicalScope:aLexicalScope}, smalltalk.LexicalScope)})},
  22198. args: ["aLexicalScope"],
  22199. source: "outerScope: aLexicalScope\x0a\x09outerScope := aLexicalScope",
  22200. messageSends: [],
  22201. referencedClasses: []
  22202. }),
  22203. smalltalk.LexicalScope);
  22204. smalltalk.addMethod(
  22205. "_pseudoVars",
  22206. smalltalk.method({
  22207. selector: "pseudoVars",
  22208. category: 'accessing',
  22209. fn: function (){
  22210. var self=this;
  22211. return smalltalk.withContext(function($ctx1) { var $1;
  22212. $1=_st(_st(self)._methodScope())._pseudoVars();
  22213. return $1;
  22214. }, function($ctx1) {$ctx1.fill(self,"pseudoVars",{}, smalltalk.LexicalScope)})},
  22215. args: [],
  22216. source: "pseudoVars\x0a\x09^ self methodScope pseudoVars",
  22217. messageSends: ["pseudoVars", "methodScope"],
  22218. referencedClasses: []
  22219. }),
  22220. smalltalk.LexicalScope);
  22221. smalltalk.addMethod(
  22222. "_scopeLevel",
  22223. smalltalk.method({
  22224. selector: "scopeLevel",
  22225. category: 'accessing',
  22226. fn: function (){
  22227. var self=this;
  22228. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  22229. $1=_st(self)._outerScope();
  22230. if(($receiver = $1) == nil || $receiver == undefined){
  22231. return (1);
  22232. } else {
  22233. $1;
  22234. };
  22235. $2=_st(self)._isInlined();
  22236. if(smalltalk.assert($2)){
  22237. $3=_st(_st(self)._outerScope())._scopeLevel();
  22238. return $3;
  22239. };
  22240. $4=_st(_st(_st(self)._outerScope())._scopeLevel()).__plus((1));
  22241. return $4;
  22242. }, function($ctx1) {$ctx1.fill(self,"scopeLevel",{}, smalltalk.LexicalScope)})},
  22243. args: [],
  22244. source: "scopeLevel\x0a\x09self outerScope ifNil: [ ^ 1 ].\x0a\x09self isInlined ifTrue: [ ^ self outerScope scopeLevel ].\x0a \x0a\x09^ self outerScope scopeLevel + 1",
  22245. messageSends: ["ifNil:", "outerScope", "ifTrue:", "scopeLevel", "isInlined", "+"],
  22246. referencedClasses: []
  22247. }),
  22248. smalltalk.LexicalScope);
  22249. smalltalk.addMethod(
  22250. "_temps",
  22251. smalltalk.method({
  22252. selector: "temps",
  22253. category: 'accessing',
  22254. fn: function (){
  22255. var self=this;
  22256. return smalltalk.withContext(function($ctx1) { var $2,$1;
  22257. $2=self["@temps"];
  22258. if(($receiver = $2) == nil || $receiver == undefined){
  22259. self["@temps"]=_st((smalltalk.Dictionary || Dictionary))._new();
  22260. $1=self["@temps"];
  22261. } else {
  22262. $1=$2;
  22263. };
  22264. return $1;
  22265. }, function($ctx1) {$ctx1.fill(self,"temps",{}, smalltalk.LexicalScope)})},
  22266. args: [],
  22267. source: "temps\x0a\x09^ temps ifNil: [ temps := Dictionary new ]",
  22268. messageSends: ["ifNil:", "new"],
  22269. referencedClasses: ["Dictionary"]
  22270. }),
  22271. smalltalk.LexicalScope);
  22272. smalltalk.addClass('MethodLexicalScope', smalltalk.LexicalScope, ['iVars', 'pseudoVars', 'unknownVariables', 'localReturn', 'nonLocalReturns'], 'Compiler-Semantic');
  22273. smalltalk.MethodLexicalScope.comment="I represent a method scope."
  22274. smalltalk.addMethod(
  22275. "_addIVar_",
  22276. smalltalk.method({
  22277. selector: "addIVar:",
  22278. category: 'adding',
  22279. fn: function (aString){
  22280. var self=this;
  22281. return smalltalk.withContext(function($ctx1) { _st(_st(self)._iVars())._at_put_(aString,_st((smalltalk.InstanceVar || InstanceVar))._on_(aString));
  22282. _st(_st(_st(self)._iVars())._at_(aString))._scope_(self);
  22283. return self}, function($ctx1) {$ctx1.fill(self,"addIVar:",{aString:aString}, smalltalk.MethodLexicalScope)})},
  22284. args: ["aString"],
  22285. source: "addIVar: aString\x0a\x09self iVars at: aString put: (InstanceVar on: aString).\x0a\x09(self iVars at: aString) scope: self",
  22286. messageSends: ["at:put:", "on:", "iVars", "scope:", "at:"],
  22287. referencedClasses: ["InstanceVar"]
  22288. }),
  22289. smalltalk.MethodLexicalScope);
  22290. smalltalk.addMethod(
  22291. "_addNonLocalReturn_",
  22292. smalltalk.method({
  22293. selector: "addNonLocalReturn:",
  22294. category: 'adding',
  22295. fn: function (aScope){
  22296. var self=this;
  22297. return smalltalk.withContext(function($ctx1) { _st(_st(self)._nonLocalReturns())._add_(aScope);
  22298. return self}, function($ctx1) {$ctx1.fill(self,"addNonLocalReturn:",{aScope:aScope}, smalltalk.MethodLexicalScope)})},
  22299. args: ["aScope"],
  22300. source: "addNonLocalReturn: aScope\x0a\x09self nonLocalReturns add: aScope",
  22301. messageSends: ["add:", "nonLocalReturns"],
  22302. referencedClasses: []
  22303. }),
  22304. smalltalk.MethodLexicalScope);
  22305. smalltalk.addMethod(
  22306. "_allVariableNames",
  22307. smalltalk.method({
  22308. selector: "allVariableNames",
  22309. category: 'accessing',
  22310. fn: function (){
  22311. var self=this;
  22312. return smalltalk.withContext(function($ctx1) { var $1;
  22313. $1=_st(smalltalk.LexicalScope.fn.prototype._allVariableNames.apply(_st(self), [])).__comma(_st(_st(self)._iVars())._keys());
  22314. return $1;
  22315. }, function($ctx1) {$ctx1.fill(self,"allVariableNames",{}, smalltalk.MethodLexicalScope)})},
  22316. args: [],
  22317. source: "allVariableNames\x0a\x09^ super allVariableNames, self iVars keys",
  22318. messageSends: [",", "keys", "iVars", "allVariableNames"],
  22319. referencedClasses: []
  22320. }),
  22321. smalltalk.MethodLexicalScope);
  22322. smalltalk.addMethod(
  22323. "_bindingFor_",
  22324. smalltalk.method({
  22325. selector: "bindingFor:",
  22326. category: 'accessing',
  22327. fn: function (aNode){
  22328. var self=this;
  22329. return smalltalk.withContext(function($ctx1) { var $2,$1;
  22330. $2=smalltalk.LexicalScope.fn.prototype._bindingFor_.apply(_st(self), [aNode]);
  22331. if(($receiver = $2) == nil || $receiver == undefined){
  22332. $1=_st(_st(self)._iVars())._at_ifAbsent_(_st(aNode)._value(),(function(){
  22333. return smalltalk.withContext(function($ctx2) { return nil;
  22334. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  22335. } else {
  22336. $1=$2;
  22337. };
  22338. return $1;
  22339. }, function($ctx1) {$ctx1.fill(self,"bindingFor:",{aNode:aNode}, smalltalk.MethodLexicalScope)})},
  22340. args: ["aNode"],
  22341. source: "bindingFor: aNode\x0a\x09^ (super bindingFor: aNode) ifNil: [\x0a\x09\x09self iVars at: aNode value ifAbsent: [ nil ]]",
  22342. messageSends: ["ifNil:", "at:ifAbsent:", "value", "iVars", "bindingFor:"],
  22343. referencedClasses: []
  22344. }),
  22345. smalltalk.MethodLexicalScope);
  22346. smalltalk.addMethod(
  22347. "_canInlineNonLocalReturns",
  22348. smalltalk.method({
  22349. selector: "canInlineNonLocalReturns",
  22350. category: 'testing',
  22351. fn: function (){
  22352. var self=this;
  22353. return smalltalk.withContext(function($ctx1) { return true;
  22354. }, function($ctx1) {$ctx1.fill(self,"canInlineNonLocalReturns",{}, smalltalk.MethodLexicalScope)})},
  22355. args: [],
  22356. source: "canInlineNonLocalReturns\x0a\x09^ true",
  22357. messageSends: [],
  22358. referencedClasses: []
  22359. }),
  22360. smalltalk.MethodLexicalScope);
  22361. smalltalk.addMethod(
  22362. "_hasLocalReturn",
  22363. smalltalk.method({
  22364. selector: "hasLocalReturn",
  22365. category: 'testing',
  22366. fn: function (){
  22367. var self=this;
  22368. return smalltalk.withContext(function($ctx1) { var $1;
  22369. $1=_st(self)._localReturn();
  22370. return $1;
  22371. }, function($ctx1) {$ctx1.fill(self,"hasLocalReturn",{}, smalltalk.MethodLexicalScope)})},
  22372. args: [],
  22373. source: "hasLocalReturn\x0a\x09^ self localReturn",
  22374. messageSends: ["localReturn"],
  22375. referencedClasses: []
  22376. }),
  22377. smalltalk.MethodLexicalScope);
  22378. smalltalk.addMethod(
  22379. "_hasNonLocalReturn",
  22380. smalltalk.method({
  22381. selector: "hasNonLocalReturn",
  22382. category: 'testing',
  22383. fn: function (){
  22384. var self=this;
  22385. return smalltalk.withContext(function($ctx1) { var $1;
  22386. $1=_st(_st(self)._nonLocalReturns())._notEmpty();
  22387. return $1;
  22388. }, function($ctx1) {$ctx1.fill(self,"hasNonLocalReturn",{}, smalltalk.MethodLexicalScope)})},
  22389. args: [],
  22390. source: "hasNonLocalReturn\x0a\x09^ self nonLocalReturns notEmpty",
  22391. messageSends: ["notEmpty", "nonLocalReturns"],
  22392. referencedClasses: []
  22393. }),
  22394. smalltalk.MethodLexicalScope);
  22395. smalltalk.addMethod(
  22396. "_iVars",
  22397. smalltalk.method({
  22398. selector: "iVars",
  22399. category: 'accessing',
  22400. fn: function (){
  22401. var self=this;
  22402. return smalltalk.withContext(function($ctx1) { var $2,$1;
  22403. $2=self["@iVars"];
  22404. if(($receiver = $2) == nil || $receiver == undefined){
  22405. self["@iVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
  22406. $1=self["@iVars"];
  22407. } else {
  22408. $1=$2;
  22409. };
  22410. return $1;
  22411. }, function($ctx1) {$ctx1.fill(self,"iVars",{}, smalltalk.MethodLexicalScope)})},
  22412. args: [],
  22413. source: "iVars\x0a\x09^ iVars ifNil: [ iVars := Dictionary new ]",
  22414. messageSends: ["ifNil:", "new"],
  22415. referencedClasses: ["Dictionary"]
  22416. }),
  22417. smalltalk.MethodLexicalScope);
  22418. smalltalk.addMethod(
  22419. "_isMethodScope",
  22420. smalltalk.method({
  22421. selector: "isMethodScope",
  22422. category: 'testing',
  22423. fn: function (){
  22424. var self=this;
  22425. return smalltalk.withContext(function($ctx1) { return true;
  22426. }, function($ctx1) {$ctx1.fill(self,"isMethodScope",{}, smalltalk.MethodLexicalScope)})},
  22427. args: [],
  22428. source: "isMethodScope\x0a\x09^ true",
  22429. messageSends: [],
  22430. referencedClasses: []
  22431. }),
  22432. smalltalk.MethodLexicalScope);
  22433. smalltalk.addMethod(
  22434. "_localReturn",
  22435. smalltalk.method({
  22436. selector: "localReturn",
  22437. category: 'accessing',
  22438. fn: function (){
  22439. var self=this;
  22440. return smalltalk.withContext(function($ctx1) { var $2,$1;
  22441. $2=self["@localReturn"];
  22442. if(($receiver = $2) == nil || $receiver == undefined){
  22443. $1=false;
  22444. } else {
  22445. $1=$2;
  22446. };
  22447. return $1;
  22448. }, function($ctx1) {$ctx1.fill(self,"localReturn",{}, smalltalk.MethodLexicalScope)})},
  22449. args: [],
  22450. source: "localReturn\x0a\x09^ localReturn ifNil: [ false ]",
  22451. messageSends: ["ifNil:"],
  22452. referencedClasses: []
  22453. }),
  22454. smalltalk.MethodLexicalScope);
  22455. smalltalk.addMethod(
  22456. "_localReturn_",
  22457. smalltalk.method({
  22458. selector: "localReturn:",
  22459. category: 'accessing',
  22460. fn: function (aBoolean){
  22461. var self=this;
  22462. return smalltalk.withContext(function($ctx1) { self["@localReturn"]=aBoolean;
  22463. return self}, function($ctx1) {$ctx1.fill(self,"localReturn:",{aBoolean:aBoolean}, smalltalk.MethodLexicalScope)})},
  22464. args: ["aBoolean"],
  22465. source: "localReturn: aBoolean\x0a\x09localReturn := aBoolean",
  22466. messageSends: [],
  22467. referencedClasses: []
  22468. }),
  22469. smalltalk.MethodLexicalScope);
  22470. smalltalk.addMethod(
  22471. "_methodScope",
  22472. smalltalk.method({
  22473. selector: "methodScope",
  22474. category: 'accessing',
  22475. fn: function (){
  22476. var self=this;
  22477. return smalltalk.withContext(function($ctx1) { var $1;
  22478. $1=self;
  22479. return $1;
  22480. }, function($ctx1) {$ctx1.fill(self,"methodScope",{}, smalltalk.MethodLexicalScope)})},
  22481. args: [],
  22482. source: "methodScope\x0a\x09^ self",
  22483. messageSends: [],
  22484. referencedClasses: []
  22485. }),
  22486. smalltalk.MethodLexicalScope);
  22487. smalltalk.addMethod(
  22488. "_nonLocalReturns",
  22489. smalltalk.method({
  22490. selector: "nonLocalReturns",
  22491. category: 'accessing',
  22492. fn: function (){
  22493. var self=this;
  22494. return smalltalk.withContext(function($ctx1) { var $2,$1;
  22495. $2=self["@nonLocalReturns"];
  22496. if(($receiver = $2) == nil || $receiver == undefined){
  22497. self["@nonLocalReturns"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  22498. $1=self["@nonLocalReturns"];
  22499. } else {
  22500. $1=$2;
  22501. };
  22502. return $1;
  22503. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturns",{}, smalltalk.MethodLexicalScope)})},
  22504. args: [],
  22505. source: "nonLocalReturns\x0a\x09^ nonLocalReturns ifNil: [ nonLocalReturns := OrderedCollection new ]",
  22506. messageSends: ["ifNil:", "new"],
  22507. referencedClasses: ["OrderedCollection"]
  22508. }),
  22509. smalltalk.MethodLexicalScope);
  22510. smalltalk.addMethod(
  22511. "_pseudoVars",
  22512. smalltalk.method({
  22513. selector: "pseudoVars",
  22514. category: 'accessing',
  22515. fn: function (){
  22516. var self=this;
  22517. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  22518. $1=self["@pseudoVars"];
  22519. if(($receiver = $1) == nil || $receiver == undefined){
  22520. self["@pseudoVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
  22521. self["@pseudoVars"];
  22522. _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._pseudoVariableNames())._do_((function(each){
  22523. return smalltalk.withContext(function($ctx2) { $2=_st((smalltalk.PseudoVar || PseudoVar))._on_(each);
  22524. _st($2)._scope_(_st(self)._methodScope());
  22525. $3=_st($2)._yourself();
  22526. return _st(self["@pseudoVars"])._at_put_(each,$3);
  22527. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  22528. } else {
  22529. $1;
  22530. };
  22531. $4=self["@pseudoVars"];
  22532. return $4;
  22533. }, function($ctx1) {$ctx1.fill(self,"pseudoVars",{}, smalltalk.MethodLexicalScope)})},
  22534. args: [],
  22535. source: "pseudoVars\x0a\x09pseudoVars ifNil: [\x0a\x09\x09pseudoVars := Dictionary new.\x0a\x09\x09Smalltalk current pseudoVariableNames do: [ :each |\x0a\x09\x09\x09pseudoVars at: each put: ((PseudoVar on: each)\x0a\x09\x09\x09\x09scope: self methodScope;\x0a\x09\x09\x09\x09yourself) ]].\x0a\x09^ pseudoVars",
  22536. messageSends: ["ifNil:", "new", "do:", "at:put:", "scope:", "methodScope", "on:", "yourself", "pseudoVariableNames", "current"],
  22537. referencedClasses: ["Dictionary", "PseudoVar", "Smalltalk"]
  22538. }),
  22539. smalltalk.MethodLexicalScope);
  22540. smalltalk.addMethod(
  22541. "_removeNonLocalReturn_",
  22542. smalltalk.method({
  22543. selector: "removeNonLocalReturn:",
  22544. category: 'adding',
  22545. fn: function (aScope){
  22546. var self=this;
  22547. return smalltalk.withContext(function($ctx1) { _st(_st(self)._nonLocalReturns())._remove_ifAbsent_(aScope,(function(){
  22548. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  22549. return self}, function($ctx1) {$ctx1.fill(self,"removeNonLocalReturn:",{aScope:aScope}, smalltalk.MethodLexicalScope)})},
  22550. args: ["aScope"],
  22551. source: "removeNonLocalReturn: aScope\x0a\x09self nonLocalReturns remove: aScope ifAbsent: []",
  22552. messageSends: ["remove:ifAbsent:", "nonLocalReturns"],
  22553. referencedClasses: []
  22554. }),
  22555. smalltalk.MethodLexicalScope);
  22556. smalltalk.addMethod(
  22557. "_unknownVariables",
  22558. smalltalk.method({
  22559. selector: "unknownVariables",
  22560. category: 'accessing',
  22561. fn: function (){
  22562. var self=this;
  22563. return smalltalk.withContext(function($ctx1) { var $2,$1;
  22564. $2=self["@unknownVariables"];
  22565. if(($receiver = $2) == nil || $receiver == undefined){
  22566. self["@unknownVariables"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  22567. $1=self["@unknownVariables"];
  22568. } else {
  22569. $1=$2;
  22570. };
  22571. return $1;
  22572. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{}, smalltalk.MethodLexicalScope)})},
  22573. args: [],
  22574. source: "unknownVariables\x0a\x09^ unknownVariables ifNil: [ unknownVariables := OrderedCollection new ]",
  22575. messageSends: ["ifNil:", "new"],
  22576. referencedClasses: ["OrderedCollection"]
  22577. }),
  22578. smalltalk.MethodLexicalScope);
  22579. smalltalk.addClass('ScopeVar', smalltalk.Object, ['scope', 'name'], 'Compiler-Semantic');
  22580. smalltalk.ScopeVar.comment="I am an entry in a LexicalScope that gets associated with variable nodes of the same name. \x0aThere are 4 different subclasses of vars: temp vars, local vars, args, and unknown/global vars."
  22581. smalltalk.addMethod(
  22582. "_alias",
  22583. smalltalk.method({
  22584. selector: "alias",
  22585. category: 'accessing',
  22586. fn: function (){
  22587. var self=this;
  22588. return smalltalk.withContext(function($ctx1) { var $1;
  22589. $1=_st(_st(self)._name())._asVariableName();
  22590. return $1;
  22591. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.ScopeVar)})},
  22592. args: [],
  22593. source: "alias\x0a\x09^ self name asVariableName",
  22594. messageSends: ["asVariableName", "name"],
  22595. referencedClasses: []
  22596. }),
  22597. smalltalk.ScopeVar);
  22598. smalltalk.addMethod(
  22599. "_isArgVar",
  22600. smalltalk.method({
  22601. selector: "isArgVar",
  22602. category: 'testing',
  22603. fn: function (){
  22604. var self=this;
  22605. return smalltalk.withContext(function($ctx1) { return false;
  22606. }, function($ctx1) {$ctx1.fill(self,"isArgVar",{}, smalltalk.ScopeVar)})},
  22607. args: [],
  22608. source: "isArgVar\x0a\x09^ false",
  22609. messageSends: [],
  22610. referencedClasses: []
  22611. }),
  22612. smalltalk.ScopeVar);
  22613. smalltalk.addMethod(
  22614. "_isClassRefVar",
  22615. smalltalk.method({
  22616. selector: "isClassRefVar",
  22617. category: 'testing',
  22618. fn: function (){
  22619. var self=this;
  22620. return smalltalk.withContext(function($ctx1) { return false;
  22621. }, function($ctx1) {$ctx1.fill(self,"isClassRefVar",{}, smalltalk.ScopeVar)})},
  22622. args: [],
  22623. source: "isClassRefVar\x0a\x09^ false",
  22624. messageSends: [],
  22625. referencedClasses: []
  22626. }),
  22627. smalltalk.ScopeVar);
  22628. smalltalk.addMethod(
  22629. "_isInstanceVar",
  22630. smalltalk.method({
  22631. selector: "isInstanceVar",
  22632. category: 'testing',
  22633. fn: function (){
  22634. var self=this;
  22635. return smalltalk.withContext(function($ctx1) { return false;
  22636. }, function($ctx1) {$ctx1.fill(self,"isInstanceVar",{}, smalltalk.ScopeVar)})},
  22637. args: [],
  22638. source: "isInstanceVar\x0a\x09^ false",
  22639. messageSends: [],
  22640. referencedClasses: []
  22641. }),
  22642. smalltalk.ScopeVar);
  22643. smalltalk.addMethod(
  22644. "_isPseudoVar",
  22645. smalltalk.method({
  22646. selector: "isPseudoVar",
  22647. category: 'testing',
  22648. fn: function (){
  22649. var self=this;
  22650. return smalltalk.withContext(function($ctx1) { return false;
  22651. }, function($ctx1) {$ctx1.fill(self,"isPseudoVar",{}, smalltalk.ScopeVar)})},
  22652. args: [],
  22653. source: "isPseudoVar\x0a\x09^ false",
  22654. messageSends: [],
  22655. referencedClasses: []
  22656. }),
  22657. smalltalk.ScopeVar);
  22658. smalltalk.addMethod(
  22659. "_isTempVar",
  22660. smalltalk.method({
  22661. selector: "isTempVar",
  22662. category: 'testing',
  22663. fn: function (){
  22664. var self=this;
  22665. return smalltalk.withContext(function($ctx1) { return false;
  22666. }, function($ctx1) {$ctx1.fill(self,"isTempVar",{}, smalltalk.ScopeVar)})},
  22667. args: [],
  22668. source: "isTempVar\x0a\x09^ false",
  22669. messageSends: [],
  22670. referencedClasses: []
  22671. }),
  22672. smalltalk.ScopeVar);
  22673. smalltalk.addMethod(
  22674. "_isUnknownVar",
  22675. smalltalk.method({
  22676. selector: "isUnknownVar",
  22677. category: 'testing',
  22678. fn: function (){
  22679. var self=this;
  22680. return smalltalk.withContext(function($ctx1) { return false;
  22681. }, function($ctx1) {$ctx1.fill(self,"isUnknownVar",{}, smalltalk.ScopeVar)})},
  22682. args: [],
  22683. source: "isUnknownVar\x0a\x09^ false",
  22684. messageSends: [],
  22685. referencedClasses: []
  22686. }),
  22687. smalltalk.ScopeVar);
  22688. smalltalk.addMethod(
  22689. "_name",
  22690. smalltalk.method({
  22691. selector: "name",
  22692. category: 'accessing',
  22693. fn: function (){
  22694. var self=this;
  22695. return smalltalk.withContext(function($ctx1) { var $1;
  22696. $1=self["@name"];
  22697. return $1;
  22698. }, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.ScopeVar)})},
  22699. args: [],
  22700. source: "name\x0a\x09^ name",
  22701. messageSends: [],
  22702. referencedClasses: []
  22703. }),
  22704. smalltalk.ScopeVar);
  22705. smalltalk.addMethod(
  22706. "_name_",
  22707. smalltalk.method({
  22708. selector: "name:",
  22709. category: 'accessing',
  22710. fn: function (aString){
  22711. var self=this;
  22712. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  22713. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString}, smalltalk.ScopeVar)})},
  22714. args: ["aString"],
  22715. source: "name: aString\x0a\x09name := aString",
  22716. messageSends: [],
  22717. referencedClasses: []
  22718. }),
  22719. smalltalk.ScopeVar);
  22720. smalltalk.addMethod(
  22721. "_scope",
  22722. smalltalk.method({
  22723. selector: "scope",
  22724. category: 'accessing',
  22725. fn: function (){
  22726. var self=this;
  22727. return smalltalk.withContext(function($ctx1) { var $1;
  22728. $1=self["@scope"];
  22729. return $1;
  22730. }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.ScopeVar)})},
  22731. args: [],
  22732. source: "scope\x0a\x09^ scope",
  22733. messageSends: [],
  22734. referencedClasses: []
  22735. }),
  22736. smalltalk.ScopeVar);
  22737. smalltalk.addMethod(
  22738. "_scope_",
  22739. smalltalk.method({
  22740. selector: "scope:",
  22741. category: 'accessing',
  22742. fn: function (aScope){
  22743. var self=this;
  22744. return smalltalk.withContext(function($ctx1) { self["@scope"]=aScope;
  22745. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.ScopeVar)})},
  22746. args: ["aScope"],
  22747. source: "scope: aScope\x0a\x09scope := aScope",
  22748. messageSends: [],
  22749. referencedClasses: []
  22750. }),
  22751. smalltalk.ScopeVar);
  22752. smalltalk.addMethod(
  22753. "_validateAssignment",
  22754. smalltalk.method({
  22755. selector: "validateAssignment",
  22756. category: 'testing',
  22757. fn: function (){
  22758. var self=this;
  22759. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  22760. $1=_st(_st(self)._isArgVar())._or_((function(){
  22761. return smalltalk.withContext(function($ctx2) { return _st(self)._isPseudoVar();
  22762. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  22763. if(smalltalk.assert($1)){
  22764. $2=_st((smalltalk.InvalidAssignmentError || InvalidAssignmentError))._new();
  22765. _st($2)._variableName_(_st(self)._name());
  22766. $3=_st($2)._signal();
  22767. $3;
  22768. };
  22769. return self}, function($ctx1) {$ctx1.fill(self,"validateAssignment",{}, smalltalk.ScopeVar)})},
  22770. args: [],
  22771. source: "validateAssignment\x0a\x09(self isArgVar or: [ self isPseudoVar ]) ifTrue: [\x0a\x09\x09InvalidAssignmentError new\x0a\x09\x09\x09variableName: self name;\x0a\x09\x09\x09signal]",
  22772. messageSends: ["ifTrue:", "variableName:", "name", "new", "signal", "or:", "isPseudoVar", "isArgVar"],
  22773. referencedClasses: ["InvalidAssignmentError"]
  22774. }),
  22775. smalltalk.ScopeVar);
  22776. smalltalk.addMethod(
  22777. "_on_",
  22778. smalltalk.method({
  22779. selector: "on:",
  22780. category: 'instance creation',
  22781. fn: function (aString){
  22782. var self=this;
  22783. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  22784. $2=_st(self)._new();
  22785. _st($2)._name_(aString);
  22786. $3=_st($2)._yourself();
  22787. $1=$3;
  22788. return $1;
  22789. }, function($ctx1) {$ctx1.fill(self,"on:",{aString:aString}, smalltalk.ScopeVar.klass)})},
  22790. args: ["aString"],
  22791. source: "on: aString\x0a\x09^ self new \x0a\x09\x09name: aString;\x0a\x09\x09yourself",
  22792. messageSends: ["name:", "new", "yourself"],
  22793. referencedClasses: []
  22794. }),
  22795. smalltalk.ScopeVar.klass);
  22796. smalltalk.addClass('AliasVar', smalltalk.ScopeVar, ['node'], 'Compiler-Semantic');
  22797. smalltalk.AliasVar.comment="I am an internally defined variable by the compiler"
  22798. smalltalk.addMethod(
  22799. "_node",
  22800. smalltalk.method({
  22801. selector: "node",
  22802. category: 'accessing',
  22803. fn: function (){
  22804. var self=this;
  22805. return smalltalk.withContext(function($ctx1) { var $1;
  22806. $1=self["@node"];
  22807. return $1;
  22808. }, function($ctx1) {$ctx1.fill(self,"node",{}, smalltalk.AliasVar)})},
  22809. args: [],
  22810. source: "node\x0a\x09^ node",
  22811. messageSends: [],
  22812. referencedClasses: []
  22813. }),
  22814. smalltalk.AliasVar);
  22815. smalltalk.addMethod(
  22816. "_node_",
  22817. smalltalk.method({
  22818. selector: "node:",
  22819. category: 'accessing',
  22820. fn: function (aNode){
  22821. var self=this;
  22822. return smalltalk.withContext(function($ctx1) { self["@node"]=aNode;
  22823. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode}, smalltalk.AliasVar)})},
  22824. args: ["aNode"],
  22825. source: "node: aNode\x0a\x09node := aNode",
  22826. messageSends: [],
  22827. referencedClasses: []
  22828. }),
  22829. smalltalk.AliasVar);
  22830. smalltalk.addClass('ArgVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  22831. smalltalk.ArgVar.comment="I am an argument of a method or block."
  22832. smalltalk.addMethod(
  22833. "_isArgVar",
  22834. smalltalk.method({
  22835. selector: "isArgVar",
  22836. category: 'testing',
  22837. fn: function (){
  22838. var self=this;
  22839. return smalltalk.withContext(function($ctx1) { return true;
  22840. }, function($ctx1) {$ctx1.fill(self,"isArgVar",{}, smalltalk.ArgVar)})},
  22841. args: [],
  22842. source: "isArgVar\x0a\x09^ true",
  22843. messageSends: [],
  22844. referencedClasses: []
  22845. }),
  22846. smalltalk.ArgVar);
  22847. smalltalk.addClass('ClassRefVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  22848. smalltalk.ClassRefVar.comment="I am an class reference variable"
  22849. smalltalk.addMethod(
  22850. "_alias",
  22851. smalltalk.method({
  22852. selector: "alias",
  22853. category: 'accessing',
  22854. fn: function (){
  22855. var self=this;
  22856. return smalltalk.withContext(function($ctx1) { var $1;
  22857. $1=_st(_st(_st(_st("(smalltalk.").__comma(_st(self)._name())).__comma(" || ")).__comma(_st(self)._name())).__comma(")");
  22858. return $1;
  22859. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.ClassRefVar)})},
  22860. args: [],
  22861. source: "alias\x0a\x09^ '(smalltalk.', self name, ' || ', self name, ')'",
  22862. messageSends: [",", "name"],
  22863. referencedClasses: []
  22864. }),
  22865. smalltalk.ClassRefVar);
  22866. smalltalk.addMethod(
  22867. "_isClassRefVar",
  22868. smalltalk.method({
  22869. selector: "isClassRefVar",
  22870. category: 'testing',
  22871. fn: function (){
  22872. var self=this;
  22873. return smalltalk.withContext(function($ctx1) { return true;
  22874. }, function($ctx1) {$ctx1.fill(self,"isClassRefVar",{}, smalltalk.ClassRefVar)})},
  22875. args: [],
  22876. source: "isClassRefVar\x0a\x09^ true",
  22877. messageSends: [],
  22878. referencedClasses: []
  22879. }),
  22880. smalltalk.ClassRefVar);
  22881. smalltalk.addClass('InstanceVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  22882. smalltalk.InstanceVar.comment="I am an instance variable of a method or block."
  22883. smalltalk.addMethod(
  22884. "_alias",
  22885. smalltalk.method({
  22886. selector: "alias",
  22887. category: 'testing',
  22888. fn: function (){
  22889. var self=this;
  22890. return smalltalk.withContext(function($ctx1) { var $1;
  22891. $1=_st(_st("self[\x22@").__comma(_st(self)._name())).__comma("\x22]");
  22892. return $1;
  22893. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.InstanceVar)})},
  22894. args: [],
  22895. source: "alias\x0a\x09^ 'self[\x22@', self name, '\x22]'",
  22896. messageSends: [",", "name"],
  22897. referencedClasses: []
  22898. }),
  22899. smalltalk.InstanceVar);
  22900. smalltalk.addMethod(
  22901. "_isInstanceVar",
  22902. smalltalk.method({
  22903. selector: "isInstanceVar",
  22904. category: 'testing',
  22905. fn: function (){
  22906. var self=this;
  22907. return smalltalk.withContext(function($ctx1) { return true;
  22908. }, function($ctx1) {$ctx1.fill(self,"isInstanceVar",{}, smalltalk.InstanceVar)})},
  22909. args: [],
  22910. source: "isInstanceVar\x0a\x09^ true",
  22911. messageSends: [],
  22912. referencedClasses: []
  22913. }),
  22914. smalltalk.InstanceVar);
  22915. smalltalk.addClass('PseudoVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  22916. smalltalk.PseudoVar.comment="I am an pseudo variable.\x0a\x0aThe five Smalltalk pseudo variables are: 'self', 'super', 'nil', 'true' and 'false'"
  22917. smalltalk.addMethod(
  22918. "_alias",
  22919. smalltalk.method({
  22920. selector: "alias",
  22921. category: 'accessing',
  22922. fn: function (){
  22923. var self=this;
  22924. return smalltalk.withContext(function($ctx1) { var $1;
  22925. $1=_st(self)._name();
  22926. return $1;
  22927. }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.PseudoVar)})},
  22928. args: [],
  22929. source: "alias\x0a\x09^ self name",
  22930. messageSends: ["name"],
  22931. referencedClasses: []
  22932. }),
  22933. smalltalk.PseudoVar);
  22934. smalltalk.addMethod(
  22935. "_isPseudoVar",
  22936. smalltalk.method({
  22937. selector: "isPseudoVar",
  22938. category: 'testing',
  22939. fn: function (){
  22940. var self=this;
  22941. return smalltalk.withContext(function($ctx1) { return true;
  22942. }, function($ctx1) {$ctx1.fill(self,"isPseudoVar",{}, smalltalk.PseudoVar)})},
  22943. args: [],
  22944. source: "isPseudoVar\x0a\x09^ true",
  22945. messageSends: [],
  22946. referencedClasses: []
  22947. }),
  22948. smalltalk.PseudoVar);
  22949. smalltalk.addClass('TempVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  22950. smalltalk.TempVar.comment="I am an temporary variable of a method or block."
  22951. smalltalk.addMethod(
  22952. "_isTempVar",
  22953. smalltalk.method({
  22954. selector: "isTempVar",
  22955. category: 'testing',
  22956. fn: function (){
  22957. var self=this;
  22958. return smalltalk.withContext(function($ctx1) { return true;
  22959. }, function($ctx1) {$ctx1.fill(self,"isTempVar",{}, smalltalk.TempVar)})},
  22960. args: [],
  22961. source: "isTempVar\x0a\x09^ true",
  22962. messageSends: [],
  22963. referencedClasses: []
  22964. }),
  22965. smalltalk.TempVar);
  22966. smalltalk.addClass('UnknownVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  22967. smalltalk.UnknownVar.comment="I am an unknown variable. Amber uses unknown variables as JavaScript globals"
  22968. smalltalk.addMethod(
  22969. "_isUnknownVar",
  22970. smalltalk.method({
  22971. selector: "isUnknownVar",
  22972. category: 'testing',
  22973. fn: function (){
  22974. var self=this;
  22975. return smalltalk.withContext(function($ctx1) { return true;
  22976. }, function($ctx1) {$ctx1.fill(self,"isUnknownVar",{}, smalltalk.UnknownVar)})},
  22977. args: [],
  22978. source: "isUnknownVar\x0a\x09^ true",
  22979. messageSends: [],
  22980. referencedClasses: []
  22981. }),
  22982. smalltalk.UnknownVar);
  22983. smalltalk.addClass('SemanticAnalyzer', smalltalk.NodeVisitor, ['currentScope', 'theClass', 'classReferences', 'messageSends', 'superSends'], 'Compiler-Semantic');
  22984. smalltalk.SemanticAnalyzer.comment="I semantically analyze the abstract syntax tree and annotate it with informations such as non local returns and variable scopes."
  22985. smalltalk.addMethod(
  22986. "_classReferences",
  22987. smalltalk.method({
  22988. selector: "classReferences",
  22989. category: 'accessing',
  22990. fn: function (){
  22991. var self=this;
  22992. return smalltalk.withContext(function($ctx1) { var $2,$1;
  22993. $2=self["@classReferences"];
  22994. if(($receiver = $2) == nil || $receiver == undefined){
  22995. self["@classReferences"]=_st((smalltalk.Set || Set))._new();
  22996. $1=self["@classReferences"];
  22997. } else {
  22998. $1=$2;
  22999. };
  23000. return $1;
  23001. }, function($ctx1) {$ctx1.fill(self,"classReferences",{}, smalltalk.SemanticAnalyzer)})},
  23002. args: [],
  23003. source: "classReferences\x0a\x09^ classReferences ifNil: [ classReferences := Set new ]",
  23004. messageSends: ["ifNil:", "new"],
  23005. referencedClasses: ["Set"]
  23006. }),
  23007. smalltalk.SemanticAnalyzer);
  23008. smalltalk.addMethod(
  23009. "_errorShadowingVariable_",
  23010. smalltalk.method({
  23011. selector: "errorShadowingVariable:",
  23012. category: 'error handling',
  23013. fn: function (aString){
  23014. var self=this;
  23015. return smalltalk.withContext(function($ctx1) { var $1,$2;
  23016. $1=_st((smalltalk.ShadowingVariableError || ShadowingVariableError))._new();
  23017. _st($1)._variableName_(aString);
  23018. $2=_st($1)._signal();
  23019. return self}, function($ctx1) {$ctx1.fill(self,"errorShadowingVariable:",{aString:aString}, smalltalk.SemanticAnalyzer)})},
  23020. args: ["aString"],
  23021. source: "errorShadowingVariable: aString\x0a\x09ShadowingVariableError new\x0a\x09\x09variableName: aString;\x0a\x09\x09signal",
  23022. messageSends: ["variableName:", "new", "signal"],
  23023. referencedClasses: ["ShadowingVariableError"]
  23024. }),
  23025. smalltalk.SemanticAnalyzer);
  23026. smalltalk.addMethod(
  23027. "_errorUnknownVariable_",
  23028. smalltalk.method({
  23029. selector: "errorUnknownVariable:",
  23030. category: 'error handling',
  23031. fn: function (aNode){
  23032. var self=this;
  23033. var identifier;
  23034. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  23035. identifier=_st(aNode)._value();
  23036. $1=_st(_st(_st(["jQuery", "window", "document", "process", "global"])._includes_(identifier))._not())._and_((function(){
  23037. return smalltalk.withContext(function($ctx2) { return _st(self)._isVariableGloballyUndefined_(identifier);
  23038. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  23039. if(smalltalk.assert($1)){
  23040. $2=_st((smalltalk.UnknownVariableError || UnknownVariableError))._new();
  23041. _st($2)._variableName_(_st(aNode)._value());
  23042. $3=_st($2)._signal();
  23043. $3;
  23044. } else {
  23045. _st(_st(_st(self["@currentScope"])._methodScope())._unknownVariables())._add_(_st(aNode)._value());
  23046. };
  23047. return self}, function($ctx1) {$ctx1.fill(self,"errorUnknownVariable:",{aNode:aNode,identifier:identifier}, smalltalk.SemanticAnalyzer)})},
  23048. args: ["aNode"],
  23049. source: "errorUnknownVariable: aNode\x0a\x09\x22Throw an error if the variable is undeclared in the global JS scope (i.e. window).\x0a We allow four variable names in addition: `jQuery`, `window`, `process` and `global` \x0a for nodejs and browser environments. \x0a \x0a This is only to make sure compilation works on both browser-based and nodejs environments.\x0a The ideal solution would be to use a pragma instead\x22\x0a\x0a\x09| identifier |\x0a identifier := aNode value.\x0a \x0a\x09((#('jQuery' 'window' 'document' 'process' 'global') includes: identifier) not \x0a and: [ self isVariableGloballyUndefined: identifier ]) \x0a \x09ifTrue: [\x0a\x09\x09\x09\x09UnknownVariableError new\x0a\x09\x09\x09\x09\x09variableName: aNode value;\x0a\x09\x09\x09\x09\x09signal ]\x0a\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09currentScope methodScope unknownVariables add: aNode value ]",
  23050. messageSends: ["value", "ifTrue:ifFalse:", "variableName:", "new", "signal", "add:", "unknownVariables", "methodScope", "and:", "isVariableGloballyUndefined:", "not", "includes:"],
  23051. referencedClasses: ["UnknownVariableError"]
  23052. }),
  23053. smalltalk.SemanticAnalyzer);
  23054. smalltalk.addMethod(
  23055. "_isVariableGloballyUndefined_",
  23056. smalltalk.method({
  23057. selector: "isVariableGloballyUndefined:",
  23058. category: 'testing',
  23059. fn: function (aString){
  23060. var self=this;
  23061. return smalltalk.withContext(function($ctx1) { return eval('typeof ' + aString + ' == "undefined"');
  23062. return self}, function($ctx1) {$ctx1.fill(self,"isVariableGloballyUndefined:",{aString:aString}, smalltalk.SemanticAnalyzer)})},
  23063. args: ["aString"],
  23064. source: "isVariableGloballyUndefined: aString\x0a\x09<return eval('typeof ' + aString + ' == \x22undefined\x22')>",
  23065. messageSends: [],
  23066. referencedClasses: []
  23067. }),
  23068. smalltalk.SemanticAnalyzer);
  23069. smalltalk.addMethod(
  23070. "_messageSends",
  23071. smalltalk.method({
  23072. selector: "messageSends",
  23073. category: 'accessing',
  23074. fn: function (){
  23075. var self=this;
  23076. return smalltalk.withContext(function($ctx1) { var $2,$1;
  23077. $2=self["@messageSends"];
  23078. if(($receiver = $2) == nil || $receiver == undefined){
  23079. self["@messageSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
  23080. $1=self["@messageSends"];
  23081. } else {
  23082. $1=$2;
  23083. };
  23084. return $1;
  23085. }, function($ctx1) {$ctx1.fill(self,"messageSends",{}, smalltalk.SemanticAnalyzer)})},
  23086. args: [],
  23087. source: "messageSends\x0a\x09^ messageSends ifNil: [ messageSends := Dictionary new ]",
  23088. messageSends: ["ifNil:", "new"],
  23089. referencedClasses: ["Dictionary"]
  23090. }),
  23091. smalltalk.SemanticAnalyzer);
  23092. smalltalk.addMethod(
  23093. "_newBlockScope",
  23094. smalltalk.method({
  23095. selector: "newBlockScope",
  23096. category: 'factory',
  23097. fn: function (){
  23098. var self=this;
  23099. return smalltalk.withContext(function($ctx1) { var $1;
  23100. $1=_st(self)._newScopeOfClass_((smalltalk.LexicalScope || LexicalScope));
  23101. return $1;
  23102. }, function($ctx1) {$ctx1.fill(self,"newBlockScope",{}, smalltalk.SemanticAnalyzer)})},
  23103. args: [],
  23104. source: "newBlockScope\x0a\x09^ self newScopeOfClass: LexicalScope",
  23105. messageSends: ["newScopeOfClass:"],
  23106. referencedClasses: ["LexicalScope"]
  23107. }),
  23108. smalltalk.SemanticAnalyzer);
  23109. smalltalk.addMethod(
  23110. "_newMethodScope",
  23111. smalltalk.method({
  23112. selector: "newMethodScope",
  23113. category: 'factory',
  23114. fn: function (){
  23115. var self=this;
  23116. return smalltalk.withContext(function($ctx1) { var $1;
  23117. $1=_st(self)._newScopeOfClass_((smalltalk.MethodLexicalScope || MethodLexicalScope));
  23118. return $1;
  23119. }, function($ctx1) {$ctx1.fill(self,"newMethodScope",{}, smalltalk.SemanticAnalyzer)})},
  23120. args: [],
  23121. source: "newMethodScope\x0a\x09^ self newScopeOfClass: MethodLexicalScope",
  23122. messageSends: ["newScopeOfClass:"],
  23123. referencedClasses: ["MethodLexicalScope"]
  23124. }),
  23125. smalltalk.SemanticAnalyzer);
  23126. smalltalk.addMethod(
  23127. "_newScopeOfClass_",
  23128. smalltalk.method({
  23129. selector: "newScopeOfClass:",
  23130. category: 'factory',
  23131. fn: function (aLexicalScopeClass){
  23132. var self=this;
  23133. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  23134. $2=_st(aLexicalScopeClass)._new();
  23135. _st($2)._outerScope_(self["@currentScope"]);
  23136. $3=_st($2)._yourself();
  23137. $1=$3;
  23138. return $1;
  23139. }, function($ctx1) {$ctx1.fill(self,"newScopeOfClass:",{aLexicalScopeClass:aLexicalScopeClass}, smalltalk.SemanticAnalyzer)})},
  23140. args: ["aLexicalScopeClass"],
  23141. source: "newScopeOfClass: aLexicalScopeClass\x0a\x09^ aLexicalScopeClass new \x0a\x09\x09outerScope: currentScope;\x0a\x09\x09yourself",
  23142. messageSends: ["outerScope:", "new", "yourself"],
  23143. referencedClasses: []
  23144. }),
  23145. smalltalk.SemanticAnalyzer);
  23146. smalltalk.addMethod(
  23147. "_popScope",
  23148. smalltalk.method({
  23149. selector: "popScope",
  23150. category: 'scope',
  23151. fn: function (){
  23152. var self=this;
  23153. return smalltalk.withContext(function($ctx1) { var $1;
  23154. $1=self["@currentScope"];
  23155. if(($receiver = $1) == nil || $receiver == undefined){
  23156. $1;
  23157. } else {
  23158. self["@currentScope"]=_st(self["@currentScope"])._outerScope();
  23159. self["@currentScope"];
  23160. };
  23161. return self}, function($ctx1) {$ctx1.fill(self,"popScope",{}, smalltalk.SemanticAnalyzer)})},
  23162. args: [],
  23163. source: "popScope\x0a\x09currentScope ifNotNil: [\x0a\x09\x09currentScope := currentScope outerScope ]",
  23164. messageSends: ["ifNotNil:", "outerScope"],
  23165. referencedClasses: []
  23166. }),
  23167. smalltalk.SemanticAnalyzer);
  23168. smalltalk.addMethod(
  23169. "_pushScope_",
  23170. smalltalk.method({
  23171. selector: "pushScope:",
  23172. category: 'scope',
  23173. fn: function (aScope){
  23174. var self=this;
  23175. return smalltalk.withContext(function($ctx1) { _st(aScope)._outerScope_(self["@currentScope"]);
  23176. self["@currentScope"]=aScope;
  23177. return self}, function($ctx1) {$ctx1.fill(self,"pushScope:",{aScope:aScope}, smalltalk.SemanticAnalyzer)})},
  23178. args: ["aScope"],
  23179. source: "pushScope: aScope\x0a\x09aScope outerScope: currentScope.\x0a\x09currentScope := aScope",
  23180. messageSends: ["outerScope:"],
  23181. referencedClasses: []
  23182. }),
  23183. smalltalk.SemanticAnalyzer);
  23184. smalltalk.addMethod(
  23185. "_superSends",
  23186. smalltalk.method({
  23187. selector: "superSends",
  23188. category: 'accessing',
  23189. fn: function (){
  23190. var self=this;
  23191. return smalltalk.withContext(function($ctx1) { var $2,$1;
  23192. $2=self["@superSends"];
  23193. if(($receiver = $2) == nil || $receiver == undefined){
  23194. self["@superSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
  23195. $1=self["@superSends"];
  23196. } else {
  23197. $1=$2;
  23198. };
  23199. return $1;
  23200. }, function($ctx1) {$ctx1.fill(self,"superSends",{}, smalltalk.SemanticAnalyzer)})},
  23201. args: [],
  23202. source: "superSends\x0a\x09^ superSends ifNil: [ superSends := Dictionary new ]",
  23203. messageSends: ["ifNil:", "new"],
  23204. referencedClasses: ["Dictionary"]
  23205. }),
  23206. smalltalk.SemanticAnalyzer);
  23207. smalltalk.addMethod(
  23208. "_theClass",
  23209. smalltalk.method({
  23210. selector: "theClass",
  23211. category: 'accessing',
  23212. fn: function (){
  23213. var self=this;
  23214. return smalltalk.withContext(function($ctx1) { var $1;
  23215. $1=self["@theClass"];
  23216. return $1;
  23217. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.SemanticAnalyzer)})},
  23218. args: [],
  23219. source: "theClass\x0a\x09^ theClass",
  23220. messageSends: [],
  23221. referencedClasses: []
  23222. }),
  23223. smalltalk.SemanticAnalyzer);
  23224. smalltalk.addMethod(
  23225. "_theClass_",
  23226. smalltalk.method({
  23227. selector: "theClass:",
  23228. category: 'accessing',
  23229. fn: function (aClass){
  23230. var self=this;
  23231. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  23232. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.SemanticAnalyzer)})},
  23233. args: ["aClass"],
  23234. source: "theClass: aClass\x0a\x09theClass := aClass",
  23235. messageSends: [],
  23236. referencedClasses: []
  23237. }),
  23238. smalltalk.SemanticAnalyzer);
  23239. smalltalk.addMethod(
  23240. "_validateVariableScope_",
  23241. smalltalk.method({
  23242. selector: "validateVariableScope:",
  23243. category: 'scope',
  23244. fn: function (aString){
  23245. var self=this;
  23246. return smalltalk.withContext(function($ctx1) { var $1;
  23247. $1=_st(self["@currentScope"])._lookupVariable_(aString);
  23248. if(($receiver = $1) == nil || $receiver == undefined){
  23249. $1;
  23250. } else {
  23251. _st(self)._errorShadowingVariable_(aString);
  23252. };
  23253. return self}, function($ctx1) {$ctx1.fill(self,"validateVariableScope:",{aString:aString}, smalltalk.SemanticAnalyzer)})},
  23254. args: ["aString"],
  23255. source: "validateVariableScope: aString\x0a\x09\x22Validate the variable scope in by doing a recursive lookup, up to the method scope\x22\x0a\x0a\x09(currentScope lookupVariable: aString) ifNotNil: [\x0a\x09\x09self errorShadowingVariable: aString ]",
  23256. messageSends: ["ifNotNil:", "errorShadowingVariable:", "lookupVariable:"],
  23257. referencedClasses: []
  23258. }),
  23259. smalltalk.SemanticAnalyzer);
  23260. smalltalk.addMethod(
  23261. "_visitAssignmentNode_",
  23262. smalltalk.method({
  23263. selector: "visitAssignmentNode:",
  23264. category: 'visiting',
  23265. fn: function (aNode){
  23266. var self=this;
  23267. return smalltalk.withContext(function($ctx1) { smalltalk.NodeVisitor.fn.prototype._visitAssignmentNode_.apply(_st(self), [aNode]);
  23268. _st(_st(aNode)._left())._beAssigned();
  23269. return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23270. args: ["aNode"],
  23271. source: "visitAssignmentNode: aNode\x0a\x09super visitAssignmentNode: aNode.\x0a\x09aNode left beAssigned",
  23272. messageSends: ["visitAssignmentNode:", "beAssigned", "left"],
  23273. referencedClasses: []
  23274. }),
  23275. smalltalk.SemanticAnalyzer);
  23276. smalltalk.addMethod(
  23277. "_visitBlockNode_",
  23278. smalltalk.method({
  23279. selector: "visitBlockNode:",
  23280. category: 'visiting',
  23281. fn: function (aNode){
  23282. var self=this;
  23283. return smalltalk.withContext(function($ctx1) { _st(self)._pushScope_(_st(self)._newBlockScope());
  23284. _st(aNode)._scope_(self["@currentScope"]);
  23285. _st(self["@currentScope"])._node_(aNode);
  23286. _st(_st(aNode)._parameters())._do_((function(each){
  23287. return smalltalk.withContext(function($ctx2) { _st(self)._validateVariableScope_(each);
  23288. return _st(self["@currentScope"])._addArg_(each);
  23289. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  23290. smalltalk.NodeVisitor.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  23291. _st(self)._popScope();
  23292. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23293. args: ["aNode"],
  23294. source: "visitBlockNode: aNode\x0a\x09self pushScope: self newBlockScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x09\x0a\x09aNode parameters do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitBlockNode: aNode.\x0a\x09self popScope",
  23295. messageSends: ["pushScope:", "newBlockScope", "scope:", "node:", "do:", "validateVariableScope:", "addArg:", "parameters", "visitBlockNode:", "popScope"],
  23296. referencedClasses: []
  23297. }),
  23298. smalltalk.SemanticAnalyzer);
  23299. smalltalk.addMethod(
  23300. "_visitCascadeNode_",
  23301. smalltalk.method({
  23302. selector: "visitCascadeNode:",
  23303. category: 'visiting',
  23304. fn: function (aNode){
  23305. var self=this;
  23306. return smalltalk.withContext(function($ctx1) { var $1;
  23307. _st(_st(aNode)._nodes())._do_((function(each){
  23308. return smalltalk.withContext(function($ctx2) { return _st(each)._receiver_(_st(aNode)._receiver());
  23309. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  23310. smalltalk.NodeVisitor.fn.prototype._visitCascadeNode_.apply(_st(self), [aNode]);
  23311. $1=_st(_st(_st(aNode)._nodes())._first())._superSend();
  23312. if(smalltalk.assert($1)){
  23313. _st(_st(aNode)._nodes())._do_((function(each){
  23314. return smalltalk.withContext(function($ctx2) { return _st(each)._superSend_(true);
  23315. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  23316. };
  23317. return self}, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23318. args: ["aNode"],
  23319. source: "visitCascadeNode: aNode\x0a\x09\x22Populate the receiver into all children\x22\x0a\x09aNode nodes do: [ :each | \x0a\x09\x09each receiver: aNode receiver ].\x0a\x09super visitCascadeNode: aNode.\x0a\x09aNode nodes first superSend ifTrue: [\x0a\x09\x09aNode nodes do: [ :each | each superSend: true ]]",
  23320. messageSends: ["do:", "receiver:", "receiver", "nodes", "visitCascadeNode:", "ifTrue:", "superSend:", "superSend", "first"],
  23321. referencedClasses: []
  23322. }),
  23323. smalltalk.SemanticAnalyzer);
  23324. smalltalk.addMethod(
  23325. "_visitClassReferenceNode_",
  23326. smalltalk.method({
  23327. selector: "visitClassReferenceNode:",
  23328. category: 'visiting',
  23329. fn: function (aNode){
  23330. var self=this;
  23331. return smalltalk.withContext(function($ctx1) { var $1,$2;
  23332. _st(_st(self)._classReferences())._add_(_st(aNode)._value());
  23333. $1=_st((smalltalk.ClassRefVar || ClassRefVar))._new();
  23334. _st($1)._name_(_st(aNode)._value());
  23335. $2=_st($1)._yourself();
  23336. _st(aNode)._binding_($2);
  23337. return self}, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23338. args: ["aNode"],
  23339. source: "visitClassReferenceNode: aNode\x0a\x09self classReferences add: aNode value.\x0a\x09aNode binding: (ClassRefVar new name: aNode value; yourself)",
  23340. messageSends: ["add:", "value", "classReferences", "binding:", "name:", "new", "yourself"],
  23341. referencedClasses: ["ClassRefVar"]
  23342. }),
  23343. smalltalk.SemanticAnalyzer);
  23344. smalltalk.addMethod(
  23345. "_visitMethodNode_",
  23346. smalltalk.method({
  23347. selector: "visitMethodNode:",
  23348. category: 'visiting',
  23349. fn: function (aNode){
  23350. var self=this;
  23351. return smalltalk.withContext(function($ctx1) { var $1,$2;
  23352. _st(self)._pushScope_(_st(self)._newMethodScope());
  23353. _st(aNode)._scope_(self["@currentScope"]);
  23354. _st(self["@currentScope"])._node_(aNode);
  23355. _st(_st(_st(self)._theClass())._allInstanceVariableNames())._do_((function(each){
  23356. return smalltalk.withContext(function($ctx2) { return _st(self["@currentScope"])._addIVar_(each);
  23357. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  23358. _st(_st(aNode)._arguments())._do_((function(each){
  23359. return smalltalk.withContext(function($ctx2) { _st(self)._validateVariableScope_(each);
  23360. return _st(self["@currentScope"])._addArg_(each);
  23361. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  23362. smalltalk.NodeVisitor.fn.prototype._visitMethodNode_.apply(_st(self), [aNode]);
  23363. $1=aNode;
  23364. _st($1)._classReferences_(_st(self)._classReferences());
  23365. _st($1)._messageSends_(_st(_st(self)._messageSends())._keys());
  23366. $2=_st($1)._superSends_(_st(_st(self)._superSends())._keys());
  23367. _st(self)._popScope();
  23368. return self}, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23369. args: ["aNode"],
  23370. source: "visitMethodNode: aNode\x0a\x09self pushScope: self newMethodScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x0a\x09self theClass allInstanceVariableNames do: [:each | \x0a\x09\x09currentScope addIVar: each ].\x0a\x09aNode arguments do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitMethodNode: aNode.\x0a\x0a\x09aNode \x0a\x09\x09classReferences: self classReferences;\x0a\x09\x09messageSends: self messageSends keys;\x0a superSends: self superSends keys.\x0a\x09self popScope",
  23371. messageSends: ["pushScope:", "newMethodScope", "scope:", "node:", "do:", "addIVar:", "allInstanceVariableNames", "theClass", "validateVariableScope:", "addArg:", "arguments", "visitMethodNode:", "classReferences:", "classReferences", "messageSends:", "keys", "messageSends", "superSends:", "superSends", "popScope"],
  23372. referencedClasses: []
  23373. }),
  23374. smalltalk.SemanticAnalyzer);
  23375. smalltalk.addMethod(
  23376. "_visitReturnNode_",
  23377. smalltalk.method({
  23378. selector: "visitReturnNode:",
  23379. category: 'visiting',
  23380. fn: function (aNode){
  23381. var self=this;
  23382. return smalltalk.withContext(function($ctx1) { var $1;
  23383. _st(aNode)._scope_(self["@currentScope"]);
  23384. $1=_st(self["@currentScope"])._isMethodScope();
  23385. if(smalltalk.assert($1)){
  23386. _st(self["@currentScope"])._localReturn_(true);
  23387. } else {
  23388. _st(_st(self["@currentScope"])._methodScope())._addNonLocalReturn_(self["@currentScope"]);
  23389. };
  23390. smalltalk.NodeVisitor.fn.prototype._visitReturnNode_.apply(_st(self), [aNode]);
  23391. return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23392. args: ["aNode"],
  23393. source: "visitReturnNode: aNode\x0a\x09aNode scope: currentScope.\x0a\x09currentScope isMethodScope\x0a\x09\x09ifTrue: [ currentScope localReturn: true ]\x0a\x09\x09ifFalse: [ currentScope methodScope addNonLocalReturn: currentScope ].\x0a\x09super visitReturnNode: aNode",
  23394. messageSends: ["scope:", "ifTrue:ifFalse:", "localReturn:", "addNonLocalReturn:", "methodScope", "isMethodScope", "visitReturnNode:"],
  23395. referencedClasses: []
  23396. }),
  23397. smalltalk.SemanticAnalyzer);
  23398. smalltalk.addMethod(
  23399. "_visitSendNode_",
  23400. smalltalk.method({
  23401. selector: "visitSendNode:",
  23402. category: 'visiting',
  23403. fn: function (aNode){
  23404. var self=this;
  23405. return smalltalk.withContext(function($ctx1) { var $1,$2;
  23406. $1=_st(_st(_st(aNode)._receiver())._value()).__eq("super");
  23407. if(smalltalk.assert($1)){
  23408. _st(aNode)._superSend_(true);
  23409. _st(_st(aNode)._receiver())._value_("self");
  23410. _st(_st(self)._superSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  23411. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.Set || Set))._new();
  23412. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  23413. _st(_st(_st(self)._superSends())._at_(_st(aNode)._selector()))._add_(aNode);
  23414. } else {
  23415. $2=_st(_st((smalltalk.IRSendInliner || IRSendInliner))._inlinedSelectors())._includes_(_st(aNode)._selector());
  23416. if(smalltalk.assert($2)){
  23417. _st(aNode)._shouldBeInlined_(true);
  23418. _st(_st(aNode)._receiver())._shouldBeAliased_(true);
  23419. };
  23420. };
  23421. _st(_st(self)._messageSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  23422. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.Set || Set))._new();
  23423. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  23424. _st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._add_(aNode);
  23425. _st(aNode)._index_(_st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._size());
  23426. smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  23427. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23428. args: ["aNode"],
  23429. source: "visitSendNode: aNode\x0a\x0a\x09aNode receiver value = 'super' \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09aNode superSend: true.\x0a\x09\x09\x09aNode receiver value: 'self'.\x0a\x09\x09\x09self superSends at: aNode selector ifAbsentPut: [ Set new ].\x0a\x09\x09\x09(self superSends at: aNode selector) add: aNode ]\x0a \x0a\x09\x09ifFalse: [ (IRSendInliner inlinedSelectors includes: aNode selector) ifTrue: [\x0a\x09\x09\x09aNode shouldBeInlined: true.\x0a\x09\x09\x09aNode receiver shouldBeAliased: true ] ].\x0a\x0a\x09self messageSends at: aNode selector ifAbsentPut: [ Set new ].\x0a\x09(self messageSends at: aNode selector) add: aNode.\x0a\x0a\x09aNode index: (self messageSends at: aNode selector) size.\x0a\x0a\x09super visitSendNode: aNode",
  23430. messageSends: ["ifTrue:ifFalse:", "superSend:", "value:", "receiver", "at:ifAbsentPut:", "selector", "new", "superSends", "add:", "at:", "ifTrue:", "shouldBeInlined:", "shouldBeAliased:", "includes:", "inlinedSelectors", "=", "value", "messageSends", "index:", "size", "visitSendNode:"],
  23431. referencedClasses: ["Set", "IRSendInliner"]
  23432. }),
  23433. smalltalk.SemanticAnalyzer);
  23434. smalltalk.addMethod(
  23435. "_visitSequenceNode_",
  23436. smalltalk.method({
  23437. selector: "visitSequenceNode:",
  23438. category: 'visiting',
  23439. fn: function (aNode){
  23440. var self=this;
  23441. return smalltalk.withContext(function($ctx1) { _st(_st(aNode)._temps())._do_((function(each){
  23442. return smalltalk.withContext(function($ctx2) { _st(self)._validateVariableScope_(each);
  23443. return _st(self["@currentScope"])._addTemp_(each);
  23444. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  23445. smalltalk.NodeVisitor.fn.prototype._visitSequenceNode_.apply(_st(self), [aNode]);
  23446. return self}, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23447. args: ["aNode"],
  23448. source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addTemp: each ].\x0a\x0a\x09super visitSequenceNode: aNode",
  23449. messageSends: ["do:", "validateVariableScope:", "addTemp:", "temps", "visitSequenceNode:"],
  23450. referencedClasses: []
  23451. }),
  23452. smalltalk.SemanticAnalyzer);
  23453. smalltalk.addMethod(
  23454. "_visitVariableNode_",
  23455. smalltalk.method({
  23456. selector: "visitVariableNode:",
  23457. category: 'visiting',
  23458. fn: function (aNode){
  23459. var self=this;
  23460. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$2;
  23461. $1=aNode;
  23462. $3=_st(self["@currentScope"])._lookupVariable_(aNode);
  23463. if(($receiver = $3) == nil || $receiver == undefined){
  23464. _st(self)._errorUnknownVariable_(aNode);
  23465. $4=_st((smalltalk.UnknownVar || UnknownVar))._new();
  23466. _st($4)._name_(_st(aNode)._value());
  23467. $5=_st($4)._yourself();
  23468. $2=$5;
  23469. } else {
  23470. $2=$3;
  23471. };
  23472. _st($1)._binding_($2);
  23473. return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
  23474. args: ["aNode"],
  23475. source: "visitVariableNode: aNode\x0a\x09\x22Bind a ScopeVar to aNode by doing a lookup in the current scope.\x0a\x09If no ScopeVar is found, bind a UnknowVar and throw an error\x22\x0a\x0a\x09aNode binding: ((currentScope lookupVariable: aNode) ifNil: [ \x0a\x09\x09self errorUnknownVariable: aNode.\x0a\x09\x09UnknownVar new name: aNode value; yourself ])",
  23476. messageSends: ["binding:", "ifNil:", "errorUnknownVariable:", "name:", "value", "new", "yourself", "lookupVariable:"],
  23477. referencedClasses: ["UnknownVar"]
  23478. }),
  23479. smalltalk.SemanticAnalyzer);
  23480. smalltalk.addMethod(
  23481. "_on_",
  23482. smalltalk.method({
  23483. selector: "on:",
  23484. category: 'instance creation',
  23485. fn: function (aClass){
  23486. var self=this;
  23487. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  23488. $2=_st(self)._new();
  23489. _st($2)._theClass_(aClass);
  23490. $3=_st($2)._yourself();
  23491. $1=$3;
  23492. return $1;
  23493. }, function($ctx1) {$ctx1.fill(self,"on:",{aClass:aClass}, smalltalk.SemanticAnalyzer.klass)})},
  23494. args: ["aClass"],
  23495. source: "on: aClass\x0a\x09^ self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09yourself",
  23496. messageSends: ["theClass:", "new", "yourself"],
  23497. referencedClasses: []
  23498. }),
  23499. smalltalk.SemanticAnalyzer.klass);
  23500. smalltalk.parser = (function(){
  23501. /*
  23502. * Generated by PEG.js 0.7.0.
  23503. *
  23504. * http://pegjs.majda.cz/
  23505. */
  23506. function quote(s) {
  23507. /*
  23508. * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a
  23509. * string literal except for the closing quote character, backslash,
  23510. * carriage return, line separator, paragraph separator, and line feed.
  23511. * Any character may appear in the form of an escape sequence.
  23512. *
  23513. * For portability, we also escape escape all control and non-ASCII
  23514. * characters. Note that "\0" and "\v" escape sequences are not used
  23515. * because JSHint does not like the first and IE the second.
  23516. */
  23517. return '"' + s
  23518. .replace(/\\/g, '\\\\') // backslash
  23519. .replace(/"/g, '\\"') // closing quote character
  23520. .replace(/\x08/g, '\\b') // backspace
  23521. .replace(/\t/g, '\\t') // horizontal tab
  23522. .replace(/\n/g, '\\n') // line feed
  23523. .replace(/\f/g, '\\f') // form feed
  23524. .replace(/\r/g, '\\r') // carriage return
  23525. .replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g, escape)
  23526. + '"';
  23527. }
  23528. var result = {
  23529. /*
  23530. * Parses the input with a generated parser. If the parsing is successfull,
  23531. * returns a value explicitly or implicitly specified by the grammar from
  23532. * which the parser was generated (see |PEG.buildParser|). If the parsing is
  23533. * unsuccessful, throws |PEG.parser.SyntaxError| describing the error.
  23534. */
  23535. parse: function(input, startRule) {
  23536. var parseFunctions = {
  23537. "separator": parse_separator,
  23538. "comments": parse_comments,
  23539. "ws": parse_ws,
  23540. "identifier": parse_identifier,
  23541. "varIdentifier": parse_varIdentifier,
  23542. "keyword": parse_keyword,
  23543. "className": parse_className,
  23544. "string": parse_string,
  23545. "symbol": parse_symbol,
  23546. "number": parse_number,
  23547. "hex": parse_hex,
  23548. "float": parse_float,
  23549. "integer": parse_integer,
  23550. "literalArray": parse_literalArray,
  23551. "dynamicArray": parse_dynamicArray,
  23552. "dynamicDictionary": parse_dynamicDictionary,
  23553. "pseudoVariable": parse_pseudoVariable,
  23554. "literal": parse_literal,
  23555. "variable": parse_variable,
  23556. "classReference": parse_classReference,
  23557. "reference": parse_reference,
  23558. "keywordPair": parse_keywordPair,
  23559. "binarySelector": parse_binarySelector,
  23560. "keywordPattern": parse_keywordPattern,
  23561. "binaryPattern": parse_binaryPattern,
  23562. "unaryPattern": parse_unaryPattern,
  23563. "expression": parse_expression,
  23564. "expressionList": parse_expressionList,
  23565. "expressions": parse_expressions,
  23566. "assignment": parse_assignment,
  23567. "ret": parse_ret,
  23568. "temps": parse_temps,
  23569. "blockParamList": parse_blockParamList,
  23570. "subexpression": parse_subexpression,
  23571. "statements": parse_statements,
  23572. "sequence": parse_sequence,
  23573. "stSequence": parse_stSequence,
  23574. "block": parse_block,
  23575. "operand": parse_operand,
  23576. "unaryMessage": parse_unaryMessage,
  23577. "unaryTail": parse_unaryTail,
  23578. "unarySend": parse_unarySend,
  23579. "binaryMessage": parse_binaryMessage,
  23580. "binaryTail": parse_binaryTail,
  23581. "binarySend": parse_binarySend,
  23582. "keywordMessage": parse_keywordMessage,
  23583. "keywordSend": parse_keywordSend,
  23584. "message": parse_message,
  23585. "cascade": parse_cascade,
  23586. "jsStatement": parse_jsStatement,
  23587. "method": parse_method
  23588. };
  23589. if (startRule !== undefined) {
  23590. if (parseFunctions[startRule] === undefined) {
  23591. throw new Error("Invalid rule name: " + quote(startRule) + ".");
  23592. }
  23593. } else {
  23594. startRule = "method";
  23595. }
  23596. var pos = { offset: 0, line: 1, column: 1, seenCR: false };
  23597. var reportFailures = 0;
  23598. var rightmostFailuresPos = { offset: 0, line: 1, column: 1, seenCR: false };
  23599. var rightmostFailuresExpected = [];
  23600. var cache = {};
  23601. function padLeft(input, padding, length) {
  23602. var result = input;
  23603. var padLength = length - input.length;
  23604. for (var i = 0; i < padLength; i++) {
  23605. result = padding + result;
  23606. }
  23607. return result;
  23608. }
  23609. function escape(ch) {
  23610. var charCode = ch.charCodeAt(0);
  23611. var escapeChar;
  23612. var length;
  23613. if (charCode <= 0xFF) {
  23614. escapeChar = 'x';
  23615. length = 2;
  23616. } else {
  23617. escapeChar = 'u';
  23618. length = 4;
  23619. }
  23620. return '\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length);
  23621. }
  23622. function clone(object) {
  23623. var result = {};
  23624. for (var key in object) {
  23625. result[key] = object[key];
  23626. }
  23627. return result;
  23628. }
  23629. function advance(pos, n) {
  23630. var endOffset = pos.offset + n;
  23631. for (var offset = pos.offset; offset < endOffset; offset++) {
  23632. var ch = input.charAt(offset);
  23633. if (ch === "\n") {
  23634. if (!pos.seenCR) { pos.line++; }
  23635. pos.column = 1;
  23636. pos.seenCR = false;
  23637. } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") {
  23638. pos.line++;
  23639. pos.column = 1;
  23640. pos.seenCR = true;
  23641. } else {
  23642. pos.column++;
  23643. pos.seenCR = false;
  23644. }
  23645. }
  23646. pos.offset += n;
  23647. }
  23648. function matchFailed(failure) {
  23649. if (pos.offset < rightmostFailuresPos.offset) {
  23650. return;
  23651. }
  23652. if (pos.offset > rightmostFailuresPos.offset) {
  23653. rightmostFailuresPos = clone(pos);
  23654. rightmostFailuresExpected = [];
  23655. }
  23656. rightmostFailuresExpected.push(failure);
  23657. }
  23658. function parse_separator() {
  23659. var cacheKey = "separator@" + pos.offset;
  23660. var cachedResult = cache[cacheKey];
  23661. if (cachedResult) {
  23662. pos = clone(cachedResult.nextPos);
  23663. return cachedResult.result;
  23664. }
  23665. var result0, result1;
  23666. if (/^[ \t\x0B\f\xA0\uFEFF\n\r\u2028\u2029]/.test(input.charAt(pos.offset))) {
  23667. result1 = input.charAt(pos.offset);
  23668. advance(pos, 1);
  23669. } else {
  23670. result1 = null;
  23671. if (reportFailures === 0) {
  23672. matchFailed("[ \\t\\x0B\\f\\xA0\\uFEFF\\n\\r\\u2028\\u2029]");
  23673. }
  23674. }
  23675. if (result1 !== null) {
  23676. result0 = [];
  23677. while (result1 !== null) {
  23678. result0.push(result1);
  23679. if (/^[ \t\x0B\f\xA0\uFEFF\n\r\u2028\u2029]/.test(input.charAt(pos.offset))) {
  23680. result1 = input.charAt(pos.offset);
  23681. advance(pos, 1);
  23682. } else {
  23683. result1 = null;
  23684. if (reportFailures === 0) {
  23685. matchFailed("[ \\t\\x0B\\f\\xA0\\uFEFF\\n\\r\\u2028\\u2029]");
  23686. }
  23687. }
  23688. }
  23689. } else {
  23690. result0 = null;
  23691. }
  23692. cache[cacheKey] = {
  23693. nextPos: clone(pos),
  23694. result: result0
  23695. };
  23696. return result0;
  23697. }
  23698. function parse_comments() {
  23699. var cacheKey = "comments@" + pos.offset;
  23700. var cachedResult = cache[cacheKey];
  23701. if (cachedResult) {
  23702. pos = clone(cachedResult.nextPos);
  23703. return cachedResult.result;
  23704. }
  23705. var result0, result1, result2, result3;
  23706. var pos0;
  23707. pos0 = clone(pos);
  23708. if (/^["]/.test(input.charAt(pos.offset))) {
  23709. result1 = input.charAt(pos.offset);
  23710. advance(pos, 1);
  23711. } else {
  23712. result1 = null;
  23713. if (reportFailures === 0) {
  23714. matchFailed("[\"]");
  23715. }
  23716. }
  23717. if (result1 !== null) {
  23718. result2 = [];
  23719. if (/^[^"]/.test(input.charAt(pos.offset))) {
  23720. result3 = input.charAt(pos.offset);
  23721. advance(pos, 1);
  23722. } else {
  23723. result3 = null;
  23724. if (reportFailures === 0) {
  23725. matchFailed("[^\"]");
  23726. }
  23727. }
  23728. while (result3 !== null) {
  23729. result2.push(result3);
  23730. if (/^[^"]/.test(input.charAt(pos.offset))) {
  23731. result3 = input.charAt(pos.offset);
  23732. advance(pos, 1);
  23733. } else {
  23734. result3 = null;
  23735. if (reportFailures === 0) {
  23736. matchFailed("[^\"]");
  23737. }
  23738. }
  23739. }
  23740. if (result2 !== null) {
  23741. if (/^["]/.test(input.charAt(pos.offset))) {
  23742. result3 = input.charAt(pos.offset);
  23743. advance(pos, 1);
  23744. } else {
  23745. result3 = null;
  23746. if (reportFailures === 0) {
  23747. matchFailed("[\"]");
  23748. }
  23749. }
  23750. if (result3 !== null) {
  23751. result1 = [result1, result2, result3];
  23752. } else {
  23753. result1 = null;
  23754. pos = clone(pos0);
  23755. }
  23756. } else {
  23757. result1 = null;
  23758. pos = clone(pos0);
  23759. }
  23760. } else {
  23761. result1 = null;
  23762. pos = clone(pos0);
  23763. }
  23764. if (result1 !== null) {
  23765. result0 = [];
  23766. while (result1 !== null) {
  23767. result0.push(result1);
  23768. pos0 = clone(pos);
  23769. if (/^["]/.test(input.charAt(pos.offset))) {
  23770. result1 = input.charAt(pos.offset);
  23771. advance(pos, 1);
  23772. } else {
  23773. result1 = null;
  23774. if (reportFailures === 0) {
  23775. matchFailed("[\"]");
  23776. }
  23777. }
  23778. if (result1 !== null) {
  23779. result2 = [];
  23780. if (/^[^"]/.test(input.charAt(pos.offset))) {
  23781. result3 = input.charAt(pos.offset);
  23782. advance(pos, 1);
  23783. } else {
  23784. result3 = null;
  23785. if (reportFailures === 0) {
  23786. matchFailed("[^\"]");
  23787. }
  23788. }
  23789. while (result3 !== null) {
  23790. result2.push(result3);
  23791. if (/^[^"]/.test(input.charAt(pos.offset))) {
  23792. result3 = input.charAt(pos.offset);
  23793. advance(pos, 1);
  23794. } else {
  23795. result3 = null;
  23796. if (reportFailures === 0) {
  23797. matchFailed("[^\"]");
  23798. }
  23799. }
  23800. }
  23801. if (result2 !== null) {
  23802. if (/^["]/.test(input.charAt(pos.offset))) {
  23803. result3 = input.charAt(pos.offset);
  23804. advance(pos, 1);
  23805. } else {
  23806. result3 = null;
  23807. if (reportFailures === 0) {
  23808. matchFailed("[\"]");
  23809. }
  23810. }
  23811. if (result3 !== null) {
  23812. result1 = [result1, result2, result3];
  23813. } else {
  23814. result1 = null;
  23815. pos = clone(pos0);
  23816. }
  23817. } else {
  23818. result1 = null;
  23819. pos = clone(pos0);
  23820. }
  23821. } else {
  23822. result1 = null;
  23823. pos = clone(pos0);
  23824. }
  23825. }
  23826. } else {
  23827. result0 = null;
  23828. }
  23829. cache[cacheKey] = {
  23830. nextPos: clone(pos),
  23831. result: result0
  23832. };
  23833. return result0;
  23834. }
  23835. function parse_ws() {
  23836. var cacheKey = "ws@" + pos.offset;
  23837. var cachedResult = cache[cacheKey];
  23838. if (cachedResult) {
  23839. pos = clone(cachedResult.nextPos);
  23840. return cachedResult.result;
  23841. }
  23842. var result0, result1;
  23843. result0 = [];
  23844. result1 = parse_separator();
  23845. if (result1 === null) {
  23846. result1 = parse_comments();
  23847. }
  23848. while (result1 !== null) {
  23849. result0.push(result1);
  23850. result1 = parse_separator();
  23851. if (result1 === null) {
  23852. result1 = parse_comments();
  23853. }
  23854. }
  23855. cache[cacheKey] = {
  23856. nextPos: clone(pos),
  23857. result: result0
  23858. };
  23859. return result0;
  23860. }
  23861. function parse_identifier() {
  23862. var cacheKey = "identifier@" + pos.offset;
  23863. var cachedResult = cache[cacheKey];
  23864. if (cachedResult) {
  23865. pos = clone(cachedResult.nextPos);
  23866. return cachedResult.result;
  23867. }
  23868. var result0, result1, result2;
  23869. var pos0, pos1;
  23870. pos0 = clone(pos);
  23871. pos1 = clone(pos);
  23872. if (/^[a-zA-Z]/.test(input.charAt(pos.offset))) {
  23873. result0 = input.charAt(pos.offset);
  23874. advance(pos, 1);
  23875. } else {
  23876. result0 = null;
  23877. if (reportFailures === 0) {
  23878. matchFailed("[a-zA-Z]");
  23879. }
  23880. }
  23881. if (result0 !== null) {
  23882. result1 = [];
  23883. if (/^[a-zA-Z0-9]/.test(input.charAt(pos.offset))) {
  23884. result2 = input.charAt(pos.offset);
  23885. advance(pos, 1);
  23886. } else {
  23887. result2 = null;
  23888. if (reportFailures === 0) {
  23889. matchFailed("[a-zA-Z0-9]");
  23890. }
  23891. }
  23892. while (result2 !== null) {
  23893. result1.push(result2);
  23894. if (/^[a-zA-Z0-9]/.test(input.charAt(pos.offset))) {
  23895. result2 = input.charAt(pos.offset);
  23896. advance(pos, 1);
  23897. } else {
  23898. result2 = null;
  23899. if (reportFailures === 0) {
  23900. matchFailed("[a-zA-Z0-9]");
  23901. }
  23902. }
  23903. }
  23904. if (result1 !== null) {
  23905. result0 = [result0, result1];
  23906. } else {
  23907. result0 = null;
  23908. pos = clone(pos1);
  23909. }
  23910. } else {
  23911. result0 = null;
  23912. pos = clone(pos1);
  23913. }
  23914. if (result0 !== null) {
  23915. result0 = (function(offset, line, column, first, others) {return first + others.join("")})(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  23916. }
  23917. if (result0 === null) {
  23918. pos = clone(pos0);
  23919. }
  23920. cache[cacheKey] = {
  23921. nextPos: clone(pos),
  23922. result: result0
  23923. };
  23924. return result0;
  23925. }
  23926. function parse_varIdentifier() {
  23927. var cacheKey = "varIdentifier@" + pos.offset;
  23928. var cachedResult = cache[cacheKey];
  23929. if (cachedResult) {
  23930. pos = clone(cachedResult.nextPos);
  23931. return cachedResult.result;
  23932. }
  23933. var result0, result1, result2;
  23934. var pos0, pos1;
  23935. pos0 = clone(pos);
  23936. pos1 = clone(pos);
  23937. if (/^[a-z]/.test(input.charAt(pos.offset))) {
  23938. result0 = input.charAt(pos.offset);
  23939. advance(pos, 1);
  23940. } else {
  23941. result0 = null;
  23942. if (reportFailures === 0) {
  23943. matchFailed("[a-z]");
  23944. }
  23945. }
  23946. if (result0 !== null) {
  23947. result1 = [];
  23948. if (/^[a-zA-Z0-9]/.test(input.charAt(pos.offset))) {
  23949. result2 = input.charAt(pos.offset);
  23950. advance(pos, 1);
  23951. } else {
  23952. result2 = null;
  23953. if (reportFailures === 0) {
  23954. matchFailed("[a-zA-Z0-9]");
  23955. }
  23956. }
  23957. while (result2 !== null) {
  23958. result1.push(result2);
  23959. if (/^[a-zA-Z0-9]/.test(input.charAt(pos.offset))) {
  23960. result2 = input.charAt(pos.offset);
  23961. advance(pos, 1);
  23962. } else {
  23963. result2 = null;
  23964. if (reportFailures === 0) {
  23965. matchFailed("[a-zA-Z0-9]");
  23966. }
  23967. }
  23968. }
  23969. if (result1 !== null) {
  23970. result0 = [result0, result1];
  23971. } else {
  23972. result0 = null;
  23973. pos = clone(pos1);
  23974. }
  23975. } else {
  23976. result0 = null;
  23977. pos = clone(pos1);
  23978. }
  23979. if (result0 !== null) {
  23980. result0 = (function(offset, line, column, first, others) {return first + others.join("")})(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  23981. }
  23982. if (result0 === null) {
  23983. pos = clone(pos0);
  23984. }
  23985. cache[cacheKey] = {
  23986. nextPos: clone(pos),
  23987. result: result0
  23988. };
  23989. return result0;
  23990. }
  23991. function parse_keyword() {
  23992. var cacheKey = "keyword@" + pos.offset;
  23993. var cachedResult = cache[cacheKey];
  23994. if (cachedResult) {
  23995. pos = clone(cachedResult.nextPos);
  23996. return cachedResult.result;
  23997. }
  23998. var result0, result1;
  23999. var pos0, pos1;
  24000. pos0 = clone(pos);
  24001. pos1 = clone(pos);
  24002. result0 = parse_identifier();
  24003. if (result0 !== null) {
  24004. if (/^[:]/.test(input.charAt(pos.offset))) {
  24005. result1 = input.charAt(pos.offset);
  24006. advance(pos, 1);
  24007. } else {
  24008. result1 = null;
  24009. if (reportFailures === 0) {
  24010. matchFailed("[:]");
  24011. }
  24012. }
  24013. if (result1 !== null) {
  24014. result0 = [result0, result1];
  24015. } else {
  24016. result0 = null;
  24017. pos = clone(pos1);
  24018. }
  24019. } else {
  24020. result0 = null;
  24021. pos = clone(pos1);
  24022. }
  24023. if (result0 !== null) {
  24024. result0 = (function(offset, line, column, first, last) {return first + last})(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  24025. }
  24026. if (result0 === null) {
  24027. pos = clone(pos0);
  24028. }
  24029. cache[cacheKey] = {
  24030. nextPos: clone(pos),
  24031. result: result0
  24032. };
  24033. return result0;
  24034. }
  24035. function parse_className() {
  24036. var cacheKey = "className@" + pos.offset;
  24037. var cachedResult = cache[cacheKey];
  24038. if (cachedResult) {
  24039. pos = clone(cachedResult.nextPos);
  24040. return cachedResult.result;
  24041. }
  24042. var result0, result1, result2;
  24043. var pos0, pos1;
  24044. pos0 = clone(pos);
  24045. pos1 = clone(pos);
  24046. if (/^[A-Z]/.test(input.charAt(pos.offset))) {
  24047. result0 = input.charAt(pos.offset);
  24048. advance(pos, 1);
  24049. } else {
  24050. result0 = null;
  24051. if (reportFailures === 0) {
  24052. matchFailed("[A-Z]");
  24053. }
  24054. }
  24055. if (result0 !== null) {
  24056. result1 = [];
  24057. if (/^[a-zA-Z0-9]/.test(input.charAt(pos.offset))) {
  24058. result2 = input.charAt(pos.offset);
  24059. advance(pos, 1);
  24060. } else {
  24061. result2 = null;
  24062. if (reportFailures === 0) {
  24063. matchFailed("[a-zA-Z0-9]");
  24064. }
  24065. }
  24066. while (result2 !== null) {
  24067. result1.push(result2);
  24068. if (/^[a-zA-Z0-9]/.test(input.charAt(pos.offset))) {
  24069. result2 = input.charAt(pos.offset);
  24070. advance(pos, 1);
  24071. } else {
  24072. result2 = null;
  24073. if (reportFailures === 0) {
  24074. matchFailed("[a-zA-Z0-9]");
  24075. }
  24076. }
  24077. }
  24078. if (result1 !== null) {
  24079. result0 = [result0, result1];
  24080. } else {
  24081. result0 = null;
  24082. pos = clone(pos1);
  24083. }
  24084. } else {
  24085. result0 = null;
  24086. pos = clone(pos1);
  24087. }
  24088. if (result0 !== null) {
  24089. result0 = (function(offset, line, column, first, others) {return first + others.join("")})(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  24090. }
  24091. if (result0 === null) {
  24092. pos = clone(pos0);
  24093. }
  24094. cache[cacheKey] = {
  24095. nextPos: clone(pos),
  24096. result: result0
  24097. };
  24098. return result0;
  24099. }
  24100. function parse_string() {
  24101. var cacheKey = "string@" + pos.offset;
  24102. var cachedResult = cache[cacheKey];
  24103. if (cachedResult) {
  24104. pos = clone(cachedResult.nextPos);
  24105. return cachedResult.result;
  24106. }
  24107. var result0, result1, result2;
  24108. var pos0, pos1, pos2;
  24109. pos0 = clone(pos);
  24110. pos1 = clone(pos);
  24111. if (/^[']/.test(input.charAt(pos.offset))) {
  24112. result0 = input.charAt(pos.offset);
  24113. advance(pos, 1);
  24114. } else {
  24115. result0 = null;
  24116. if (reportFailures === 0) {
  24117. matchFailed("[']");
  24118. }
  24119. }
  24120. if (result0 !== null) {
  24121. result1 = [];
  24122. pos2 = clone(pos);
  24123. if (input.substr(pos.offset, 2) === "''") {
  24124. result2 = "''";
  24125. advance(pos, 2);
  24126. } else {
  24127. result2 = null;
  24128. if (reportFailures === 0) {
  24129. matchFailed("\"''\"");
  24130. }
  24131. }
  24132. if (result2 !== null) {
  24133. result2 = (function(offset, line, column) {return "'"})(pos2.offset, pos2.line, pos2.column);
  24134. }
  24135. if (result2 === null) {
  24136. pos = clone(pos2);
  24137. }
  24138. if (result2 === null) {
  24139. if (/^[^']/.test(input.charAt(pos.offset))) {
  24140. result2 = input.charAt(pos.offset);
  24141. advance(pos, 1);
  24142. } else {
  24143. result2 = null;
  24144. if (reportFailures === 0) {
  24145. matchFailed("[^']");
  24146. }
  24147. }
  24148. }
  24149. while (result2 !== null) {
  24150. result1.push(result2);
  24151. pos2 = clone(pos);
  24152. if (input.substr(pos.offset, 2) === "''") {
  24153. result2 = "''";
  24154. advance(pos, 2);
  24155. } else {
  24156. result2 = null;
  24157. if (reportFailures === 0) {
  24158. matchFailed("\"''\"");
  24159. }
  24160. }
  24161. if (result2 !== null) {
  24162. result2 = (function(offset, line, column) {return "'"})(pos2.offset, pos2.line, pos2.column);
  24163. }
  24164. if (result2 === null) {
  24165. pos = clone(pos2);
  24166. }
  24167. if (result2 === null) {
  24168. if (/^[^']/.test(input.charAt(pos.offset))) {
  24169. result2 = input.charAt(pos.offset);
  24170. advance(pos, 1);
  24171. } else {
  24172. result2 = null;
  24173. if (reportFailures === 0) {
  24174. matchFailed("[^']");
  24175. }
  24176. }
  24177. }
  24178. }
  24179. if (result1 !== null) {
  24180. if (/^[']/.test(input.charAt(pos.offset))) {
  24181. result2 = input.charAt(pos.offset);
  24182. advance(pos, 1);
  24183. } else {
  24184. result2 = null;
  24185. if (reportFailures === 0) {
  24186. matchFailed("[']");
  24187. }
  24188. }
  24189. if (result2 !== null) {
  24190. result0 = [result0, result1, result2];
  24191. } else {
  24192. result0 = null;
  24193. pos = clone(pos1);
  24194. }
  24195. } else {
  24196. result0 = null;
  24197. pos = clone(pos1);
  24198. }
  24199. } else {
  24200. result0 = null;
  24201. pos = clone(pos1);
  24202. }
  24203. if (result0 !== null) {
  24204. result0 = (function(offset, line, column, val) {
  24205. return smalltalk.ValueNode._new()
  24206. ._value_(val.join("").replace(/\"/ig, '"'))
  24207. })(pos0.offset, pos0.line, pos0.column, result0[1]);
  24208. }
  24209. if (result0 === null) {
  24210. pos = clone(pos0);
  24211. }
  24212. cache[cacheKey] = {
  24213. nextPos: clone(pos),
  24214. result: result0
  24215. };
  24216. return result0;
  24217. }
  24218. function parse_symbol() {
  24219. var cacheKey = "symbol@" + pos.offset;
  24220. var cachedResult = cache[cacheKey];
  24221. if (cachedResult) {
  24222. pos = clone(cachedResult.nextPos);
  24223. return cachedResult.result;
  24224. }
  24225. var result0, result1, result2, result3;
  24226. var pos0, pos1, pos2;
  24227. pos0 = clone(pos);
  24228. pos1 = clone(pos);
  24229. if (input.charCodeAt(pos.offset) === 35) {
  24230. result0 = "#";
  24231. advance(pos, 1);
  24232. } else {
  24233. result0 = null;
  24234. if (reportFailures === 0) {
  24235. matchFailed("\"#\"");
  24236. }
  24237. }
  24238. if (result0 !== null) {
  24239. result1 = [];
  24240. pos2 = clone(pos);
  24241. if (/^[a-zA-Z0-9:]/.test(input.charAt(pos.offset))) {
  24242. result3 = input.charAt(pos.offset);
  24243. advance(pos, 1);
  24244. } else {
  24245. result3 = null;
  24246. if (reportFailures === 0) {
  24247. matchFailed("[a-zA-Z0-9:]");
  24248. }
  24249. }
  24250. if (result3 !== null) {
  24251. result2 = [];
  24252. while (result3 !== null) {
  24253. result2.push(result3);
  24254. if (/^[a-zA-Z0-9:]/.test(input.charAt(pos.offset))) {
  24255. result3 = input.charAt(pos.offset);
  24256. advance(pos, 1);
  24257. } else {
  24258. result3 = null;
  24259. if (reportFailures === 0) {
  24260. matchFailed("[a-zA-Z0-9:]");
  24261. }
  24262. }
  24263. }
  24264. } else {
  24265. result2 = null;
  24266. }
  24267. if (result2 !== null) {
  24268. result2 = (function(offset, line, column, digits) {return digits.join("")})(pos2.offset, pos2.line, pos2.column, result2);
  24269. }
  24270. if (result2 === null) {
  24271. pos = clone(pos2);
  24272. }
  24273. if (result2 === null) {
  24274. pos2 = clone(pos);
  24275. result2 = parse_string();
  24276. if (result2 !== null) {
  24277. result2 = (function(offset, line, column, node) {return node._value()})(pos2.offset, pos2.line, pos2.column, result2);
  24278. }
  24279. if (result2 === null) {
  24280. pos = clone(pos2);
  24281. }
  24282. }
  24283. while (result2 !== null) {
  24284. result1.push(result2);
  24285. pos2 = clone(pos);
  24286. if (/^[a-zA-Z0-9:]/.test(input.charAt(pos.offset))) {
  24287. result3 = input.charAt(pos.offset);
  24288. advance(pos, 1);
  24289. } else {
  24290. result3 = null;
  24291. if (reportFailures === 0) {
  24292. matchFailed("[a-zA-Z0-9:]");
  24293. }
  24294. }
  24295. if (result3 !== null) {
  24296. result2 = [];
  24297. while (result3 !== null) {
  24298. result2.push(result3);
  24299. if (/^[a-zA-Z0-9:]/.test(input.charAt(pos.offset))) {
  24300. result3 = input.charAt(pos.offset);
  24301. advance(pos, 1);
  24302. } else {
  24303. result3 = null;
  24304. if (reportFailures === 0) {
  24305. matchFailed("[a-zA-Z0-9:]");
  24306. }
  24307. }
  24308. }
  24309. } else {
  24310. result2 = null;
  24311. }
  24312. if (result2 !== null) {
  24313. result2 = (function(offset, line, column, digits) {return digits.join("")})(pos2.offset, pos2.line, pos2.column, result2);
  24314. }
  24315. if (result2 === null) {
  24316. pos = clone(pos2);
  24317. }
  24318. if (result2 === null) {
  24319. pos2 = clone(pos);
  24320. result2 = parse_string();
  24321. if (result2 !== null) {
  24322. result2 = (function(offset, line, column, node) {return node._value()})(pos2.offset, pos2.line, pos2.column, result2);
  24323. }
  24324. if (result2 === null) {
  24325. pos = clone(pos2);
  24326. }
  24327. }
  24328. }
  24329. if (result1 !== null) {
  24330. result0 = [result0, result1];
  24331. } else {
  24332. result0 = null;
  24333. pos = clone(pos1);
  24334. }
  24335. } else {
  24336. result0 = null;
  24337. pos = clone(pos1);
  24338. }
  24339. if (result0 !== null) {
  24340. result0 = (function(offset, line, column, val) {
  24341. return smalltalk.ValueNode._new()
  24342. ._value_(smalltalk.symbolFor(val.join("").replace(/\"/ig, '"')))
  24343. })(pos0.offset, pos0.line, pos0.column, result0[1]);
  24344. }
  24345. if (result0 === null) {
  24346. pos = clone(pos0);
  24347. }
  24348. cache[cacheKey] = {
  24349. nextPos: clone(pos),
  24350. result: result0
  24351. };
  24352. return result0;
  24353. }
  24354. function parse_number() {
  24355. var cacheKey = "number@" + pos.offset;
  24356. var cachedResult = cache[cacheKey];
  24357. if (cachedResult) {
  24358. pos = clone(cachedResult.nextPos);
  24359. return cachedResult.result;
  24360. }
  24361. var result0;
  24362. var pos0;
  24363. pos0 = clone(pos);
  24364. result0 = parse_hex();
  24365. if (result0 === null) {
  24366. result0 = parse_float();
  24367. if (result0 === null) {
  24368. result0 = parse_integer();
  24369. }
  24370. }
  24371. if (result0 !== null) {
  24372. result0 = (function(offset, line, column, n) {
  24373. return smalltalk.ValueNode._new()
  24374. ._value_(n)
  24375. })(pos0.offset, pos0.line, pos0.column, result0);
  24376. }
  24377. if (result0 === null) {
  24378. pos = clone(pos0);
  24379. }
  24380. cache[cacheKey] = {
  24381. nextPos: clone(pos),
  24382. result: result0
  24383. };
  24384. return result0;
  24385. }
  24386. function parse_hex() {
  24387. var cacheKey = "hex@" + pos.offset;
  24388. var cachedResult = cache[cacheKey];
  24389. if (cachedResult) {
  24390. pos = clone(cachedResult.nextPos);
  24391. return cachedResult.result;
  24392. }
  24393. var result0, result1, result2, result3;
  24394. var pos0, pos1;
  24395. pos0 = clone(pos);
  24396. pos1 = clone(pos);
  24397. if (/^[\-]/.test(input.charAt(pos.offset))) {
  24398. result0 = input.charAt(pos.offset);
  24399. advance(pos, 1);
  24400. } else {
  24401. result0 = null;
  24402. if (reportFailures === 0) {
  24403. matchFailed("[\\-]");
  24404. }
  24405. }
  24406. result0 = result0 !== null ? result0 : "";
  24407. if (result0 !== null) {
  24408. if (input.substr(pos.offset, 3) === "16r") {
  24409. result1 = "16r";
  24410. advance(pos, 3);
  24411. } else {
  24412. result1 = null;
  24413. if (reportFailures === 0) {
  24414. matchFailed("\"16r\"");
  24415. }
  24416. }
  24417. if (result1 !== null) {
  24418. if (/^[0-9a-fA-F]/.test(input.charAt(pos.offset))) {
  24419. result3 = input.charAt(pos.offset);
  24420. advance(pos, 1);
  24421. } else {
  24422. result3 = null;
  24423. if (reportFailures === 0) {
  24424. matchFailed("[0-9a-fA-F]");
  24425. }
  24426. }
  24427. if (result3 !== null) {
  24428. result2 = [];
  24429. while (result3 !== null) {
  24430. result2.push(result3);
  24431. if (/^[0-9a-fA-F]/.test(input.charAt(pos.offset))) {
  24432. result3 = input.charAt(pos.offset);
  24433. advance(pos, 1);
  24434. } else {
  24435. result3 = null;
  24436. if (reportFailures === 0) {
  24437. matchFailed("[0-9a-fA-F]");
  24438. }
  24439. }
  24440. }
  24441. } else {
  24442. result2 = null;
  24443. }
  24444. if (result2 !== null) {
  24445. result0 = [result0, result1, result2];
  24446. } else {
  24447. result0 = null;
  24448. pos = clone(pos1);
  24449. }
  24450. } else {
  24451. result0 = null;
  24452. pos = clone(pos1);
  24453. }
  24454. } else {
  24455. result0 = null;
  24456. pos = clone(pos1);
  24457. }
  24458. if (result0 !== null) {
  24459. result0 = (function(offset, line, column, neg, num) {return parseInt((neg + num.join("")), 16)})(pos0.offset, pos0.line, pos0.column, result0[0], result0[2]);
  24460. }
  24461. if (result0 === null) {
  24462. pos = clone(pos0);
  24463. }
  24464. cache[cacheKey] = {
  24465. nextPos: clone(pos),
  24466. result: result0
  24467. };
  24468. return result0;
  24469. }
  24470. function parse_float() {
  24471. var cacheKey = "float@" + pos.offset;
  24472. var cachedResult = cache[cacheKey];
  24473. if (cachedResult) {
  24474. pos = clone(cachedResult.nextPos);
  24475. return cachedResult.result;
  24476. }
  24477. var result0, result1, result2, result3, result4;
  24478. var pos0, pos1;
  24479. pos0 = clone(pos);
  24480. pos1 = clone(pos);
  24481. if (/^[\-]/.test(input.charAt(pos.offset))) {
  24482. result0 = input.charAt(pos.offset);
  24483. advance(pos, 1);
  24484. } else {
  24485. result0 = null;
  24486. if (reportFailures === 0) {
  24487. matchFailed("[\\-]");
  24488. }
  24489. }
  24490. result0 = result0 !== null ? result0 : "";
  24491. if (result0 !== null) {
  24492. if (/^[0-9]/.test(input.charAt(pos.offset))) {
  24493. result2 = input.charAt(pos.offset);
  24494. advance(pos, 1);
  24495. } else {
  24496. result2 = null;
  24497. if (reportFailures === 0) {
  24498. matchFailed("[0-9]");
  24499. }
  24500. }
  24501. if (result2 !== null) {
  24502. result1 = [];
  24503. while (result2 !== null) {
  24504. result1.push(result2);
  24505. if (/^[0-9]/.test(input.charAt(pos.offset))) {
  24506. result2 = input.charAt(pos.offset);
  24507. advance(pos, 1);
  24508. } else {
  24509. result2 = null;
  24510. if (reportFailures === 0) {
  24511. matchFailed("[0-9]");
  24512. }
  24513. }
  24514. }
  24515. } else {
  24516. result1 = null;
  24517. }
  24518. if (result1 !== null) {
  24519. if (input.charCodeAt(pos.offset) === 46) {
  24520. result2 = ".";
  24521. advance(pos, 1);
  24522. } else {
  24523. result2 = null;
  24524. if (reportFailures === 0) {
  24525. matchFailed("\".\"");
  24526. }
  24527. }
  24528. if (result2 !== null) {
  24529. if (/^[0-9]/.test(input.charAt(pos.offset))) {
  24530. result4 = input.charAt(pos.offset);
  24531. advance(pos, 1);
  24532. } else {
  24533. result4 = null;
  24534. if (reportFailures === 0) {
  24535. matchFailed("[0-9]");
  24536. }
  24537. }
  24538. if (result4 !== null) {
  24539. result3 = [];
  24540. while (result4 !== null) {
  24541. result3.push(result4);
  24542. if (/^[0-9]/.test(input.charAt(pos.offset))) {
  24543. result4 = input.charAt(pos.offset);
  24544. advance(pos, 1);
  24545. } else {
  24546. result4 = null;
  24547. if (reportFailures === 0) {
  24548. matchFailed("[0-9]");
  24549. }
  24550. }
  24551. }
  24552. } else {
  24553. result3 = null;
  24554. }
  24555. if (result3 !== null) {
  24556. result0 = [result0, result1, result2, result3];
  24557. } else {
  24558. result0 = null;
  24559. pos = clone(pos1);
  24560. }
  24561. } else {
  24562. result0 = null;
  24563. pos = clone(pos1);
  24564. }
  24565. } else {
  24566. result0 = null;
  24567. pos = clone(pos1);
  24568. }
  24569. } else {
  24570. result0 = null;
  24571. pos = clone(pos1);
  24572. }
  24573. if (result0 !== null) {
  24574. result0 = (function(offset, line, column, neg, int, dec) {return parseFloat((neg + int.join("") + "." + dec.join("")), 10)})(pos0.offset, pos0.line, pos0.column, result0[0], result0[1], result0[3]);
  24575. }
  24576. if (result0 === null) {
  24577. pos = clone(pos0);
  24578. }
  24579. cache[cacheKey] = {
  24580. nextPos: clone(pos),
  24581. result: result0
  24582. };
  24583. return result0;
  24584. }
  24585. function parse_integer() {
  24586. var cacheKey = "integer@" + pos.offset;
  24587. var cachedResult = cache[cacheKey];
  24588. if (cachedResult) {
  24589. pos = clone(cachedResult.nextPos);
  24590. return cachedResult.result;
  24591. }
  24592. var result0, result1, result2;
  24593. var pos0, pos1;
  24594. pos0 = clone(pos);
  24595. pos1 = clone(pos);
  24596. if (/^[\-]/.test(input.charAt(pos.offset))) {
  24597. result0 = input.charAt(pos.offset);
  24598. advance(pos, 1);
  24599. } else {
  24600. result0 = null;
  24601. if (reportFailures === 0) {
  24602. matchFailed("[\\-]");
  24603. }
  24604. }
  24605. result0 = result0 !== null ? result0 : "";
  24606. if (result0 !== null) {
  24607. if (/^[0-9]/.test(input.charAt(pos.offset))) {
  24608. result2 = input.charAt(pos.offset);
  24609. advance(pos, 1);
  24610. } else {
  24611. result2 = null;
  24612. if (reportFailures === 0) {
  24613. matchFailed("[0-9]");
  24614. }
  24615. }
  24616. if (result2 !== null) {
  24617. result1 = [];
  24618. while (result2 !== null) {
  24619. result1.push(result2);
  24620. if (/^[0-9]/.test(input.charAt(pos.offset))) {
  24621. result2 = input.charAt(pos.offset);
  24622. advance(pos, 1);
  24623. } else {
  24624. result2 = null;
  24625. if (reportFailures === 0) {
  24626. matchFailed("[0-9]");
  24627. }
  24628. }
  24629. }
  24630. } else {
  24631. result1 = null;
  24632. }
  24633. if (result1 !== null) {
  24634. result0 = [result0, result1];
  24635. } else {
  24636. result0 = null;
  24637. pos = clone(pos1);
  24638. }
  24639. } else {
  24640. result0 = null;
  24641. pos = clone(pos1);
  24642. }
  24643. if (result0 !== null) {
  24644. result0 = (function(offset, line, column, neg, digits) {return (parseInt(neg+digits.join(""), 10))})(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  24645. }
  24646. if (result0 === null) {
  24647. pos = clone(pos0);
  24648. }
  24649. cache[cacheKey] = {
  24650. nextPos: clone(pos),
  24651. result: result0
  24652. };
  24653. return result0;
  24654. }
  24655. function parse_literalArray() {
  24656. var cacheKey = "literalArray@" + pos.offset;
  24657. var cachedResult = cache[cacheKey];
  24658. if (cachedResult) {
  24659. pos = clone(cachedResult.nextPos);
  24660. return cachedResult.result;
  24661. }
  24662. var result0, result1, result2, result3, result4;
  24663. var pos0, pos1, pos2, pos3;
  24664. pos0 = clone(pos);
  24665. pos1 = clone(pos);
  24666. if (input.substr(pos.offset, 2) === "#(") {
  24667. result0 = "#(";
  24668. advance(pos, 2);
  24669. } else {
  24670. result0 = null;
  24671. if (reportFailures === 0) {
  24672. matchFailed("\"#(\"");
  24673. }
  24674. }
  24675. if (result0 !== null) {
  24676. result1 = parse_ws();
  24677. if (result1 !== null) {
  24678. result2 = [];
  24679. pos2 = clone(pos);
  24680. pos3 = clone(pos);
  24681. result3 = parse_literal();
  24682. if (result3 !== null) {
  24683. result4 = parse_ws();
  24684. if (result4 !== null) {
  24685. result3 = [result3, result4];
  24686. } else {
  24687. result3 = null;
  24688. pos = clone(pos3);
  24689. }
  24690. } else {
  24691. result3 = null;
  24692. pos = clone(pos3);
  24693. }
  24694. if (result3 !== null) {
  24695. result3 = (function(offset, line, column, lit) {return lit._value()})(pos2.offset, pos2.line, pos2.column, result3[0]);
  24696. }
  24697. if (result3 === null) {
  24698. pos = clone(pos2);
  24699. }
  24700. while (result3 !== null) {
  24701. result2.push(result3);
  24702. pos2 = clone(pos);
  24703. pos3 = clone(pos);
  24704. result3 = parse_literal();
  24705. if (result3 !== null) {
  24706. result4 = parse_ws();
  24707. if (result4 !== null) {
  24708. result3 = [result3, result4];
  24709. } else {
  24710. result3 = null;
  24711. pos = clone(pos3);
  24712. }
  24713. } else {
  24714. result3 = null;
  24715. pos = clone(pos3);
  24716. }
  24717. if (result3 !== null) {
  24718. result3 = (function(offset, line, column, lit) {return lit._value()})(pos2.offset, pos2.line, pos2.column, result3[0]);
  24719. }
  24720. if (result3 === null) {
  24721. pos = clone(pos2);
  24722. }
  24723. }
  24724. if (result2 !== null) {
  24725. result3 = parse_ws();
  24726. if (result3 !== null) {
  24727. if (input.charCodeAt(pos.offset) === 41) {
  24728. result4 = ")";
  24729. advance(pos, 1);
  24730. } else {
  24731. result4 = null;
  24732. if (reportFailures === 0) {
  24733. matchFailed("\")\"");
  24734. }
  24735. }
  24736. if (result4 !== null) {
  24737. result0 = [result0, result1, result2, result3, result4];
  24738. } else {
  24739. result0 = null;
  24740. pos = clone(pos1);
  24741. }
  24742. } else {
  24743. result0 = null;
  24744. pos = clone(pos1);
  24745. }
  24746. } else {
  24747. result0 = null;
  24748. pos = clone(pos1);
  24749. }
  24750. } else {
  24751. result0 = null;
  24752. pos = clone(pos1);
  24753. }
  24754. } else {
  24755. result0 = null;
  24756. pos = clone(pos1);
  24757. }
  24758. if (result0 !== null) {
  24759. result0 = (function(offset, line, column, lits) {
  24760. return smalltalk.ValueNode._new()
  24761. ._value_(lits)
  24762. })(pos0.offset, pos0.line, pos0.column, result0[2]);
  24763. }
  24764. if (result0 === null) {
  24765. pos = clone(pos0);
  24766. }
  24767. cache[cacheKey] = {
  24768. nextPos: clone(pos),
  24769. result: result0
  24770. };
  24771. return result0;
  24772. }
  24773. function parse_dynamicArray() {
  24774. var cacheKey = "dynamicArray@" + pos.offset;
  24775. var cachedResult = cache[cacheKey];
  24776. if (cachedResult) {
  24777. pos = clone(cachedResult.nextPos);
  24778. return cachedResult.result;
  24779. }
  24780. var result0, result1, result2, result3, result4, result5;
  24781. var pos0, pos1;
  24782. pos0 = clone(pos);
  24783. pos1 = clone(pos);
  24784. if (input.charCodeAt(pos.offset) === 123) {
  24785. result0 = "{";
  24786. advance(pos, 1);
  24787. } else {
  24788. result0 = null;
  24789. if (reportFailures === 0) {
  24790. matchFailed("\"{\"");
  24791. }
  24792. }
  24793. if (result0 !== null) {
  24794. result1 = parse_ws();
  24795. if (result1 !== null) {
  24796. result2 = parse_expressions();
  24797. result2 = result2 !== null ? result2 : "";
  24798. if (result2 !== null) {
  24799. result3 = parse_ws();
  24800. if (result3 !== null) {
  24801. if (input.charCodeAt(pos.offset) === 46) {
  24802. result4 = ".";
  24803. advance(pos, 1);
  24804. } else {
  24805. result4 = null;
  24806. if (reportFailures === 0) {
  24807. matchFailed("\".\"");
  24808. }
  24809. }
  24810. result4 = result4 !== null ? result4 : "";
  24811. if (result4 !== null) {
  24812. if (input.charCodeAt(pos.offset) === 125) {
  24813. result5 = "}";
  24814. advance(pos, 1);
  24815. } else {
  24816. result5 = null;
  24817. if (reportFailures === 0) {
  24818. matchFailed("\"}\"");
  24819. }
  24820. }
  24821. if (result5 !== null) {
  24822. result0 = [result0, result1, result2, result3, result4, result5];
  24823. } else {
  24824. result0 = null;
  24825. pos = clone(pos1);
  24826. }
  24827. } else {
  24828. result0 = null;
  24829. pos = clone(pos1);
  24830. }
  24831. } else {
  24832. result0 = null;
  24833. pos = clone(pos1);
  24834. }
  24835. } else {
  24836. result0 = null;
  24837. pos = clone(pos1);
  24838. }
  24839. } else {
  24840. result0 = null;
  24841. pos = clone(pos1);
  24842. }
  24843. } else {
  24844. result0 = null;
  24845. pos = clone(pos1);
  24846. }
  24847. if (result0 !== null) {
  24848. result0 = (function(offset, line, column, expressions) {
  24849. return smalltalk.DynamicArrayNode._new()
  24850. ._nodes_(expressions)
  24851. })(pos0.offset, pos0.line, pos0.column, result0[2]);
  24852. }
  24853. if (result0 === null) {
  24854. pos = clone(pos0);
  24855. }
  24856. cache[cacheKey] = {
  24857. nextPos: clone(pos),
  24858. result: result0
  24859. };
  24860. return result0;
  24861. }
  24862. function parse_dynamicDictionary() {
  24863. var cacheKey = "dynamicDictionary@" + pos.offset;
  24864. var cachedResult = cache[cacheKey];
  24865. if (cachedResult) {
  24866. pos = clone(cachedResult.nextPos);
  24867. return cachedResult.result;
  24868. }
  24869. var result0, result1, result2, result3, result4;
  24870. var pos0, pos1;
  24871. pos0 = clone(pos);
  24872. pos1 = clone(pos);
  24873. if (input.substr(pos.offset, 2) === "#{") {
  24874. result0 = "#{";
  24875. advance(pos, 2);
  24876. } else {
  24877. result0 = null;
  24878. if (reportFailures === 0) {
  24879. matchFailed("\"#{\"");
  24880. }
  24881. }
  24882. if (result0 !== null) {
  24883. result1 = parse_ws();
  24884. if (result1 !== null) {
  24885. result2 = parse_expressions();
  24886. result2 = result2 !== null ? result2 : "";
  24887. if (result2 !== null) {
  24888. result3 = parse_ws();
  24889. if (result3 !== null) {
  24890. if (input.charCodeAt(pos.offset) === 125) {
  24891. result4 = "}";
  24892. advance(pos, 1);
  24893. } else {
  24894. result4 = null;
  24895. if (reportFailures === 0) {
  24896. matchFailed("\"}\"");
  24897. }
  24898. }
  24899. if (result4 !== null) {
  24900. result0 = [result0, result1, result2, result3, result4];
  24901. } else {
  24902. result0 = null;
  24903. pos = clone(pos1);
  24904. }
  24905. } else {
  24906. result0 = null;
  24907. pos = clone(pos1);
  24908. }
  24909. } else {
  24910. result0 = null;
  24911. pos = clone(pos1);
  24912. }
  24913. } else {
  24914. result0 = null;
  24915. pos = clone(pos1);
  24916. }
  24917. } else {
  24918. result0 = null;
  24919. pos = clone(pos1);
  24920. }
  24921. if (result0 !== null) {
  24922. result0 = (function(offset, line, column, expressions) {
  24923. return smalltalk.DynamicDictionaryNode._new()
  24924. ._nodes_(expressions)
  24925. })(pos0.offset, pos0.line, pos0.column, result0[2]);
  24926. }
  24927. if (result0 === null) {
  24928. pos = clone(pos0);
  24929. }
  24930. cache[cacheKey] = {
  24931. nextPos: clone(pos),
  24932. result: result0
  24933. };
  24934. return result0;
  24935. }
  24936. function parse_pseudoVariable() {
  24937. var cacheKey = "pseudoVariable@" + pos.offset;
  24938. var cachedResult = cache[cacheKey];
  24939. if (cachedResult) {
  24940. pos = clone(cachedResult.nextPos);
  24941. return cachedResult.result;
  24942. }
  24943. var result0;
  24944. var pos0, pos1;
  24945. pos0 = clone(pos);
  24946. pos1 = clone(pos);
  24947. if (input.substr(pos.offset, 4) === "true") {
  24948. result0 = "true";
  24949. advance(pos, 4);
  24950. } else {
  24951. result0 = null;
  24952. if (reportFailures === 0) {
  24953. matchFailed("\"true\"");
  24954. }
  24955. }
  24956. if (result0 !== null) {
  24957. result0 = (function(offset, line, column) {return true})(pos1.offset, pos1.line, pos1.column);
  24958. }
  24959. if (result0 === null) {
  24960. pos = clone(pos1);
  24961. }
  24962. if (result0 === null) {
  24963. pos1 = clone(pos);
  24964. if (input.substr(pos.offset, 5) === "false") {
  24965. result0 = "false";
  24966. advance(pos, 5);
  24967. } else {
  24968. result0 = null;
  24969. if (reportFailures === 0) {
  24970. matchFailed("\"false\"");
  24971. }
  24972. }
  24973. if (result0 !== null) {
  24974. result0 = (function(offset, line, column) {return false})(pos1.offset, pos1.line, pos1.column);
  24975. }
  24976. if (result0 === null) {
  24977. pos = clone(pos1);
  24978. }
  24979. if (result0 === null) {
  24980. pos1 = clone(pos);
  24981. if (input.substr(pos.offset, 3) === "nil") {
  24982. result0 = "nil";
  24983. advance(pos, 3);
  24984. } else {
  24985. result0 = null;
  24986. if (reportFailures === 0) {
  24987. matchFailed("\"nil\"");
  24988. }
  24989. }
  24990. if (result0 !== null) {
  24991. result0 = (function(offset, line, column) {return nil})(pos1.offset, pos1.line, pos1.column);
  24992. }
  24993. if (result0 === null) {
  24994. pos = clone(pos1);
  24995. }
  24996. }
  24997. }
  24998. if (result0 !== null) {
  24999. result0 = (function(offset, line, column, val) {
  25000. return smalltalk.ValueNode._new()
  25001. ._value_(val)
  25002. })(pos0.offset, pos0.line, pos0.column, result0);
  25003. }
  25004. if (result0 === null) {
  25005. pos = clone(pos0);
  25006. }
  25007. cache[cacheKey] = {
  25008. nextPos: clone(pos),
  25009. result: result0
  25010. };
  25011. return result0;
  25012. }
  25013. function parse_literal() {
  25014. var cacheKey = "literal@" + pos.offset;
  25015. var cachedResult = cache[cacheKey];
  25016. if (cachedResult) {
  25017. pos = clone(cachedResult.nextPos);
  25018. return cachedResult.result;
  25019. }
  25020. var result0;
  25021. result0 = parse_pseudoVariable();
  25022. if (result0 === null) {
  25023. result0 = parse_number();
  25024. if (result0 === null) {
  25025. result0 = parse_literalArray();
  25026. if (result0 === null) {
  25027. result0 = parse_dynamicDictionary();
  25028. if (result0 === null) {
  25029. result0 = parse_dynamicArray();
  25030. if (result0 === null) {
  25031. result0 = parse_string();
  25032. if (result0 === null) {
  25033. result0 = parse_symbol();
  25034. if (result0 === null) {
  25035. result0 = parse_block();
  25036. }
  25037. }
  25038. }
  25039. }
  25040. }
  25041. }
  25042. }
  25043. cache[cacheKey] = {
  25044. nextPos: clone(pos),
  25045. result: result0
  25046. };
  25047. return result0;
  25048. }
  25049. function parse_variable() {
  25050. var cacheKey = "variable@" + pos.offset;
  25051. var cachedResult = cache[cacheKey];
  25052. if (cachedResult) {
  25053. pos = clone(cachedResult.nextPos);
  25054. return cachedResult.result;
  25055. }
  25056. var result0;
  25057. var pos0;
  25058. pos0 = clone(pos);
  25059. result0 = parse_varIdentifier();
  25060. if (result0 !== null) {
  25061. result0 = (function(offset, line, column, identifier) {
  25062. return smalltalk.VariableNode._new()
  25063. ._value_(identifier)
  25064. })(pos0.offset, pos0.line, pos0.column, result0);
  25065. }
  25066. if (result0 === null) {
  25067. pos = clone(pos0);
  25068. }
  25069. cache[cacheKey] = {
  25070. nextPos: clone(pos),
  25071. result: result0
  25072. };
  25073. return result0;
  25074. }
  25075. function parse_classReference() {
  25076. var cacheKey = "classReference@" + pos.offset;
  25077. var cachedResult = cache[cacheKey];
  25078. if (cachedResult) {
  25079. pos = clone(cachedResult.nextPos);
  25080. return cachedResult.result;
  25081. }
  25082. var result0;
  25083. var pos0;
  25084. pos0 = clone(pos);
  25085. result0 = parse_className();
  25086. if (result0 !== null) {
  25087. result0 = (function(offset, line, column, className) {
  25088. return smalltalk.ClassReferenceNode._new()
  25089. ._value_(className)
  25090. })(pos0.offset, pos0.line, pos0.column, result0);
  25091. }
  25092. if (result0 === null) {
  25093. pos = clone(pos0);
  25094. }
  25095. cache[cacheKey] = {
  25096. nextPos: clone(pos),
  25097. result: result0
  25098. };
  25099. return result0;
  25100. }
  25101. function parse_reference() {
  25102. var cacheKey = "reference@" + pos.offset;
  25103. var cachedResult = cache[cacheKey];
  25104. if (cachedResult) {
  25105. pos = clone(cachedResult.nextPos);
  25106. return cachedResult.result;
  25107. }
  25108. var result0;
  25109. result0 = parse_variable();
  25110. if (result0 === null) {
  25111. result0 = parse_classReference();
  25112. }
  25113. cache[cacheKey] = {
  25114. nextPos: clone(pos),
  25115. result: result0
  25116. };
  25117. return result0;
  25118. }
  25119. function parse_keywordPair() {
  25120. var cacheKey = "keywordPair@" + pos.offset;
  25121. var cachedResult = cache[cacheKey];
  25122. if (cachedResult) {
  25123. pos = clone(cachedResult.nextPos);
  25124. return cachedResult.result;
  25125. }
  25126. var result0, result1, result2, result3;
  25127. var pos0, pos1;
  25128. pos0 = clone(pos);
  25129. pos1 = clone(pos);
  25130. result0 = parse_keyword();
  25131. if (result0 !== null) {
  25132. result1 = parse_ws();
  25133. if (result1 !== null) {
  25134. result2 = parse_binarySend();
  25135. if (result2 !== null) {
  25136. result3 = parse_ws();
  25137. if (result3 !== null) {
  25138. result0 = [result0, result1, result2, result3];
  25139. } else {
  25140. result0 = null;
  25141. pos = clone(pos1);
  25142. }
  25143. } else {
  25144. result0 = null;
  25145. pos = clone(pos1);
  25146. }
  25147. } else {
  25148. result0 = null;
  25149. pos = clone(pos1);
  25150. }
  25151. } else {
  25152. result0 = null;
  25153. pos = clone(pos1);
  25154. }
  25155. if (result0 !== null) {
  25156. result0 = (function(offset, line, column, key, arg) {return {key:key, arg: arg}})(pos0.offset, pos0.line, pos0.column, result0[0], result0[2]);
  25157. }
  25158. if (result0 === null) {
  25159. pos = clone(pos0);
  25160. }
  25161. cache[cacheKey] = {
  25162. nextPos: clone(pos),
  25163. result: result0
  25164. };
  25165. return result0;
  25166. }
  25167. function parse_binarySelector() {
  25168. var cacheKey = "binarySelector@" + pos.offset;
  25169. var cachedResult = cache[cacheKey];
  25170. if (cachedResult) {
  25171. pos = clone(cachedResult.nextPos);
  25172. return cachedResult.result;
  25173. }
  25174. var result0, result1;
  25175. var pos0;
  25176. pos0 = clone(pos);
  25177. if (/^[\\+*\/=><,@%~|&\-]/.test(input.charAt(pos.offset))) {
  25178. result1 = input.charAt(pos.offset);
  25179. advance(pos, 1);
  25180. } else {
  25181. result1 = null;
  25182. if (reportFailures === 0) {
  25183. matchFailed("[\\\\+*\\/=><,@%~|&\\-]");
  25184. }
  25185. }
  25186. if (result1 !== null) {
  25187. result0 = [];
  25188. while (result1 !== null) {
  25189. result0.push(result1);
  25190. if (/^[\\+*\/=><,@%~|&\-]/.test(input.charAt(pos.offset))) {
  25191. result1 = input.charAt(pos.offset);
  25192. advance(pos, 1);
  25193. } else {
  25194. result1 = null;
  25195. if (reportFailures === 0) {
  25196. matchFailed("[\\\\+*\\/=><,@%~|&\\-]");
  25197. }
  25198. }
  25199. }
  25200. } else {
  25201. result0 = null;
  25202. }
  25203. if (result0 !== null) {
  25204. result0 = (function(offset, line, column, bin) {return bin.join("")})(pos0.offset, pos0.line, pos0.column, result0);
  25205. }
  25206. if (result0 === null) {
  25207. pos = clone(pos0);
  25208. }
  25209. cache[cacheKey] = {
  25210. nextPos: clone(pos),
  25211. result: result0
  25212. };
  25213. return result0;
  25214. }
  25215. function parse_keywordPattern() {
  25216. var cacheKey = "keywordPattern@" + pos.offset;
  25217. var cachedResult = cache[cacheKey];
  25218. if (cachedResult) {
  25219. pos = clone(cachedResult.nextPos);
  25220. return cachedResult.result;
  25221. }
  25222. var result0, result1, result2, result3, result4;
  25223. var pos0, pos1, pos2;
  25224. pos0 = clone(pos);
  25225. pos1 = clone(pos);
  25226. pos2 = clone(pos);
  25227. result1 = parse_ws();
  25228. if (result1 !== null) {
  25229. result2 = parse_keyword();
  25230. if (result2 !== null) {
  25231. result3 = parse_ws();
  25232. if (result3 !== null) {
  25233. result4 = parse_identifier();
  25234. if (result4 !== null) {
  25235. result1 = [result1, result2, result3, result4];
  25236. } else {
  25237. result1 = null;
  25238. pos = clone(pos2);
  25239. }
  25240. } else {
  25241. result1 = null;
  25242. pos = clone(pos2);
  25243. }
  25244. } else {
  25245. result1 = null;
  25246. pos = clone(pos2);
  25247. }
  25248. } else {
  25249. result1 = null;
  25250. pos = clone(pos2);
  25251. }
  25252. if (result1 !== null) {
  25253. result1 = (function(offset, line, column, key, arg) {return {key:key, arg: arg}})(pos1.offset, pos1.line, pos1.column, result1[1], result1[3]);
  25254. }
  25255. if (result1 === null) {
  25256. pos = clone(pos1);
  25257. }
  25258. if (result1 !== null) {
  25259. result0 = [];
  25260. while (result1 !== null) {
  25261. result0.push(result1);
  25262. pos1 = clone(pos);
  25263. pos2 = clone(pos);
  25264. result1 = parse_ws();
  25265. if (result1 !== null) {
  25266. result2 = parse_keyword();
  25267. if (result2 !== null) {
  25268. result3 = parse_ws();
  25269. if (result3 !== null) {
  25270. result4 = parse_identifier();
  25271. if (result4 !== null) {
  25272. result1 = [result1, result2, result3, result4];
  25273. } else {
  25274. result1 = null;
  25275. pos = clone(pos2);
  25276. }
  25277. } else {
  25278. result1 = null;
  25279. pos = clone(pos2);
  25280. }
  25281. } else {
  25282. result1 = null;
  25283. pos = clone(pos2);
  25284. }
  25285. } else {
  25286. result1 = null;
  25287. pos = clone(pos2);
  25288. }
  25289. if (result1 !== null) {
  25290. result1 = (function(offset, line, column, key, arg) {return {key:key, arg: arg}})(pos1.offset, pos1.line, pos1.column, result1[1], result1[3]);
  25291. }
  25292. if (result1 === null) {
  25293. pos = clone(pos1);
  25294. }
  25295. }
  25296. } else {
  25297. result0 = null;
  25298. }
  25299. if (result0 !== null) {
  25300. result0 = (function(offset, line, column, pairs) {
  25301. var keywords = [];
  25302. var params = [];
  25303. for(var i=0;i<pairs.length;i++){
  25304. keywords.push(pairs[i].key);
  25305. }
  25306. for(var i=0;i<pairs.length;i++){
  25307. params.push(pairs[i].arg);
  25308. }
  25309. return [keywords.join(""), params]
  25310. })(pos0.offset, pos0.line, pos0.column, result0);
  25311. }
  25312. if (result0 === null) {
  25313. pos = clone(pos0);
  25314. }
  25315. cache[cacheKey] = {
  25316. nextPos: clone(pos),
  25317. result: result0
  25318. };
  25319. return result0;
  25320. }
  25321. function parse_binaryPattern() {
  25322. var cacheKey = "binaryPattern@" + pos.offset;
  25323. var cachedResult = cache[cacheKey];
  25324. if (cachedResult) {
  25325. pos = clone(cachedResult.nextPos);
  25326. return cachedResult.result;
  25327. }
  25328. var result0, result1, result2, result3;
  25329. var pos0, pos1;
  25330. pos0 = clone(pos);
  25331. pos1 = clone(pos);
  25332. result0 = parse_ws();
  25333. if (result0 !== null) {
  25334. result1 = parse_binarySelector();
  25335. if (result1 !== null) {
  25336. result2 = parse_ws();
  25337. if (result2 !== null) {
  25338. result3 = parse_identifier();
  25339. if (result3 !== null) {
  25340. result0 = [result0, result1, result2, result3];
  25341. } else {
  25342. result0 = null;
  25343. pos = clone(pos1);
  25344. }
  25345. } else {
  25346. result0 = null;
  25347. pos = clone(pos1);
  25348. }
  25349. } else {
  25350. result0 = null;
  25351. pos = clone(pos1);
  25352. }
  25353. } else {
  25354. result0 = null;
  25355. pos = clone(pos1);
  25356. }
  25357. if (result0 !== null) {
  25358. result0 = (function(offset, line, column, selector, arg) {return [selector, [arg]]})(pos0.offset, pos0.line, pos0.column, result0[1], result0[3]);
  25359. }
  25360. if (result0 === null) {
  25361. pos = clone(pos0);
  25362. }
  25363. cache[cacheKey] = {
  25364. nextPos: clone(pos),
  25365. result: result0
  25366. };
  25367. return result0;
  25368. }
  25369. function parse_unaryPattern() {
  25370. var cacheKey = "unaryPattern@" + pos.offset;
  25371. var cachedResult = cache[cacheKey];
  25372. if (cachedResult) {
  25373. pos = clone(cachedResult.nextPos);
  25374. return cachedResult.result;
  25375. }
  25376. var result0, result1;
  25377. var pos0, pos1;
  25378. pos0 = clone(pos);
  25379. pos1 = clone(pos);
  25380. result0 = parse_ws();
  25381. if (result0 !== null) {
  25382. result1 = parse_identifier();
  25383. if (result1 !== null) {
  25384. result0 = [result0, result1];
  25385. } else {
  25386. result0 = null;
  25387. pos = clone(pos1);
  25388. }
  25389. } else {
  25390. result0 = null;
  25391. pos = clone(pos1);
  25392. }
  25393. if (result0 !== null) {
  25394. result0 = (function(offset, line, column, selector) {return [selector, []]})(pos0.offset, pos0.line, pos0.column, result0[1]);
  25395. }
  25396. if (result0 === null) {
  25397. pos = clone(pos0);
  25398. }
  25399. cache[cacheKey] = {
  25400. nextPos: clone(pos),
  25401. result: result0
  25402. };
  25403. return result0;
  25404. }
  25405. function parse_expression() {
  25406. var cacheKey = "expression@" + pos.offset;
  25407. var cachedResult = cache[cacheKey];
  25408. if (cachedResult) {
  25409. pos = clone(cachedResult.nextPos);
  25410. return cachedResult.result;
  25411. }
  25412. var result0;
  25413. result0 = parse_assignment();
  25414. if (result0 === null) {
  25415. result0 = parse_cascade();
  25416. if (result0 === null) {
  25417. result0 = parse_keywordSend();
  25418. if (result0 === null) {
  25419. result0 = parse_binarySend();
  25420. }
  25421. }
  25422. }
  25423. cache[cacheKey] = {
  25424. nextPos: clone(pos),
  25425. result: result0
  25426. };
  25427. return result0;
  25428. }
  25429. function parse_expressionList() {
  25430. var cacheKey = "expressionList@" + pos.offset;
  25431. var cachedResult = cache[cacheKey];
  25432. if (cachedResult) {
  25433. pos = clone(cachedResult.nextPos);
  25434. return cachedResult.result;
  25435. }
  25436. var result0, result1, result2, result3;
  25437. var pos0, pos1;
  25438. pos0 = clone(pos);
  25439. pos1 = clone(pos);
  25440. result0 = parse_ws();
  25441. if (result0 !== null) {
  25442. if (input.charCodeAt(pos.offset) === 46) {
  25443. result1 = ".";
  25444. advance(pos, 1);
  25445. } else {
  25446. result1 = null;
  25447. if (reportFailures === 0) {
  25448. matchFailed("\".\"");
  25449. }
  25450. }
  25451. if (result1 !== null) {
  25452. result2 = parse_ws();
  25453. if (result2 !== null) {
  25454. result3 = parse_expression();
  25455. if (result3 !== null) {
  25456. result0 = [result0, result1, result2, result3];
  25457. } else {
  25458. result0 = null;
  25459. pos = clone(pos1);
  25460. }
  25461. } else {
  25462. result0 = null;
  25463. pos = clone(pos1);
  25464. }
  25465. } else {
  25466. result0 = null;
  25467. pos = clone(pos1);
  25468. }
  25469. } else {
  25470. result0 = null;
  25471. pos = clone(pos1);
  25472. }
  25473. if (result0 !== null) {
  25474. result0 = (function(offset, line, column, expression) {return expression})(pos0.offset, pos0.line, pos0.column, result0[3]);
  25475. }
  25476. if (result0 === null) {
  25477. pos = clone(pos0);
  25478. }
  25479. cache[cacheKey] = {
  25480. nextPos: clone(pos),
  25481. result: result0
  25482. };
  25483. return result0;
  25484. }
  25485. function parse_expressions() {
  25486. var cacheKey = "expressions@" + pos.offset;
  25487. var cachedResult = cache[cacheKey];
  25488. if (cachedResult) {
  25489. pos = clone(cachedResult.nextPos);
  25490. return cachedResult.result;
  25491. }
  25492. var result0, result1, result2;
  25493. var pos0, pos1;
  25494. pos0 = clone(pos);
  25495. pos1 = clone(pos);
  25496. result0 = parse_expression();
  25497. if (result0 !== null) {
  25498. result1 = [];
  25499. result2 = parse_expressionList();
  25500. while (result2 !== null) {
  25501. result1.push(result2);
  25502. result2 = parse_expressionList();
  25503. }
  25504. if (result1 !== null) {
  25505. result0 = [result0, result1];
  25506. } else {
  25507. result0 = null;
  25508. pos = clone(pos1);
  25509. }
  25510. } else {
  25511. result0 = null;
  25512. pos = clone(pos1);
  25513. }
  25514. if (result0 !== null) {
  25515. result0 = (function(offset, line, column, first, others) {
  25516. var result = [first];
  25517. for(var i=0;i<others.length;i++) {
  25518. result.push(others[i]);
  25519. }
  25520. return result;
  25521. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  25522. }
  25523. if (result0 === null) {
  25524. pos = clone(pos0);
  25525. }
  25526. cache[cacheKey] = {
  25527. nextPos: clone(pos),
  25528. result: result0
  25529. };
  25530. return result0;
  25531. }
  25532. function parse_assignment() {
  25533. var cacheKey = "assignment@" + pos.offset;
  25534. var cachedResult = cache[cacheKey];
  25535. if (cachedResult) {
  25536. pos = clone(cachedResult.nextPos);
  25537. return cachedResult.result;
  25538. }
  25539. var result0, result1, result2, result3, result4;
  25540. var pos0, pos1;
  25541. pos0 = clone(pos);
  25542. pos1 = clone(pos);
  25543. result0 = parse_variable();
  25544. if (result0 !== null) {
  25545. result1 = parse_ws();
  25546. if (result1 !== null) {
  25547. if (input.substr(pos.offset, 2) === ":=") {
  25548. result2 = ":=";
  25549. advance(pos, 2);
  25550. } else {
  25551. result2 = null;
  25552. if (reportFailures === 0) {
  25553. matchFailed("\":=\"");
  25554. }
  25555. }
  25556. if (result2 !== null) {
  25557. result3 = parse_ws();
  25558. if (result3 !== null) {
  25559. result4 = parse_expression();
  25560. if (result4 !== null) {
  25561. result0 = [result0, result1, result2, result3, result4];
  25562. } else {
  25563. result0 = null;
  25564. pos = clone(pos1);
  25565. }
  25566. } else {
  25567. result0 = null;
  25568. pos = clone(pos1);
  25569. }
  25570. } else {
  25571. result0 = null;
  25572. pos = clone(pos1);
  25573. }
  25574. } else {
  25575. result0 = null;
  25576. pos = clone(pos1);
  25577. }
  25578. } else {
  25579. result0 = null;
  25580. pos = clone(pos1);
  25581. }
  25582. if (result0 !== null) {
  25583. result0 = (function(offset, line, column, variable, expression) {
  25584. return smalltalk.AssignmentNode._new()
  25585. ._left_(variable)
  25586. ._right_(expression)
  25587. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[4]);
  25588. }
  25589. if (result0 === null) {
  25590. pos = clone(pos0);
  25591. }
  25592. cache[cacheKey] = {
  25593. nextPos: clone(pos),
  25594. result: result0
  25595. };
  25596. return result0;
  25597. }
  25598. function parse_ret() {
  25599. var cacheKey = "ret@" + pos.offset;
  25600. var cachedResult = cache[cacheKey];
  25601. if (cachedResult) {
  25602. pos = clone(cachedResult.nextPos);
  25603. return cachedResult.result;
  25604. }
  25605. var result0, result1, result2, result3, result4;
  25606. var pos0, pos1;
  25607. pos0 = clone(pos);
  25608. pos1 = clone(pos);
  25609. if (input.charCodeAt(pos.offset) === 94) {
  25610. result0 = "^";
  25611. advance(pos, 1);
  25612. } else {
  25613. result0 = null;
  25614. if (reportFailures === 0) {
  25615. matchFailed("\"^\"");
  25616. }
  25617. }
  25618. if (result0 !== null) {
  25619. result1 = parse_ws();
  25620. if (result1 !== null) {
  25621. result2 = parse_expression();
  25622. if (result2 !== null) {
  25623. result3 = parse_ws();
  25624. if (result3 !== null) {
  25625. if (input.charCodeAt(pos.offset) === 46) {
  25626. result4 = ".";
  25627. advance(pos, 1);
  25628. } else {
  25629. result4 = null;
  25630. if (reportFailures === 0) {
  25631. matchFailed("\".\"");
  25632. }
  25633. }
  25634. result4 = result4 !== null ? result4 : "";
  25635. if (result4 !== null) {
  25636. result0 = [result0, result1, result2, result3, result4];
  25637. } else {
  25638. result0 = null;
  25639. pos = clone(pos1);
  25640. }
  25641. } else {
  25642. result0 = null;
  25643. pos = clone(pos1);
  25644. }
  25645. } else {
  25646. result0 = null;
  25647. pos = clone(pos1);
  25648. }
  25649. } else {
  25650. result0 = null;
  25651. pos = clone(pos1);
  25652. }
  25653. } else {
  25654. result0 = null;
  25655. pos = clone(pos1);
  25656. }
  25657. if (result0 !== null) {
  25658. result0 = (function(offset, line, column, expression) {
  25659. return smalltalk.ReturnNode._new()
  25660. ._nodes_([expression])
  25661. })(pos0.offset, pos0.line, pos0.column, result0[2]);
  25662. }
  25663. if (result0 === null) {
  25664. pos = clone(pos0);
  25665. }
  25666. cache[cacheKey] = {
  25667. nextPos: clone(pos),
  25668. result: result0
  25669. };
  25670. return result0;
  25671. }
  25672. function parse_temps() {
  25673. var cacheKey = "temps@" + pos.offset;
  25674. var cachedResult = cache[cacheKey];
  25675. if (cachedResult) {
  25676. pos = clone(cachedResult.nextPos);
  25677. return cachedResult.result;
  25678. }
  25679. var result0, result1, result2, result3, result4;
  25680. var pos0, pos1, pos2, pos3;
  25681. pos0 = clone(pos);
  25682. pos1 = clone(pos);
  25683. if (input.charCodeAt(pos.offset) === 124) {
  25684. result0 = "|";
  25685. advance(pos, 1);
  25686. } else {
  25687. result0 = null;
  25688. if (reportFailures === 0) {
  25689. matchFailed("\"|\"");
  25690. }
  25691. }
  25692. if (result0 !== null) {
  25693. result1 = [];
  25694. pos2 = clone(pos);
  25695. pos3 = clone(pos);
  25696. result2 = parse_ws();
  25697. if (result2 !== null) {
  25698. result3 = parse_identifier();
  25699. if (result3 !== null) {
  25700. result4 = parse_ws();
  25701. if (result4 !== null) {
  25702. result2 = [result2, result3, result4];
  25703. } else {
  25704. result2 = null;
  25705. pos = clone(pos3);
  25706. }
  25707. } else {
  25708. result2 = null;
  25709. pos = clone(pos3);
  25710. }
  25711. } else {
  25712. result2 = null;
  25713. pos = clone(pos3);
  25714. }
  25715. if (result2 !== null) {
  25716. result2 = (function(offset, line, column, variable) {return variable})(pos2.offset, pos2.line, pos2.column, result2[1]);
  25717. }
  25718. if (result2 === null) {
  25719. pos = clone(pos2);
  25720. }
  25721. while (result2 !== null) {
  25722. result1.push(result2);
  25723. pos2 = clone(pos);
  25724. pos3 = clone(pos);
  25725. result2 = parse_ws();
  25726. if (result2 !== null) {
  25727. result3 = parse_identifier();
  25728. if (result3 !== null) {
  25729. result4 = parse_ws();
  25730. if (result4 !== null) {
  25731. result2 = [result2, result3, result4];
  25732. } else {
  25733. result2 = null;
  25734. pos = clone(pos3);
  25735. }
  25736. } else {
  25737. result2 = null;
  25738. pos = clone(pos3);
  25739. }
  25740. } else {
  25741. result2 = null;
  25742. pos = clone(pos3);
  25743. }
  25744. if (result2 !== null) {
  25745. result2 = (function(offset, line, column, variable) {return variable})(pos2.offset, pos2.line, pos2.column, result2[1]);
  25746. }
  25747. if (result2 === null) {
  25748. pos = clone(pos2);
  25749. }
  25750. }
  25751. if (result1 !== null) {
  25752. if (input.charCodeAt(pos.offset) === 124) {
  25753. result2 = "|";
  25754. advance(pos, 1);
  25755. } else {
  25756. result2 = null;
  25757. if (reportFailures === 0) {
  25758. matchFailed("\"|\"");
  25759. }
  25760. }
  25761. if (result2 !== null) {
  25762. result0 = [result0, result1, result2];
  25763. } else {
  25764. result0 = null;
  25765. pos = clone(pos1);
  25766. }
  25767. } else {
  25768. result0 = null;
  25769. pos = clone(pos1);
  25770. }
  25771. } else {
  25772. result0 = null;
  25773. pos = clone(pos1);
  25774. }
  25775. if (result0 !== null) {
  25776. result0 = (function(offset, line, column, vars) {return vars})(pos0.offset, pos0.line, pos0.column, result0[1]);
  25777. }
  25778. if (result0 === null) {
  25779. pos = clone(pos0);
  25780. }
  25781. cache[cacheKey] = {
  25782. nextPos: clone(pos),
  25783. result: result0
  25784. };
  25785. return result0;
  25786. }
  25787. function parse_blockParamList() {
  25788. var cacheKey = "blockParamList@" + pos.offset;
  25789. var cachedResult = cache[cacheKey];
  25790. if (cachedResult) {
  25791. pos = clone(cachedResult.nextPos);
  25792. return cachedResult.result;
  25793. }
  25794. var result0, result1, result2, result3, result4;
  25795. var pos0, pos1, pos2, pos3;
  25796. pos0 = clone(pos);
  25797. pos1 = clone(pos);
  25798. pos2 = clone(pos);
  25799. pos3 = clone(pos);
  25800. result1 = parse_ws();
  25801. if (result1 !== null) {
  25802. if (input.charCodeAt(pos.offset) === 58) {
  25803. result2 = ":";
  25804. advance(pos, 1);
  25805. } else {
  25806. result2 = null;
  25807. if (reportFailures === 0) {
  25808. matchFailed("\":\"");
  25809. }
  25810. }
  25811. if (result2 !== null) {
  25812. result3 = parse_ws();
  25813. if (result3 !== null) {
  25814. result4 = parse_identifier();
  25815. if (result4 !== null) {
  25816. result1 = [result1, result2, result3, result4];
  25817. } else {
  25818. result1 = null;
  25819. pos = clone(pos3);
  25820. }
  25821. } else {
  25822. result1 = null;
  25823. pos = clone(pos3);
  25824. }
  25825. } else {
  25826. result1 = null;
  25827. pos = clone(pos3);
  25828. }
  25829. } else {
  25830. result1 = null;
  25831. pos = clone(pos3);
  25832. }
  25833. if (result1 !== null) {
  25834. result1 = (function(offset, line, column, param) {return param})(pos2.offset, pos2.line, pos2.column, result1[3]);
  25835. }
  25836. if (result1 === null) {
  25837. pos = clone(pos2);
  25838. }
  25839. if (result1 !== null) {
  25840. result0 = [];
  25841. while (result1 !== null) {
  25842. result0.push(result1);
  25843. pos2 = clone(pos);
  25844. pos3 = clone(pos);
  25845. result1 = parse_ws();
  25846. if (result1 !== null) {
  25847. if (input.charCodeAt(pos.offset) === 58) {
  25848. result2 = ":";
  25849. advance(pos, 1);
  25850. } else {
  25851. result2 = null;
  25852. if (reportFailures === 0) {
  25853. matchFailed("\":\"");
  25854. }
  25855. }
  25856. if (result2 !== null) {
  25857. result3 = parse_ws();
  25858. if (result3 !== null) {
  25859. result4 = parse_identifier();
  25860. if (result4 !== null) {
  25861. result1 = [result1, result2, result3, result4];
  25862. } else {
  25863. result1 = null;
  25864. pos = clone(pos3);
  25865. }
  25866. } else {
  25867. result1 = null;
  25868. pos = clone(pos3);
  25869. }
  25870. } else {
  25871. result1 = null;
  25872. pos = clone(pos3);
  25873. }
  25874. } else {
  25875. result1 = null;
  25876. pos = clone(pos3);
  25877. }
  25878. if (result1 !== null) {
  25879. result1 = (function(offset, line, column, param) {return param})(pos2.offset, pos2.line, pos2.column, result1[3]);
  25880. }
  25881. if (result1 === null) {
  25882. pos = clone(pos2);
  25883. }
  25884. }
  25885. } else {
  25886. result0 = null;
  25887. }
  25888. if (result0 !== null) {
  25889. result1 = parse_ws();
  25890. if (result1 !== null) {
  25891. if (input.charCodeAt(pos.offset) === 124) {
  25892. result2 = "|";
  25893. advance(pos, 1);
  25894. } else {
  25895. result2 = null;
  25896. if (reportFailures === 0) {
  25897. matchFailed("\"|\"");
  25898. }
  25899. }
  25900. if (result2 !== null) {
  25901. result0 = [result0, result1, result2];
  25902. } else {
  25903. result0 = null;
  25904. pos = clone(pos1);
  25905. }
  25906. } else {
  25907. result0 = null;
  25908. pos = clone(pos1);
  25909. }
  25910. } else {
  25911. result0 = null;
  25912. pos = clone(pos1);
  25913. }
  25914. if (result0 !== null) {
  25915. result0 = (function(offset, line, column, params) {return params})(pos0.offset, pos0.line, pos0.column, result0[0]);
  25916. }
  25917. if (result0 === null) {
  25918. pos = clone(pos0);
  25919. }
  25920. cache[cacheKey] = {
  25921. nextPos: clone(pos),
  25922. result: result0
  25923. };
  25924. return result0;
  25925. }
  25926. function parse_subexpression() {
  25927. var cacheKey = "subexpression@" + pos.offset;
  25928. var cachedResult = cache[cacheKey];
  25929. if (cachedResult) {
  25930. pos = clone(cachedResult.nextPos);
  25931. return cachedResult.result;
  25932. }
  25933. var result0, result1, result2, result3, result4;
  25934. var pos0, pos1;
  25935. pos0 = clone(pos);
  25936. pos1 = clone(pos);
  25937. if (input.charCodeAt(pos.offset) === 40) {
  25938. result0 = "(";
  25939. advance(pos, 1);
  25940. } else {
  25941. result0 = null;
  25942. if (reportFailures === 0) {
  25943. matchFailed("\"(\"");
  25944. }
  25945. }
  25946. if (result0 !== null) {
  25947. result1 = parse_ws();
  25948. if (result1 !== null) {
  25949. result2 = parse_expression();
  25950. if (result2 !== null) {
  25951. result3 = parse_ws();
  25952. if (result3 !== null) {
  25953. if (input.charCodeAt(pos.offset) === 41) {
  25954. result4 = ")";
  25955. advance(pos, 1);
  25956. } else {
  25957. result4 = null;
  25958. if (reportFailures === 0) {
  25959. matchFailed("\")\"");
  25960. }
  25961. }
  25962. if (result4 !== null) {
  25963. result0 = [result0, result1, result2, result3, result4];
  25964. } else {
  25965. result0 = null;
  25966. pos = clone(pos1);
  25967. }
  25968. } else {
  25969. result0 = null;
  25970. pos = clone(pos1);
  25971. }
  25972. } else {
  25973. result0 = null;
  25974. pos = clone(pos1);
  25975. }
  25976. } else {
  25977. result0 = null;
  25978. pos = clone(pos1);
  25979. }
  25980. } else {
  25981. result0 = null;
  25982. pos = clone(pos1);
  25983. }
  25984. if (result0 !== null) {
  25985. result0 = (function(offset, line, column, expression) {return expression})(pos0.offset, pos0.line, pos0.column, result0[2]);
  25986. }
  25987. if (result0 === null) {
  25988. pos = clone(pos0);
  25989. }
  25990. cache[cacheKey] = {
  25991. nextPos: clone(pos),
  25992. result: result0
  25993. };
  25994. return result0;
  25995. }
  25996. function parse_statements() {
  25997. var cacheKey = "statements@" + pos.offset;
  25998. var cachedResult = cache[cacheKey];
  25999. if (cachedResult) {
  26000. pos = clone(cachedResult.nextPos);
  26001. return cachedResult.result;
  26002. }
  26003. var result0, result1, result2, result3, result4, result5, result6;
  26004. var pos0, pos1;
  26005. pos0 = clone(pos);
  26006. pos1 = clone(pos);
  26007. result0 = parse_ret();
  26008. if (result0 !== null) {
  26009. result1 = [];
  26010. if (/^[.]/.test(input.charAt(pos.offset))) {
  26011. result2 = input.charAt(pos.offset);
  26012. advance(pos, 1);
  26013. } else {
  26014. result2 = null;
  26015. if (reportFailures === 0) {
  26016. matchFailed("[.]");
  26017. }
  26018. }
  26019. while (result2 !== null) {
  26020. result1.push(result2);
  26021. if (/^[.]/.test(input.charAt(pos.offset))) {
  26022. result2 = input.charAt(pos.offset);
  26023. advance(pos, 1);
  26024. } else {
  26025. result2 = null;
  26026. if (reportFailures === 0) {
  26027. matchFailed("[.]");
  26028. }
  26029. }
  26030. }
  26031. if (result1 !== null) {
  26032. result0 = [result0, result1];
  26033. } else {
  26034. result0 = null;
  26035. pos = clone(pos1);
  26036. }
  26037. } else {
  26038. result0 = null;
  26039. pos = clone(pos1);
  26040. }
  26041. if (result0 !== null) {
  26042. result0 = (function(offset, line, column, ret) {return [ret]})(pos0.offset, pos0.line, pos0.column, result0[0]);
  26043. }
  26044. if (result0 === null) {
  26045. pos = clone(pos0);
  26046. }
  26047. if (result0 === null) {
  26048. pos0 = clone(pos);
  26049. pos1 = clone(pos);
  26050. result0 = parse_expressions();
  26051. if (result0 !== null) {
  26052. result1 = parse_ws();
  26053. if (result1 !== null) {
  26054. if (/^[.]/.test(input.charAt(pos.offset))) {
  26055. result3 = input.charAt(pos.offset);
  26056. advance(pos, 1);
  26057. } else {
  26058. result3 = null;
  26059. if (reportFailures === 0) {
  26060. matchFailed("[.]");
  26061. }
  26062. }
  26063. if (result3 !== null) {
  26064. result2 = [];
  26065. while (result3 !== null) {
  26066. result2.push(result3);
  26067. if (/^[.]/.test(input.charAt(pos.offset))) {
  26068. result3 = input.charAt(pos.offset);
  26069. advance(pos, 1);
  26070. } else {
  26071. result3 = null;
  26072. if (reportFailures === 0) {
  26073. matchFailed("[.]");
  26074. }
  26075. }
  26076. }
  26077. } else {
  26078. result2 = null;
  26079. }
  26080. if (result2 !== null) {
  26081. result3 = parse_ws();
  26082. if (result3 !== null) {
  26083. result4 = parse_ret();
  26084. if (result4 !== null) {
  26085. result5 = [];
  26086. if (/^[.]/.test(input.charAt(pos.offset))) {
  26087. result6 = input.charAt(pos.offset);
  26088. advance(pos, 1);
  26089. } else {
  26090. result6 = null;
  26091. if (reportFailures === 0) {
  26092. matchFailed("[.]");
  26093. }
  26094. }
  26095. while (result6 !== null) {
  26096. result5.push(result6);
  26097. if (/^[.]/.test(input.charAt(pos.offset))) {
  26098. result6 = input.charAt(pos.offset);
  26099. advance(pos, 1);
  26100. } else {
  26101. result6 = null;
  26102. if (reportFailures === 0) {
  26103. matchFailed("[.]");
  26104. }
  26105. }
  26106. }
  26107. if (result5 !== null) {
  26108. result0 = [result0, result1, result2, result3, result4, result5];
  26109. } else {
  26110. result0 = null;
  26111. pos = clone(pos1);
  26112. }
  26113. } else {
  26114. result0 = null;
  26115. pos = clone(pos1);
  26116. }
  26117. } else {
  26118. result0 = null;
  26119. pos = clone(pos1);
  26120. }
  26121. } else {
  26122. result0 = null;
  26123. pos = clone(pos1);
  26124. }
  26125. } else {
  26126. result0 = null;
  26127. pos = clone(pos1);
  26128. }
  26129. } else {
  26130. result0 = null;
  26131. pos = clone(pos1);
  26132. }
  26133. if (result0 !== null) {
  26134. result0 = (function(offset, line, column, exps, ret) {
  26135. var expressions = exps;
  26136. expressions.push(ret);
  26137. return expressions
  26138. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[4]);
  26139. }
  26140. if (result0 === null) {
  26141. pos = clone(pos0);
  26142. }
  26143. if (result0 === null) {
  26144. pos0 = clone(pos);
  26145. pos1 = clone(pos);
  26146. result0 = parse_expressions();
  26147. result0 = result0 !== null ? result0 : "";
  26148. if (result0 !== null) {
  26149. result1 = [];
  26150. if (/^[.]/.test(input.charAt(pos.offset))) {
  26151. result2 = input.charAt(pos.offset);
  26152. advance(pos, 1);
  26153. } else {
  26154. result2 = null;
  26155. if (reportFailures === 0) {
  26156. matchFailed("[.]");
  26157. }
  26158. }
  26159. while (result2 !== null) {
  26160. result1.push(result2);
  26161. if (/^[.]/.test(input.charAt(pos.offset))) {
  26162. result2 = input.charAt(pos.offset);
  26163. advance(pos, 1);
  26164. } else {
  26165. result2 = null;
  26166. if (reportFailures === 0) {
  26167. matchFailed("[.]");
  26168. }
  26169. }
  26170. }
  26171. if (result1 !== null) {
  26172. result0 = [result0, result1];
  26173. } else {
  26174. result0 = null;
  26175. pos = clone(pos1);
  26176. }
  26177. } else {
  26178. result0 = null;
  26179. pos = clone(pos1);
  26180. }
  26181. if (result0 !== null) {
  26182. result0 = (function(offset, line, column, expressions) {
  26183. return expressions || []
  26184. })(pos0.offset, pos0.line, pos0.column, result0[0]);
  26185. }
  26186. if (result0 === null) {
  26187. pos = clone(pos0);
  26188. }
  26189. }
  26190. }
  26191. cache[cacheKey] = {
  26192. nextPos: clone(pos),
  26193. result: result0
  26194. };
  26195. return result0;
  26196. }
  26197. function parse_sequence() {
  26198. var cacheKey = "sequence@" + pos.offset;
  26199. var cachedResult = cache[cacheKey];
  26200. if (cachedResult) {
  26201. pos = clone(cachedResult.nextPos);
  26202. return cachedResult.result;
  26203. }
  26204. var result0;
  26205. result0 = parse_jsStatement();
  26206. if (result0 === null) {
  26207. result0 = parse_stSequence();
  26208. }
  26209. cache[cacheKey] = {
  26210. nextPos: clone(pos),
  26211. result: result0
  26212. };
  26213. return result0;
  26214. }
  26215. function parse_stSequence() {
  26216. var cacheKey = "stSequence@" + pos.offset;
  26217. var cachedResult = cache[cacheKey];
  26218. if (cachedResult) {
  26219. pos = clone(cachedResult.nextPos);
  26220. return cachedResult.result;
  26221. }
  26222. var result0, result1, result2, result3;
  26223. var pos0, pos1;
  26224. pos0 = clone(pos);
  26225. pos1 = clone(pos);
  26226. result0 = parse_temps();
  26227. result0 = result0 !== null ? result0 : "";
  26228. if (result0 !== null) {
  26229. result1 = parse_ws();
  26230. if (result1 !== null) {
  26231. result2 = parse_statements();
  26232. result2 = result2 !== null ? result2 : "";
  26233. if (result2 !== null) {
  26234. result3 = parse_ws();
  26235. if (result3 !== null) {
  26236. result0 = [result0, result1, result2, result3];
  26237. } else {
  26238. result0 = null;
  26239. pos = clone(pos1);
  26240. }
  26241. } else {
  26242. result0 = null;
  26243. pos = clone(pos1);
  26244. }
  26245. } else {
  26246. result0 = null;
  26247. pos = clone(pos1);
  26248. }
  26249. } else {
  26250. result0 = null;
  26251. pos = clone(pos1);
  26252. }
  26253. if (result0 !== null) {
  26254. result0 = (function(offset, line, column, temps, statements) {
  26255. return smalltalk.SequenceNode._new()
  26256. ._temps_(temps || [])
  26257. ._nodes_(statements || [])
  26258. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[2]);
  26259. }
  26260. if (result0 === null) {
  26261. pos = clone(pos0);
  26262. }
  26263. cache[cacheKey] = {
  26264. nextPos: clone(pos),
  26265. result: result0
  26266. };
  26267. return result0;
  26268. }
  26269. function parse_block() {
  26270. var cacheKey = "block@" + pos.offset;
  26271. var cachedResult = cache[cacheKey];
  26272. if (cachedResult) {
  26273. pos = clone(cachedResult.nextPos);
  26274. return cachedResult.result;
  26275. }
  26276. var result0, result1, result2, result3, result4, result5, result6;
  26277. var pos0, pos1;
  26278. pos0 = clone(pos);
  26279. pos1 = clone(pos);
  26280. if (input.charCodeAt(pos.offset) === 91) {
  26281. result0 = "[";
  26282. advance(pos, 1);
  26283. } else {
  26284. result0 = null;
  26285. if (reportFailures === 0) {
  26286. matchFailed("\"[\"");
  26287. }
  26288. }
  26289. if (result0 !== null) {
  26290. result1 = parse_ws();
  26291. if (result1 !== null) {
  26292. result2 = parse_blockParamList();
  26293. result2 = result2 !== null ? result2 : "";
  26294. if (result2 !== null) {
  26295. result3 = parse_ws();
  26296. if (result3 !== null) {
  26297. result4 = parse_sequence();
  26298. result4 = result4 !== null ? result4 : "";
  26299. if (result4 !== null) {
  26300. result5 = parse_ws();
  26301. if (result5 !== null) {
  26302. if (input.charCodeAt(pos.offset) === 93) {
  26303. result6 = "]";
  26304. advance(pos, 1);
  26305. } else {
  26306. result6 = null;
  26307. if (reportFailures === 0) {
  26308. matchFailed("\"]\"");
  26309. }
  26310. }
  26311. if (result6 !== null) {
  26312. result0 = [result0, result1, result2, result3, result4, result5, result6];
  26313. } else {
  26314. result0 = null;
  26315. pos = clone(pos1);
  26316. }
  26317. } else {
  26318. result0 = null;
  26319. pos = clone(pos1);
  26320. }
  26321. } else {
  26322. result0 = null;
  26323. pos = clone(pos1);
  26324. }
  26325. } else {
  26326. result0 = null;
  26327. pos = clone(pos1);
  26328. }
  26329. } else {
  26330. result0 = null;
  26331. pos = clone(pos1);
  26332. }
  26333. } else {
  26334. result0 = null;
  26335. pos = clone(pos1);
  26336. }
  26337. } else {
  26338. result0 = null;
  26339. pos = clone(pos1);
  26340. }
  26341. if (result0 !== null) {
  26342. result0 = (function(offset, line, column, params, sequence) {
  26343. return smalltalk.BlockNode._new()
  26344. ._parameters_(params || [])
  26345. ._nodes_([sequence._asBlockSequenceNode()])
  26346. })(pos0.offset, pos0.line, pos0.column, result0[2], result0[4]);
  26347. }
  26348. if (result0 === null) {
  26349. pos = clone(pos0);
  26350. }
  26351. cache[cacheKey] = {
  26352. nextPos: clone(pos),
  26353. result: result0
  26354. };
  26355. return result0;
  26356. }
  26357. function parse_operand() {
  26358. var cacheKey = "operand@" + pos.offset;
  26359. var cachedResult = cache[cacheKey];
  26360. if (cachedResult) {
  26361. pos = clone(cachedResult.nextPos);
  26362. return cachedResult.result;
  26363. }
  26364. var result0;
  26365. result0 = parse_literal();
  26366. if (result0 === null) {
  26367. result0 = parse_reference();
  26368. if (result0 === null) {
  26369. result0 = parse_subexpression();
  26370. }
  26371. }
  26372. cache[cacheKey] = {
  26373. nextPos: clone(pos),
  26374. result: result0
  26375. };
  26376. return result0;
  26377. }
  26378. function parse_unaryMessage() {
  26379. var cacheKey = "unaryMessage@" + pos.offset;
  26380. var cachedResult = cache[cacheKey];
  26381. if (cachedResult) {
  26382. pos = clone(cachedResult.nextPos);
  26383. return cachedResult.result;
  26384. }
  26385. var result0, result1, result2;
  26386. var pos0, pos1, pos2;
  26387. pos0 = clone(pos);
  26388. pos1 = clone(pos);
  26389. result0 = parse_ws();
  26390. if (result0 !== null) {
  26391. result1 = parse_identifier();
  26392. if (result1 !== null) {
  26393. pos2 = clone(pos);
  26394. reportFailures++;
  26395. if (/^[:]/.test(input.charAt(pos.offset))) {
  26396. result2 = input.charAt(pos.offset);
  26397. advance(pos, 1);
  26398. } else {
  26399. result2 = null;
  26400. if (reportFailures === 0) {
  26401. matchFailed("[:]");
  26402. }
  26403. }
  26404. reportFailures--;
  26405. if (result2 === null) {
  26406. result2 = "";
  26407. } else {
  26408. result2 = null;
  26409. pos = clone(pos2);
  26410. }
  26411. if (result2 !== null) {
  26412. result0 = [result0, result1, result2];
  26413. } else {
  26414. result0 = null;
  26415. pos = clone(pos1);
  26416. }
  26417. } else {
  26418. result0 = null;
  26419. pos = clone(pos1);
  26420. }
  26421. } else {
  26422. result0 = null;
  26423. pos = clone(pos1);
  26424. }
  26425. if (result0 !== null) {
  26426. result0 = (function(offset, line, column, selector) {
  26427. return smalltalk.SendNode._new()
  26428. ._selector_(selector)
  26429. })(pos0.offset, pos0.line, pos0.column, result0[1]);
  26430. }
  26431. if (result0 === null) {
  26432. pos = clone(pos0);
  26433. }
  26434. cache[cacheKey] = {
  26435. nextPos: clone(pos),
  26436. result: result0
  26437. };
  26438. return result0;
  26439. }
  26440. function parse_unaryTail() {
  26441. var cacheKey = "unaryTail@" + pos.offset;
  26442. var cachedResult = cache[cacheKey];
  26443. if (cachedResult) {
  26444. pos = clone(cachedResult.nextPos);
  26445. return cachedResult.result;
  26446. }
  26447. var result0, result1, result2, result3;
  26448. var pos0, pos1;
  26449. pos0 = clone(pos);
  26450. pos1 = clone(pos);
  26451. result0 = parse_unaryMessage();
  26452. if (result0 !== null) {
  26453. result1 = parse_ws();
  26454. if (result1 !== null) {
  26455. result2 = parse_unaryTail();
  26456. result2 = result2 !== null ? result2 : "";
  26457. if (result2 !== null) {
  26458. result3 = parse_ws();
  26459. if (result3 !== null) {
  26460. result0 = [result0, result1, result2, result3];
  26461. } else {
  26462. result0 = null;
  26463. pos = clone(pos1);
  26464. }
  26465. } else {
  26466. result0 = null;
  26467. pos = clone(pos1);
  26468. }
  26469. } else {
  26470. result0 = null;
  26471. pos = clone(pos1);
  26472. }
  26473. } else {
  26474. result0 = null;
  26475. pos = clone(pos1);
  26476. }
  26477. if (result0 !== null) {
  26478. result0 = (function(offset, line, column, message, tail) {
  26479. if(tail) {
  26480. return tail._valueForReceiver_(message);
  26481. }
  26482. else {
  26483. return message;
  26484. }
  26485. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[2]);
  26486. }
  26487. if (result0 === null) {
  26488. pos = clone(pos0);
  26489. }
  26490. cache[cacheKey] = {
  26491. nextPos: clone(pos),
  26492. result: result0
  26493. };
  26494. return result0;
  26495. }
  26496. function parse_unarySend() {
  26497. var cacheKey = "unarySend@" + pos.offset;
  26498. var cachedResult = cache[cacheKey];
  26499. if (cachedResult) {
  26500. pos = clone(cachedResult.nextPos);
  26501. return cachedResult.result;
  26502. }
  26503. var result0, result1, result2;
  26504. var pos0, pos1;
  26505. pos0 = clone(pos);
  26506. pos1 = clone(pos);
  26507. result0 = parse_operand();
  26508. if (result0 !== null) {
  26509. result1 = parse_ws();
  26510. if (result1 !== null) {
  26511. result2 = parse_unaryTail();
  26512. result2 = result2 !== null ? result2 : "";
  26513. if (result2 !== null) {
  26514. result0 = [result0, result1, result2];
  26515. } else {
  26516. result0 = null;
  26517. pos = clone(pos1);
  26518. }
  26519. } else {
  26520. result0 = null;
  26521. pos = clone(pos1);
  26522. }
  26523. } else {
  26524. result0 = null;
  26525. pos = clone(pos1);
  26526. }
  26527. if (result0 !== null) {
  26528. result0 = (function(offset, line, column, receiver, tail) {
  26529. if(tail) {
  26530. return tail._valueForReceiver_(receiver);
  26531. }
  26532. else {
  26533. return receiver;
  26534. }
  26535. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[2]);
  26536. }
  26537. if (result0 === null) {
  26538. pos = clone(pos0);
  26539. }
  26540. cache[cacheKey] = {
  26541. nextPos: clone(pos),
  26542. result: result0
  26543. };
  26544. return result0;
  26545. }
  26546. function parse_binaryMessage() {
  26547. var cacheKey = "binaryMessage@" + pos.offset;
  26548. var cachedResult = cache[cacheKey];
  26549. if (cachedResult) {
  26550. pos = clone(cachedResult.nextPos);
  26551. return cachedResult.result;
  26552. }
  26553. var result0, result1, result2, result3;
  26554. var pos0, pos1;
  26555. pos0 = clone(pos);
  26556. pos1 = clone(pos);
  26557. result0 = parse_ws();
  26558. if (result0 !== null) {
  26559. result1 = parse_binarySelector();
  26560. if (result1 !== null) {
  26561. result2 = parse_ws();
  26562. if (result2 !== null) {
  26563. result3 = parse_unarySend();
  26564. if (result3 === null) {
  26565. result3 = parse_operand();
  26566. }
  26567. if (result3 !== null) {
  26568. result0 = [result0, result1, result2, result3];
  26569. } else {
  26570. result0 = null;
  26571. pos = clone(pos1);
  26572. }
  26573. } else {
  26574. result0 = null;
  26575. pos = clone(pos1);
  26576. }
  26577. } else {
  26578. result0 = null;
  26579. pos = clone(pos1);
  26580. }
  26581. } else {
  26582. result0 = null;
  26583. pos = clone(pos1);
  26584. }
  26585. if (result0 !== null) {
  26586. result0 = (function(offset, line, column, selector, arg) {
  26587. return smalltalk.SendNode._new()
  26588. ._selector_(selector)
  26589. ._arguments_([arg])
  26590. })(pos0.offset, pos0.line, pos0.column, result0[1], result0[3]);
  26591. }
  26592. if (result0 === null) {
  26593. pos = clone(pos0);
  26594. }
  26595. cache[cacheKey] = {
  26596. nextPos: clone(pos),
  26597. result: result0
  26598. };
  26599. return result0;
  26600. }
  26601. function parse_binaryTail() {
  26602. var cacheKey = "binaryTail@" + pos.offset;
  26603. var cachedResult = cache[cacheKey];
  26604. if (cachedResult) {
  26605. pos = clone(cachedResult.nextPos);
  26606. return cachedResult.result;
  26607. }
  26608. var result0, result1;
  26609. var pos0, pos1;
  26610. pos0 = clone(pos);
  26611. pos1 = clone(pos);
  26612. result0 = parse_binaryMessage();
  26613. if (result0 !== null) {
  26614. result1 = parse_binaryTail();
  26615. result1 = result1 !== null ? result1 : "";
  26616. if (result1 !== null) {
  26617. result0 = [result0, result1];
  26618. } else {
  26619. result0 = null;
  26620. pos = clone(pos1);
  26621. }
  26622. } else {
  26623. result0 = null;
  26624. pos = clone(pos1);
  26625. }
  26626. if (result0 !== null) {
  26627. result0 = (function(offset, line, column, message, tail) {
  26628. if(tail) {
  26629. return tail._valueForReceiver_(message);
  26630. }
  26631. else {
  26632. return message;
  26633. }
  26634. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  26635. }
  26636. if (result0 === null) {
  26637. pos = clone(pos0);
  26638. }
  26639. cache[cacheKey] = {
  26640. nextPos: clone(pos),
  26641. result: result0
  26642. };
  26643. return result0;
  26644. }
  26645. function parse_binarySend() {
  26646. var cacheKey = "binarySend@" + pos.offset;
  26647. var cachedResult = cache[cacheKey];
  26648. if (cachedResult) {
  26649. pos = clone(cachedResult.nextPos);
  26650. return cachedResult.result;
  26651. }
  26652. var result0, result1;
  26653. var pos0, pos1;
  26654. pos0 = clone(pos);
  26655. pos1 = clone(pos);
  26656. result0 = parse_unarySend();
  26657. if (result0 !== null) {
  26658. result1 = parse_binaryTail();
  26659. result1 = result1 !== null ? result1 : "";
  26660. if (result1 !== null) {
  26661. result0 = [result0, result1];
  26662. } else {
  26663. result0 = null;
  26664. pos = clone(pos1);
  26665. }
  26666. } else {
  26667. result0 = null;
  26668. pos = clone(pos1);
  26669. }
  26670. if (result0 !== null) {
  26671. result0 = (function(offset, line, column, receiver, tail) {
  26672. if(tail) {
  26673. return tail._valueForReceiver_(receiver);
  26674. }
  26675. else {
  26676. return receiver;
  26677. }
  26678. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  26679. }
  26680. if (result0 === null) {
  26681. pos = clone(pos0);
  26682. }
  26683. cache[cacheKey] = {
  26684. nextPos: clone(pos),
  26685. result: result0
  26686. };
  26687. return result0;
  26688. }
  26689. function parse_keywordMessage() {
  26690. var cacheKey = "keywordMessage@" + pos.offset;
  26691. var cachedResult = cache[cacheKey];
  26692. if (cachedResult) {
  26693. pos = clone(cachedResult.nextPos);
  26694. return cachedResult.result;
  26695. }
  26696. var result0, result1, result2, result3;
  26697. var pos0, pos1, pos2, pos3;
  26698. pos0 = clone(pos);
  26699. pos1 = clone(pos);
  26700. result0 = parse_ws();
  26701. if (result0 !== null) {
  26702. pos2 = clone(pos);
  26703. pos3 = clone(pos);
  26704. result2 = parse_keywordPair();
  26705. if (result2 !== null) {
  26706. result3 = parse_ws();
  26707. if (result3 !== null) {
  26708. result2 = [result2, result3];
  26709. } else {
  26710. result2 = null;
  26711. pos = clone(pos3);
  26712. }
  26713. } else {
  26714. result2 = null;
  26715. pos = clone(pos3);
  26716. }
  26717. if (result2 !== null) {
  26718. result2 = (function(offset, line, column, pair) {return pair})(pos2.offset, pos2.line, pos2.column, result2[0]);
  26719. }
  26720. if (result2 === null) {
  26721. pos = clone(pos2);
  26722. }
  26723. if (result2 !== null) {
  26724. result1 = [];
  26725. while (result2 !== null) {
  26726. result1.push(result2);
  26727. pos2 = clone(pos);
  26728. pos3 = clone(pos);
  26729. result2 = parse_keywordPair();
  26730. if (result2 !== null) {
  26731. result3 = parse_ws();
  26732. if (result3 !== null) {
  26733. result2 = [result2, result3];
  26734. } else {
  26735. result2 = null;
  26736. pos = clone(pos3);
  26737. }
  26738. } else {
  26739. result2 = null;
  26740. pos = clone(pos3);
  26741. }
  26742. if (result2 !== null) {
  26743. result2 = (function(offset, line, column, pair) {return pair})(pos2.offset, pos2.line, pos2.column, result2[0]);
  26744. }
  26745. if (result2 === null) {
  26746. pos = clone(pos2);
  26747. }
  26748. }
  26749. } else {
  26750. result1 = null;
  26751. }
  26752. if (result1 !== null) {
  26753. result0 = [result0, result1];
  26754. } else {
  26755. result0 = null;
  26756. pos = clone(pos1);
  26757. }
  26758. } else {
  26759. result0 = null;
  26760. pos = clone(pos1);
  26761. }
  26762. if (result0 !== null) {
  26763. result0 = (function(offset, line, column, pairs) {
  26764. var selector = [];
  26765. var args = [];
  26766. for(var i=0;i<pairs.length;i++) {
  26767. selector.push(pairs[i].key);
  26768. args.push(pairs[i].arg);
  26769. }
  26770. return smalltalk.SendNode._new()
  26771. ._selector_(selector.join(""))
  26772. ._arguments_(args)
  26773. })(pos0.offset, pos0.line, pos0.column, result0[1]);
  26774. }
  26775. if (result0 === null) {
  26776. pos = clone(pos0);
  26777. }
  26778. cache[cacheKey] = {
  26779. nextPos: clone(pos),
  26780. result: result0
  26781. };
  26782. return result0;
  26783. }
  26784. function parse_keywordSend() {
  26785. var cacheKey = "keywordSend@" + pos.offset;
  26786. var cachedResult = cache[cacheKey];
  26787. if (cachedResult) {
  26788. pos = clone(cachedResult.nextPos);
  26789. return cachedResult.result;
  26790. }
  26791. var result0, result1;
  26792. var pos0, pos1;
  26793. pos0 = clone(pos);
  26794. pos1 = clone(pos);
  26795. result0 = parse_binarySend();
  26796. if (result0 !== null) {
  26797. result1 = parse_keywordMessage();
  26798. if (result1 !== null) {
  26799. result0 = [result0, result1];
  26800. } else {
  26801. result0 = null;
  26802. pos = clone(pos1);
  26803. }
  26804. } else {
  26805. result0 = null;
  26806. pos = clone(pos1);
  26807. }
  26808. if (result0 !== null) {
  26809. result0 = (function(offset, line, column, receiver, tail) {
  26810. return tail._valueForReceiver_(receiver);
  26811. })(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
  26812. }
  26813. if (result0 === null) {
  26814. pos = clone(pos0);
  26815. }
  26816. cache[cacheKey] = {
  26817. nextPos: clone(pos),
  26818. result: result0
  26819. };
  26820. return result0;
  26821. }
  26822. function parse_message() {
  26823. var cacheKey = "message@" + pos.offset;
  26824. var cachedResult = cache[cacheKey];
  26825. if (cachedResult) {
  26826. pos = clone(cachedResult.nextPos);
  26827. return cachedResult.result;
  26828. }
  26829. var result0;
  26830. result0 = parse_binaryMessage();
  26831. if (result0 === null) {
  26832. result0 = parse_unaryMessage();
  26833. if (result0 === null) {
  26834. result0 = parse_keywordMessage();
  26835. }
  26836. }
  26837. cache[cacheKey] = {
  26838. nextPos: clone(pos),
  26839. result: result0
  26840. };
  26841. return result0;
  26842. }
  26843. function parse_cascade() {
  26844. var cacheKey = "cascade@" + pos.offset;
  26845. var cachedResult = cache[cacheKey];
  26846. if (cachedResult) {
  26847. pos = clone(cachedResult.nextPos);
  26848. return cachedResult.result;
  26849. }
  26850. var result0, result1, result2, result3, result4, result5, result6, result7;
  26851. var pos0, pos1, pos2, pos3;
  26852. pos0 = clone(pos);
  26853. pos1 = clone(pos);
  26854. result0 = parse_ws();
  26855. if (result0 !== null) {
  26856. result1 = parse_keywordSend();
  26857. if (result1 === null) {
  26858. result1 = parse_binarySend();
  26859. }
  26860. if (result1 !== null) {
  26861. pos2 = clone(pos);
  26862. pos3 = clone(pos);
  26863. result3 = parse_ws();
  26864. if (result3 !== null) {
  26865. if (input.charCodeAt(pos.offset) === 59) {
  26866. result4 = ";";
  26867. advance(pos, 1);
  26868. } else {
  26869. result4 = null;
  26870. if (reportFailures === 0) {
  26871. matchFailed("\";\"");
  26872. }
  26873. }
  26874. if (result4 !== null) {
  26875. result5 = parse_ws();
  26876. if (result5 !== null) {
  26877. result6 = parse_message();
  26878. if (result6 !== null) {
  26879. result7 = parse_ws();
  26880. if (result7 !== null) {
  26881. result3 = [result3, result4, result5, result6, result7];
  26882. } else {
  26883. result3 = null;
  26884. pos = clone(pos3);
  26885. }
  26886. } else {
  26887. result3 = null;
  26888. pos = clone(pos3);
  26889. }
  26890. } else {
  26891. result3 = null;
  26892. pos = clone(pos3);
  26893. }
  26894. } else {
  26895. result3 = null;
  26896. pos = clone(pos3);
  26897. }
  26898. } else {
  26899. result3 = null;
  26900. pos = clone(pos3);
  26901. }
  26902. if (result3 !== null) {
  26903. result3 = (function(offset, line, column, mess) {return mess})(pos2.offset, pos2.line, pos2.column, result3[3]);
  26904. }
  26905. if (result3 === null) {
  26906. pos = clone(pos2);
  26907. }
  26908. if (result3 !== null) {
  26909. result2 = [];
  26910. while (result3 !== null) {
  26911. result2.push(result3);
  26912. pos2 = clone(pos);
  26913. pos3 = clone(pos);
  26914. result3 = parse_ws();
  26915. if (result3 !== null) {
  26916. if (input.charCodeAt(pos.offset) === 59) {
  26917. result4 = ";";
  26918. advance(pos, 1);
  26919. } else {
  26920. result4 = null;
  26921. if (reportFailures === 0) {
  26922. matchFailed("\";\"");
  26923. }
  26924. }
  26925. if (result4 !== null) {
  26926. result5 = parse_ws();
  26927. if (result5 !== null) {
  26928. result6 = parse_message();
  26929. if (result6 !== null) {
  26930. result7 = parse_ws();
  26931. if (result7 !== null) {
  26932. result3 = [result3, result4, result5, result6, result7];
  26933. } else {
  26934. result3 = null;
  26935. pos = clone(pos3);
  26936. }
  26937. } else {
  26938. result3 = null;
  26939. pos = clone(pos3);
  26940. }
  26941. } else {
  26942. result3 = null;
  26943. pos = clone(pos3);
  26944. }
  26945. } else {
  26946. result3 = null;
  26947. pos = clone(pos3);
  26948. }
  26949. } else {
  26950. result3 = null;
  26951. pos = clone(pos3);
  26952. }
  26953. if (result3 !== null) {
  26954. result3 = (function(offset, line, column, mess) {return mess})(pos2.offset, pos2.line, pos2.column, result3[3]);
  26955. }
  26956. if (result3 === null) {
  26957. pos = clone(pos2);
  26958. }
  26959. }
  26960. } else {
  26961. result2 = null;
  26962. }
  26963. if (result2 !== null) {
  26964. result0 = [result0, result1, result2];
  26965. } else {
  26966. result0 = null;
  26967. pos = clone(pos1);
  26968. }
  26969. } else {
  26970. result0 = null;
  26971. pos = clone(pos1);
  26972. }
  26973. } else {
  26974. result0 = null;
  26975. pos = clone(pos1);
  26976. }
  26977. if (result0 !== null) {
  26978. result0 = (function(offset, line, column, send, messages) {
  26979. var cascade = [];
  26980. cascade.push(send);
  26981. for(var i=0;i<messages.length;i++) {
  26982. cascade.push(messages[i]);
  26983. }
  26984. return smalltalk.CascadeNode._new()
  26985. ._receiver_(send._receiver())
  26986. ._nodes_(cascade)
  26987. })(pos0.offset, pos0.line, pos0.column, result0[1], result0[2]);
  26988. }
  26989. if (result0 === null) {
  26990. pos = clone(pos0);
  26991. }
  26992. cache[cacheKey] = {
  26993. nextPos: clone(pos),
  26994. result: result0
  26995. };
  26996. return result0;
  26997. }
  26998. function parse_jsStatement() {
  26999. var cacheKey = "jsStatement@" + pos.offset;
  27000. var cachedResult = cache[cacheKey];
  27001. if (cachedResult) {
  27002. pos = clone(cachedResult.nextPos);
  27003. return cachedResult.result;
  27004. }
  27005. var result0, result1, result2;
  27006. var pos0, pos1, pos2;
  27007. pos0 = clone(pos);
  27008. pos1 = clone(pos);
  27009. if (input.charCodeAt(pos.offset) === 60) {
  27010. result0 = "<";
  27011. advance(pos, 1);
  27012. } else {
  27013. result0 = null;
  27014. if (reportFailures === 0) {
  27015. matchFailed("\"<\"");
  27016. }
  27017. }
  27018. if (result0 !== null) {
  27019. result1 = [];
  27020. pos2 = clone(pos);
  27021. if (input.substr(pos.offset, 2) === ">>") {
  27022. result2 = ">>";
  27023. advance(pos, 2);
  27024. } else {
  27025. result2 = null;
  27026. if (reportFailures === 0) {
  27027. matchFailed("\">>\"");
  27028. }
  27029. }
  27030. if (result2 !== null) {
  27031. result2 = (function(offset, line, column) {return ">"})(pos2.offset, pos2.line, pos2.column);
  27032. }
  27033. if (result2 === null) {
  27034. pos = clone(pos2);
  27035. }
  27036. if (result2 === null) {
  27037. if (/^[^>]/.test(input.charAt(pos.offset))) {
  27038. result2 = input.charAt(pos.offset);
  27039. advance(pos, 1);
  27040. } else {
  27041. result2 = null;
  27042. if (reportFailures === 0) {
  27043. matchFailed("[^>]");
  27044. }
  27045. }
  27046. }
  27047. while (result2 !== null) {
  27048. result1.push(result2);
  27049. pos2 = clone(pos);
  27050. if (input.substr(pos.offset, 2) === ">>") {
  27051. result2 = ">>";
  27052. advance(pos, 2);
  27053. } else {
  27054. result2 = null;
  27055. if (reportFailures === 0) {
  27056. matchFailed("\">>\"");
  27057. }
  27058. }
  27059. if (result2 !== null) {
  27060. result2 = (function(offset, line, column) {return ">"})(pos2.offset, pos2.line, pos2.column);
  27061. }
  27062. if (result2 === null) {
  27063. pos = clone(pos2);
  27064. }
  27065. if (result2 === null) {
  27066. if (/^[^>]/.test(input.charAt(pos.offset))) {
  27067. result2 = input.charAt(pos.offset);
  27068. advance(pos, 1);
  27069. } else {
  27070. result2 = null;
  27071. if (reportFailures === 0) {
  27072. matchFailed("[^>]");
  27073. }
  27074. }
  27075. }
  27076. }
  27077. if (result1 !== null) {
  27078. if (input.charCodeAt(pos.offset) === 62) {
  27079. result2 = ">";
  27080. advance(pos, 1);
  27081. } else {
  27082. result2 = null;
  27083. if (reportFailures === 0) {
  27084. matchFailed("\">\"");
  27085. }
  27086. }
  27087. if (result2 !== null) {
  27088. result0 = [result0, result1, result2];
  27089. } else {
  27090. result0 = null;
  27091. pos = clone(pos1);
  27092. }
  27093. } else {
  27094. result0 = null;
  27095. pos = clone(pos1);
  27096. }
  27097. } else {
  27098. result0 = null;
  27099. pos = clone(pos1);
  27100. }
  27101. if (result0 !== null) {
  27102. result0 = (function(offset, line, column, val) {
  27103. return smalltalk.JSStatementNode._new()
  27104. ._source_(val.join(""))
  27105. })(pos0.offset, pos0.line, pos0.column, result0[1]);
  27106. }
  27107. if (result0 === null) {
  27108. pos = clone(pos0);
  27109. }
  27110. cache[cacheKey] = {
  27111. nextPos: clone(pos),
  27112. result: result0
  27113. };
  27114. return result0;
  27115. }
  27116. function parse_method() {
  27117. var cacheKey = "method@" + pos.offset;
  27118. var cachedResult = cache[cacheKey];
  27119. if (cachedResult) {
  27120. pos = clone(cachedResult.nextPos);
  27121. return cachedResult.result;
  27122. }
  27123. var result0, result1, result2, result3, result4;
  27124. var pos0, pos1;
  27125. pos0 = clone(pos);
  27126. pos1 = clone(pos);
  27127. result0 = parse_ws();
  27128. if (result0 !== null) {
  27129. result1 = parse_keywordPattern();
  27130. if (result1 === null) {
  27131. result1 = parse_binaryPattern();
  27132. if (result1 === null) {
  27133. result1 = parse_unaryPattern();
  27134. }
  27135. }
  27136. if (result1 !== null) {
  27137. result2 = parse_ws();
  27138. if (result2 !== null) {
  27139. result3 = parse_sequence();
  27140. result3 = result3 !== null ? result3 : "";
  27141. if (result3 !== null) {
  27142. result4 = parse_ws();
  27143. if (result4 !== null) {
  27144. result0 = [result0, result1, result2, result3, result4];
  27145. } else {
  27146. result0 = null;
  27147. pos = clone(pos1);
  27148. }
  27149. } else {
  27150. result0 = null;
  27151. pos = clone(pos1);
  27152. }
  27153. } else {
  27154. result0 = null;
  27155. pos = clone(pos1);
  27156. }
  27157. } else {
  27158. result0 = null;
  27159. pos = clone(pos1);
  27160. }
  27161. } else {
  27162. result0 = null;
  27163. pos = clone(pos1);
  27164. }
  27165. if (result0 !== null) {
  27166. result0 = (function(offset, line, column, pattern, sequence) {
  27167. return smalltalk.MethodNode._new()
  27168. ._selector_(pattern[0])
  27169. ._arguments_(pattern[1])
  27170. ._nodes_([sequence])
  27171. })(pos0.offset, pos0.line, pos0.column, result0[1], result0[3]);
  27172. }
  27173. if (result0 === null) {
  27174. pos = clone(pos0);
  27175. }
  27176. cache[cacheKey] = {
  27177. nextPos: clone(pos),
  27178. result: result0
  27179. };
  27180. return result0;
  27181. }
  27182. function cleanupExpected(expected) {
  27183. expected.sort();
  27184. var lastExpected = null;
  27185. var cleanExpected = [];
  27186. for (var i = 0; i < expected.length; i++) {
  27187. if (expected[i] !== lastExpected) {
  27188. cleanExpected.push(expected[i]);
  27189. lastExpected = expected[i];
  27190. }
  27191. }
  27192. return cleanExpected;
  27193. }
  27194. var result = parseFunctions[startRule]();
  27195. /*
  27196. * The parser is now in one of the following three states:
  27197. *
  27198. * 1. The parser successfully parsed the whole input.
  27199. *
  27200. * - |result !== null|
  27201. * - |pos.offset === input.length|
  27202. * - |rightmostFailuresExpected| may or may not contain something
  27203. *
  27204. * 2. The parser successfully parsed only a part of the input.
  27205. *
  27206. * - |result !== null|
  27207. * - |pos.offset < input.length|
  27208. * - |rightmostFailuresExpected| may or may not contain something
  27209. *
  27210. * 3. The parser did not successfully parse any part of the input.
  27211. *
  27212. * - |result === null|
  27213. * - |pos.offset === 0|
  27214. * - |rightmostFailuresExpected| contains at least one failure
  27215. *
  27216. * All code following this comment (including called functions) must
  27217. * handle these states.
  27218. */
  27219. if (result === null || pos.offset !== input.length) {
  27220. var offset = Math.max(pos.offset, rightmostFailuresPos.offset);
  27221. var found = offset < input.length ? input.charAt(offset) : null;
  27222. var errorPosition = pos.offset > rightmostFailuresPos.offset ? pos : rightmostFailuresPos;
  27223. throw new this.SyntaxError(
  27224. cleanupExpected(rightmostFailuresExpected),
  27225. found,
  27226. offset,
  27227. errorPosition.line,
  27228. errorPosition.column
  27229. );
  27230. }
  27231. return result;
  27232. },
  27233. /* Returns the parser source code. */
  27234. toSource: function() { return this._source; }
  27235. };
  27236. /* Thrown when a parser encounters a syntax error. */
  27237. result.SyntaxError = function(expected, found, offset, line, column) {
  27238. function buildMessage(expected, found) {
  27239. var expectedHumanized, foundHumanized;
  27240. switch (expected.length) {
  27241. case 0:
  27242. expectedHumanized = "end of input";
  27243. break;
  27244. case 1:
  27245. expectedHumanized = expected[0];
  27246. break;
  27247. default:
  27248. expectedHumanized = expected.slice(0, expected.length - 1).join(", ")
  27249. + " or "
  27250. + expected[expected.length - 1];
  27251. }
  27252. foundHumanized = found ? quote(found) : "end of input";
  27253. return "Expected " + expectedHumanized + " but " + foundHumanized + " found.";
  27254. }
  27255. this.name = "SyntaxError";
  27256. this.expected = expected;
  27257. this.found = found;
  27258. this.message = buildMessage(expected, found);
  27259. this.offset = offset;
  27260. this.line = line;
  27261. this.column = column;
  27262. };
  27263. result.SyntaxError.prototype = Error.prototype;
  27264. return result;
  27265. })();
  27266. smalltalk.addPackage('REPL', {});
  27267. smalltalk.addClass('Repl', smalltalk.Object, ['readline', 'interface', 'util'], 'REPL');
  27268. smalltalk.addMethod(
  27269. "_close",
  27270. smalltalk.method({
  27271. selector: "close",
  27272. category: 'actions',
  27273. fn: function (){
  27274. var self=this;
  27275. return smalltalk.withContext(function($ctx1) { _st(_st(process)._stdin())._destroy();
  27276. return self}, function($ctx1) {$ctx1.fill(self,"close",{}, smalltalk.Repl)})},
  27277. args: [],
  27278. source: "close\x0a\x09process stdin destroy",
  27279. messageSends: ["destroy", "stdin"],
  27280. referencedClasses: []
  27281. }),
  27282. smalltalk.Repl);
  27283. smalltalk.addMethod(
  27284. "_createInterface",
  27285. smalltalk.method({
  27286. selector: "createInterface",
  27287. category: 'actions',
  27288. fn: function (){
  27289. var self=this;
  27290. return smalltalk.withContext(function($ctx1) { self["@interface"]=_st(self["@readline"])._createInterface_stdout_(_st(process)._stdin(),_st(process)._stdout());
  27291. _st(self["@interface"])._on_do_("line",(function(buffer){
  27292. return smalltalk.withContext(function($ctx2) { return _st(self)._eval_(buffer);
  27293. }, function($ctx2) {$ctx2.fillBlock({buffer:buffer},$ctx1)})}));
  27294. _st(self["@interface"])._on_do_("close",(function(){
  27295. return smalltalk.withContext(function($ctx2) { return _st(self)._close();
  27296. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  27297. _st(self)._setPrompt();
  27298. _st(self["@interface"])._prompt();
  27299. return self}, function($ctx1) {$ctx1.fill(self,"createInterface",{}, smalltalk.Repl)})},
  27300. args: [],
  27301. source: "createInterface\x0a\x09\x22No completion for now\x22\x0a\x09interface := readline createInterface: process stdin stdout: process stdout.\x0a\x09interface on: 'line' do: [:buffer | self eval: buffer].\x0a\x09interface on: 'close' do: [self close].\x0a\x09self setPrompt.\x0a\x09interface prompt",
  27302. messageSends: ["createInterface:stdout:", "stdin", "stdout", "on:do:", "eval:", "close", "setPrompt", "prompt"],
  27303. referencedClasses: []
  27304. }),
  27305. smalltalk.Repl);
  27306. smalltalk.addMethod(
  27307. "_eval_",
  27308. smalltalk.method({
  27309. selector: "eval:",
  27310. category: 'actions',
  27311. fn: function (buffer){
  27312. var self=this;
  27313. var result;
  27314. return smalltalk.withContext(function($ctx1) { var $1,$2;
  27315. $1=_st(buffer)._isEmpty();
  27316. if(! smalltalk.assert($1)){
  27317. _st(self)._try_catch_((function(){
  27318. return smalltalk.withContext(function($ctx2) { result=_st(_st((smalltalk.Compiler || Compiler))._new())._evaluateExpression_(buffer);
  27319. result;
  27320. return _st((smalltalk.Transcript || Transcript))._show_(result);
  27321. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(e){
  27322. return smalltalk.withContext(function($ctx2) { $2=_st(e)._isSmalltalkError();
  27323. if(smalltalk.assert($2)){
  27324. return _st(_st((smalltalk.ErrorHandler || ErrorHandler))._new())._handleError_(e);
  27325. } else {
  27326. return _st(_st(process)._stdout())._write_(_st(e)._jsStack());
  27327. };
  27328. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  27329. };
  27330. _st(self["@interface"])._prompt();
  27331. return self}, function($ctx1) {$ctx1.fill(self,"eval:",{buffer:buffer,result:result}, smalltalk.Repl)})},
  27332. args: ["buffer"],
  27333. source: "eval: buffer\x0a\x09| result |\x0a\x09buffer isEmpty ifFalse: [\x0a\x09\x09self try: [\x0a\x09\x09\x09result := Compiler new evaluateExpression: buffer.\x0a\x09\x09\x09Transcript show: result]\x0a\x09\x09catch: [:e |\x0a\x09\x09\x09e isSmalltalkError\x0a\x09\x09\x09 ifTrue: [ErrorHandler new handleError: e]\x0a\x09\x09\x09 ifFalse: [process stdout write: e jsStack]]].\x0a\x09interface prompt",
  27334. messageSends: ["ifFalse:", "try:catch:", "evaluateExpression:", "new", "show:", "ifTrue:ifFalse:", "handleError:", "write:", "jsStack", "stdout", "isSmalltalkError", "isEmpty", "prompt"],
  27335. referencedClasses: ["Compiler", "Transcript", "ErrorHandler"]
  27336. }),
  27337. smalltalk.Repl);
  27338. smalltalk.addMethod(
  27339. "_initialize",
  27340. smalltalk.method({
  27341. selector: "initialize",
  27342. category: 'initialization',
  27343. fn: function (){
  27344. var self=this;
  27345. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  27346. self["@readline"]=_st(require)._value_("readline");
  27347. self["@util"]=_st(require)._value_("util");
  27348. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Repl)})},
  27349. args: [],
  27350. source: "initialize\x0a\x09super initialize.\x0a\x09readline := require value: 'readline'.\x0a\x09util := require value: 'util'",
  27351. messageSends: ["initialize", "value:"],
  27352. referencedClasses: []
  27353. }),
  27354. smalltalk.Repl);
  27355. smalltalk.addMethod(
  27356. "_prompt",
  27357. smalltalk.method({
  27358. selector: "prompt",
  27359. category: 'accessing',
  27360. fn: function (){
  27361. var self=this;
  27362. return smalltalk.withContext(function($ctx1) { return "amber >> ";
  27363. }, function($ctx1) {$ctx1.fill(self,"prompt",{}, smalltalk.Repl)})},
  27364. args: [],
  27365. source: "prompt\x0a\x09^'amber >> '",
  27366. messageSends: [],
  27367. referencedClasses: []
  27368. }),
  27369. smalltalk.Repl);
  27370. smalltalk.addMethod(
  27371. "_setPrompt",
  27372. smalltalk.method({
  27373. selector: "setPrompt",
  27374. category: 'actions',
  27375. fn: function (){
  27376. var self=this;
  27377. return smalltalk.withContext(function($ctx1) { _st(self["@interface"])._setPrompt_(_st(self)._prompt());
  27378. return self}, function($ctx1) {$ctx1.fill(self,"setPrompt",{}, smalltalk.Repl)})},
  27379. args: [],
  27380. source: "setPrompt\x0a\x09interface setPrompt: self prompt",
  27381. messageSends: ["setPrompt:", "prompt"],
  27382. referencedClasses: []
  27383. }),
  27384. smalltalk.Repl);
  27385. smalltalk.addMethod(
  27386. "_main",
  27387. smalltalk.method({
  27388. selector: "main",
  27389. category: 'not yet classified',
  27390. fn: function (){
  27391. var self=this;
  27392. return smalltalk.withContext(function($ctx1) { _st(_st(self)._new())._createInterface();
  27393. return self}, function($ctx1) {$ctx1.fill(self,"main",{}, smalltalk.Repl.klass)})},
  27394. args: [],
  27395. source: "main\x0a\x09self new createInterface",
  27396. messageSends: ["createInterface", "new"],
  27397. referencedClasses: []
  27398. }),
  27399. smalltalk.Repl.klass);
  27400. smalltalk.initialize();
  27401. /* Similar to jQuery(document).ready() */
  27402. if(this.smalltalkReady) {
  27403. this.smalltalkReady();
  27404. }
  27405. smalltalk.Repl._main()