2
0

Kernel.deploy.js 177 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920
  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.addMethod(
  2051. '_ensure_',
  2052. smalltalk.method({
  2053. selector: 'ensure:',
  2054. fn: function (aBlock){
  2055. var self=this;
  2056. var success=nil;
  2057. success=false;
  2058. smalltalk.send((function(){smalltalk.send(self, "_value", []);success=true;return smalltalk.send(aBlock, "_value", []);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){((($receiver = success).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value", []);})]));return smalltalk.send(ex, "_signal", []);})]);
  2059. return self;}
  2060. }),
  2061. smalltalk.BlockClosure);
  2062. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  2063. smalltalk.addMethod(
  2064. '__eq',
  2065. smalltalk.method({
  2066. selector: '=',
  2067. fn: function (aBoolean){
  2068. var self=this;
  2069. 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}})})();})]));
  2070. return Boolean(self == true) == aBoolean;
  2071. return self;
  2072. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  2073. }),
  2074. smalltalk.Boolean);
  2075. smalltalk.addMethod(
  2076. '_shallowCopy',
  2077. smalltalk.method({
  2078. selector: 'shallowCopy',
  2079. fn: function (){
  2080. var self=this;
  2081. return self;
  2082. return self;}
  2083. }),
  2084. smalltalk.Boolean);
  2085. smalltalk.addMethod(
  2086. '_deepCopy',
  2087. smalltalk.method({
  2088. selector: 'deepCopy',
  2089. fn: function (){
  2090. var self=this;
  2091. return self;
  2092. return self;}
  2093. }),
  2094. smalltalk.Boolean);
  2095. smalltalk.addMethod(
  2096. '_ifTrue_',
  2097. smalltalk.method({
  2098. selector: 'ifTrue:',
  2099. fn: function (aBlock){
  2100. var self=this;
  2101. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  2102. return self;}
  2103. }),
  2104. smalltalk.Boolean);
  2105. smalltalk.addMethod(
  2106. '_ifFalse_',
  2107. smalltalk.method({
  2108. selector: 'ifFalse:',
  2109. fn: function (aBlock){
  2110. var self=this;
  2111. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  2112. return self;}
  2113. }),
  2114. smalltalk.Boolean);
  2115. smalltalk.addMethod(
  2116. '_ifFalse_ifTrue_',
  2117. smalltalk.method({
  2118. selector: 'ifFalse:ifTrue:',
  2119. fn: function (aBlock, anotherBlock){
  2120. var self=this;
  2121. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  2122. return self;}
  2123. }),
  2124. smalltalk.Boolean);
  2125. smalltalk.addMethod(
  2126. '_ifTrue_ifFalse_',
  2127. smalltalk.method({
  2128. selector: 'ifTrue:ifFalse:',
  2129. fn: function (aBlock, anotherBlock){
  2130. var self=this;
  2131. if(self == true) {
  2132. return aBlock();
  2133. } else {
  2134. return anotherBlock();
  2135. }
  2136. ;
  2137. return self;}
  2138. }),
  2139. smalltalk.Boolean);
  2140. smalltalk.addMethod(
  2141. '_and_',
  2142. smalltalk.method({
  2143. selector: 'and:',
  2144. fn: function (aBlock){
  2145. var self=this;
  2146. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  2147. return self;}
  2148. }),
  2149. smalltalk.Boolean);
  2150. smalltalk.addMethod(
  2151. '_or_',
  2152. smalltalk.method({
  2153. selector: 'or:',
  2154. fn: function (aBlock){
  2155. var self=this;
  2156. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  2157. return self;}
  2158. }),
  2159. smalltalk.Boolean);
  2160. smalltalk.addMethod(
  2161. '_not',
  2162. smalltalk.method({
  2163. selector: 'not',
  2164. fn: function (){
  2165. var self=this;
  2166. return smalltalk.send(self, "__eq", [false]);
  2167. return self;}
  2168. }),
  2169. smalltalk.Boolean);
  2170. smalltalk.addMethod(
  2171. '_printString',
  2172. smalltalk.method({
  2173. selector: 'printString',
  2174. fn: function (){
  2175. var self=this;
  2176. return self.toString();
  2177. return self;}
  2178. }),
  2179. smalltalk.Boolean);
  2180. smalltalk.addMethod(
  2181. '_asJSONObject',
  2182. smalltalk.method({
  2183. selector: 'asJSONObject',
  2184. fn: function (){
  2185. var self=this;
  2186. return self;
  2187. return self;}
  2188. }),
  2189. smalltalk.Boolean);
  2190. smalltalk.addMethod(
  2191. '_&',
  2192. smalltalk.method({
  2193. selector: '&',
  2194. fn: function (aBoolean){
  2195. var self=this;
  2196. if(self == true) {
  2197. return aBoolean;
  2198. } else {
  2199. return false;
  2200. }
  2201. ;
  2202. return self;}
  2203. }),
  2204. smalltalk.Boolean);
  2205. smalltalk.addMethod(
  2206. '_|',
  2207. smalltalk.method({
  2208. selector: '|',
  2209. fn: function (aBoolean){
  2210. var self=this;
  2211. if(self == true) {
  2212. return true;
  2213. } else {
  2214. return aBoolean;
  2215. }
  2216. ;
  2217. return self;}
  2218. }),
  2219. smalltalk.Boolean);
  2220. smalltalk.addMethod(
  2221. '__eq_eq',
  2222. smalltalk.method({
  2223. selector: '==',
  2224. fn: function (aBoolean){
  2225. var self=this;
  2226. 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}})})();})]));
  2227. return Boolean(self == true) === Boolean(aBoolean == true);
  2228. return self;
  2229. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  2230. }),
  2231. smalltalk.Boolean);
  2232. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  2233. smalltalk.addMethod(
  2234. '_year',
  2235. smalltalk.method({
  2236. selector: 'year',
  2237. fn: function (){
  2238. var self=this;
  2239. return self.getFullYear();
  2240. return self;}
  2241. }),
  2242. smalltalk.Date);
  2243. smalltalk.addMethod(
  2244. '_month',
  2245. smalltalk.method({
  2246. selector: 'month',
  2247. fn: function (){
  2248. var self=this;
  2249. return self.getMonth() + 1;
  2250. return self;}
  2251. }),
  2252. smalltalk.Date);
  2253. smalltalk.addMethod(
  2254. '_month_',
  2255. smalltalk.method({
  2256. selector: 'month:',
  2257. fn: function (aNumber){
  2258. var self=this;
  2259. self.setMonth(aNumber - 1);
  2260. return self;}
  2261. }),
  2262. smalltalk.Date);
  2263. smalltalk.addMethod(
  2264. '_day',
  2265. smalltalk.method({
  2266. selector: 'day',
  2267. fn: function (){
  2268. var self=this;
  2269. return smalltalk.send(self, "_dayOfWeek", []);
  2270. return self;}
  2271. }),
  2272. smalltalk.Date);
  2273. smalltalk.addMethod(
  2274. '_dayOfWeek',
  2275. smalltalk.method({
  2276. selector: 'dayOfWeek',
  2277. fn: function (){
  2278. var self=this;
  2279. return self.getDay() + 1;
  2280. return self;}
  2281. }),
  2282. smalltalk.Date);
  2283. smalltalk.addMethod(
  2284. '_dayOfWeek_',
  2285. smalltalk.method({
  2286. selector: 'dayOfWeek:',
  2287. fn: function (aNumber){
  2288. var self=this;
  2289. return self.setDay(aNumber - 1);
  2290. return self;}
  2291. }),
  2292. smalltalk.Date);
  2293. smalltalk.addMethod(
  2294. '_day_',
  2295. smalltalk.method({
  2296. selector: 'day:',
  2297. fn: function (aNumber){
  2298. var self=this;
  2299. smalltalk.send(self, "_day_", [aNumber]);
  2300. return self;}
  2301. }),
  2302. smalltalk.Date);
  2303. smalltalk.addMethod(
  2304. '_year_',
  2305. smalltalk.method({
  2306. selector: 'year:',
  2307. fn: function (aNumber){
  2308. var self=this;
  2309. self.setFullYear(aNumber);
  2310. return self;}
  2311. }),
  2312. smalltalk.Date);
  2313. smalltalk.addMethod(
  2314. '_dayOfMonth',
  2315. smalltalk.method({
  2316. selector: 'dayOfMonth',
  2317. fn: function (){
  2318. var self=this;
  2319. return self.getDate();
  2320. return self;}
  2321. }),
  2322. smalltalk.Date);
  2323. smalltalk.addMethod(
  2324. '_dayOfMonth_',
  2325. smalltalk.method({
  2326. selector: 'dayOfMonth:',
  2327. fn: function (aNumber){
  2328. var self=this;
  2329. self.setDate(aNumber);
  2330. return self;}
  2331. }),
  2332. smalltalk.Date);
  2333. smalltalk.addMethod(
  2334. '_asString',
  2335. smalltalk.method({
  2336. selector: 'asString',
  2337. fn: function (){
  2338. var self=this;
  2339. return self.toString();
  2340. return self;}
  2341. }),
  2342. smalltalk.Date);
  2343. smalltalk.addMethod(
  2344. '_printString',
  2345. smalltalk.method({
  2346. selector: 'printString',
  2347. fn: function (){
  2348. var self=this;
  2349. return smalltalk.send(self, "_asString", []);
  2350. return self;}
  2351. }),
  2352. smalltalk.Date);
  2353. smalltalk.addMethod(
  2354. '_asMilliseconds',
  2355. smalltalk.method({
  2356. selector: 'asMilliseconds',
  2357. fn: function (){
  2358. var self=this;
  2359. return smalltalk.send(self, "_time", []);
  2360. return self;}
  2361. }),
  2362. smalltalk.Date);
  2363. smalltalk.addMethod(
  2364. '_time',
  2365. smalltalk.method({
  2366. selector: 'time',
  2367. fn: function (){
  2368. var self=this;
  2369. return self.getTime();
  2370. return self;}
  2371. }),
  2372. smalltalk.Date);
  2373. smalltalk.addMethod(
  2374. '_time_',
  2375. smalltalk.method({
  2376. selector: 'time:',
  2377. fn: function (aNumber){
  2378. var self=this;
  2379. self.setTime(aNumber);
  2380. return self;}
  2381. }),
  2382. smalltalk.Date);
  2383. smalltalk.addMethod(
  2384. '_asDateString',
  2385. smalltalk.method({
  2386. selector: 'asDateString',
  2387. fn: function (){
  2388. var self=this;
  2389. return self.toDateString();
  2390. return self;}
  2391. }),
  2392. smalltalk.Date);
  2393. smalltalk.addMethod(
  2394. '_asTimeString',
  2395. smalltalk.method({
  2396. selector: 'asTimeString',
  2397. fn: function (){
  2398. var self=this;
  2399. return self.toTimeString();
  2400. return self;}
  2401. }),
  2402. smalltalk.Date);
  2403. smalltalk.addMethod(
  2404. '_asLocaleString',
  2405. smalltalk.method({
  2406. selector: 'asLocaleString',
  2407. fn: function (){
  2408. var self=this;
  2409. return self.toLocaleString();
  2410. return self;}
  2411. }),
  2412. smalltalk.Date);
  2413. smalltalk.addMethod(
  2414. '_asNumber',
  2415. smalltalk.method({
  2416. selector: 'asNumber',
  2417. fn: function (){
  2418. var self=this;
  2419. return smalltalk.send(self, "_asMilliseconds", []);
  2420. return self;}
  2421. }),
  2422. smalltalk.Date);
  2423. smalltalk.addMethod(
  2424. '_hours_',
  2425. smalltalk.method({
  2426. selector: 'hours:',
  2427. fn: function (aNumber){
  2428. var self=this;
  2429. self.setHours(aNumber);
  2430. return self;}
  2431. }),
  2432. smalltalk.Date);
  2433. smalltalk.addMethod(
  2434. '_minutes_',
  2435. smalltalk.method({
  2436. selector: 'minutes:',
  2437. fn: function (aNumber){
  2438. var self=this;
  2439. self.setMinutes(aNumber);
  2440. return self;}
  2441. }),
  2442. smalltalk.Date);
  2443. smalltalk.addMethod(
  2444. '_seconds_',
  2445. smalltalk.method({
  2446. selector: 'seconds:',
  2447. fn: function (aNumber){
  2448. var self=this;
  2449. self.setSeconds(aNumber);
  2450. return self;}
  2451. }),
  2452. smalltalk.Date);
  2453. smalltalk.addMethod(
  2454. '_milliseconds_',
  2455. smalltalk.method({
  2456. selector: 'milliseconds:',
  2457. fn: function (aNumber){
  2458. var self=this;
  2459. self.setMilliseconds(aNumber);
  2460. return self;}
  2461. }),
  2462. smalltalk.Date);
  2463. smalltalk.addMethod(
  2464. '_hours',
  2465. smalltalk.method({
  2466. selector: 'hours',
  2467. fn: function (){
  2468. var self=this;
  2469. return self.getHours();
  2470. return self;}
  2471. }),
  2472. smalltalk.Date);
  2473. smalltalk.addMethod(
  2474. '_minutes',
  2475. smalltalk.method({
  2476. selector: 'minutes',
  2477. fn: function (){
  2478. var self=this;
  2479. return self.getMinutes();
  2480. return self;}
  2481. }),
  2482. smalltalk.Date);
  2483. smalltalk.addMethod(
  2484. '_seconds',
  2485. smalltalk.method({
  2486. selector: 'seconds',
  2487. fn: function (){
  2488. var self=this;
  2489. return self.getSeconds();
  2490. return self;}
  2491. }),
  2492. smalltalk.Date);
  2493. smalltalk.addMethod(
  2494. '_milliseconds',
  2495. smalltalk.method({
  2496. selector: 'milliseconds',
  2497. fn: function (){
  2498. var self=this;
  2499. return self.getMilliseconds();
  2500. return self;}
  2501. }),
  2502. smalltalk.Date);
  2503. smalltalk.addMethod(
  2504. '__lt',
  2505. smalltalk.method({
  2506. selector: '<',
  2507. fn: function (aDate){
  2508. var self=this;
  2509. return self < aDate;
  2510. return self;}
  2511. }),
  2512. smalltalk.Date);
  2513. smalltalk.addMethod(
  2514. '__gt',
  2515. smalltalk.method({
  2516. selector: '>',
  2517. fn: function (aDate){
  2518. var self=this;
  2519. return self > aDate;
  2520. return self;}
  2521. }),
  2522. smalltalk.Date);
  2523. smalltalk.addMethod(
  2524. '__lt_eq',
  2525. smalltalk.method({
  2526. selector: '<=',
  2527. fn: function (aDate){
  2528. var self=this;
  2529. return self <= aDate;
  2530. return self;}
  2531. }),
  2532. smalltalk.Date);
  2533. smalltalk.addMethod(
  2534. '__gt_eq',
  2535. smalltalk.method({
  2536. selector: '>=',
  2537. fn: function (aDate){
  2538. var self=this;
  2539. return self >= aDate;
  2540. return self;}
  2541. }),
  2542. smalltalk.Date);
  2543. smalltalk.addMethod(
  2544. '__minus',
  2545. smalltalk.method({
  2546. selector: '-',
  2547. fn: function (aDate){
  2548. var self=this;
  2549. return self - aDate;
  2550. return self;}
  2551. }),
  2552. smalltalk.Date);
  2553. smalltalk.addMethod(
  2554. '__plus',
  2555. smalltalk.method({
  2556. selector: '+',
  2557. fn: function (aDate){
  2558. var self=this;
  2559. return self + aDate;
  2560. return self;}
  2561. }),
  2562. smalltalk.Date);
  2563. smalltalk.addMethod(
  2564. '_asJSONObject',
  2565. smalltalk.method({
  2566. selector: 'asJSONObject',
  2567. fn: function (){
  2568. var self=this;
  2569. return self;
  2570. return self;}
  2571. }),
  2572. smalltalk.Date);
  2573. smalltalk.addMethod(
  2574. '_new_',
  2575. smalltalk.method({
  2576. selector: 'new:',
  2577. fn: function (anObject){
  2578. var self=this;
  2579. return new Date(anObject);
  2580. return self;}
  2581. }),
  2582. smalltalk.Date.klass);
  2583. smalltalk.addMethod(
  2584. '_fromString_',
  2585. smalltalk.method({
  2586. selector: 'fromString:',
  2587. fn: function (aString){
  2588. var self=this;
  2589. return smalltalk.send(self, "_new_", [aString]);
  2590. return self;}
  2591. }),
  2592. smalltalk.Date.klass);
  2593. smalltalk.addMethod(
  2594. '_fromSeconds_',
  2595. smalltalk.method({
  2596. selector: 'fromSeconds:',
  2597. fn: function (aNumber){
  2598. var self=this;
  2599. return smalltalk.send(self, "_fromMilliseconds_", [((($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))]);
  2600. return self;}
  2601. }),
  2602. smalltalk.Date.klass);
  2603. smalltalk.addMethod(
  2604. '_fromMilliseconds_',
  2605. smalltalk.method({
  2606. selector: 'fromMilliseconds:',
  2607. fn: function (aNumber){
  2608. var self=this;
  2609. return smalltalk.send(self, "_new_", [aNumber]);
  2610. return self;}
  2611. }),
  2612. smalltalk.Date.klass);
  2613. smalltalk.addMethod(
  2614. '_today',
  2615. smalltalk.method({
  2616. selector: 'today',
  2617. fn: function (){
  2618. var self=this;
  2619. return smalltalk.send(self, "_new", []);
  2620. return self;}
  2621. }),
  2622. smalltalk.Date.klass);
  2623. smalltalk.addMethod(
  2624. '_now',
  2625. smalltalk.method({
  2626. selector: 'now',
  2627. fn: function (){
  2628. var self=this;
  2629. return smalltalk.send(self, "_today", []);
  2630. return self;}
  2631. }),
  2632. smalltalk.Date.klass);
  2633. smalltalk.addMethod(
  2634. '_millisecondsToRun_',
  2635. smalltalk.method({
  2636. selector: 'millisecondsToRun:',
  2637. fn: function (aBlock){
  2638. var self=this;
  2639. var t=nil;
  2640. t=smalltalk.send((smalltalk.Date || Date), "_now", []);
  2641. smalltalk.send(aBlock, "_value", []);
  2642. return ((($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]));
  2643. return self;}
  2644. }),
  2645. smalltalk.Date.klass);
  2646. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2647. smalltalk.addMethod(
  2648. '_subclass_instanceVariableNames_',
  2649. smalltalk.method({
  2650. selector: 'subclass:instanceVariableNames:',
  2651. fn: function (aString, anotherString){
  2652. var self=this;
  2653. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  2654. return self;}
  2655. }),
  2656. smalltalk.UndefinedObject);
  2657. smalltalk.addMethod(
  2658. '_subclass_instanceVariableNames_category_',
  2659. smalltalk.method({
  2660. selector: 'subclass:instanceVariableNames:category:',
  2661. fn: function (aString, aString2, aString3){
  2662. var self=this;
  2663. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  2664. return self;}
  2665. }),
  2666. smalltalk.UndefinedObject);
  2667. smalltalk.addMethod(
  2668. '_shallowCopy',
  2669. smalltalk.method({
  2670. selector: 'shallowCopy',
  2671. fn: function (){
  2672. var self=this;
  2673. return self;
  2674. return self;}
  2675. }),
  2676. smalltalk.UndefinedObject);
  2677. smalltalk.addMethod(
  2678. '_deepCopy',
  2679. smalltalk.method({
  2680. selector: 'deepCopy',
  2681. fn: function (){
  2682. var self=this;
  2683. return self;
  2684. return self;}
  2685. }),
  2686. smalltalk.UndefinedObject);
  2687. smalltalk.addMethod(
  2688. '_ifNil_',
  2689. smalltalk.method({
  2690. selector: 'ifNil:',
  2691. fn: function (aBlock){
  2692. var self=this;
  2693. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2694. return self;}
  2695. }),
  2696. smalltalk.UndefinedObject);
  2697. smalltalk.addMethod(
  2698. '_ifNotNil_',
  2699. smalltalk.method({
  2700. selector: 'ifNotNil:',
  2701. fn: function (aBlock){
  2702. var self=this;
  2703. return self;
  2704. return self;}
  2705. }),
  2706. smalltalk.UndefinedObject);
  2707. smalltalk.addMethod(
  2708. '_ifNil_ifNotNil_',
  2709. smalltalk.method({
  2710. selector: 'ifNil:ifNotNil:',
  2711. fn: function (aBlock, anotherBlock){
  2712. var self=this;
  2713. return smalltalk.send(aBlock, "_value", []);
  2714. return self;}
  2715. }),
  2716. smalltalk.UndefinedObject);
  2717. smalltalk.addMethod(
  2718. '_ifNotNil_ifNil_',
  2719. smalltalk.method({
  2720. selector: 'ifNotNil:ifNil:',
  2721. fn: function (aBlock, anotherBlock){
  2722. var self=this;
  2723. return smalltalk.send(anotherBlock, "_value", []);
  2724. return self;}
  2725. }),
  2726. smalltalk.UndefinedObject);
  2727. smalltalk.addMethod(
  2728. '_isNil',
  2729. smalltalk.method({
  2730. selector: 'isNil',
  2731. fn: function (){
  2732. var self=this;
  2733. return true;
  2734. return self;}
  2735. }),
  2736. smalltalk.UndefinedObject);
  2737. smalltalk.addMethod(
  2738. '_notNil',
  2739. smalltalk.method({
  2740. selector: 'notNil',
  2741. fn: function (){
  2742. var self=this;
  2743. return false;
  2744. return self;}
  2745. }),
  2746. smalltalk.UndefinedObject);
  2747. smalltalk.addMethod(
  2748. '_printString',
  2749. smalltalk.method({
  2750. selector: 'printString',
  2751. fn: function (){
  2752. var self=this;
  2753. return "nil";
  2754. return self;}
  2755. }),
  2756. smalltalk.UndefinedObject);
  2757. smalltalk.addMethod(
  2758. '_subclass_instanceVariableNames_package_',
  2759. smalltalk.method({
  2760. selector: 'subclass:instanceVariableNames:package:',
  2761. fn: function (aString, aString2, aString3){
  2762. var self=this;
  2763. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  2764. return self;}
  2765. }),
  2766. smalltalk.UndefinedObject);
  2767. smalltalk.addMethod(
  2768. '_new',
  2769. smalltalk.method({
  2770. selector: 'new',
  2771. fn: function (){
  2772. var self=this;
  2773. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2774. return self;}
  2775. }),
  2776. smalltalk.UndefinedObject.klass);
  2777. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  2778. smalltalk.addMethod(
  2779. '_size',
  2780. smalltalk.method({
  2781. selector: 'size',
  2782. fn: function (){
  2783. var self=this;
  2784. smalltalk.send(self, "_subclassResponsibility", []);
  2785. return self;}
  2786. }),
  2787. smalltalk.Collection);
  2788. smalltalk.addMethod(
  2789. '_readStream',
  2790. smalltalk.method({
  2791. selector: 'readStream',
  2792. fn: function (){
  2793. var self=this;
  2794. return smalltalk.send(self, "_stream", []);
  2795. return self;}
  2796. }),
  2797. smalltalk.Collection);
  2798. smalltalk.addMethod(
  2799. '_writeStream',
  2800. smalltalk.method({
  2801. selector: 'writeStream',
  2802. fn: function (){
  2803. var self=this;
  2804. return smalltalk.send(self, "_stream", []);
  2805. return self;}
  2806. }),
  2807. smalltalk.Collection);
  2808. smalltalk.addMethod(
  2809. '_stream',
  2810. smalltalk.method({
  2811. selector: 'stream',
  2812. fn: function (){
  2813. var self=this;
  2814. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  2815. return self;}
  2816. }),
  2817. smalltalk.Collection);
  2818. smalltalk.addMethod(
  2819. '_streamClass',
  2820. smalltalk.method({
  2821. selector: 'streamClass',
  2822. fn: function (){
  2823. var self=this;
  2824. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  2825. return self;}
  2826. }),
  2827. smalltalk.Collection);
  2828. smalltalk.addMethod(
  2829. '_add_',
  2830. smalltalk.method({
  2831. selector: 'add:',
  2832. fn: function (anObject){
  2833. var self=this;
  2834. smalltalk.send(self, "_subclassResponsibility", []);
  2835. return self;}
  2836. }),
  2837. smalltalk.Collection);
  2838. smalltalk.addMethod(
  2839. '_addAll_',
  2840. smalltalk.method({
  2841. selector: 'addAll:',
  2842. fn: function (aCollection){
  2843. var self=this;
  2844. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  2845. return aCollection;
  2846. return self;}
  2847. }),
  2848. smalltalk.Collection);
  2849. smalltalk.addMethod(
  2850. '__comma',
  2851. smalltalk.method({
  2852. selector: ',',
  2853. fn: function (aCollection){
  2854. var self=this;
  2855. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2856. return self;}
  2857. }),
  2858. smalltalk.Collection);
  2859. smalltalk.addMethod(
  2860. '_copyWith_',
  2861. smalltalk.method({
  2862. selector: 'copyWith:',
  2863. fn: function (anObject){
  2864. var self=this;
  2865. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2866. return self;}
  2867. }),
  2868. smalltalk.Collection);
  2869. smalltalk.addMethod(
  2870. '_copyWithAll_',
  2871. smalltalk.method({
  2872. selector: 'copyWithAll:',
  2873. fn: function (aCollection){
  2874. var self=this;
  2875. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  2876. return self;}
  2877. }),
  2878. smalltalk.Collection);
  2879. smalltalk.addMethod(
  2880. '_asArray',
  2881. smalltalk.method({
  2882. selector: 'asArray',
  2883. fn: function (){
  2884. var self=this;
  2885. var array=nil;
  2886. var index=nil;
  2887. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  2888. index=(0);
  2889. 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]);})]);
  2890. return array;
  2891. return self;}
  2892. }),
  2893. smalltalk.Collection);
  2894. smalltalk.addMethod(
  2895. '_do_',
  2896. smalltalk.method({
  2897. selector: 'do:',
  2898. fn: function (aBlock){
  2899. var self=this;
  2900. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  2901. return self;}
  2902. }),
  2903. smalltalk.Collection);
  2904. smalltalk.addMethod(
  2905. '_collect_',
  2906. smalltalk.method({
  2907. selector: 'collect:',
  2908. fn: function (aBlock){
  2909. var self=this;
  2910. var newCollection=nil;
  2911. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  2912. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  2913. return newCollection;
  2914. return self;}
  2915. }),
  2916. smalltalk.Collection);
  2917. smalltalk.addMethod(
  2918. '_detect_',
  2919. smalltalk.method({
  2920. selector: 'detect:',
  2921. fn: function (aBlock){
  2922. var self=this;
  2923. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  2924. return self;}
  2925. }),
  2926. smalltalk.Collection);
  2927. smalltalk.addMethod(
  2928. '_detect_ifNone_',
  2929. smalltalk.method({
  2930. selector: 'detect:ifNone:',
  2931. fn: function (aBlock, anotherBlock){
  2932. var self=this;
  2933. for(var i = 0; i < self.length; i++)
  2934. if(aBlock(self[i]))
  2935. return self[i];
  2936. return anotherBlock();
  2937. ;
  2938. return self;}
  2939. }),
  2940. smalltalk.Collection);
  2941. smalltalk.addMethod(
  2942. '_do_separatedBy_',
  2943. smalltalk.method({
  2944. selector: 'do:separatedBy:',
  2945. fn: function (aBlock, anotherBlock){
  2946. var self=this;
  2947. var first=nil;
  2948. first=true;
  2949. 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]);})]);
  2950. return self;}
  2951. }),
  2952. smalltalk.Collection);
  2953. smalltalk.addMethod(
  2954. '_inject_into_',
  2955. smalltalk.method({
  2956. selector: 'inject:into:',
  2957. fn: function (anObject, aBlock){
  2958. var self=this;
  2959. var result=nil;
  2960. result=anObject;
  2961. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  2962. return result;
  2963. return self;}
  2964. }),
  2965. smalltalk.Collection);
  2966. smalltalk.addMethod(
  2967. '_reject_',
  2968. smalltalk.method({
  2969. selector: 'reject:',
  2970. fn: function (aBlock){
  2971. var self=this;
  2972. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  2973. return self;}
  2974. }),
  2975. smalltalk.Collection);
  2976. smalltalk.addMethod(
  2977. '_select_',
  2978. smalltalk.method({
  2979. selector: 'select:',
  2980. fn: function (aBlock){
  2981. var self=this;
  2982. var stream=nil;
  2983. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  2984. 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]);})]));})]);
  2985. return smalltalk.send(stream, "_contents", []);
  2986. return self;}
  2987. }),
  2988. smalltalk.Collection);
  2989. smalltalk.addMethod(
  2990. '_errorNotFound',
  2991. smalltalk.method({
  2992. selector: 'errorNotFound',
  2993. fn: function (){
  2994. var self=this;
  2995. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  2996. return self;}
  2997. }),
  2998. smalltalk.Collection);
  2999. smalltalk.addMethod(
  3000. '_includes_',
  3001. smalltalk.method({
  3002. selector: 'includes:',
  3003. fn: function (anObject){
  3004. var self=this;
  3005. var i = self.length;
  3006. while (i--) {
  3007. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  3008. }
  3009. return false
  3010. ;
  3011. return self;}
  3012. }),
  3013. smalltalk.Collection);
  3014. smalltalk.addMethod(
  3015. '_notEmpty',
  3016. smalltalk.method({
  3017. selector: 'notEmpty',
  3018. fn: function (){
  3019. var self=this;
  3020. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  3021. return self;}
  3022. }),
  3023. smalltalk.Collection);
  3024. smalltalk.addMethod(
  3025. '_isEmpty',
  3026. smalltalk.method({
  3027. selector: 'isEmpty',
  3028. fn: function (){
  3029. var self=this;
  3030. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  3031. return self;}
  3032. }),
  3033. smalltalk.Collection);
  3034. smalltalk.addMethod(
  3035. '_remove_',
  3036. smalltalk.method({
  3037. selector: 'remove:',
  3038. fn: function (anObject){
  3039. var self=this;
  3040. smalltalk.send(self, "_subclassResponsibility", []);
  3041. return self;}
  3042. }),
  3043. smalltalk.Collection);
  3044. smalltalk.addMethod(
  3045. '_asSet',
  3046. smalltalk.method({
  3047. selector: 'asSet',
  3048. fn: function (){
  3049. var self=this;
  3050. return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
  3051. return self;}
  3052. }),
  3053. smalltalk.Collection);
  3054. smalltalk.addMethod(
  3055. '_ifNotEmpty_',
  3056. smalltalk.method({
  3057. selector: 'ifNotEmpty:',
  3058. fn: function (aBlock){
  3059. var self=this;
  3060. smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
  3061. return self;}
  3062. }),
  3063. smalltalk.Collection);
  3064. smalltalk.addMethod(
  3065. '_ifEmpty_',
  3066. smalltalk.method({
  3067. selector: 'ifEmpty:',
  3068. fn: function (aBlock){
  3069. var self=this;
  3070. smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_ifTrue_", [aBlock]);
  3071. return self;}
  3072. }),
  3073. smalltalk.Collection);
  3074. smalltalk.addMethod(
  3075. '_copyWithoutAll_',
  3076. smalltalk.method({
  3077. selector: 'copyWithoutAll:',
  3078. fn: function (aCollection){
  3079. var self=this;
  3080. return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
  3081. return self;}
  3082. }),
  3083. smalltalk.Collection);
  3084. smalltalk.addMethod(
  3085. '_streamClass',
  3086. smalltalk.method({
  3087. selector: 'streamClass',
  3088. fn: function (){
  3089. var self=this;
  3090. return (smalltalk.Stream || Stream);
  3091. return self;}
  3092. }),
  3093. smalltalk.Collection.klass);
  3094. smalltalk.addMethod(
  3095. '_with_',
  3096. smalltalk.method({
  3097. selector: 'with:',
  3098. fn: function (anObject){
  3099. var self=this;
  3100. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3101. return self;}
  3102. }),
  3103. smalltalk.Collection.klass);
  3104. smalltalk.addMethod(
  3105. '_with_with_',
  3106. smalltalk.method({
  3107. selector: 'with:with:',
  3108. fn: function (anObject, anotherObject){
  3109. var self=this;
  3110. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3111. return self;}
  3112. }),
  3113. smalltalk.Collection.klass);
  3114. smalltalk.addMethod(
  3115. '_with_with_with_',
  3116. smalltalk.method({
  3117. selector: 'with:with:with:',
  3118. fn: function (firstObject, secondObject, thirdObject){
  3119. var self=this;
  3120. 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", []));
  3121. return self;}
  3122. }),
  3123. smalltalk.Collection.klass);
  3124. smalltalk.addMethod(
  3125. '_withAll_',
  3126. smalltalk.method({
  3127. selector: 'withAll:',
  3128. fn: function (aCollection){
  3129. var self=this;
  3130. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3131. return self;}
  3132. }),
  3133. smalltalk.Collection.klass);
  3134. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  3135. smalltalk.addMethod(
  3136. '_at_',
  3137. smalltalk.method({
  3138. selector: 'at:',
  3139. fn: function (anIndex){
  3140. var self=this;
  3141. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3142. return self;}
  3143. }),
  3144. smalltalk.SequenceableCollection);
  3145. smalltalk.addMethod(
  3146. '_at_ifAbsent_',
  3147. smalltalk.method({
  3148. selector: 'at:ifAbsent:',
  3149. fn: function (anIndex, aBlock){
  3150. var self=this;
  3151. smalltalk.send(self, "_subclassResponsibility", []);
  3152. return self;}
  3153. }),
  3154. smalltalk.SequenceableCollection);
  3155. smalltalk.addMethod(
  3156. '_at_put_',
  3157. smalltalk.method({
  3158. selector: 'at:put:',
  3159. fn: function (anIndex, anObject){
  3160. var self=this;
  3161. smalltalk.send(self, "_subclassResponsibility", []);
  3162. return self;}
  3163. }),
  3164. smalltalk.SequenceableCollection);
  3165. smalltalk.addMethod(
  3166. '_copyFrom_to_',
  3167. smalltalk.method({
  3168. selector: 'copyFrom:to:',
  3169. fn: function (anIndex, anotherIndex){
  3170. var self=this;
  3171. smalltalk.send(self, "_subclassResponsibility", []);
  3172. return self;}
  3173. }),
  3174. smalltalk.SequenceableCollection);
  3175. smalltalk.addMethod(
  3176. '_first',
  3177. smalltalk.method({
  3178. selector: 'first',
  3179. fn: function (){
  3180. var self=this;
  3181. return smalltalk.send(self, "_at_", [(1)]);
  3182. return self;}
  3183. }),
  3184. smalltalk.SequenceableCollection);
  3185. smalltalk.addMethod(
  3186. '_fourth',
  3187. smalltalk.method({
  3188. selector: 'fourth',
  3189. fn: function (){
  3190. var self=this;
  3191. return smalltalk.send(self, "_at_", [(4)]);
  3192. return self;}
  3193. }),
  3194. smalltalk.SequenceableCollection);
  3195. smalltalk.addMethod(
  3196. '_last',
  3197. smalltalk.method({
  3198. selector: 'last',
  3199. fn: function (){
  3200. var self=this;
  3201. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  3202. return self;}
  3203. }),
  3204. smalltalk.SequenceableCollection);
  3205. smalltalk.addMethod(
  3206. '_second',
  3207. smalltalk.method({
  3208. selector: 'second',
  3209. fn: function (){
  3210. var self=this;
  3211. return smalltalk.send(self, "_at_", [(2)]);
  3212. return self;}
  3213. }),
  3214. smalltalk.SequenceableCollection);
  3215. smalltalk.addMethod(
  3216. '_third',
  3217. smalltalk.method({
  3218. selector: 'third',
  3219. fn: function (){
  3220. var self=this;
  3221. return smalltalk.send(self, "_at_", [(3)]);
  3222. return self;}
  3223. }),
  3224. smalltalk.SequenceableCollection);
  3225. smalltalk.addMethod(
  3226. '_removeLast',
  3227. smalltalk.method({
  3228. selector: 'removeLast',
  3229. fn: function (){
  3230. var self=this;
  3231. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  3232. return self;}
  3233. }),
  3234. smalltalk.SequenceableCollection);
  3235. smalltalk.addMethod(
  3236. '_addLast_',
  3237. smalltalk.method({
  3238. selector: 'addLast:',
  3239. fn: function (anObject){
  3240. var self=this;
  3241. smalltalk.send(self, "_add_", [anObject]);
  3242. return self;}
  3243. }),
  3244. smalltalk.SequenceableCollection);
  3245. smalltalk.addMethod(
  3246. '_withIndexDo_',
  3247. smalltalk.method({
  3248. selector: 'withIndexDo:',
  3249. fn: function (aBlock){
  3250. var self=this;
  3251. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  3252. return self;}
  3253. }),
  3254. smalltalk.SequenceableCollection);
  3255. smalltalk.addMethod(
  3256. '_allButFirst',
  3257. smalltalk.method({
  3258. selector: 'allButFirst',
  3259. fn: function (){
  3260. var self=this;
  3261. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  3262. return self;}
  3263. }),
  3264. smalltalk.SequenceableCollection);
  3265. smalltalk.addMethod(
  3266. '_allButLast',
  3267. smalltalk.method({
  3268. selector: 'allButLast',
  3269. fn: function (){
  3270. var self=this;
  3271. return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
  3272. return self;}
  3273. }),
  3274. smalltalk.SequenceableCollection);
  3275. smalltalk.addMethod(
  3276. '_indexOf_',
  3277. smalltalk.method({
  3278. selector: 'indexOf:',
  3279. fn: function (anObject){
  3280. var self=this;
  3281. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3282. return self;}
  3283. }),
  3284. smalltalk.SequenceableCollection);
  3285. smalltalk.addMethod(
  3286. '_indexOf_ifAbsent_',
  3287. smalltalk.method({
  3288. selector: 'indexOf:ifAbsent:',
  3289. fn: function (anObject, aBlock){
  3290. var self=this;
  3291. for(var i=0;i<self.length;i++){
  3292. if(self[i].__eq(anObject)) {return i+1}
  3293. }
  3294. return aBlock();
  3295. ;
  3296. return self;}
  3297. }),
  3298. smalltalk.SequenceableCollection);
  3299. smalltalk.addMethod(
  3300. '_indexOf_startingAt_ifAbsent_',
  3301. smalltalk.method({
  3302. selector: 'indexOf:startingAt:ifAbsent:',
  3303. fn: function (anObject, start, aBlock){
  3304. var self=this;
  3305. for(var i=start-1;i<self.length;i++){
  3306. if(self[i].__eq(anObject)) {return i+1}
  3307. }
  3308. return aBlock();
  3309. ;
  3310. return self;}
  3311. }),
  3312. smalltalk.SequenceableCollection);
  3313. smalltalk.addMethod(
  3314. '_indexOf_startingAt_',
  3315. smalltalk.method({
  3316. selector: 'indexOf:startingAt:',
  3317. fn: function (anObject, start){
  3318. var self=this;
  3319. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  3320. return self;}
  3321. }),
  3322. smalltalk.SequenceableCollection);
  3323. smalltalk.addMethod(
  3324. '_reversed',
  3325. smalltalk.method({
  3326. selector: 'reversed',
  3327. fn: function (){
  3328. var self=this;
  3329. smalltalk.send(self, "_subclassResponsibility", []);
  3330. return self;}
  3331. }),
  3332. smalltalk.SequenceableCollection);
  3333. smalltalk.addMethod(
  3334. '_atRandom',
  3335. smalltalk.method({
  3336. selector: 'atRandom',
  3337. fn: function (){
  3338. var self=this;
  3339. return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
  3340. return self;}
  3341. }),
  3342. smalltalk.SequenceableCollection);
  3343. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  3344. smalltalk.addMethod(
  3345. '__eq',
  3346. smalltalk.method({
  3347. selector: '=',
  3348. fn: function (aString){
  3349. var self=this;
  3350. 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}})})();})]));
  3351. return String(self) == aString;
  3352. return self;
  3353. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  3354. }),
  3355. smalltalk.String);
  3356. smalltalk.addMethod(
  3357. '_size',
  3358. smalltalk.method({
  3359. selector: 'size',
  3360. fn: function (){
  3361. var self=this;
  3362. return self.length;
  3363. return self;}
  3364. }),
  3365. smalltalk.String);
  3366. smalltalk.addMethod(
  3367. '_at_',
  3368. smalltalk.method({
  3369. selector: 'at:',
  3370. fn: function (anIndex){
  3371. var self=this;
  3372. return self[anIndex - 1];
  3373. return self;}
  3374. }),
  3375. smalltalk.String);
  3376. smalltalk.addMethod(
  3377. '_at_put_',
  3378. smalltalk.method({
  3379. selector: 'at:put:',
  3380. fn: function (anIndex, anObject){
  3381. var self=this;
  3382. smalltalk.send(self, "_errorReadOnly", []);
  3383. return self;}
  3384. }),
  3385. smalltalk.String);
  3386. smalltalk.addMethod(
  3387. '_at_ifAbsent_',
  3388. smalltalk.method({
  3389. selector: 'at:ifAbsent:',
  3390. fn: function (anIndex, aBlock){
  3391. var self=this;
  3392. (($receiver = smalltalk.send(self, "_at_", [anIndex])) == nil || $receiver == undefined) ? (function(){return aBlock;})() : $receiver;
  3393. return self;}
  3394. }),
  3395. smalltalk.String);
  3396. smalltalk.addMethod(
  3397. '_escaped',
  3398. smalltalk.method({
  3399. selector: 'escaped',
  3400. fn: function (){
  3401. var self=this;
  3402. return escape(self);
  3403. return self;}
  3404. }),
  3405. smalltalk.String);
  3406. smalltalk.addMethod(
  3407. '_unescaped',
  3408. smalltalk.method({
  3409. selector: 'unescaped',
  3410. fn: function (){
  3411. var self=this;
  3412. return unescape(self);
  3413. return self;}
  3414. }),
  3415. smalltalk.String);
  3416. smalltalk.addMethod(
  3417. '_add_',
  3418. smalltalk.method({
  3419. selector: 'add:',
  3420. fn: function (anObject){
  3421. var self=this;
  3422. smalltalk.send(self, "_errorReadOnly", []);
  3423. return self;}
  3424. }),
  3425. smalltalk.String);
  3426. smalltalk.addMethod(
  3427. '__comma',
  3428. smalltalk.method({
  3429. selector: ',',
  3430. fn: function (aString){
  3431. var self=this;
  3432. return self + aString;
  3433. return self;}
  3434. }),
  3435. smalltalk.String);
  3436. smalltalk.addMethod(
  3437. '_copyFrom_to_',
  3438. smalltalk.method({
  3439. selector: 'copyFrom:to:',
  3440. fn: function (anIndex, anotherIndex){
  3441. var self=this;
  3442. return self.substring(anIndex - 1, anotherIndex);
  3443. return self;}
  3444. }),
  3445. smalltalk.String);
  3446. smalltalk.addMethod(
  3447. '_shallowCopy',
  3448. smalltalk.method({
  3449. selector: 'shallowCopy',
  3450. fn: function (){
  3451. var self=this;
  3452. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  3453. return self;}
  3454. }),
  3455. smalltalk.String);
  3456. smalltalk.addMethod(
  3457. '_deepCopy',
  3458. smalltalk.method({
  3459. selector: 'deepCopy',
  3460. fn: function (){
  3461. var self=this;
  3462. return smalltalk.send(self, "_shallowCopy", []);
  3463. return self;}
  3464. }),
  3465. smalltalk.String);
  3466. smalltalk.addMethod(
  3467. '_asSelector',
  3468. smalltalk.method({
  3469. selector: 'asSelector',
  3470. fn: function (){
  3471. var self=this;
  3472. var selector=nil;
  3473. selector=smalltalk.send("_", "__comma", [self]);
  3474. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  3475. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  3476. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  3477. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  3478. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  3479. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  3480. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  3481. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  3482. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  3483. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  3484. return selector;
  3485. return self;}
  3486. }),
  3487. smalltalk.String);
  3488. smalltalk.addMethod(
  3489. '_asJavascript',
  3490. smalltalk.method({
  3491. selector: 'asJavascript',
  3492. fn: function (){
  3493. var self=this;
  3494. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  3495. return "unescape(\"" + escape(self) + "\")";
  3496. else
  3497. return "\"" + self + "\"";
  3498. ;
  3499. return self;}
  3500. }),
  3501. smalltalk.String);
  3502. smalltalk.addMethod(
  3503. '_replace_with_',
  3504. smalltalk.method({
  3505. selector: 'replace:with:',
  3506. fn: function (aString, anotherString){
  3507. var self=this;
  3508. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  3509. return self;}
  3510. }),
  3511. smalltalk.String);
  3512. smalltalk.addMethod(
  3513. '_replaceRegexp_with_',
  3514. smalltalk.method({
  3515. selector: 'replaceRegexp:with:',
  3516. fn: function (aRegexp, aString){
  3517. var self=this;
  3518. return self.replace(aRegexp, aString);
  3519. return self;}
  3520. }),
  3521. smalltalk.String);
  3522. smalltalk.addMethod(
  3523. '_tokenize_',
  3524. smalltalk.method({
  3525. selector: 'tokenize:',
  3526. fn: function (aString){
  3527. var self=this;
  3528. return self.split(aString);
  3529. return self;}
  3530. }),
  3531. smalltalk.String);
  3532. smalltalk.addMethod(
  3533. '_match_',
  3534. smalltalk.method({
  3535. selector: 'match:',
  3536. fn: function (aRegexp){
  3537. var self=this;
  3538. return self.search(aRegexp) != -1;
  3539. return self;}
  3540. }),
  3541. smalltalk.String);
  3542. smalltalk.addMethod(
  3543. '_asString',
  3544. smalltalk.method({
  3545. selector: 'asString',
  3546. fn: function (){
  3547. var self=this;
  3548. return self;
  3549. return self;}
  3550. }),
  3551. smalltalk.String);
  3552. smalltalk.addMethod(
  3553. '_asNumber',
  3554. smalltalk.method({
  3555. selector: 'asNumber',
  3556. fn: function (){
  3557. var self=this;
  3558. return Number(self);
  3559. return self;}
  3560. }),
  3561. smalltalk.String);
  3562. smalltalk.addMethod(
  3563. '_errorReadOnly',
  3564. smalltalk.method({
  3565. selector: 'errorReadOnly',
  3566. fn: function (){
  3567. var self=this;
  3568. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  3569. return self;}
  3570. }),
  3571. smalltalk.String);
  3572. smalltalk.addMethod(
  3573. '_printString',
  3574. smalltalk.method({
  3575. selector: 'printString',
  3576. fn: function (){
  3577. var self=this;
  3578. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  3579. return self;}
  3580. }),
  3581. smalltalk.String);
  3582. smalltalk.addMethod(
  3583. '_printNl',
  3584. smalltalk.method({
  3585. selector: 'printNl',
  3586. fn: function (){
  3587. var self=this;
  3588. console.log(self);
  3589. return self;}
  3590. }),
  3591. smalltalk.String);
  3592. smalltalk.addMethod(
  3593. '_isString',
  3594. smalltalk.method({
  3595. selector: 'isString',
  3596. fn: function (){
  3597. var self=this;
  3598. return true;
  3599. return self;}
  3600. }),
  3601. smalltalk.String);
  3602. smalltalk.addMethod(
  3603. '__gt',
  3604. smalltalk.method({
  3605. selector: '>',
  3606. fn: function (aString){
  3607. var self=this;
  3608. return String(self) > aString;
  3609. return self;}
  3610. }),
  3611. smalltalk.String);
  3612. smalltalk.addMethod(
  3613. '__lt',
  3614. smalltalk.method({
  3615. selector: '<',
  3616. fn: function (aString){
  3617. var self=this;
  3618. return String(self) < aString;
  3619. return self;}
  3620. }),
  3621. smalltalk.String);
  3622. smalltalk.addMethod(
  3623. '__gt_eq',
  3624. smalltalk.method({
  3625. selector: '>=',
  3626. fn: function (aString){
  3627. var self=this;
  3628. return String(self) >= aString;
  3629. return self;}
  3630. }),
  3631. smalltalk.String);
  3632. smalltalk.addMethod(
  3633. '__lt_eq',
  3634. smalltalk.method({
  3635. selector: '<=',
  3636. fn: function (aString){
  3637. var self=this;
  3638. return String(self) <= aString;
  3639. return self;}
  3640. }),
  3641. smalltalk.String);
  3642. smalltalk.addMethod(
  3643. '_remove_',
  3644. smalltalk.method({
  3645. selector: 'remove:',
  3646. fn: function (anObject){
  3647. var self=this;
  3648. smalltalk.send(self, "_errorReadOnly", []);
  3649. return self;}
  3650. }),
  3651. smalltalk.String);
  3652. smalltalk.addMethod(
  3653. '_asJSONObject',
  3654. smalltalk.method({
  3655. selector: 'asJSONObject',
  3656. fn: function (){
  3657. var self=this;
  3658. return self;
  3659. return self;}
  3660. }),
  3661. smalltalk.String);
  3662. smalltalk.addMethod(
  3663. '_trimLeft_',
  3664. smalltalk.method({
  3665. selector: 'trimLeft:',
  3666. fn: function (separators){
  3667. var self=this;
  3668. 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"]), ""]);
  3669. return self;}
  3670. }),
  3671. smalltalk.String);
  3672. smalltalk.addMethod(
  3673. '_trimRight_',
  3674. smalltalk.method({
  3675. selector: 'trimRight:',
  3676. fn: function (separators){
  3677. var self=this;
  3678. 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"]), ""]);
  3679. return self;}
  3680. }),
  3681. smalltalk.String);
  3682. smalltalk.addMethod(
  3683. '_trimLeft',
  3684. smalltalk.method({
  3685. selector: 'trimLeft',
  3686. fn: function (){
  3687. var self=this;
  3688. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  3689. return self;}
  3690. }),
  3691. smalltalk.String);
  3692. smalltalk.addMethod(
  3693. '_trimRight',
  3694. smalltalk.method({
  3695. selector: 'trimRight',
  3696. fn: function (){
  3697. var self=this;
  3698. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  3699. return self;}
  3700. }),
  3701. smalltalk.String);
  3702. smalltalk.addMethod(
  3703. '_trimBoth',
  3704. smalltalk.method({
  3705. selector: 'trimBoth',
  3706. fn: function (){
  3707. var self=this;
  3708. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  3709. return self;}
  3710. }),
  3711. smalltalk.String);
  3712. smalltalk.addMethod(
  3713. '_trimBoth_',
  3714. smalltalk.method({
  3715. selector: 'trimBoth:',
  3716. fn: function (separators){
  3717. var self=this;
  3718. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  3719. return self;}
  3720. }),
  3721. smalltalk.String);
  3722. smalltalk.addMethod(
  3723. '_asLowercase',
  3724. smalltalk.method({
  3725. selector: 'asLowercase',
  3726. fn: function (){
  3727. var self=this;
  3728. return self.toLowerCase();
  3729. return self;}
  3730. }),
  3731. smalltalk.String);
  3732. smalltalk.addMethod(
  3733. '_asUppercase',
  3734. smalltalk.method({
  3735. selector: 'asUppercase',
  3736. fn: function (){
  3737. var self=this;
  3738. return self.toUpperCase();
  3739. return self;}
  3740. }),
  3741. smalltalk.String);
  3742. smalltalk.addMethod(
  3743. '_join_',
  3744. smalltalk.method({
  3745. selector: 'join:',
  3746. fn: function (aCollection){
  3747. var self=this;
  3748. 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]);})]);})]);
  3749. return self;}
  3750. }),
  3751. smalltalk.String);
  3752. smalltalk.addMethod(
  3753. '_includesSubString_',
  3754. smalltalk.method({
  3755. selector: 'includesSubString:',
  3756. fn: function (subString){
  3757. var self=this;
  3758. return self.indexOf(subString) != -1 ;
  3759. return self;}
  3760. }),
  3761. smalltalk.String);
  3762. smalltalk.addMethod(
  3763. '_asciiValue',
  3764. smalltalk.method({
  3765. selector: 'asciiValue',
  3766. fn: function (){
  3767. var self=this;
  3768. return self.charCodeAt(0);;
  3769. return self;}
  3770. }),
  3771. smalltalk.String);
  3772. smalltalk.addMethod(
  3773. '_lineIndicesDo_',
  3774. smalltalk.method({
  3775. selector: 'lineIndicesDo:',
  3776. fn: function (aBlock){
  3777. var self=this;
  3778. try{var cr=nil;
  3779. var lf=nil;
  3780. var start=nil;
  3781. var sz=nil;
  3782. var nextLF=nil;
  3783. var nextCR=nil;
  3784. start=(1);
  3785. sz=smalltalk.send(self, "_size", []);
  3786. cr=smalltalk.send((smalltalk.String || String), "_cr", []);
  3787. nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]);
  3788. lf=smalltalk.send((smalltalk.String || String), "_lf", []);
  3789. nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]);
  3790. (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]);})]));})]));})()}})();
  3791. return self;
  3792. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}}
  3793. }),
  3794. smalltalk.String);
  3795. smalltalk.addMethod(
  3796. '_linesDo_',
  3797. smalltalk.method({
  3798. selector: 'linesDo:',
  3799. fn: function (aBlock){
  3800. var self=this;
  3801. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  3802. return self;}
  3803. }),
  3804. smalltalk.String);
  3805. smalltalk.addMethod(
  3806. '_lines',
  3807. smalltalk.method({
  3808. selector: 'lines',
  3809. fn: function (){
  3810. var self=this;
  3811. var lines=nil;
  3812. lines=smalltalk.send((smalltalk.Array || Array), "_new", []);
  3813. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  3814. return lines;
  3815. return self;}
  3816. }),
  3817. smalltalk.String);
  3818. smalltalk.addMethod(
  3819. '_lineNumber_',
  3820. smalltalk.method({
  3821. selector: 'lineNumber:',
  3822. fn: function (anIndex){
  3823. var self=this;
  3824. try{var lineCount=nil;
  3825. lineCount=(0);
  3826. 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])}})})();})]));})]);
  3827. (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
  3828. return self;
  3829. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}}
  3830. }),
  3831. smalltalk.String);
  3832. smalltalk.addMethod(
  3833. '_reversed',
  3834. smalltalk.method({
  3835. selector: 'reversed',
  3836. fn: function (){
  3837. var self=this;
  3838. return self.split("").reverse().join("");
  3839. return self;}
  3840. }),
  3841. smalltalk.String);
  3842. smalltalk.addMethod(
  3843. '__eq_eq',
  3844. smalltalk.method({
  3845. selector: '==',
  3846. fn: function (aString){
  3847. var self=this;
  3848. 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}})})();})]));
  3849. return String(self) === String(aString);
  3850. return self;
  3851. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  3852. }),
  3853. smalltalk.String);
  3854. smalltalk.addMethod(
  3855. '_asJavaScriptSelector',
  3856. smalltalk.method({
  3857. selector: 'asJavaScriptSelector',
  3858. fn: function (){
  3859. var self=this;
  3860. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", [unescape("%5E_"), ""]), "_replace_with_", [unescape("_.*"), ""]);
  3861. return self;}
  3862. }),
  3863. smalltalk.String);
  3864. smalltalk.addMethod(
  3865. '_streamClass',
  3866. smalltalk.method({
  3867. selector: 'streamClass',
  3868. fn: function (){
  3869. var self=this;
  3870. return (smalltalk.StringStream || StringStream);
  3871. return self;}
  3872. }),
  3873. smalltalk.String.klass);
  3874. smalltalk.addMethod(
  3875. '_fromString_',
  3876. smalltalk.method({
  3877. selector: 'fromString:',
  3878. fn: function (aString){
  3879. var self=this;
  3880. return new self.fn(aString);
  3881. return self;}
  3882. }),
  3883. smalltalk.String.klass);
  3884. smalltalk.addMethod(
  3885. '_cr',
  3886. smalltalk.method({
  3887. selector: 'cr',
  3888. fn: function (){
  3889. var self=this;
  3890. return '\r';
  3891. return self;}
  3892. }),
  3893. smalltalk.String.klass);
  3894. smalltalk.addMethod(
  3895. '_lf',
  3896. smalltalk.method({
  3897. selector: 'lf',
  3898. fn: function (){
  3899. var self=this;
  3900. return '\n';
  3901. return self;}
  3902. }),
  3903. smalltalk.String.klass);
  3904. smalltalk.addMethod(
  3905. '_space',
  3906. smalltalk.method({
  3907. selector: 'space',
  3908. fn: function (){
  3909. var self=this;
  3910. return ' ';
  3911. return self;}
  3912. }),
  3913. smalltalk.String.klass);
  3914. smalltalk.addMethod(
  3915. '_tab',
  3916. smalltalk.method({
  3917. selector: 'tab',
  3918. fn: function (){
  3919. var self=this;
  3920. return '\t';
  3921. return self;}
  3922. }),
  3923. smalltalk.String.klass);
  3924. smalltalk.addMethod(
  3925. '_crlf',
  3926. smalltalk.method({
  3927. selector: 'crlf',
  3928. fn: function (){
  3929. var self=this;
  3930. return '\r\n';
  3931. return self;}
  3932. }),
  3933. smalltalk.String.klass);
  3934. smalltalk.addMethod(
  3935. '_streamContents_',
  3936. smalltalk.method({
  3937. selector: 'streamContents:',
  3938. fn: function (blockWithArg){
  3939. var self=this;
  3940. var stream=nil;
  3941. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]);
  3942. smalltalk.send(blockWithArg, "_value_", [stream]);
  3943. return smalltalk.send(stream, "_contents", []);
  3944. return self;}
  3945. }),
  3946. smalltalk.String.klass);
  3947. smalltalk.addMethod(
  3948. '_value_',
  3949. smalltalk.method({
  3950. selector: 'value:',
  3951. fn: function (aUTFCharCode){
  3952. var self=this;
  3953. return String.fromCharCode(aUTFCharCode);;
  3954. return self;}
  3955. }),
  3956. smalltalk.String.klass);
  3957. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  3958. smalltalk.addMethod(
  3959. '_size',
  3960. smalltalk.method({
  3961. selector: 'size',
  3962. fn: function (){
  3963. var self=this;
  3964. return self.length;
  3965. return self;}
  3966. }),
  3967. smalltalk.Array);
  3968. smalltalk.addMethod(
  3969. '_at_put_',
  3970. smalltalk.method({
  3971. selector: 'at:put:',
  3972. fn: function (anIndex, anObject){
  3973. var self=this;
  3974. return self[anIndex - 1] = anObject;
  3975. return self;}
  3976. }),
  3977. smalltalk.Array);
  3978. smalltalk.addMethod(
  3979. '_at_ifAbsent_',
  3980. smalltalk.method({
  3981. selector: 'at:ifAbsent:',
  3982. fn: function (anIndex, aBlock){
  3983. var self=this;
  3984. var value = self[anIndex - 1];
  3985. if(value === undefined) {
  3986. return aBlock();
  3987. } else {
  3988. return value;
  3989. }
  3990. ;
  3991. return self;}
  3992. }),
  3993. smalltalk.Array);
  3994. smalltalk.addMethod(
  3995. '_add_',
  3996. smalltalk.method({
  3997. selector: 'add:',
  3998. fn: function (anObject){
  3999. var self=this;
  4000. self.push(anObject); return anObject;;
  4001. return self;}
  4002. }),
  4003. smalltalk.Array);
  4004. smalltalk.addMethod(
  4005. '_shallowCopy',
  4006. smalltalk.method({
  4007. selector: 'shallowCopy',
  4008. fn: function (){
  4009. var self=this;
  4010. var newCollection=nil;
  4011. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4012. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  4013. return newCollection;
  4014. return self;}
  4015. }),
  4016. smalltalk.Array);
  4017. smalltalk.addMethod(
  4018. '_deepCopy',
  4019. smalltalk.method({
  4020. selector: 'deepCopy',
  4021. fn: function (){
  4022. var self=this;
  4023. var newCollection=nil;
  4024. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4025. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  4026. return newCollection;
  4027. return self;}
  4028. }),
  4029. smalltalk.Array);
  4030. smalltalk.addMethod(
  4031. '_copyFrom_to_',
  4032. smalltalk.method({
  4033. selector: 'copyFrom:to:',
  4034. fn: function (anIndex, anotherIndex){
  4035. var self=this;
  4036. var array=nil;
  4037. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4038. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  4039. return array;
  4040. return self;}
  4041. }),
  4042. smalltalk.Array);
  4043. smalltalk.addMethod(
  4044. '_join_',
  4045. smalltalk.method({
  4046. selector: 'join:',
  4047. fn: function (aString){
  4048. var self=this;
  4049. return self.join(aString);
  4050. return self;}
  4051. }),
  4052. smalltalk.Array);
  4053. smalltalk.addMethod(
  4054. '_asJavascript',
  4055. smalltalk.method({
  4056. selector: 'asJavascript',
  4057. fn: function (){
  4058. var self=this;
  4059. 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")]);
  4060. return self;}
  4061. }),
  4062. smalltalk.Array);
  4063. smalltalk.addMethod(
  4064. '_sort',
  4065. smalltalk.method({
  4066. selector: 'sort',
  4067. fn: function (){
  4068. var self=this;
  4069. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  4070. return self;}
  4071. }),
  4072. smalltalk.Array);
  4073. smalltalk.addMethod(
  4074. '_sort_',
  4075. smalltalk.method({
  4076. selector: 'sort:',
  4077. fn: function (aBlock){
  4078. var self=this;
  4079. return self.sort(function(a, b) {
  4080. if(aBlock(a,b)) {return -1} else {return 1}
  4081. })
  4082. ;
  4083. return self;}
  4084. }),
  4085. smalltalk.Array);
  4086. smalltalk.addMethod(
  4087. '_remove_',
  4088. smalltalk.method({
  4089. selector: 'remove:',
  4090. fn: function (anObject){
  4091. var self=this;
  4092. for(var i=0;i<self.length;i++) {
  4093. if(self[i] == anObject) {
  4094. self.splice(i,1);
  4095. break;
  4096. }
  4097. }
  4098. ;
  4099. return self;}
  4100. }),
  4101. smalltalk.Array);
  4102. smalltalk.addMethod(
  4103. '_sorted',
  4104. smalltalk.method({
  4105. selector: 'sorted',
  4106. fn: function (){
  4107. var self=this;
  4108. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  4109. return self;}
  4110. }),
  4111. smalltalk.Array);
  4112. smalltalk.addMethod(
  4113. '_sorted_',
  4114. smalltalk.method({
  4115. selector: 'sorted:',
  4116. fn: function (aBlock){
  4117. var self=this;
  4118. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  4119. return self;}
  4120. }),
  4121. smalltalk.Array);
  4122. smalltalk.addMethod(
  4123. '_asJSONObject',
  4124. smalltalk.method({
  4125. selector: 'asJSONObject',
  4126. fn: function (){
  4127. var self=this;
  4128. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  4129. return self;}
  4130. }),
  4131. smalltalk.Array);
  4132. smalltalk.addMethod(
  4133. '_removeFrom_to_',
  4134. smalltalk.method({
  4135. selector: 'removeFrom:to:',
  4136. fn: function (aNumber, anotherNumber){
  4137. var self=this;
  4138. self.splice(aNumber - 1,anotherNumber - 1);
  4139. return self;}
  4140. }),
  4141. smalltalk.Array);
  4142. smalltalk.addMethod(
  4143. '_printString',
  4144. smalltalk.method({
  4145. selector: 'printString',
  4146. fn: function (){
  4147. var self=this;
  4148. var str=nil;
  4149. str=smalltalk.send("", "_writeStream", []);
  4150. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  4151. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  4152. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  4153. return smalltalk.send(str, "_contents", []);
  4154. return self;}
  4155. }),
  4156. smalltalk.Array);
  4157. smalltalk.addMethod(
  4158. '_reversed',
  4159. smalltalk.method({
  4160. selector: 'reversed',
  4161. fn: function (){
  4162. var self=this;
  4163. return self._copy().reverse();
  4164. return self;}
  4165. }),
  4166. smalltalk.Array);
  4167. smalltalk.addMethod(
  4168. '__eq',
  4169. smalltalk.method({
  4170. selector: '=',
  4171. fn: function (aCollection){
  4172. var self=this;
  4173. 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}})})();})]));
  4174. 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}})})();})]));})]);
  4175. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  4176. return self;
  4177. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  4178. }),
  4179. smalltalk.Array);
  4180. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  4181. smalltalk.addMethod(
  4182. '_compile_',
  4183. smalltalk.method({
  4184. selector: 'compile:',
  4185. fn: function (aString){
  4186. var self=this;
  4187. return self.compile(aString);
  4188. return self;}
  4189. }),
  4190. smalltalk.RegularExpression);
  4191. smalltalk.addMethod(
  4192. '_exec_',
  4193. smalltalk.method({
  4194. selector: 'exec:',
  4195. fn: function (aString){
  4196. var self=this;
  4197. return self.exec(aString) || nil;
  4198. return self;}
  4199. }),
  4200. smalltalk.RegularExpression);
  4201. smalltalk.addMethod(
  4202. '_test_',
  4203. smalltalk.method({
  4204. selector: 'test:',
  4205. fn: function (aString){
  4206. var self=this;
  4207. return self.test(aString);
  4208. return self;}
  4209. }),
  4210. smalltalk.RegularExpression);
  4211. smalltalk.addMethod(
  4212. '_fromString_flag_',
  4213. smalltalk.method({
  4214. selector: 'fromString:flag:',
  4215. fn: function (aString, anotherString){
  4216. var self=this;
  4217. return new RegExp(aString, anotherString);
  4218. return self;}
  4219. }),
  4220. smalltalk.RegularExpression.klass);
  4221. smalltalk.addMethod(
  4222. '_fromString_',
  4223. smalltalk.method({
  4224. selector: 'fromString:',
  4225. fn: function (aString){
  4226. var self=this;
  4227. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  4228. return self;}
  4229. }),
  4230. smalltalk.RegularExpression.klass);
  4231. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  4232. smalltalk.addMethod(
  4233. '_messageText',
  4234. smalltalk.method({
  4235. selector: 'messageText',
  4236. fn: function (){
  4237. var self=this;
  4238. return self['@messageText'];
  4239. return self;}
  4240. }),
  4241. smalltalk.Error);
  4242. smalltalk.addMethod(
  4243. '_messageText_',
  4244. smalltalk.method({
  4245. selector: 'messageText:',
  4246. fn: function (aString){
  4247. var self=this;
  4248. self['@messageText']=aString;
  4249. return self;}
  4250. }),
  4251. smalltalk.Error);
  4252. smalltalk.addMethod(
  4253. '_signal',
  4254. smalltalk.method({
  4255. selector: 'signal',
  4256. fn: function (){
  4257. var self=this;
  4258. self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  4259. return self;}
  4260. }),
  4261. smalltalk.Error);
  4262. smalltalk.addMethod(
  4263. '_context',
  4264. smalltalk.method({
  4265. selector: 'context',
  4266. fn: function (){
  4267. var self=this;
  4268. return self.context;
  4269. return self;}
  4270. }),
  4271. smalltalk.Error);
  4272. smalltalk.addMethod(
  4273. '_jsStack',
  4274. smalltalk.method({
  4275. selector: 'jsStack',
  4276. fn: function (){
  4277. var self=this;
  4278. return self.stack;
  4279. return self;}
  4280. }),
  4281. smalltalk.Error);
  4282. smalltalk.addMethod(
  4283. '_isSmalltalkError',
  4284. smalltalk.method({
  4285. selector: 'isSmalltalkError',
  4286. fn: function (){
  4287. var self=this;
  4288. return self.smalltalkError === true;
  4289. return self;}
  4290. }),
  4291. smalltalk.Error);
  4292. smalltalk.addMethod(
  4293. '_signal_',
  4294. smalltalk.method({
  4295. selector: 'signal:',
  4296. fn: function (aString){
  4297. var self=this;
  4298. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  4299. return self;}
  4300. }),
  4301. smalltalk.Error.klass);
  4302. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel');
  4303. smalltalk.addMethod(
  4304. '_receiver',
  4305. smalltalk.method({
  4306. selector: 'receiver',
  4307. fn: function (){
  4308. var self=this;
  4309. return self.receiver;
  4310. return self;}
  4311. }),
  4312. smalltalk.MethodContext);
  4313. smalltalk.addMethod(
  4314. '_selector',
  4315. smalltalk.method({
  4316. selector: 'selector',
  4317. fn: function (){
  4318. var self=this;
  4319. return smalltalk.convertSelector(self.selector);
  4320. return self;}
  4321. }),
  4322. smalltalk.MethodContext);
  4323. smalltalk.addMethod(
  4324. '_home',
  4325. smalltalk.method({
  4326. selector: 'home',
  4327. fn: function (){
  4328. var self=this;
  4329. return self.homeContext;
  4330. return self;}
  4331. }),
  4332. smalltalk.MethodContext);
  4333. smalltalk.addMethod(
  4334. '_temps',
  4335. smalltalk.method({
  4336. selector: 'temps',
  4337. fn: function (){
  4338. var self=this;
  4339. return self.temps;
  4340. return self;}
  4341. }),
  4342. smalltalk.MethodContext);
  4343. smalltalk.addMethod(
  4344. '_printString',
  4345. smalltalk.method({
  4346. selector: 'printString',
  4347. fn: function (){
  4348. var self=this;
  4349. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  4350. return self;}
  4351. }),
  4352. smalltalk.MethodContext);
  4353. smalltalk.addMethod(
  4354. '_asString',
  4355. smalltalk.method({
  4356. selector: 'asString',
  4357. fn: function (){
  4358. var self=this;
  4359. 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", [])]);
  4360. return self;}
  4361. }),
  4362. smalltalk.MethodContext);
  4363. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  4364. smalltalk.addMethod(
  4365. '__eq',
  4366. smalltalk.method({
  4367. selector: '=',
  4368. fn: function (anAssociation){
  4369. var self=this;
  4370. 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", [])]);})]);})]);
  4371. return self;}
  4372. }),
  4373. smalltalk.Association);
  4374. smalltalk.addMethod(
  4375. '_key_',
  4376. smalltalk.method({
  4377. selector: 'key:',
  4378. fn: function (aKey){
  4379. var self=this;
  4380. self['@key']=aKey;
  4381. return self;}
  4382. }),
  4383. smalltalk.Association);
  4384. smalltalk.addMethod(
  4385. '_key',
  4386. smalltalk.method({
  4387. selector: 'key',
  4388. fn: function (){
  4389. var self=this;
  4390. return self['@key'];
  4391. return self;}
  4392. }),
  4393. smalltalk.Association);
  4394. smalltalk.addMethod(
  4395. '_value_',
  4396. smalltalk.method({
  4397. selector: 'value:',
  4398. fn: function (aValue){
  4399. var self=this;
  4400. self['@value']=aValue;
  4401. return self;}
  4402. }),
  4403. smalltalk.Association);
  4404. smalltalk.addMethod(
  4405. '_value',
  4406. smalltalk.method({
  4407. selector: 'value',
  4408. fn: function (){
  4409. var self=this;
  4410. return self['@value'];
  4411. return self;}
  4412. }),
  4413. smalltalk.Association);
  4414. smalltalk.addMethod(
  4415. '_storeOn_',
  4416. smalltalk.method({
  4417. selector: 'storeOn:',
  4418. fn: function (aStream){
  4419. var self=this;
  4420. smalltalk.send(self['@key'], "_storeOn_", [aStream]);
  4421. smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
  4422. smalltalk.send(self['@value'], "_storeOn_", [aStream]);
  4423. return self;}
  4424. }),
  4425. smalltalk.Association);
  4426. smalltalk.addMethod(
  4427. '_key_value_',
  4428. smalltalk.method({
  4429. selector: 'key:value:',
  4430. fn: function (aKey, aValue){
  4431. var self=this;
  4432. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  4433. return self;}
  4434. }),
  4435. smalltalk.Association.klass);
  4436. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  4437. smalltalk.addMethod(
  4438. '__eq',
  4439. smalltalk.method({
  4440. selector: '=',
  4441. fn: function (aDictionary){
  4442. var self=this;
  4443. 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}})})();})]));
  4444. ((($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}})})();})]));
  4445. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
  4446. return self;
  4447. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  4448. }),
  4449. smalltalk.Dictionary);
  4450. smalltalk.addMethod(
  4451. '_shallowCopy',
  4452. smalltalk.method({
  4453. selector: 'shallowCopy',
  4454. fn: function (){
  4455. var self=this;
  4456. var copy=nil;
  4457. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4458. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4459. return copy;
  4460. return self;}
  4461. }),
  4462. smalltalk.Dictionary);
  4463. smalltalk.addMethod(
  4464. '_initialize',
  4465. smalltalk.method({
  4466. selector: 'initialize',
  4467. fn: function (){
  4468. var self=this;
  4469. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  4470. self['@keys']=[];
  4471. return self;}
  4472. }),
  4473. smalltalk.Dictionary);
  4474. smalltalk.addMethod(
  4475. '_size',
  4476. smalltalk.method({
  4477. selector: 'size',
  4478. fn: function (){
  4479. var self=this;
  4480. return smalltalk.send(self['@keys'], "_size", []);
  4481. return self;}
  4482. }),
  4483. smalltalk.Dictionary);
  4484. smalltalk.addMethod(
  4485. '_associations',
  4486. smalltalk.method({
  4487. selector: 'associations',
  4488. fn: function (){
  4489. var self=this;
  4490. var associations=nil;
  4491. associations=[];
  4492. 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])])]);})]);
  4493. return associations;
  4494. return self;}
  4495. }),
  4496. smalltalk.Dictionary);
  4497. smalltalk.addMethod(
  4498. '_keys',
  4499. smalltalk.method({
  4500. selector: 'keys',
  4501. fn: function (){
  4502. var self=this;
  4503. return smalltalk.send(self['@keys'], "_copy", []);
  4504. return self;}
  4505. }),
  4506. smalltalk.Dictionary);
  4507. smalltalk.addMethod(
  4508. '_values',
  4509. smalltalk.method({
  4510. selector: 'values',
  4511. fn: function (){
  4512. var self=this;
  4513. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  4514. return self;}
  4515. }),
  4516. smalltalk.Dictionary);
  4517. smalltalk.addMethod(
  4518. '_at_put_',
  4519. smalltalk.method({
  4520. selector: 'at:put:',
  4521. fn: function (aKey, aValue){
  4522. var self=this;
  4523. ((($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]);})]));
  4524. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  4525. return self;}
  4526. }),
  4527. smalltalk.Dictionary);
  4528. smalltalk.addMethod(
  4529. '_at_ifAbsent_',
  4530. smalltalk.method({
  4531. selector: 'at:ifAbsent:',
  4532. fn: function (aKey, aBlock){
  4533. var self=this;
  4534. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  4535. return self;}
  4536. }),
  4537. smalltalk.Dictionary);
  4538. smalltalk.addMethod(
  4539. '_at_ifAbsentPut_',
  4540. smalltalk.method({
  4541. selector: 'at:ifAbsentPut:',
  4542. fn: function (aKey, aBlock){
  4543. var self=this;
  4544. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  4545. return self;}
  4546. }),
  4547. smalltalk.Dictionary);
  4548. smalltalk.addMethod(
  4549. '_at_ifPresent_',
  4550. smalltalk.method({
  4551. selector: 'at:ifPresent:',
  4552. fn: function (aKey, aBlock){
  4553. var self=this;
  4554. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  4555. return self;}
  4556. }),
  4557. smalltalk.Dictionary);
  4558. smalltalk.addMethod(
  4559. '_at_ifPresent_ifAbsent_',
  4560. smalltalk.method({
  4561. selector: 'at:ifPresent:ifAbsent:',
  4562. fn: function (aKey, aBlock, anotherBlock){
  4563. var self=this;
  4564. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  4565. return self;}
  4566. }),
  4567. smalltalk.Dictionary);
  4568. smalltalk.addMethod(
  4569. '_add_',
  4570. smalltalk.method({
  4571. selector: 'add:',
  4572. fn: function (anAssociation){
  4573. var self=this;
  4574. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  4575. return self;}
  4576. }),
  4577. smalltalk.Dictionary);
  4578. smalltalk.addMethod(
  4579. '_addAll_',
  4580. smalltalk.method({
  4581. selector: 'addAll:',
  4582. fn: function (aDictionary){
  4583. var self=this;
  4584. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  4585. return aDictionary;
  4586. return self;}
  4587. }),
  4588. smalltalk.Dictionary);
  4589. smalltalk.addMethod(
  4590. '__comma',
  4591. smalltalk.method({
  4592. selector: ',',
  4593. fn: function (aCollection){
  4594. var self=this;
  4595. smalltalk.send(self, "_shouldNotImplement", []);
  4596. return self;}
  4597. }),
  4598. smalltalk.Dictionary);
  4599. smalltalk.addMethod(
  4600. '_copyFrom_to_',
  4601. smalltalk.method({
  4602. selector: 'copyFrom:to:',
  4603. fn: function (anIndex, anotherIndex){
  4604. var self=this;
  4605. smalltalk.send(self, "_shouldNotImplement", []);
  4606. return self;}
  4607. }),
  4608. smalltalk.Dictionary);
  4609. smalltalk.addMethod(
  4610. '_associationsDo_',
  4611. smalltalk.method({
  4612. selector: 'associationsDo:',
  4613. fn: function (aBlock){
  4614. var self=this;
  4615. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  4616. return self;}
  4617. }),
  4618. smalltalk.Dictionary);
  4619. smalltalk.addMethod(
  4620. '_keysAndValuesDo_',
  4621. smalltalk.method({
  4622. selector: 'keysAndValuesDo:',
  4623. fn: function (aBlock){
  4624. var self=this;
  4625. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4626. return self;}
  4627. }),
  4628. smalltalk.Dictionary);
  4629. smalltalk.addMethod(
  4630. '_do_',
  4631. smalltalk.method({
  4632. selector: 'do:',
  4633. fn: function (aBlock){
  4634. var self=this;
  4635. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  4636. return self;}
  4637. }),
  4638. smalltalk.Dictionary);
  4639. smalltalk.addMethod(
  4640. '_select_',
  4641. smalltalk.method({
  4642. selector: 'select:',
  4643. fn: function (aBlock){
  4644. var self=this;
  4645. var newDict=nil;
  4646. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4647. 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]);})]));})]);
  4648. return newDict;
  4649. return self;}
  4650. }),
  4651. smalltalk.Dictionary);
  4652. smalltalk.addMethod(
  4653. '_collect_',
  4654. smalltalk.method({
  4655. selector: 'collect:',
  4656. fn: function (aBlock){
  4657. var self=this;
  4658. var newDict=nil;
  4659. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4660. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  4661. return newDict;
  4662. return self;}
  4663. }),
  4664. smalltalk.Dictionary);
  4665. smalltalk.addMethod(
  4666. '_detect_ifNone_',
  4667. smalltalk.method({
  4668. selector: 'detect:ifNone:',
  4669. fn: function (aBlock, anotherBlock){
  4670. var self=this;
  4671. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  4672. return self;}
  4673. }),
  4674. smalltalk.Dictionary);
  4675. smalltalk.addMethod(
  4676. '_includes_',
  4677. smalltalk.method({
  4678. selector: 'includes:',
  4679. fn: function (anObject){
  4680. var self=this;
  4681. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  4682. return self;}
  4683. }),
  4684. smalltalk.Dictionary);
  4685. smalltalk.addMethod(
  4686. '_remove_',
  4687. smalltalk.method({
  4688. selector: 'remove:',
  4689. fn: function (aKey){
  4690. var self=this;
  4691. smalltalk.send(self, "_removeKey_", [aKey]);
  4692. return self;}
  4693. }),
  4694. smalltalk.Dictionary);
  4695. smalltalk.addMethod(
  4696. '_removeKey_',
  4697. smalltalk.method({
  4698. selector: 'removeKey:',
  4699. fn: function (aKey){
  4700. var self=this;
  4701. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  4702. return self;}
  4703. }),
  4704. smalltalk.Dictionary);
  4705. smalltalk.addMethod(
  4706. '_at_',
  4707. smalltalk.method({
  4708. selector: 'at:',
  4709. fn: function (aKey){
  4710. var self=this;
  4711. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  4712. return self;}
  4713. }),
  4714. smalltalk.Dictionary);
  4715. smalltalk.addMethod(
  4716. '_asJSONObject',
  4717. smalltalk.method({
  4718. selector: 'asJSONObject',
  4719. fn: function (){
  4720. var self=this;
  4721. var object=nil;
  4722. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  4723. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  4724. return object;
  4725. return self;}
  4726. }),
  4727. smalltalk.Dictionary);
  4728. smalltalk.addMethod(
  4729. '_printString',
  4730. smalltalk.method({
  4731. selector: 'printString',
  4732. fn: function (){
  4733. var self=this;
  4734. 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")]);})]);
  4735. return self;}
  4736. }),
  4737. smalltalk.Dictionary);
  4738. smalltalk.addMethod(
  4739. '_storeOn_',
  4740. smalltalk.method({
  4741. selector: 'storeOn:',
  4742. fn: function (aStream){
  4743. var self=this;
  4744. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  4745. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  4746. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  4747. return self;}
  4748. }),
  4749. smalltalk.Dictionary);
  4750. smalltalk.addMethod(
  4751. '_fromPairs_',
  4752. smalltalk.method({
  4753. selector: 'fromPairs:',
  4754. fn: function (aCollection){
  4755. var self=this;
  4756. var dict=nil;
  4757. dict=smalltalk.send(self, "_new", []);
  4758. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  4759. return dict;
  4760. return self;}
  4761. }),
  4762. smalltalk.Dictionary.klass);
  4763. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  4764. smalltalk.addMethod(
  4765. '_superclass_subclass_',
  4766. smalltalk.method({
  4767. selector: 'superclass:subclass:',
  4768. fn: function (aClass, aString){
  4769. var self=this;
  4770. return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
  4771. return self;}
  4772. }),
  4773. smalltalk.ClassBuilder);
  4774. smalltalk.addMethod(
  4775. '_class_instanceVariableNames_',
  4776. smalltalk.method({
  4777. selector: 'class:instanceVariableNames:',
  4778. fn: function (aClass, aString){
  4779. var self=this;
  4780. ((($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"])]);})]));
  4781. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  4782. smalltalk.send(self, "_setupClass_", [aClass]);
  4783. return self;}
  4784. }),
  4785. smalltalk.ClassBuilder);
  4786. smalltalk.addMethod(
  4787. '_instanceVariableNamesFor_',
  4788. smalltalk.method({
  4789. selector: 'instanceVariableNamesFor:',
  4790. fn: function (aString){
  4791. var self=this;
  4792. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  4793. return self;}
  4794. }),
  4795. smalltalk.ClassBuilder);
  4796. smalltalk.addMethod(
  4797. '_addSubclassOf_named_instanceVariableNames_',
  4798. smalltalk.method({
  4799. selector: 'addSubclassOf:named:instanceVariableNames:',
  4800. fn: function (aClass, aString, aCollection){
  4801. var self=this;
  4802. smalltalk.addClass(aString, aClass, aCollection);
  4803. return smalltalk[aString];
  4804. return self;}
  4805. }),
  4806. smalltalk.ClassBuilder);
  4807. smalltalk.addMethod(
  4808. '_setupClass_',
  4809. smalltalk.method({
  4810. selector: 'setupClass:',
  4811. fn: function (aClass){
  4812. var self=this;
  4813. smalltalk.init(aClass);;
  4814. return self;}
  4815. }),
  4816. smalltalk.ClassBuilder);
  4817. smalltalk.addMethod(
  4818. '_superclass_subclass_instanceVariableNames_package_',
  4819. smalltalk.method({
  4820. selector: 'superclass:subclass:instanceVariableNames:package:',
  4821. fn: function (aClass, aString, aString2, aString3){
  4822. var self=this;
  4823. var newClass=nil;
  4824. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]);
  4825. smalltalk.send(self, "_setupClass_", [newClass]);
  4826. return newClass;
  4827. return self;}
  4828. }),
  4829. smalltalk.ClassBuilder);
  4830. smalltalk.addMethod(
  4831. '_addSubclassOf_named_instanceVariableNames_package_',
  4832. smalltalk.method({
  4833. selector: 'addSubclassOf:named:instanceVariableNames:package:',
  4834. fn: function (aClass, aString, aCollection, packageName){
  4835. var self=this;
  4836. smalltalk.addClass(aString, aClass, aCollection, packageName);
  4837. return smalltalk[aString];
  4838. return self;}
  4839. }),
  4840. smalltalk.ClassBuilder);
  4841. smalltalk.addMethod(
  4842. '_copyClass_named_',
  4843. smalltalk.method({
  4844. selector: 'copyClass:named:',
  4845. fn: function (aClass, aString){
  4846. var self=this;
  4847. var newClass=nil;
  4848. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]);
  4849. smalltalk.send(self, "_setupClass_", [newClass]);
  4850. 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", [])]);})]);
  4851. 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", [])]);})]);
  4852. smalltalk.send(self, "_setupClass_", [newClass]);
  4853. return newClass;
  4854. return self;}
  4855. }),
  4856. smalltalk.ClassBuilder);
  4857. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  4858. smalltalk.addMethod(
  4859. '_initialize',
  4860. smalltalk.method({
  4861. selector: 'initialize',
  4862. fn: function (){
  4863. var self=this;
  4864. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  4865. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  4866. return self;}
  4867. }),
  4868. smalltalk.ClassCategoryReader);
  4869. smalltalk.addMethod(
  4870. '_class_category_',
  4871. smalltalk.method({
  4872. selector: 'class:category:',
  4873. fn: function (aClass, aString){
  4874. var self=this;
  4875. self['@class']=aClass;
  4876. self['@category']=aString;
  4877. return self;}
  4878. }),
  4879. smalltalk.ClassCategoryReader);
  4880. smalltalk.addMethod(
  4881. '_scanFrom_',
  4882. smalltalk.method({
  4883. selector: 'scanFrom:',
  4884. fn: function (aChunkParser){
  4885. var self=this;
  4886. var chunk=nil;
  4887. (function(){while(!(function(){chunk=smalltalk.send(aChunkParser, "_nextChunk", []);return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  4888. return self;}
  4889. }),
  4890. smalltalk.ClassCategoryReader);
  4891. smalltalk.addMethod(
  4892. '_compileMethod_',
  4893. smalltalk.method({
  4894. selector: 'compileMethod:',
  4895. fn: function (aString){
  4896. var self=this;
  4897. var method=nil;
  4898. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self['@class']]);
  4899. smalltalk.send(method, "_category_", [self['@category']]);
  4900. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  4901. return self;}
  4902. }),
  4903. smalltalk.ClassCategoryReader);
  4904. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  4905. smalltalk.addMethod(
  4906. '_collection',
  4907. smalltalk.method({
  4908. selector: 'collection',
  4909. fn: function (){
  4910. var self=this;
  4911. return self['@collection'];
  4912. return self;}
  4913. }),
  4914. smalltalk.Stream);
  4915. smalltalk.addMethod(
  4916. '_setCollection_',
  4917. smalltalk.method({
  4918. selector: 'setCollection:',
  4919. fn: function (aCollection){
  4920. var self=this;
  4921. self['@collection']=aCollection;
  4922. return self;}
  4923. }),
  4924. smalltalk.Stream);
  4925. smalltalk.addMethod(
  4926. '_position',
  4927. smalltalk.method({
  4928. selector: 'position',
  4929. fn: function (){
  4930. var self=this;
  4931. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return self['@position']=(0);})() : $receiver;
  4932. return self;}
  4933. }),
  4934. smalltalk.Stream);
  4935. smalltalk.addMethod(
  4936. '_position_',
  4937. smalltalk.method({
  4938. selector: 'position:',
  4939. fn: function (anInteger){
  4940. var self=this;
  4941. self['@position']=anInteger;
  4942. return self;}
  4943. }),
  4944. smalltalk.Stream);
  4945. smalltalk.addMethod(
  4946. '_streamSize',
  4947. smalltalk.method({
  4948. selector: 'streamSize',
  4949. fn: function (){
  4950. var self=this;
  4951. return self['@streamSize'];
  4952. return self;}
  4953. }),
  4954. smalltalk.Stream);
  4955. smalltalk.addMethod(
  4956. '_setStreamSize_',
  4957. smalltalk.method({
  4958. selector: 'setStreamSize:',
  4959. fn: function (anInteger){
  4960. var self=this;
  4961. self['@streamSize']=anInteger;
  4962. return self;}
  4963. }),
  4964. smalltalk.Stream);
  4965. smalltalk.addMethod(
  4966. '_contents',
  4967. smalltalk.method({
  4968. selector: 'contents',
  4969. fn: function (){
  4970. var self=this;
  4971. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  4972. return self;}
  4973. }),
  4974. smalltalk.Stream);
  4975. smalltalk.addMethod(
  4976. '_size',
  4977. smalltalk.method({
  4978. selector: 'size',
  4979. fn: function (){
  4980. var self=this;
  4981. return smalltalk.send(self, "_streamSize", []);
  4982. return self;}
  4983. }),
  4984. smalltalk.Stream);
  4985. smalltalk.addMethod(
  4986. '_reset',
  4987. smalltalk.method({
  4988. selector: 'reset',
  4989. fn: function (){
  4990. var self=this;
  4991. smalltalk.send(self, "_position_", [(0)]);
  4992. return self;}
  4993. }),
  4994. smalltalk.Stream);
  4995. smalltalk.addMethod(
  4996. '_close',
  4997. smalltalk.method({
  4998. selector: 'close',
  4999. fn: function (){
  5000. var self=this;
  5001. return self;}
  5002. }),
  5003. smalltalk.Stream);
  5004. smalltalk.addMethod(
  5005. '_flush',
  5006. smalltalk.method({
  5007. selector: 'flush',
  5008. fn: function (){
  5009. var self=this;
  5010. return self;}
  5011. }),
  5012. smalltalk.Stream);
  5013. smalltalk.addMethod(
  5014. '_resetContents',
  5015. smalltalk.method({
  5016. selector: 'resetContents',
  5017. fn: function (){
  5018. var self=this;
  5019. smalltalk.send(self, "_reset", []);
  5020. smalltalk.send(self, "_setStreamSize_", [(0)]);
  5021. return self;}
  5022. }),
  5023. smalltalk.Stream);
  5024. smalltalk.addMethod(
  5025. '_do_',
  5026. smalltalk.method({
  5027. selector: 'do:',
  5028. fn: function (aBlock){
  5029. var self=this;
  5030. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  5031. return self;}
  5032. }),
  5033. smalltalk.Stream);
  5034. smalltalk.addMethod(
  5035. '_setToEnd',
  5036. smalltalk.method({
  5037. selector: 'setToEnd',
  5038. fn: function (){
  5039. var self=this;
  5040. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  5041. return self;}
  5042. }),
  5043. smalltalk.Stream);
  5044. smalltalk.addMethod(
  5045. '_skip_',
  5046. smalltalk.method({
  5047. selector: 'skip:',
  5048. fn: function (anInteger){
  5049. var self=this;
  5050. 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)])]);
  5051. return self;}
  5052. }),
  5053. smalltalk.Stream);
  5054. smalltalk.addMethod(
  5055. '_next',
  5056. smalltalk.method({
  5057. selector: 'next',
  5058. fn: function (){
  5059. var self=this;
  5060. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  5061. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  5062. return self;}
  5063. }),
  5064. smalltalk.Stream);
  5065. smalltalk.addMethod(
  5066. '_next_',
  5067. smalltalk.method({
  5068. selector: 'next:',
  5069. fn: function (anInteger){
  5070. var self=this;
  5071. var tempCollection=nil;
  5072. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  5073. 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", [])]);})]));})]);
  5074. return tempCollection;
  5075. return self;}
  5076. }),
  5077. smalltalk.Stream);
  5078. smalltalk.addMethod(
  5079. '_nextPut_',
  5080. smalltalk.method({
  5081. selector: 'nextPut:',
  5082. fn: function (anObject){
  5083. var self=this;
  5084. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  5085. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  5086. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  5087. return self;}
  5088. }),
  5089. smalltalk.Stream);
  5090. smalltalk.addMethod(
  5091. '_nextPutAll_',
  5092. smalltalk.method({
  5093. selector: 'nextPutAll:',
  5094. fn: function (aCollection){
  5095. var self=this;
  5096. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  5097. return self;}
  5098. }),
  5099. smalltalk.Stream);
  5100. smalltalk.addMethod(
  5101. '_peek',
  5102. smalltalk.method({
  5103. selector: 'peek',
  5104. fn: function (){
  5105. var self=this;
  5106. 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)]))]);})]));
  5107. return self;}
  5108. }),
  5109. smalltalk.Stream);
  5110. smalltalk.addMethod(
  5111. '_atEnd',
  5112. smalltalk.method({
  5113. selector: 'atEnd',
  5114. fn: function (){
  5115. var self=this;
  5116. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  5117. return self;}
  5118. }),
  5119. smalltalk.Stream);
  5120. smalltalk.addMethod(
  5121. '_atStart',
  5122. smalltalk.method({
  5123. selector: 'atStart',
  5124. fn: function (){
  5125. var self=this;
  5126. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  5127. return self;}
  5128. }),
  5129. smalltalk.Stream);
  5130. smalltalk.addMethod(
  5131. '_isEmpty',
  5132. smalltalk.method({
  5133. selector: 'isEmpty',
  5134. fn: function (){
  5135. var self=this;
  5136. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  5137. return self;}
  5138. }),
  5139. smalltalk.Stream);
  5140. smalltalk.addMethod(
  5141. '_on_',
  5142. smalltalk.method({
  5143. selector: 'on:',
  5144. fn: function (aCollection){
  5145. var self=this;
  5146. 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", []));
  5147. return self;}
  5148. }),
  5149. smalltalk.Stream.klass);
  5150. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  5151. smalltalk.addMethod(
  5152. '_next_',
  5153. smalltalk.method({
  5154. selector: 'next:',
  5155. fn: function (anInteger){
  5156. var self=this;
  5157. var tempCollection=nil;
  5158. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  5159. 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", [])]);})]));})]);
  5160. return tempCollection;
  5161. return self;}
  5162. }),
  5163. smalltalk.StringStream);
  5164. smalltalk.addMethod(
  5165. '_nextPut_',
  5166. smalltalk.method({
  5167. selector: 'nextPut:',
  5168. fn: function (aString){
  5169. var self=this;
  5170. smalltalk.send(self, "_nextPutAll_", [aString]);
  5171. return self;}
  5172. }),
  5173. smalltalk.StringStream);
  5174. smalltalk.addMethod(
  5175. '_nextPutAll_',
  5176. smalltalk.method({
  5177. selector: 'nextPutAll:',
  5178. fn: function (aString){
  5179. var self=this;
  5180. 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", [])])])]);
  5181. 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", [])]))]);
  5182. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  5183. return self;}
  5184. }),
  5185. smalltalk.StringStream);
  5186. smalltalk.addMethod(
  5187. '_cr',
  5188. smalltalk.method({
  5189. selector: 'cr',
  5190. fn: function (){
  5191. var self=this;
  5192. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  5193. return self;}
  5194. }),
  5195. smalltalk.StringStream);
  5196. smalltalk.addMethod(
  5197. '_crlf',
  5198. smalltalk.method({
  5199. selector: 'crlf',
  5200. fn: function (){
  5201. var self=this;
  5202. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  5203. return self;}
  5204. }),
  5205. smalltalk.StringStream);
  5206. smalltalk.addMethod(
  5207. '_lf',
  5208. smalltalk.method({
  5209. selector: 'lf',
  5210. fn: function (){
  5211. var self=this;
  5212. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  5213. return self;}
  5214. }),
  5215. smalltalk.StringStream);
  5216. smalltalk.addMethod(
  5217. '_space',
  5218. smalltalk.method({
  5219. selector: 'space',
  5220. fn: function (){
  5221. var self=this;
  5222. smalltalk.send(self, "_nextPut_", [" "]);
  5223. return self;}
  5224. }),
  5225. smalltalk.StringStream);
  5226. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  5227. smalltalk.addMethod(
  5228. '_class_',
  5229. smalltalk.method({
  5230. selector: 'class:',
  5231. fn: function (aClass){
  5232. var self=this;
  5233. self['@class']=aClass;
  5234. return self;}
  5235. }),
  5236. smalltalk.ClassCommentReader);
  5237. smalltalk.addMethod(
  5238. '_scanFrom_',
  5239. smalltalk.method({
  5240. selector: 'scanFrom:',
  5241. fn: function (aChunkParser){
  5242. var self=this;
  5243. var chunk=nil;
  5244. chunk=smalltalk.send(aChunkParser, "_nextChunk", []);
  5245. ((($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]);})]));
  5246. return self;}
  5247. }),
  5248. smalltalk.ClassCommentReader);
  5249. smalltalk.addMethod(
  5250. '_initialize',
  5251. smalltalk.method({
  5252. selector: 'initialize',
  5253. fn: function (){
  5254. var self=this;
  5255. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  5256. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  5257. return self;}
  5258. }),
  5259. smalltalk.ClassCommentReader);
  5260. smalltalk.addMethod(
  5261. '_setComment_',
  5262. smalltalk.method({
  5263. selector: 'setComment:',
  5264. fn: function (aString){
  5265. var self=this;
  5266. smalltalk.send(self['@class'], "_comment_", [aString]);
  5267. return self;}
  5268. }),
  5269. smalltalk.ClassCommentReader);
  5270. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  5271. smalltalk.addMethod(
  5272. '_next',
  5273. smalltalk.method({
  5274. selector: 'next',
  5275. fn: function (){
  5276. var self=this;
  5277. return Math.random();
  5278. return self;}
  5279. }),
  5280. smalltalk.Random);
  5281. smalltalk.addMethod(
  5282. '_next_',
  5283. smalltalk.method({
  5284. selector: 'next:',
  5285. fn: function (anInteger){
  5286. var self=this;
  5287. return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
  5288. return self;}
  5289. }),
  5290. smalltalk.Random);
  5291. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  5292. smalltalk.addMethod(
  5293. '_x',
  5294. smalltalk.method({
  5295. selector: 'x',
  5296. fn: function (){
  5297. var self=this;
  5298. return self['@x'];
  5299. return self;}
  5300. }),
  5301. smalltalk.Point);
  5302. smalltalk.addMethod(
  5303. '_y',
  5304. smalltalk.method({
  5305. selector: 'y',
  5306. fn: function (){
  5307. var self=this;
  5308. return self['@y'];
  5309. return self;}
  5310. }),
  5311. smalltalk.Point);
  5312. smalltalk.addMethod(
  5313. '_y_',
  5314. smalltalk.method({
  5315. selector: 'y:',
  5316. fn: function (aNumber){
  5317. var self=this;
  5318. self['@y']=aNumber;
  5319. return self;}
  5320. }),
  5321. smalltalk.Point);
  5322. smalltalk.addMethod(
  5323. '_x_',
  5324. smalltalk.method({
  5325. selector: 'x:',
  5326. fn: function (aNumber){
  5327. var self=this;
  5328. self['@x']=aNumber;
  5329. return self;}
  5330. }),
  5331. smalltalk.Point);
  5332. smalltalk.addMethod(
  5333. '__star',
  5334. smalltalk.method({
  5335. selector: '*',
  5336. fn: function (aPoint){
  5337. var self=this;
  5338. 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", [])]))]);
  5339. return self;}
  5340. }),
  5341. smalltalk.Point);
  5342. smalltalk.addMethod(
  5343. '__plus',
  5344. smalltalk.method({
  5345. selector: '+',
  5346. fn: function (aPoint){
  5347. var self=this;
  5348. 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", [])]))]);
  5349. return self;}
  5350. }),
  5351. smalltalk.Point);
  5352. smalltalk.addMethod(
  5353. '__minus',
  5354. smalltalk.method({
  5355. selector: '-',
  5356. fn: function (aPoint){
  5357. var self=this;
  5358. 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", [])]))]);
  5359. return self;}
  5360. }),
  5361. smalltalk.Point);
  5362. smalltalk.addMethod(
  5363. '__slash',
  5364. smalltalk.method({
  5365. selector: '/',
  5366. fn: function (aPoint){
  5367. var self=this;
  5368. 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", [])]))]);
  5369. return self;}
  5370. }),
  5371. smalltalk.Point);
  5372. smalltalk.addMethod(
  5373. '_asPoint',
  5374. smalltalk.method({
  5375. selector: 'asPoint',
  5376. fn: function (){
  5377. var self=this;
  5378. return self;
  5379. return self;}
  5380. }),
  5381. smalltalk.Point);
  5382. smalltalk.addMethod(
  5383. '__eq',
  5384. smalltalk.method({
  5385. selector: '=',
  5386. fn: function (aPoint){
  5387. var self=this;
  5388. 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", [])])]);})]);
  5389. return self;}
  5390. }),
  5391. smalltalk.Point);
  5392. smalltalk.addMethod(
  5393. '_x_y_',
  5394. smalltalk.method({
  5395. selector: 'x:y:',
  5396. fn: function (aNumber, anotherNumber){
  5397. var self=this;
  5398. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5399. return self;}
  5400. }),
  5401. smalltalk.Point.klass);
  5402. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  5403. smalltalk.addMethod(
  5404. '_selector',
  5405. smalltalk.method({
  5406. selector: 'selector',
  5407. fn: function (){
  5408. var self=this;
  5409. return self['@selector'];
  5410. return self;}
  5411. }),
  5412. smalltalk.Message);
  5413. smalltalk.addMethod(
  5414. '_selector_',
  5415. smalltalk.method({
  5416. selector: 'selector:',
  5417. fn: function (aString){
  5418. var self=this;
  5419. self['@selector']=aString;
  5420. return self;}
  5421. }),
  5422. smalltalk.Message);
  5423. smalltalk.addMethod(
  5424. '_arguments_',
  5425. smalltalk.method({
  5426. selector: 'arguments:',
  5427. fn: function (anArray){
  5428. var self=this;
  5429. self['@arguments']=anArray;
  5430. return self;}
  5431. }),
  5432. smalltalk.Message);
  5433. smalltalk.addMethod(
  5434. '_arguments',
  5435. smalltalk.method({
  5436. selector: 'arguments',
  5437. fn: function (){
  5438. var self=this;
  5439. return self['@arguments'];
  5440. return self;}
  5441. }),
  5442. smalltalk.Message);
  5443. smalltalk.addMethod(
  5444. '_printString',
  5445. smalltalk.method({
  5446. selector: 'printString',
  5447. fn: function (){
  5448. var self=this;
  5449. 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);})]);
  5450. return self;}
  5451. }),
  5452. smalltalk.Message);
  5453. smalltalk.addMethod(
  5454. '_selector_arguments_',
  5455. smalltalk.method({
  5456. selector: 'selector:arguments:',
  5457. fn: function (aString, anArray){
  5458. var self=this;
  5459. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5460. return self;}
  5461. }),
  5462. smalltalk.Message.klass);
  5463. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  5464. smalltalk.addMethod(
  5465. '_message',
  5466. smalltalk.method({
  5467. selector: 'message',
  5468. fn: function (){
  5469. var self=this;
  5470. return self['@message'];
  5471. return self;}
  5472. }),
  5473. smalltalk.MessageNotUnderstood);
  5474. smalltalk.addMethod(
  5475. '_message_',
  5476. smalltalk.method({
  5477. selector: 'message:',
  5478. fn: function (aMessage){
  5479. var self=this;
  5480. self['@message']=aMessage;
  5481. return self;}
  5482. }),
  5483. smalltalk.MessageNotUnderstood);
  5484. smalltalk.addMethod(
  5485. '_receiver',
  5486. smalltalk.method({
  5487. selector: 'receiver',
  5488. fn: function (){
  5489. var self=this;
  5490. return self['@receiver'];
  5491. return self;}
  5492. }),
  5493. smalltalk.MessageNotUnderstood);
  5494. smalltalk.addMethod(
  5495. '_receiver_',
  5496. smalltalk.method({
  5497. selector: 'receiver:',
  5498. fn: function (anObject){
  5499. var self=this;
  5500. self['@receiver']=anObject;
  5501. return self;}
  5502. }),
  5503. smalltalk.MessageNotUnderstood);
  5504. smalltalk.addMethod(
  5505. '_messageText',
  5506. smalltalk.method({
  5507. selector: 'messageText',
  5508. fn: function (){
  5509. var self=this;
  5510. 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", [])]);
  5511. return self;}
  5512. }),
  5513. smalltalk.MessageNotUnderstood);
  5514. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel');
  5515. smalltalk.addMethod(
  5516. '_handleError_',
  5517. smalltalk.method({
  5518. selector: 'handleError:',
  5519. fn: function (anError){
  5520. var self=this;
  5521. (($receiver = smalltalk.send(anError, "_context", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})() : nil;
  5522. smalltalk.send(self, "_logError_", [anError]);
  5523. return self;}
  5524. }),
  5525. smalltalk.ErrorHandler);
  5526. smalltalk.addMethod(
  5527. '_logContext_',
  5528. smalltalk.method({
  5529. selector: 'logContext:',
  5530. fn: function (aContext){
  5531. var self=this;
  5532. (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;
  5533. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  5534. return self;}
  5535. }),
  5536. smalltalk.ErrorHandler);
  5537. smalltalk.addMethod(
  5538. '_logErrorContext_',
  5539. smalltalk.method({
  5540. selector: 'logErrorContext:',
  5541. fn: function (aContext){
  5542. var self=this;
  5543. (($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;
  5544. return self;}
  5545. }),
  5546. smalltalk.ErrorHandler);
  5547. smalltalk.addMethod(
  5548. '_logError_',
  5549. smalltalk.method({
  5550. selector: 'logError:',
  5551. fn: function (anError){
  5552. var self=this;
  5553. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  5554. return self;}
  5555. }),
  5556. smalltalk.ErrorHandler);
  5557. smalltalk.addMethod(
  5558. '_log_',
  5559. smalltalk.method({
  5560. selector: 'log:',
  5561. fn: function (aString){
  5562. var self=this;
  5563. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [aString]);
  5564. return self;}
  5565. }),
  5566. smalltalk.ErrorHandler);
  5567. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  5568. smalltalk.addMethod(
  5569. '_current',
  5570. smalltalk.method({
  5571. selector: 'current',
  5572. fn: function (){
  5573. var self=this;
  5574. return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return self['@current']=smalltalk.send(self, "_new", []);})() : $receiver;
  5575. return self;}
  5576. }),
  5577. smalltalk.ErrorHandler.klass);
  5578. smalltalk.addMethod(
  5579. '_initialize',
  5580. smalltalk.method({
  5581. selector: 'initialize',
  5582. fn: function (){
  5583. var self=this;
  5584. smalltalk.send(self, "_register", []);
  5585. return self;}
  5586. }),
  5587. smalltalk.ErrorHandler.klass);
  5588. smalltalk.addMethod(
  5589. '_register',
  5590. smalltalk.method({
  5591. selector: 'register',
  5592. fn: function (){
  5593. var self=this;
  5594. smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  5595. return self;}
  5596. }),
  5597. smalltalk.ErrorHandler.klass);
  5598. smalltalk.addMethod(
  5599. '_setCurrent_',
  5600. smalltalk.method({
  5601. selector: 'setCurrent:',
  5602. fn: function (anHandler){
  5603. var self=this;
  5604. self['@current']=anHandler;
  5605. return self;}
  5606. }),
  5607. smalltalk.ErrorHandler.klass);
  5608. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel');
  5609. smalltalk.addMethod(
  5610. '_jsObject_',
  5611. smalltalk.method({
  5612. selector: 'jsObject:',
  5613. fn: function (aJSObject){
  5614. var self=this;
  5615. self['@jsObject']=aJSObject;
  5616. return self;}
  5617. }),
  5618. smalltalk.JSObjectProxy);
  5619. smalltalk.addMethod(
  5620. '_jsObject',
  5621. smalltalk.method({
  5622. selector: 'jsObject',
  5623. fn: function (){
  5624. var self=this;
  5625. return self['@jsObject'];
  5626. return self;}
  5627. }),
  5628. smalltalk.JSObjectProxy);
  5629. smalltalk.addMethod(
  5630. '_printString',
  5631. smalltalk.method({
  5632. selector: 'printString',
  5633. fn: function (){
  5634. var self=this;
  5635. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  5636. return self;}
  5637. }),
  5638. smalltalk.JSObjectProxy);
  5639. smalltalk.addMethod(
  5640. '_inspectOn_',
  5641. smalltalk.method({
  5642. selector: 'inspectOn:',
  5643. fn: function (anInspector){
  5644. var self=this;
  5645. var variables=nil;
  5646. variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  5647. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  5648. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  5649. for(var i in self['@jsObject']) {
  5650. variables._at_put_(i, self['@jsObject'][i]);
  5651. };
  5652. smalltalk.send(anInspector, "_setVariables_", [variables]);
  5653. return self;}
  5654. }),
  5655. smalltalk.JSObjectProxy);
  5656. smalltalk.addMethod(
  5657. '_doesNotUnderstand_',
  5658. smalltalk.method({
  5659. selector: 'doesNotUnderstand:',
  5660. fn: function (aMessage){
  5661. var self=this;
  5662. var obj=nil;
  5663. var selector=nil;
  5664. var jsSelector=nil;
  5665. var arguments=nil;
  5666. obj=smalltalk.send(self, "_jsObject", []);
  5667. selector=smalltalk.send(aMessage, "_selector", []);
  5668. jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []);
  5669. arguments=smalltalk.send(aMessage, "_arguments", []);
  5670. if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
  5671. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  5672. return self;}
  5673. }),
  5674. smalltalk.JSObjectProxy);
  5675. smalltalk.addMethod(
  5676. '_at_',
  5677. smalltalk.method({
  5678. selector: 'at:',
  5679. fn: function (aString){
  5680. var self=this;
  5681. return self['@jsObject'][aString];
  5682. return self;}
  5683. }),
  5684. smalltalk.JSObjectProxy);
  5685. smalltalk.addMethod(
  5686. '_at_put_',
  5687. smalltalk.method({
  5688. selector: 'at:put:',
  5689. fn: function (aString, anObject){
  5690. var self=this;
  5691. self['@jsObject'][aString] = anObject;
  5692. return self;}
  5693. }),
  5694. smalltalk.JSObjectProxy);
  5695. smalltalk.addMethod(
  5696. '_on_',
  5697. smalltalk.method({
  5698. selector: 'on:',
  5699. fn: function (aJSObject){
  5700. var self=this;
  5701. return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5702. return self;}
  5703. }),
  5704. smalltalk.JSObjectProxy.klass);
  5705. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel');
  5706. smalltalk.addMethod(
  5707. '_add_',
  5708. smalltalk.method({
  5709. selector: 'add:',
  5710. fn: function (anObject){
  5711. var self=this;
  5712. var found;
  5713. for(var i in self['@elements']) {
  5714. if(anObject == self['@elements'][i]) {
  5715. found = true;
  5716. break;
  5717. }
  5718. }
  5719. if(!found) {self['@elements'].push(anObject)}
  5720. ;
  5721. return self;}
  5722. }),
  5723. smalltalk.Set);
  5724. smalltalk.addMethod(
  5725. '_remove_',
  5726. smalltalk.method({
  5727. selector: 'remove:',
  5728. fn: function (anObject){
  5729. var self=this;
  5730. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  5731. return self;}
  5732. }),
  5733. smalltalk.Set);
  5734. smalltalk.addMethod(
  5735. '_initialize',
  5736. smalltalk.method({
  5737. selector: 'initialize',
  5738. fn: function (){
  5739. var self=this;
  5740. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  5741. self['@elements']=[];
  5742. return self;}
  5743. }),
  5744. smalltalk.Set);
  5745. smalltalk.addMethod(
  5746. '_size',
  5747. smalltalk.method({
  5748. selector: 'size',
  5749. fn: function (){
  5750. var self=this;
  5751. return smalltalk.send(self['@elements'], "_size", []);
  5752. return self;}
  5753. }),
  5754. smalltalk.Set);
  5755. smalltalk.addMethod(
  5756. '_asArray',
  5757. smalltalk.method({
  5758. selector: 'asArray',
  5759. fn: function (){
  5760. var self=this;
  5761. return smalltalk.send(self['@elements'], "_copy", []);
  5762. return self;}
  5763. }),
  5764. smalltalk.Set);
  5765. smalltalk.addMethod(
  5766. '_detect_ifNone_',
  5767. smalltalk.method({
  5768. selector: 'detect:ifNone:',
  5769. fn: function (aBlock, anotherBlock){
  5770. var self=this;
  5771. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  5772. return self;}
  5773. }),
  5774. smalltalk.Set);
  5775. smalltalk.addMethod(
  5776. '_do_',
  5777. smalltalk.method({
  5778. selector: 'do:',
  5779. fn: function (aBlock){
  5780. var self=this;
  5781. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  5782. return self;}
  5783. }),
  5784. smalltalk.Set);
  5785. smalltalk.addMethod(
  5786. '_includes_',
  5787. smalltalk.method({
  5788. selector: 'includes:',
  5789. fn: function (anObject){
  5790. var self=this;
  5791. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  5792. return self;}
  5793. }),
  5794. smalltalk.Set);
  5795. smalltalk.addMethod(
  5796. '__eq',
  5797. smalltalk.method({
  5798. selector: '=',
  5799. fn: function (aCollection){
  5800. var self=this;
  5801. 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", [])]);})]);
  5802. return self;}
  5803. }),
  5804. smalltalk.Set);
  5805. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel');
  5806. smalltalk.Transcript.klass.iVarNames = ['current'];
  5807. smalltalk.addMethod(
  5808. '_open',
  5809. smalltalk.method({
  5810. selector: 'open',
  5811. fn: function (){
  5812. var self=this;
  5813. smalltalk.send(smalltalk.send(self, "_current", []), "_open", []);
  5814. return self;}
  5815. }),
  5816. smalltalk.Transcript.klass);
  5817. smalltalk.addMethod(
  5818. '_new',
  5819. smalltalk.method({
  5820. selector: 'new',
  5821. fn: function (){
  5822. var self=this;
  5823. smalltalk.send(self, "_shouldNotImplement", []);
  5824. return self;}
  5825. }),
  5826. smalltalk.Transcript.klass);
  5827. smalltalk.addMethod(
  5828. '_current',
  5829. smalltalk.method({
  5830. selector: 'current',
  5831. fn: function (){
  5832. var self=this;
  5833. return self['@current'];
  5834. return self;}
  5835. }),
  5836. smalltalk.Transcript.klass);
  5837. smalltalk.addMethod(
  5838. '_show_',
  5839. smalltalk.method({
  5840. selector: 'show:',
  5841. fn: function (anObject){
  5842. var self=this;
  5843. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [anObject]);
  5844. return self;}
  5845. }),
  5846. smalltalk.Transcript.klass);
  5847. smalltalk.addMethod(
  5848. '_cr',
  5849. smalltalk.method({
  5850. selector: 'cr',
  5851. fn: function (){
  5852. var self=this;
  5853. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  5854. return self;}
  5855. }),
  5856. smalltalk.Transcript.klass);
  5857. smalltalk.addMethod(
  5858. '_clear',
  5859. smalltalk.method({
  5860. selector: 'clear',
  5861. fn: function (){
  5862. var self=this;
  5863. smalltalk.send(smalltalk.send(self, "_current", []), "_clear", []);
  5864. return self;}
  5865. }),
  5866. smalltalk.Transcript.klass);
  5867. smalltalk.addMethod(
  5868. '_register_',
  5869. smalltalk.method({
  5870. selector: 'register:',
  5871. fn: function (aTranscript){
  5872. var self=this;
  5873. self['@current']=aTranscript;
  5874. return self;}
  5875. }),
  5876. smalltalk.Transcript.klass);
  5877. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel');
  5878. smalltalk.addMethod(
  5879. '_clear',
  5880. smalltalk.method({
  5881. selector: 'clear',
  5882. fn: function (){
  5883. var self=this;
  5884. return self;}
  5885. }),
  5886. smalltalk.ConsoleTranscript);
  5887. smalltalk.addMethod(
  5888. '_cr',
  5889. smalltalk.method({
  5890. selector: 'cr',
  5891. fn: function (){
  5892. var self=this;
  5893. return self;}
  5894. }),
  5895. smalltalk.ConsoleTranscript);
  5896. smalltalk.addMethod(
  5897. '_show_',
  5898. smalltalk.method({
  5899. selector: 'show:',
  5900. fn: function (anObject){
  5901. var self=this;
  5902. var string=nil;
  5903. string=smalltalk.send(anObject, "_asString", []);
  5904. console.log(String(string));
  5905. return self;}
  5906. }),
  5907. smalltalk.ConsoleTranscript);
  5908. smalltalk.addMethod(
  5909. '_open',
  5910. smalltalk.method({
  5911. selector: 'open',
  5912. fn: function (){
  5913. var self=this;
  5914. return self;}
  5915. }),
  5916. smalltalk.ConsoleTranscript);
  5917. smalltalk.addMethod(
  5918. '_initialize',
  5919. smalltalk.method({
  5920. selector: 'initialize',
  5921. fn: function (){
  5922. var self=this;
  5923. smalltalk.send((smalltalk.Transcript || Transcript), "_register_", [smalltalk.send(self, "_new", [])]);
  5924. return self;}
  5925. }),
  5926. smalltalk.ConsoleTranscript.klass);
  5927. smalltalk.addClass('Dictionary2', smalltalk.Dictionary, ['keys'], 'Kernel');
  5928. smalltalk.addMethod(
  5929. '__eq',
  5930. smalltalk.method({
  5931. selector: '=',
  5932. fn: function (aDictionary){
  5933. var self=this;
  5934. 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}})})();})]));
  5935. ((($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}})})();})]));
  5936. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aDictionary, "_associations", [])])}})})();
  5937. return self;
  5938. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  5939. }),
  5940. smalltalk.Dictionary2);
  5941. smalltalk.addMethod(
  5942. '_shallowCopy',
  5943. smalltalk.method({
  5944. selector: 'shallowCopy',
  5945. fn: function (){
  5946. var self=this;
  5947. var copy=nil;
  5948. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  5949. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  5950. return copy;
  5951. return self;}
  5952. }),
  5953. smalltalk.Dictionary2);
  5954. smalltalk.addMethod(
  5955. '_initialize',
  5956. smalltalk.method({
  5957. selector: 'initialize',
  5958. fn: function (){
  5959. var self=this;
  5960. smalltalk.send(self, "_initialize", [], smalltalk.Dictionary);
  5961. self['@keys']=[];
  5962. return self;}
  5963. }),
  5964. smalltalk.Dictionary2);
  5965. smalltalk.addMethod(
  5966. '_size',
  5967. smalltalk.method({
  5968. selector: 'size',
  5969. fn: function (){
  5970. var self=this;
  5971. return smalltalk.send(self['@keys'], "_size", []);
  5972. return self;}
  5973. }),
  5974. smalltalk.Dictionary2);
  5975. smalltalk.addMethod(
  5976. '_associations',
  5977. smalltalk.method({
  5978. selector: 'associations',
  5979. fn: function (){
  5980. var self=this;
  5981. var associations=nil;
  5982. associations=[];
  5983. 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])])]);})]);
  5984. return associations;
  5985. return self;}
  5986. }),
  5987. smalltalk.Dictionary2);
  5988. smalltalk.addMethod(
  5989. '_keys',
  5990. smalltalk.method({
  5991. selector: 'keys',
  5992. fn: function (){
  5993. var self=this;
  5994. return smalltalk.send(self['@keys'], "_copy", []);
  5995. return self;}
  5996. }),
  5997. smalltalk.Dictionary2);
  5998. smalltalk.addMethod(
  5999. '_values',
  6000. smalltalk.method({
  6001. selector: 'values',
  6002. fn: function (){
  6003. var self=this;
  6004. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  6005. return self;}
  6006. }),
  6007. smalltalk.Dictionary2);
  6008. smalltalk.addMethod(
  6009. '_at_put_',
  6010. smalltalk.method({
  6011. selector: 'at:put:',
  6012. fn: function (aKey, aValue){
  6013. var self=this;
  6014. ((($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]);})]));
  6015. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  6016. return self;}
  6017. }),
  6018. smalltalk.Dictionary2);
  6019. smalltalk.addMethod(
  6020. '_at_ifAbsent_',
  6021. smalltalk.method({
  6022. selector: 'at:ifAbsent:',
  6023. fn: function (aKey, aBlock){
  6024. var self=this;
  6025. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  6026. return self;}
  6027. }),
  6028. smalltalk.Dictionary2);
  6029. smalltalk.addMethod(
  6030. '_at_ifAbsentPut_',
  6031. smalltalk.method({
  6032. selector: 'at:ifAbsentPut:',
  6033. fn: function (aKey, aBlock){
  6034. var self=this;
  6035. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  6036. return self;}
  6037. }),
  6038. smalltalk.Dictionary2);
  6039. smalltalk.addMethod(
  6040. '_at_ifPresent_',
  6041. smalltalk.method({
  6042. selector: 'at:ifPresent:',
  6043. fn: function (aKey, aBlock){
  6044. var self=this;
  6045. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  6046. return self;}
  6047. }),
  6048. smalltalk.Dictionary2);
  6049. smalltalk.addMethod(
  6050. '_at_ifPresent_ifAbsent_',
  6051. smalltalk.method({
  6052. selector: 'at:ifPresent:ifAbsent:',
  6053. fn: function (aKey, aBlock, anotherBlock){
  6054. var self=this;
  6055. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  6056. return self;}
  6057. }),
  6058. smalltalk.Dictionary2);
  6059. smalltalk.addMethod(
  6060. '_add_',
  6061. smalltalk.method({
  6062. selector: 'add:',
  6063. fn: function (anAssociation){
  6064. var self=this;
  6065. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  6066. return self;}
  6067. }),
  6068. smalltalk.Dictionary2);
  6069. smalltalk.addMethod(
  6070. '_addAll_',
  6071. smalltalk.method({
  6072. selector: 'addAll:',
  6073. fn: function (aDictionary){
  6074. var self=this;
  6075. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Dictionary);
  6076. return aDictionary;
  6077. return self;}
  6078. }),
  6079. smalltalk.Dictionary2);
  6080. smalltalk.addMethod(
  6081. '__comma',
  6082. smalltalk.method({
  6083. selector: ',',
  6084. fn: function (aCollection){
  6085. var self=this;
  6086. smalltalk.send(self, "_shouldNotImplement", []);
  6087. return self;}
  6088. }),
  6089. smalltalk.Dictionary2);
  6090. smalltalk.addMethod(
  6091. '_copyFrom_to_',
  6092. smalltalk.method({
  6093. selector: 'copyFrom:to:',
  6094. fn: function (anIndex, anotherIndex){
  6095. var self=this;
  6096. smalltalk.send(self, "_shouldNotImplement", []);
  6097. return self;}
  6098. }),
  6099. smalltalk.Dictionary2);
  6100. smalltalk.addMethod(
  6101. '_associationsDo_',
  6102. smalltalk.method({
  6103. selector: 'associationsDo:',
  6104. fn: function (aBlock){
  6105. var self=this;
  6106. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  6107. return self;}
  6108. }),
  6109. smalltalk.Dictionary2);
  6110. smalltalk.addMethod(
  6111. '_keysAndValuesDo_',
  6112. smalltalk.method({
  6113. selector: 'keysAndValuesDo:',
  6114. fn: function (aBlock){
  6115. var self=this;
  6116. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  6117. return self;}
  6118. }),
  6119. smalltalk.Dictionary2);
  6120. smalltalk.addMethod(
  6121. '_do_',
  6122. smalltalk.method({
  6123. selector: 'do:',
  6124. fn: function (aBlock){
  6125. var self=this;
  6126. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  6127. return self;}
  6128. }),
  6129. smalltalk.Dictionary2);
  6130. smalltalk.addMethod(
  6131. '_select_',
  6132. smalltalk.method({
  6133. selector: 'select:',
  6134. fn: function (aBlock){
  6135. var self=this;
  6136. var newDict=nil;
  6137. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  6138. 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]);})]));})]);
  6139. return newDict;
  6140. return self;}
  6141. }),
  6142. smalltalk.Dictionary2);
  6143. smalltalk.addMethod(
  6144. '_collect_',
  6145. smalltalk.method({
  6146. selector: 'collect:',
  6147. fn: function (aBlock){
  6148. var self=this;
  6149. var newDict=nil;
  6150. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  6151. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  6152. return newDict;
  6153. return self;}
  6154. }),
  6155. smalltalk.Dictionary2);
  6156. smalltalk.addMethod(
  6157. '_detect_ifNone_',
  6158. smalltalk.method({
  6159. selector: 'detect:ifNone:',
  6160. fn: function (aBlock, anotherBlock){
  6161. var self=this;
  6162. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  6163. return self;}
  6164. }),
  6165. smalltalk.Dictionary2);
  6166. smalltalk.addMethod(
  6167. '_includes_',
  6168. smalltalk.method({
  6169. selector: 'includes:',
  6170. fn: function (anObject){
  6171. var self=this;
  6172. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  6173. return self;}
  6174. }),
  6175. smalltalk.Dictionary2);
  6176. smalltalk.addMethod(
  6177. '_remove_',
  6178. smalltalk.method({
  6179. selector: 'remove:',
  6180. fn: function (aKey){
  6181. var self=this;
  6182. smalltalk.send(self, "_removeKey_", [aKey]);
  6183. return self;}
  6184. }),
  6185. smalltalk.Dictionary2);
  6186. smalltalk.addMethod(
  6187. '_removeKey_',
  6188. smalltalk.method({
  6189. selector: 'removeKey:',
  6190. fn: function (aKey){
  6191. var self=this;
  6192. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  6193. return self;}
  6194. }),
  6195. smalltalk.Dictionary2);
  6196. smalltalk.addMethod(
  6197. '_at_',
  6198. smalltalk.method({
  6199. selector: 'at:',
  6200. fn: function (aKey){
  6201. var self=this;
  6202. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  6203. return self;}
  6204. }),
  6205. smalltalk.Dictionary2);
  6206. smalltalk.addMethod(
  6207. '_asJSONObject',
  6208. smalltalk.method({
  6209. selector: 'asJSONObject',
  6210. fn: function (){
  6211. var self=this;
  6212. var object=nil;
  6213. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  6214. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  6215. return object;
  6216. return self;}
  6217. }),
  6218. smalltalk.Dictionary2);
  6219. smalltalk.addMethod(
  6220. '_printString',
  6221. smalltalk.method({
  6222. selector: 'printString',
  6223. fn: function (){
  6224. var self=this;
  6225. 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")]);})]);
  6226. return self;}
  6227. }),
  6228. smalltalk.Dictionary2);
  6229. smalltalk.addMethod(
  6230. '_storeOn_',
  6231. smalltalk.method({
  6232. selector: 'storeOn:',
  6233. fn: function (aStream){
  6234. var self=this;
  6235. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  6236. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  6237. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  6238. return self;}
  6239. }),
  6240. smalltalk.Dictionary2);