Kernel.deploy.js 177 KB

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