1
0

Kernel.deploy.js 164 KB

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