1
0

Kernel.deploy.js 164 KB

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