Kernel.deploy.js 163 KB

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