Kernel.deploy.js 166 KB

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