1
0

Kernel.deploy.js 177 KB

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