2
0

Program.js 246 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781
  1. /* ====================================================================
  2. |
  3. | Jtalk Smalltalk
  4. | http://jtalk-project.org
  5. |
  6. ======================================================================
  7. ======================================================================
  8. |
  9. | Copyright (c) 2010-2011
  10. | Nicolas Petton <petton.nicolas@gmail.com>
  11. |
  12. | Jtalk is released under the MIT license
  13. |
  14. | Permission is hereby granted, free of charge, to any person obtaining
  15. | a copy of this software and associated documentation files (the
  16. | 'Software'), to deal in the Software without restriction, including
  17. | without limitation the rights to use, copy, modify, merge, publish,
  18. | distribute, sublicense, and/or sell copies of the Software, and to
  19. | permit persons to whom the Software is furnished to do so, subject to
  20. | the following conditions:
  21. |
  22. | The above copyright notice and this permission notice shall be
  23. | included in all copies or substantial portions of the Software.
  24. |
  25. | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  26. | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  28. | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  29. | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  30. | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  31. | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. |
  33. ==================================================================== */
  34. /* Smalltalk constructors definition */
  35. function SmalltalkObject(){};
  36. function SmalltalkBehavior(){};
  37. function SmalltalkClass(){};
  38. function SmalltalkMetaclass(){
  39. this.meta = true;
  40. };
  41. function SmalltalkMethod(){};
  42. function SmalltalkNil(){};
  43. function Smalltalk(){
  44. var st = this;
  45. /* Smalltalk class creation. A class is an instance of an automatically
  46. created metaclass object. Newly created classes (not their metaclass)
  47. should be added to the smalltalk object, see smalltalk.addClass().
  48. Superclass linking is *not* handled here, see smalltalk.init() */
  49. function klass(spec) {
  50. var spec = spec || {};
  51. var that;
  52. if(spec.meta) {
  53. that = new SmalltalkMetaclass();
  54. } else {
  55. that = new (klass({meta: true})).fn;
  56. that.klass.instanceClass = that;
  57. that.className = spec.className;
  58. that.klass.className = that.className + ' class';
  59. }
  60. that.fn = spec.fn || function(){};
  61. that.superclass = spec.superclass;
  62. that.iVarNames = spec.iVarNames || [];
  63. if(that.superclass) {
  64. that.klass.superclass = that.superclass.klass;
  65. }
  66. that.category = spec.category || "";
  67. that.fn.prototype.methods = {};
  68. that.fn.prototype.inheritedMethods = {};
  69. that.fn.prototype.klass = that;
  70. return that;
  71. };
  72. /* Smalltalk method object. To add a method to a class,
  73. use smalltalk.addMethod() */
  74. st.method = function(spec) {
  75. var that = new SmalltalkMethod();
  76. that.selector = spec.selector;
  77. that.jsSelector = spec.jsSelector;
  78. that.category = spec.category;
  79. that.source = spec.source;
  80. that.messageSends = spec.messageSends || [];
  81. that.referencedClasses = spec.referencedClasses || [];
  82. that.fn = spec.fn;
  83. return that
  84. };
  85. /* Initialize a class in its class hierarchy. Handle both class and
  86. metaclasses. */
  87. st.init = function(klass) {
  88. var subclasses = st.subclasses(klass);
  89. var methods;
  90. if(klass.superclass && klass.superclass !== nil) {
  91. methods = st.methods(klass.superclass);
  92. //Methods linking
  93. for(var i in methods) {
  94. if(!klass.fn.prototype.methods[i]) {
  95. klass.fn.prototype.inheritedMethods[i] = methods[i];
  96. klass.fn.prototype[methods[i].jsSelector] = methods[i].fn;
  97. }
  98. }
  99. }
  100. for(var i=0;i<subclasses.length;i++) {
  101. st.init(subclasses[i]);
  102. }
  103. if(klass.klass && !klass.meta) {
  104. st.init(klass.klass);
  105. }
  106. };
  107. /* Answer all registered Smalltalk classes */
  108. st.classes = function() {
  109. var classes = [];
  110. for(var i in st) {
  111. if(i.search(/^[A-Z]/g) != -1) {
  112. classes.push(st[i]);
  113. }
  114. }
  115. return classes
  116. };
  117. /* Answer all methods (included inherited ones) of klass. */
  118. st.methods = function(klass) {
  119. var methods = {};
  120. for(var i in klass.fn.prototype.methods) {
  121. methods[i] = klass.fn.prototype.methods[i]
  122. }
  123. for(var i in klass.fn.prototype.inheritedMethods) {
  124. methods[i] = klass.fn.prototype.inheritedMethods[i]
  125. }
  126. return methods;
  127. }
  128. /* Answer the direct subclasses of klass. */
  129. st.subclasses = function(klass) {
  130. var subclasses = [];
  131. var classes = st.classes();
  132. for(var i in classes) {
  133. if(classes[i].fn) {
  134. //Metaclasses
  135. if(classes[i].klass && classes[i].klass.superclass === klass) {
  136. subclasses.push(classes[i].klass);
  137. }
  138. //Classes
  139. if(classes[i].superclass === klass) {
  140. subclasses.push(classes[i]);
  141. }
  142. }
  143. }
  144. return subclasses;
  145. };
  146. /* Create a new class wrapping a JavaScript constructor, and add it to the
  147. global smalltalk object. */
  148. st.mapClassName = function(className, category, fn, superclass) {
  149. st[className] = klass({
  150. className: className,
  151. category: category,
  152. superclass: superclass,
  153. fn: fn
  154. });
  155. };
  156. /* Add a class to the smalltalk object, creating a new one if needed. */
  157. st.addClass = function(className, superclass, iVarNames, category) {
  158. if(st[className]) {
  159. st[className].superclass = superclass;
  160. st[className].iVarNames = iVarNames;
  161. st[className].category = category || st[className].category;
  162. } else {
  163. st[className] = klass({
  164. className: className,
  165. iVarNames: iVarNames,
  166. superclass: superclass
  167. });
  168. st[className].category = category || '';
  169. }
  170. };
  171. /* Add a method to a class */
  172. st.addMethod = function(jsSelector, method, klass) {
  173. klass.fn.prototype[jsSelector] = method.fn;
  174. klass.fn.prototype.methods[method.selector] = method;
  175. method.methodClass = klass;
  176. method.jsSelector = jsSelector;
  177. };
  178. /* Handles Smalltalk message send. Automatically converts undefined to the nil object.
  179. If the receiver does not understand the selector, call its #doesNotUnderstand: method */
  180. sendWithoutContext = function(receiver, selector, args, klass) {
  181. if(typeof receiver === "undefined") {
  182. receiver = nil;
  183. }
  184. if(!klass && receiver.klass && receiver[selector]) {
  185. return receiver[selector].apply(receiver, args);
  186. } else if(klass && klass.fn.prototype[selector]) {
  187. return klass.fn.prototype[selector].apply(receiver, args)
  188. }
  189. return messageNotUnderstood(receiver, selector, args);
  190. };
  191. /* Handles unhandled errors during message sends */
  192. sendWithContext = function(receiver, selector, args, klass) {
  193. if(thisContext) {
  194. return withContextSend(receiver, selector, args, klass);
  195. } else {
  196. try {return withContextSend(receiver, selector, args, klass)}
  197. catch(error) {
  198. // Reset the context stack in any case
  199. thisContext = undefined;
  200. if(error.smalltalkError) {
  201. handleError(error);
  202. } else {
  203. throw(error);
  204. }
  205. }
  206. }
  207. };
  208. /* Same as sendWithoutContext but creates a methodContext. */
  209. withContextSend = function(receiver, selector, args, klass) {
  210. var call, context;
  211. if(typeof receiver === "undefined") {
  212. receiver = nil;
  213. }
  214. if(!klass && receiver.klass && receiver[selector]) {
  215. context = pushContext(receiver, selector, args);
  216. call = receiver[selector].apply(receiver, args);
  217. popContext(context);
  218. return call;
  219. } else if(klass && klass.fn.prototype[selector]) {
  220. context = pushContext(receiver, selector, args);
  221. call = klass.fn.prototype[selector].apply(receiver, args);
  222. popContext(context);
  223. return call;
  224. }
  225. return messageNotUnderstood(receiver, selector, args);
  226. };
  227. /* Handles Smalltalk errors. Triggers the registered ErrorHandler
  228. (See the Smalltalk class ErrorHandler and its subclasses */
  229. function handleError(error) {
  230. thisContext = undefined;
  231. smalltalk.ErrorHandler._current()._handleError_(error);
  232. }
  233. /* Handles #dnu: *and* JavaScript method calls.
  234. if the receiver has no klass, we consider it a JS object (outside of the
  235. Jtalk system). Else assume that the receiver understands #doesNotUnderstand: */
  236. function messageNotUnderstood(receiver, selector, args) {
  237. /* Handles JS method calls. */
  238. if(receiver.klass === undefined || receiver.allowJavaScriptCalls) {
  239. return callJavaScriptMethod(receiver, selector, args);
  240. }
  241. /* Handles not understood messages. Also see the Jtalk counter-part
  242. Object>>doesNotUnderstand: */
  243. return receiver._doesNotUnderstand_(
  244. st.Message._new()
  245. ._selector_(st.convertSelector(selector))
  246. ._arguments_(args)
  247. );
  248. };
  249. function callJavaScriptMethod(receiver, selector, args) {
  250. /* Call a method of a JS object, or answer a property.
  251. Converts keyword-based selectors by using the first
  252. keyword only, but keeping all message arguments.
  253. Example:
  254. "self do: aBlock with: anObject" -> "self.do(aBlock, anObject)" */
  255. var jsSelector = selector
  256. .replace(/^_/, '')
  257. .replace(/_.*/g, '');
  258. var jsProperty = receiver[jsSelector];
  259. if(typeof jsProperty === "function") {
  260. return jsProperty.apply(receiver, args);
  261. } else if(jsProperty !== undefined) {
  262. if(args[0]) {
  263. receiver[jsSelector] = args[0];
  264. return nil;
  265. } else {
  266. return jsProperty
  267. }
  268. }
  269. smalltalk.Error._signal_(receiver + ' is not a Jtalk object and "' + jsSelector + '" is undefined')
  270. };
  271. /* Reuse old contexts stored in oldContexts */
  272. st.oldContexts = [];
  273. /* Handle thisContext pseudo variable */
  274. pushContext = function(receiver, selector, temps) {
  275. if(thisContext) {
  276. return thisContext = thisContext.newContext(receiver, selector, temps);
  277. } else {
  278. return thisContext = new SmalltalkMethodContext(receiver, selector, temps);
  279. }
  280. };
  281. popContext = function(context) {
  282. if(context) {
  283. context.removeYourself();
  284. }
  285. };
  286. /* Convert a string to a valid smalltalk selector.
  287. if you modify the following functions, also change String>>asSelector
  288. accordingly */
  289. st.convertSelector = function(selector) {
  290. if(selector.match(/__/)) {
  291. return convertBinarySelector(selector);
  292. } else {
  293. return convertKeywordSelector(selector);
  294. }
  295. };
  296. function convertKeywordSelector(selector) {
  297. return selector.replace(/^_/, '').replace(/_/g, ':');
  298. };
  299. function convertBinarySelector(selector) {
  300. return selector
  301. .replace(/^_/, '')
  302. .replace(/_plus/, '+')
  303. .replace(/_minus/, '-')
  304. .replace(/_star/, '*')
  305. .replace(/_slash/, '/')
  306. .replace(/_gt/, '>')
  307. .replace(/_lt/, '<')
  308. .replace(/_eq/, '=')
  309. .replace(/_comma/, ',')
  310. .replace(/_at/, '@')
  311. };
  312. /* Converts a JavaScript object to valid Smalltalk Object */
  313. st.readJSObject = function(js) {
  314. var object = js;
  315. var readObject = (js.constructor === Object);
  316. var readArray = (js.constructor === Array);
  317. if(readObject) {
  318. object = smalltalk.Dictionary._new();
  319. }
  320. for(var i in js) {
  321. if(readObject) {
  322. object._at_put_(i, st.readJSObject(js[i]));
  323. }
  324. if(readArray) {
  325. object[i] = st.readJSObject(js[i]);
  326. }
  327. }
  328. return object;
  329. };
  330. /* Toggle deployment mode (no context will be handled during message send */
  331. st.setDeploymentMode = function() {
  332. st.send = sendWithoutContext;
  333. };
  334. st.setDevelopmentMode = function() {
  335. st.send = sendWithContext;
  336. }
  337. /* Set development mode by default */
  338. st.setDevelopmentMode();
  339. }
  340. function SmalltalkMethodContext(receiver, selector, temps, home) {
  341. var that = this;
  342. that.receiver = receiver;
  343. that.selector = selector;
  344. that.temps = temps || {};
  345. that.homeContext = home;
  346. that.newContext = function(receiver, selector, temps) {
  347. var c = smalltalk.oldContexts.pop();
  348. if(c) {
  349. c.homeContext = that;
  350. c.receiver = receiver;
  351. c.selector = selector;
  352. c.temps = temps || {};
  353. } else {
  354. c = new SmalltalkMethodContext(receiver, selector, temps, that);
  355. }
  356. return c;
  357. }
  358. that.removeYourself = function() {
  359. thisContext = that.homeContext;
  360. smalltalk.oldContexts.push(that);
  361. }
  362. }
  363. /* Global Smalltalk objects. nil and thisContext shouldn't be globals. */
  364. var nil = new SmalltalkNil();
  365. var smalltalk = new Smalltalk();
  366. var thisContext = undefined;
  367. /* Utilities */
  368. Array.prototype.remove = function(s){
  369. var index = this.indexOf(s);
  370. if(this.indexOf(s) != -1)this.splice(index, 1);
  371. }
  372. if(this.jQuery) {
  373. this.jQuery.allowJavaScriptCalls = true;
  374. }
  375. /****************************************************************************************/
  376. /* Base classes mapping. If you edit this part, do not forget to set the superclass of the
  377. object metaclass to Class after the definition of Object */
  378. smalltalk.mapClassName("Object", "Kernel", SmalltalkObject);
  379. smalltalk.mapClassName("Smalltalk", "Kernel", Smalltalk, smalltalk.Object);
  380. smalltalk.mapClassName("Behavior", "Kernel", SmalltalkBehavior, smalltalk.Object);
  381. smalltalk.mapClassName("Class", "Kernel", SmalltalkClass, smalltalk.Behavior);
  382. smalltalk.mapClassName("Metaclass", "Kernel", SmalltalkMetaclass, smalltalk.Behavior);
  383. smalltalk.mapClassName("CompiledMethod", "Kernel", SmalltalkMethod, smalltalk.Object);
  384. smalltalk.Object.klass.superclass = smalltalk.Class
  385. smalltalk.mapClassName("Number", "Kernel", Number, smalltalk.Object);
  386. smalltalk.mapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
  387. smalltalk.mapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
  388. smalltalk.mapClassName("Date", "Kernel", Date, smalltalk.Object);
  389. smalltalk.mapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object);
  390. smalltalk.mapClassName("Collection", "Kernel", null, smalltalk.Object);
  391. smalltalk.mapClassName("SequenceableCollection", "Kernel", null, smalltalk.Collection);
  392. smalltalk.mapClassName("String", "Kernel", String, smalltalk.SequenceableCollection);
  393. smalltalk.mapClassName("Array", "Kernel", Array, smalltalk.SequenceableCollection);
  394. smalltalk.mapClassName("RegularExpression", "Kernel", RegExp, smalltalk.String);
  395. smalltalk.mapClassName("Error", "Kernel", Error, smalltalk.Object);
  396. smalltalk.mapClassName("MethodContext", "Kernel", SmalltalkMethodContext, smalltalk.Object);
  397. if(this.CanvasRenderingContext2D) {
  398. smalltalk.mapClassName("CanvasRenderingContext", "Canvas", CanvasRenderingContext2D, smalltalk.Object);
  399. }smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  400. smalltalk.addMethod(
  401. '__eq',
  402. smalltalk.method({
  403. selector: '=',
  404. category: 'comparing',
  405. fn: function (anObject){
  406. var self=this;
  407. return self == anObject;
  408. return self;},
  409. source: unescape('%3D%20anObject%0A%09%3Creturn%20self%20%3D%3D%20anObject%3E'),
  410. messageSends: [],
  411. referencedClasses: []
  412. }),
  413. smalltalk.Object);
  414. smalltalk.addMethod(
  415. '_~_eq',
  416. smalltalk.method({
  417. selector: '~=',
  418. category: 'comparing',
  419. fn: function (anObject){
  420. var self=this;
  421. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq", [false]);
  422. return self;},
  423. source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%20false'),
  424. messageSends: [unescape("%3D")],
  425. referencedClasses: []
  426. }),
  427. smalltalk.Object);
  428. smalltalk.addMethod(
  429. '_initialize',
  430. smalltalk.method({
  431. selector: 'initialize',
  432. category: 'initialization',
  433. fn: function (){
  434. var self=this;
  435. return self;},
  436. source: unescape('initialize'),
  437. messageSends: [],
  438. referencedClasses: []
  439. }),
  440. smalltalk.Object);
  441. smalltalk.addMethod(
  442. '_yourself',
  443. smalltalk.method({
  444. selector: 'yourself',
  445. category: 'accessing',
  446. fn: function (){
  447. var self=this;
  448. return self;
  449. return self;},
  450. source: unescape('yourself%0A%09%5Eself'),
  451. messageSends: [],
  452. referencedClasses: []
  453. }),
  454. smalltalk.Object);
  455. smalltalk.addMethod(
  456. '_class',
  457. smalltalk.method({
  458. selector: 'class',
  459. category: 'accessing',
  460. fn: function (){
  461. var self=this;
  462. return self.klass;
  463. return self;},
  464. source: unescape('class%0A%09%3Creturn%20self.klass%3E'),
  465. messageSends: [],
  466. referencedClasses: []
  467. }),
  468. smalltalk.Object);
  469. smalltalk.addMethod(
  470. '_size',
  471. smalltalk.method({
  472. selector: 'size',
  473. category: 'accessing',
  474. fn: function (){
  475. var self=this;
  476. smalltalk.send(self, "_error_", ["Object not indexable"]);
  477. return self;},
  478. source: unescape('size%0A%09self%20error%3A%20%27Object%20not%20indexable%27'),
  479. messageSends: ["error:"],
  480. referencedClasses: []
  481. }),
  482. smalltalk.Object);
  483. smalltalk.addMethod(
  484. '_copy',
  485. smalltalk.method({
  486. selector: 'copy',
  487. category: 'copying',
  488. fn: function (){
  489. var self=this;
  490. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  491. return self;},
  492. source: unescape('copy%0A%09%5Eself%20shallowCopy%20postCopy'),
  493. messageSends: ["postCopy", "shallowCopy"],
  494. referencedClasses: []
  495. }),
  496. smalltalk.Object);
  497. smalltalk.addMethod(
  498. '_shallowCopy',
  499. smalltalk.method({
  500. selector: 'shallowCopy',
  501. category: 'copying',
  502. fn: function (){
  503. var self=this;
  504. var copy = self.klass._new();
  505. for(var i in self) {
  506. if(/^@.+/.test(i)) {
  507. copy[i] = self[i];
  508. }
  509. }
  510. return copy;
  511. ;
  512. return self;},
  513. source: unescape('shallowCopy%0A%09%3C%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%3E'),
  514. messageSends: [],
  515. referencedClasses: []
  516. }),
  517. smalltalk.Object);
  518. smalltalk.addMethod(
  519. '_deepCopy',
  520. smalltalk.method({
  521. selector: 'deepCopy',
  522. category: 'copying',
  523. fn: function (){
  524. var self=this;
  525. var copy = self.klass._new();
  526. for(var i in self) {
  527. if(/^@.+/.test(i)) {
  528. copy[i] = self[i]._deepCopy();
  529. }
  530. }
  531. return copy;
  532. ;
  533. return self;},
  534. source: unescape('deepCopy%0A%09%3C%20%20%20%20%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D._deepCopy%28%29%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%3E'),
  535. messageSends: [],
  536. referencedClasses: []
  537. }),
  538. smalltalk.Object);
  539. smalltalk.addMethod(
  540. '_postCopy',
  541. smalltalk.method({
  542. selector: 'postCopy',
  543. category: 'copying',
  544. fn: function (){
  545. var self=this;
  546. return self;},
  547. source: unescape('postCopy'),
  548. messageSends: [],
  549. referencedClasses: []
  550. }),
  551. smalltalk.Object);
  552. smalltalk.addMethod(
  553. '__minus_gt',
  554. smalltalk.method({
  555. selector: '->',
  556. category: 'converting',
  557. fn: function (anObject){
  558. var self=this;
  559. return smalltalk.send((smalltalk.Association || Association), "_key_value_", [self, anObject]);
  560. return self;},
  561. source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject'),
  562. messageSends: ["key:value:"],
  563. referencedClasses: [smalltalk.nil]
  564. }),
  565. smalltalk.Object);
  566. smalltalk.addMethod(
  567. '_asString',
  568. smalltalk.method({
  569. selector: 'asString',
  570. category: 'converting',
  571. fn: function (){
  572. var self=this;
  573. return smalltalk.send(self, "_printString", []);
  574. return self;},
  575. source: unescape('asString%0A%09%5Eself%20printString'),
  576. messageSends: ["printString"],
  577. referencedClasses: []
  578. }),
  579. smalltalk.Object);
  580. smalltalk.addMethod(
  581. '_asJavascript',
  582. smalltalk.method({
  583. selector: 'asJavascript',
  584. category: 'converting',
  585. fn: function (){
  586. var self=this;
  587. return smalltalk.send(self, "_asString", []);
  588. return self;},
  589. source: unescape('asJavascript%0A%09%5Eself%20asString'),
  590. messageSends: ["asString"],
  591. referencedClasses: []
  592. }),
  593. smalltalk.Object);
  594. smalltalk.addMethod(
  595. '_perform_',
  596. smalltalk.method({
  597. selector: 'perform:',
  598. category: 'message handling',
  599. fn: function (aSymbol){
  600. var self=this;
  601. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  602. return self;},
  603. source: unescape('perform%3A%20aSymbol%0A%09%5Eself%20perform%3A%20aSymbol%20withArguments%3A%20%23%28%29'),
  604. messageSends: ["perform:withArguments:"],
  605. referencedClasses: []
  606. }),
  607. smalltalk.Object);
  608. smalltalk.addMethod(
  609. '_perform_withArguments_',
  610. smalltalk.method({
  611. selector: 'perform:withArguments:',
  612. category: 'message handling',
  613. fn: function (aSymbol, aCollection){
  614. var self=this;
  615. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  616. return self;},
  617. source: unescape('perform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5Eself%20basicPerform%3A%20aSymbol%20asSelector%20withArguments%3A%20aCollection'),
  618. messageSends: ["basicPerform:withArguments:", "asSelector"],
  619. referencedClasses: []
  620. }),
  621. smalltalk.Object);
  622. smalltalk.addMethod(
  623. '_instVarAt_',
  624. smalltalk.method({
  625. selector: 'instVarAt:',
  626. category: 'accessing',
  627. fn: function (aString){
  628. var self=this;
  629. return self['@'+aString];
  630. return self;},
  631. source: unescape('instVarAt%3A%20aString%0A%09%3Creturn%20self%5B%27@%27+aString%5D%3E'),
  632. messageSends: [],
  633. referencedClasses: []
  634. }),
  635. smalltalk.Object);
  636. smalltalk.addMethod(
  637. '_instVarAt_put_',
  638. smalltalk.method({
  639. selector: 'instVarAt:put:',
  640. category: 'accessing',
  641. fn: function (aString, anObject){
  642. var self=this;
  643. self['@' + aString] = anObject;
  644. return self;},
  645. source: unescape('instVarAt%3A%20aString%20put%3A%20anObject%0A%09%3Cself%5B%27@%27%20+%20aString%5D%20%3D%20anObject%3E'),
  646. messageSends: [],
  647. referencedClasses: []
  648. }),
  649. smalltalk.Object);
  650. smalltalk.addMethod(
  651. '_basicAt_',
  652. smalltalk.method({
  653. selector: 'basicAt:',
  654. category: 'accessing',
  655. fn: function (aString){
  656. var self=this;
  657. return self[aString];
  658. return self;},
  659. source: unescape('basicAt%3A%20aString%0A%09%3Creturn%20self%5BaString%5D%3E'),
  660. messageSends: [],
  661. referencedClasses: []
  662. }),
  663. smalltalk.Object);
  664. smalltalk.addMethod(
  665. '_basicAt_put_',
  666. smalltalk.method({
  667. selector: 'basicAt:put:',
  668. category: 'accessing',
  669. fn: function (aString, anObject){
  670. var self=this;
  671. return self[aString] = anObject;
  672. return self;},
  673. source: unescape('basicAt%3A%20aString%20put%3A%20anObject%0A%09%3Creturn%20self%5BaString%5D%20%3D%20anObject%3E'),
  674. messageSends: [],
  675. referencedClasses: []
  676. }),
  677. smalltalk.Object);
  678. smalltalk.addMethod(
  679. '_error_',
  680. smalltalk.method({
  681. selector: 'error:',
  682. category: 'error handling',
  683. fn: function (aString){
  684. var self=this;
  685. smalltalk.send((smalltalk.Error || Error), "_signal_", [aString]);
  686. return self;},
  687. source: unescape('error%3A%20aString%0A%09Error%20signal%3A%20aString'),
  688. messageSends: ["signal:"],
  689. referencedClasses: [smalltalk.Error]
  690. }),
  691. smalltalk.Object);
  692. smalltalk.addMethod(
  693. '_subclassResponsibility',
  694. smalltalk.method({
  695. selector: 'subclassResponsibility',
  696. category: 'error handling',
  697. fn: function (){
  698. var self=this;
  699. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  700. return self;},
  701. source: unescape('subclassResponsibility%0A%09self%20error%3A%20%27This%20method%20is%20a%20responsibility%20of%20a%20subclass%27'),
  702. messageSends: ["error:"],
  703. referencedClasses: []
  704. }),
  705. smalltalk.Object);
  706. smalltalk.addMethod(
  707. '_shouldNotImplement',
  708. smalltalk.method({
  709. selector: 'shouldNotImplement',
  710. category: 'error handling',
  711. fn: function (){
  712. var self=this;
  713. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  714. return self;},
  715. source: unescape('shouldNotImplement%0A%09self%20error%3A%20%27This%20method%20should%20not%20be%20implemented%20in%20%27%2C%20self%20class%20name'),
  716. messageSends: ["error:", unescape("%2C"), "name", "class"],
  717. referencedClasses: []
  718. }),
  719. smalltalk.Object);
  720. smalltalk.addMethod(
  721. '_try_catch_',
  722. smalltalk.method({
  723. selector: 'try:catch:',
  724. category: 'error handling',
  725. fn: function (aBlock, anotherBlock){
  726. var self=this;
  727. try{aBlock()} catch(e) {anotherBlock(e)};
  728. return self;},
  729. source: unescape('try%3A%20aBlock%20catch%3A%20anotherBlock%0A%09%3Ctry%7BaBlock%28%29%7D%20catch%28e%29%20%7BanotherBlock%28e%29%7D%3E%20'),
  730. messageSends: [],
  731. referencedClasses: []
  732. }),
  733. smalltalk.Object);
  734. smalltalk.addMethod(
  735. '_printString',
  736. smalltalk.method({
  737. selector: 'printString',
  738. category: 'printing',
  739. fn: function (){
  740. var self=this;
  741. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  742. return self;},
  743. source: unescape('printString%0A%09%5E%27a%20%27%2C%20self%20class%20name'),
  744. messageSends: [unescape("%2C"), "name", "class"],
  745. referencedClasses: []
  746. }),
  747. smalltalk.Object);
  748. smalltalk.addMethod(
  749. '_printNl',
  750. smalltalk.method({
  751. selector: 'printNl',
  752. category: 'printing',
  753. fn: function (){
  754. var self=this;
  755. console.log(self);
  756. return self;},
  757. source: unescape('printNl%0A%09%3Cconsole.log%28self%29%3E'),
  758. messageSends: [],
  759. referencedClasses: []
  760. }),
  761. smalltalk.Object);
  762. smalltalk.addMethod(
  763. '_isKindOf_',
  764. smalltalk.method({
  765. selector: 'isKindOf:',
  766. category: 'testing',
  767. fn: function (aClass){
  768. var self=this;
  769. 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]);})]);
  770. return self;},
  771. source: unescape('isKindOf%3A%20aClass%0A%09%5E%28self%20isMemberOf%3A%20aClass%29%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20class%20inheritsFrom%3A%20aClass%5D'),
  772. messageSends: ["ifTrue:ifFalse:", "isMemberOf:", "inheritsFrom:", "class"],
  773. referencedClasses: []
  774. }),
  775. smalltalk.Object);
  776. smalltalk.addMethod(
  777. '_isMemberOf_',
  778. smalltalk.method({
  779. selector: 'isMemberOf:',
  780. category: 'testing',
  781. fn: function (aClass){
  782. var self=this;
  783. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  784. return self;},
  785. source: unescape('isMemberOf%3A%20aClass%0A%09%5Eself%20class%20%3D%20aClass'),
  786. messageSends: [unescape("%3D"), "class"],
  787. referencedClasses: []
  788. }),
  789. smalltalk.Object);
  790. smalltalk.addMethod(
  791. '_ifNil_',
  792. smalltalk.method({
  793. selector: 'ifNil:',
  794. category: 'testing',
  795. fn: function (aBlock){
  796. var self=this;
  797. return self;
  798. return self;},
  799. source: unescape('ifNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself'),
  800. messageSends: [],
  801. referencedClasses: []
  802. }),
  803. smalltalk.Object);
  804. smalltalk.addMethod(
  805. '_ifNil_ifNotNil_',
  806. smalltalk.method({
  807. selector: 'ifNil:ifNotNil:',
  808. category: 'testing',
  809. fn: function (aBlock, anotherBlock){
  810. var self=this;
  811. return smalltalk.send(anotherBlock, "_value", []);
  812. return self;},
  813. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EanotherBlock%20value'),
  814. messageSends: ["value"],
  815. referencedClasses: []
  816. }),
  817. smalltalk.Object);
  818. smalltalk.addMethod(
  819. '_ifNotNil_',
  820. smalltalk.method({
  821. selector: 'ifNotNil:',
  822. category: 'testing',
  823. fn: function (aBlock){
  824. var self=this;
  825. return smalltalk.send(aBlock, "_value", []);
  826. return self;},
  827. source: unescape('ifNotNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  828. messageSends: ["value"],
  829. referencedClasses: []
  830. }),
  831. smalltalk.Object);
  832. smalltalk.addMethod(
  833. '_ifNotNil_ifNil_',
  834. smalltalk.method({
  835. selector: 'ifNotNil:ifNil:',
  836. category: 'testing',
  837. fn: function (aBlock, anotherBlock){
  838. var self=this;
  839. return smalltalk.send(aBlock, "_value", []);
  840. return self;},
  841. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  842. messageSends: ["value"],
  843. referencedClasses: []
  844. }),
  845. smalltalk.Object);
  846. smalltalk.addMethod(
  847. '_isNil',
  848. smalltalk.method({
  849. selector: 'isNil',
  850. category: 'testing',
  851. fn: function (){
  852. var self=this;
  853. return false;
  854. return self;},
  855. source: unescape('isNil%0A%09%5Efalse'),
  856. messageSends: [],
  857. referencedClasses: []
  858. }),
  859. smalltalk.Object);
  860. smalltalk.addMethod(
  861. '_notNil',
  862. smalltalk.method({
  863. selector: 'notNil',
  864. category: 'testing',
  865. fn: function (){
  866. var self=this;
  867. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  868. return self;},
  869. source: unescape('notNil%0A%09%5Eself%20isNil%20not'),
  870. messageSends: ["not", "isNil"],
  871. referencedClasses: []
  872. }),
  873. smalltalk.Object);
  874. smalltalk.addMethod(
  875. '_isClass',
  876. smalltalk.method({
  877. selector: 'isClass',
  878. category: 'testing',
  879. fn: function (){
  880. var self=this;
  881. return false;
  882. return self;},
  883. source: unescape('isClass%0A%09%5Efalse'),
  884. messageSends: [],
  885. referencedClasses: []
  886. }),
  887. smalltalk.Object);
  888. smalltalk.addMethod(
  889. '_isMetaclass',
  890. smalltalk.method({
  891. selector: 'isMetaclass',
  892. category: 'testing',
  893. fn: function (){
  894. var self=this;
  895. return false;
  896. return self;},
  897. source: unescape('isMetaclass%0A%09%5Efalse'),
  898. messageSends: [],
  899. referencedClasses: []
  900. }),
  901. smalltalk.Object);
  902. smalltalk.addMethod(
  903. '_isNumber',
  904. smalltalk.method({
  905. selector: 'isNumber',
  906. category: 'testing',
  907. fn: function (){
  908. var self=this;
  909. return false;
  910. return self;},
  911. source: unescape('isNumber%0A%09%5Efalse'),
  912. messageSends: [],
  913. referencedClasses: []
  914. }),
  915. smalltalk.Object);
  916. smalltalk.addMethod(
  917. '_isString',
  918. smalltalk.method({
  919. selector: 'isString',
  920. category: 'testing',
  921. fn: function (){
  922. var self=this;
  923. return false;
  924. return self;},
  925. source: unescape('isString%0A%09%5Efalse'),
  926. messageSends: [],
  927. referencedClasses: []
  928. }),
  929. smalltalk.Object);
  930. smalltalk.addMethod(
  931. '_isParseFailure',
  932. smalltalk.method({
  933. selector: 'isParseFailure',
  934. category: 'testing',
  935. fn: function (){
  936. var self=this;
  937. return false;
  938. return self;},
  939. source: unescape('isParseFailure%0A%09%5Efalse'),
  940. messageSends: [],
  941. referencedClasses: []
  942. }),
  943. smalltalk.Object);
  944. smalltalk.addMethod(
  945. '_basicPerform_',
  946. smalltalk.method({
  947. selector: 'basicPerform:',
  948. category: 'message handling',
  949. fn: function (aSymbol){
  950. var self=this;
  951. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  952. return self;},
  953. source: unescape('basicPerform%3A%20aSymbol%20%0A%09%5Eself%20basicPerform%3A%20aSymbol%20withArguments%3A%20%23%28%29'),
  954. messageSends: ["basicPerform:withArguments:"],
  955. referencedClasses: []
  956. }),
  957. smalltalk.Object);
  958. smalltalk.addMethod(
  959. '_basicPerform_withArguments_',
  960. smalltalk.method({
  961. selector: 'basicPerform:withArguments:',
  962. category: 'message handling',
  963. fn: function (aSymbol, aCollection){
  964. var self=this;
  965. return self[aSymbol].apply(self, aCollection);;
  966. return self;},
  967. source: unescape('basicPerform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%3Creturn%20self%5BaSymbol%5D.apply%28self%2C%20aCollection%29%3B%3E'),
  968. messageSends: [],
  969. referencedClasses: []
  970. }),
  971. smalltalk.Object);
  972. smalltalk.addMethod(
  973. '_basicDelete_',
  974. smalltalk.method({
  975. selector: 'basicDelete:',
  976. category: 'accessing',
  977. fn: function (aString){
  978. var self=this;
  979. delete self[aString];
  980. return self;},
  981. source: unescape('basicDelete%3A%20aString%0A%20%20%20%20%3Cdelete%20self%5BaString%5D%3E'),
  982. messageSends: [],
  983. referencedClasses: []
  984. }),
  985. smalltalk.Object);
  986. smalltalk.addMethod(
  987. '_doesNotUnderstand_',
  988. smalltalk.method({
  989. selector: 'doesNotUnderstand:',
  990. category: 'error handling',
  991. fn: function (aMessage){
  992. var self=this;
  993. (function($rec){smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.MessageNotUnderstood || MessageNotUnderstood), "_new", []));
  994. return self;},
  995. source: unescape('doesNotUnderstand%3A%20aMessage%0A%09MessageNotUnderstood%20new%0A%09%09receiver%3A%20self%3B%0A%09%09message%3A%20aMessage%3B%0A%09%09signal'),
  996. messageSends: ["receiver:", "message:", "signal", "new"],
  997. referencedClasses: [smalltalk.nil]
  998. }),
  999. smalltalk.Object);
  1000. smalltalk.addMethod(
  1001. '_asJSON',
  1002. smalltalk.method({
  1003. selector: 'asJSON',
  1004. category: 'converting',
  1005. fn: function (){
  1006. var self=this;
  1007. return JSON.stringify(self._asJSONObject());
  1008. return self;},
  1009. source: unescape('asJSON%0A%09%3Creturn%20JSON.stringify%28self._asJSONObject%28%29%29%3E'),
  1010. messageSends: [],
  1011. referencedClasses: []
  1012. }),
  1013. smalltalk.Object);
  1014. smalltalk.addMethod(
  1015. '_asJSONObject',
  1016. smalltalk.method({
  1017. selector: 'asJSONObject',
  1018. category: 'converting',
  1019. fn: function (){
  1020. var self=this;
  1021. var object=nil;
  1022. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  1023. 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", [])]);})]);
  1024. return object;
  1025. return self;},
  1026. source: unescape('asJSONObject%0A%09%7C%20object%20%7C%0A%09object%20%3A%3D%20Object%20new.%0A%09self%20class%20instanceVariableNames%20do%3A%20%5B%3Aeach%20%7C%0A%09%09object%20basicAt%3A%20each%20put%3A%20%28self%20instVarAt%3A%20each%29%20asJSONObject%5D.%0A%09%5Eobject'),
  1027. messageSends: ["new", "do:", "instanceVariableNames", "class", "basicAt:put:", "asJSONObject", "instVarAt:"],
  1028. referencedClasses: [smalltalk.Object]
  1029. }),
  1030. smalltalk.Object);
  1031. smalltalk.addMethod(
  1032. '_halt',
  1033. smalltalk.method({
  1034. selector: 'halt',
  1035. category: 'error handling',
  1036. fn: function (){
  1037. var self=this;
  1038. smalltalk.send(self, "_error_", ["Halt encountered"]);
  1039. return self;},
  1040. source: unescape('halt%0A%09self%20error%3A%20%27Halt%20encountered%27'),
  1041. messageSends: ["error:"],
  1042. referencedClasses: []
  1043. }),
  1044. smalltalk.Object);
  1045. smalltalk.addMethod(
  1046. '_log_block_',
  1047. smalltalk.method({
  1048. selector: 'log:block:',
  1049. category: 'printing',
  1050. fn: function (aString, aBlock){
  1051. var self=this;
  1052. var result=nil;
  1053. 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", [])])]);
  1054. return result;
  1055. return self;},
  1056. source: unescape('log%3A%20aString%20block%3A%20aBlock%0A%0A%09%7C%20result%20%7C%0A%09console%20log%3A%20%20aString%2C%20%20%27%20time%3A%20%27%2C%20%28Date%20millisecondsToRun%3A%20%5Bresult%20%3A%3D%20aBlock%20value%5D%29%20printString.%0A%09%5Eresult%0A%0A'),
  1057. messageSends: ["log:", unescape("%2C"), "printString", "millisecondsToRun:", "value"],
  1058. referencedClasses: [smalltalk.Date]
  1059. }),
  1060. smalltalk.Object);
  1061. smalltalk.addMethod(
  1062. '_initialize',
  1063. smalltalk.method({
  1064. selector: 'initialize',
  1065. category: 'initialization',
  1066. fn: function (){
  1067. var self=this;
  1068. return self;},
  1069. source: unescape('initialize%0A%09%22no%20op%22'),
  1070. messageSends: [],
  1071. referencedClasses: []
  1072. }),
  1073. smalltalk.Object.klass);
  1074. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  1075. smalltalk.addMethod(
  1076. '_classes',
  1077. smalltalk.method({
  1078. selector: 'classes',
  1079. category: 'accessing',
  1080. fn: function (){
  1081. var self=this;
  1082. return self.classes();
  1083. return self;},
  1084. source: unescape('classes%0A%09%3Creturn%20self.classes%28%29%3E'),
  1085. messageSends: [],
  1086. referencedClasses: []
  1087. }),
  1088. smalltalk.Smalltalk);
  1089. smalltalk.addMethod(
  1090. '_readJSON_',
  1091. smalltalk.method({
  1092. selector: 'readJSON:',
  1093. category: 'accessing',
  1094. fn: function (anObject){
  1095. var self=this;
  1096. return self.readJSObject(anObject);
  1097. return self;},
  1098. source: unescape('readJSON%3A%20anObject%0A%09%3Creturn%20self.readJSObject%28anObject%29%3E'),
  1099. messageSends: [],
  1100. referencedClasses: []
  1101. }),
  1102. smalltalk.Smalltalk);
  1103. smalltalk.addMethod(
  1104. '_at_',
  1105. smalltalk.method({
  1106. selector: 'at:',
  1107. category: 'accessing',
  1108. fn: function (aString){
  1109. var self=this;
  1110. return self[aString];
  1111. return self;},
  1112. source: unescape('at%3A%20aString%0A%09%3Creturn%20self%5BaString%5D%3E'),
  1113. messageSends: [],
  1114. referencedClasses: []
  1115. }),
  1116. smalltalk.Smalltalk);
  1117. smalltalk.addMethod(
  1118. '_removeClass_',
  1119. smalltalk.method({
  1120. selector: 'removeClass:',
  1121. category: 'accessing',
  1122. fn: function (aClass){
  1123. var self=this;
  1124. (($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")])]);})]);
  1125. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  1126. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  1127. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  1128. return self;},
  1129. source: unescape('removeClass%3A%20aClass%0A%09aClass%20isMetaclass%20ifTrue%3A%20%5Bself%20error%3A%20aClass%20asString%2C%20%27%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21%27%5D.%0A%09aClass%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09aClass%20removeCompiledMethod%3A%20each%5D.%0A%09aClass%20class%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09aClass%20class%20removeCompiledMethod%3A%20each%5D.%0A%09self%20basicDelete%3A%20aClass%20name'),
  1130. messageSends: ["ifTrue:", "isMetaclass", "error:", unescape("%2C"), "asString", "do:", "values", "methodDictionary", "removeCompiledMethod:", "class", "basicDelete:", "name"],
  1131. referencedClasses: []
  1132. }),
  1133. smalltalk.Smalltalk);
  1134. smalltalk.addMethod(
  1135. '_basicParse_',
  1136. smalltalk.method({
  1137. selector: 'basicParse:',
  1138. category: 'accessing',
  1139. fn: function (aString){
  1140. var self=this;
  1141. return smalltalk.parser.parse(aString);
  1142. return self;},
  1143. source: unescape('basicParse%3A%20aString%0A%09%3Creturn%20smalltalk.parser.parse%28aString%29%3E'),
  1144. messageSends: [],
  1145. referencedClasses: []
  1146. }),
  1147. smalltalk.Smalltalk);
  1148. smalltalk.addMethod(
  1149. '_parse_',
  1150. smalltalk.method({
  1151. selector: 'parse:',
  1152. category: 'accessing',
  1153. fn: function (aString){
  1154. var self=this;
  1155. var result=nil;
  1156. smalltalk.send(self, "_try_catch_", [(function(){return result=smalltalk.send(self, "_basicParse_", [aString]);}), (function(ex){return smalltalk.send(smalltalk.send(self, "_parseError_", [ex]), "_signal", []);})]);
  1157. return result;
  1158. return self;},
  1159. source: unescape('parse%3A%20aString%0A%09%7C%20result%20%7C%0A%09self%20try%3A%20%5Bresult%20%3A%3D%20self%20basicParse%3A%20aString%5D%20catch%3A%20%5B%3Aex%20%7C%20%28self%20parseError%3A%20ex%29%20signal%5D.%0A%09%5Eresult'),
  1160. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:"],
  1161. referencedClasses: []
  1162. }),
  1163. smalltalk.Smalltalk);
  1164. smalltalk.addMethod(
  1165. '_parseError_',
  1166. smalltalk.method({
  1167. selector: 'parseError:',
  1168. category: 'accessing',
  1169. fn: function (anException){
  1170. var self=this;
  1171. return smalltalk.Error._new()
  1172. ._messageText_('Parse error on line ' + anException.line + ' column ' + anException.column + ' : ' + anException.message);
  1173. return self;},
  1174. source: unescape('parseError%3A%20anException%0A%09%3Creturn%20smalltalk.Error._new%28%29%0A%09%09._messageText_%28%27Parse%20error%20on%20line%20%27%20+%20anException.line%20+%20%27%20column%20%27%20+%20anException.column%20+%20%27%20%3A%20%27%20+%20anException.message%29%3E'),
  1175. messageSends: [],
  1176. referencedClasses: []
  1177. }),
  1178. smalltalk.Smalltalk);
  1179. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  1180. smalltalk.addMethod(
  1181. '_current',
  1182. smalltalk.method({
  1183. selector: 'current',
  1184. category: 'accessing',
  1185. fn: function (){
  1186. var self=this;
  1187. return smalltalk;
  1188. return self;},
  1189. source: unescape('current%0A%09%3Creturn%20smalltalk%3E'),
  1190. messageSends: [],
  1191. referencedClasses: []
  1192. }),
  1193. smalltalk.Smalltalk.klass);
  1194. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  1195. smalltalk.addMethod(
  1196. '_new',
  1197. smalltalk.method({
  1198. selector: 'new',
  1199. category: 'instance creation',
  1200. fn: function (){
  1201. var self=this;
  1202. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  1203. return self;},
  1204. source: unescape('new%0A%09%5Eself%20basicNew%20initialize'),
  1205. messageSends: ["initialize", "basicNew"],
  1206. referencedClasses: []
  1207. }),
  1208. smalltalk.Behavior);
  1209. smalltalk.addMethod(
  1210. '_basicNew',
  1211. smalltalk.method({
  1212. selector: 'basicNew',
  1213. category: 'instance creation',
  1214. fn: function (){
  1215. var self=this;
  1216. return new self.fn();
  1217. return self;},
  1218. source: unescape('basicNew%0A%09%3Creturn%20new%20self.fn%28%29%3E'),
  1219. messageSends: [],
  1220. referencedClasses: []
  1221. }),
  1222. smalltalk.Behavior);
  1223. smalltalk.addMethod(
  1224. '_name',
  1225. smalltalk.method({
  1226. selector: 'name',
  1227. category: 'accessing',
  1228. fn: function (){
  1229. var self=this;
  1230. return self.className || nil;
  1231. return self;},
  1232. source: unescape('name%0A%09%3Creturn%20self.className%20%7C%7C%20nil%3E'),
  1233. messageSends: [],
  1234. referencedClasses: []
  1235. }),
  1236. smalltalk.Behavior);
  1237. smalltalk.addMethod(
  1238. '_superclass',
  1239. smalltalk.method({
  1240. selector: 'superclass',
  1241. category: 'accessing',
  1242. fn: function (){
  1243. var self=this;
  1244. return self.superclass || nil;
  1245. return self;},
  1246. source: unescape('superclass%0A%09%3Creturn%20self.superclass%20%7C%7C%20nil%3E'),
  1247. messageSends: [],
  1248. referencedClasses: []
  1249. }),
  1250. smalltalk.Behavior);
  1251. smalltalk.addMethod(
  1252. '_subclasses',
  1253. smalltalk.method({
  1254. selector: 'subclasses',
  1255. category: 'accessing',
  1256. fn: function (){
  1257. var self=this;
  1258. return smalltalk.subclasses(self);
  1259. return self;},
  1260. source: unescape('subclasses%0A%09%3Creturn%20smalltalk.subclasses%28self%29%3E'),
  1261. messageSends: [],
  1262. referencedClasses: []
  1263. }),
  1264. smalltalk.Behavior);
  1265. smalltalk.addMethod(
  1266. '_allSubclasses',
  1267. smalltalk.method({
  1268. selector: 'allSubclasses',
  1269. category: 'accessing',
  1270. fn: function (){
  1271. var self=this;
  1272. var result=nil;
  1273. result=smalltalk.send(self, "_subclasses", []);
  1274. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  1275. return result;
  1276. return self;},
  1277. source: unescape('allSubclasses%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20self%20subclasses.%0A%09self%20subclasses%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20result%20addAll%3A%20each%20allSubclasses%5D.%0A%09%5Eresult'),
  1278. messageSends: ["subclasses", "do:", "addAll:", "allSubclasses"],
  1279. referencedClasses: []
  1280. }),
  1281. smalltalk.Behavior);
  1282. smalltalk.addMethod(
  1283. '_withAllSubclasses',
  1284. smalltalk.method({
  1285. selector: 'withAllSubclasses',
  1286. category: 'accessing',
  1287. fn: function (){
  1288. var self=this;
  1289. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
  1290. return self;},
  1291. source: unescape('withAllSubclasses%0A%09%5E%28Array%20with%3A%20self%29%20addAll%3A%20self%20allSubclasses%3B%20yourself'),
  1292. messageSends: ["addAll:", "allSubclasses", "yourself", "with:"],
  1293. referencedClasses: [smalltalk.Array]
  1294. }),
  1295. smalltalk.Behavior);
  1296. smalltalk.addMethod(
  1297. '_prototype',
  1298. smalltalk.method({
  1299. selector: 'prototype',
  1300. category: 'accessing',
  1301. fn: function (){
  1302. var self=this;
  1303. return self.fn.prototype;
  1304. return self;},
  1305. source: unescape('prototype%0A%09%3Creturn%20self.fn.prototype%3E'),
  1306. messageSends: [],
  1307. referencedClasses: []
  1308. }),
  1309. smalltalk.Behavior);
  1310. smalltalk.addMethod(
  1311. '_methodDictionary',
  1312. smalltalk.method({
  1313. selector: 'methodDictionary',
  1314. category: 'accessing',
  1315. fn: function (){
  1316. var self=this;
  1317. var dict = smalltalk.Dictionary._new();
  1318. var methods = self.fn.prototype.methods;
  1319. for(var i in methods) {
  1320. if(methods[i].selector) {
  1321. dict._at_put_(methods[i].selector, methods[i]);
  1322. }
  1323. };
  1324. return dict;
  1325. return self;},
  1326. source: unescape('methodDictionary%0A%09%3Cvar%20dict%20%3D%20smalltalk.Dictionary._new%28%29%3B%0A%09var%20methods%20%3D%20self.fn.prototype.methods%3B%0A%09for%28var%20i%20in%20methods%29%20%7B%0A%09%09if%28methods%5Bi%5D.selector%29%20%7B%0A%09%09%09dict._at_put_%28methods%5Bi%5D.selector%2C%20methods%5Bi%5D%29%3B%0A%09%09%7D%0A%09%7D%3B%0A%09return%20dict%3E'),
  1327. messageSends: [],
  1328. referencedClasses: []
  1329. }),
  1330. smalltalk.Behavior);
  1331. smalltalk.addMethod(
  1332. '_methodsFor_',
  1333. smalltalk.method({
  1334. selector: 'methodsFor:',
  1335. category: 'accessing',
  1336. fn: function (aString){
  1337. var self=this;
  1338. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
  1339. return self;},
  1340. source: unescape('methodsFor%3A%20aString%0A%09%5EClassCategoryReader%20new%0A%09%20%20%20%20class%3A%20self%20category%3A%20aString%3B%0A%09%20%20%20%20yourself'),
  1341. messageSends: ["class:category:", "yourself", "new"],
  1342. referencedClasses: [smalltalk.nil]
  1343. }),
  1344. smalltalk.Behavior);
  1345. smalltalk.addMethod(
  1346. '_addCompiledMethod_',
  1347. smalltalk.method({
  1348. selector: 'addCompiledMethod:',
  1349. category: 'accessing',
  1350. fn: function (aMethod){
  1351. var self=this;
  1352. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  1353. return self;},
  1354. source: unescape('addCompiledMethod%3A%20aMethod%0A%09%3Csmalltalk.addMethod%28aMethod.selector._asSelector%28%29%2C%20aMethod%2C%20self%29%3E'),
  1355. messageSends: [],
  1356. referencedClasses: []
  1357. }),
  1358. smalltalk.Behavior);
  1359. smalltalk.addMethod(
  1360. '_instanceVariableNames',
  1361. smalltalk.method({
  1362. selector: 'instanceVariableNames',
  1363. category: 'accessing',
  1364. fn: function (){
  1365. var self=this;
  1366. return self.iVarNames;
  1367. return self;},
  1368. source: unescape('instanceVariableNames%0A%09%3Creturn%20self.iVarNames%3E'),
  1369. messageSends: [],
  1370. referencedClasses: []
  1371. }),
  1372. smalltalk.Behavior);
  1373. smalltalk.addMethod(
  1374. '_comment',
  1375. smalltalk.method({
  1376. selector: 'comment',
  1377. category: 'accessing',
  1378. fn: function (){
  1379. var self=this;
  1380. return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1381. return self;},
  1382. source: unescape('comment%0A%20%20%20%20%5E%28self%20basicAt%3A%20%27comment%27%29%20ifNil%3A%20%5B%27%27%5D'),
  1383. messageSends: ["ifNil:", "basicAt:"],
  1384. referencedClasses: []
  1385. }),
  1386. smalltalk.Behavior);
  1387. smalltalk.addMethod(
  1388. '_comment_',
  1389. smalltalk.method({
  1390. selector: 'comment:',
  1391. category: 'accessing',
  1392. fn: function (aString){
  1393. var self=this;
  1394. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  1395. return self;},
  1396. source: unescape('comment%3A%20aString%0A%20%20%20%20self%20basicAt%3A%20%27comment%27%20put%3A%20aString'),
  1397. messageSends: ["basicAt:put:"],
  1398. referencedClasses: []
  1399. }),
  1400. smalltalk.Behavior);
  1401. smalltalk.addMethod(
  1402. '_commentStamp',
  1403. smalltalk.method({
  1404. selector: 'commentStamp',
  1405. category: 'accessing',
  1406. fn: function (){
  1407. var self=this;
  1408. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
  1409. return self;},
  1410. source: unescape('commentStamp%0A%20%20%20%20%5EClassCommentReader%20new%0A%09class%3A%20self%3B%0A%09yourself'),
  1411. messageSends: ["class:", "yourself", "new"],
  1412. referencedClasses: [smalltalk.nil]
  1413. }),
  1414. smalltalk.Behavior);
  1415. smalltalk.addMethod(
  1416. '_removeCompiledMethod_',
  1417. smalltalk.method({
  1418. selector: 'removeCompiledMethod:',
  1419. category: 'accessing',
  1420. fn: function (aMethod){
  1421. var self=this;
  1422. delete self.fn.prototype[aMethod.selector._asSelector()];
  1423. delete self.fn.prototype.methods[aMethod.selector];
  1424. smalltalk.init(self);;
  1425. return self;},
  1426. source: unescape('removeCompiledMethod%3A%20aMethod%0A%09%3Cdelete%20self.fn.prototype%5BaMethod.selector._asSelector%28%29%5D%3B%0A%09delete%20self.fn.prototype.methods%5BaMethod.selector%5D%3B%0A%09smalltalk.init%28self%29%3B%3E'),
  1427. messageSends: [],
  1428. referencedClasses: []
  1429. }),
  1430. smalltalk.Behavior);
  1431. smalltalk.addMethod(
  1432. '_inheritsFrom_',
  1433. smalltalk.method({
  1434. selector: 'inheritsFrom:',
  1435. category: 'instance creation',
  1436. fn: function (aClass){
  1437. var self=this;
  1438. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  1439. return self;},
  1440. source: unescape('inheritsFrom%3A%20aClass%0A%09%5EaClass%20allSubclasses%20includes%3A%20self'),
  1441. messageSends: ["includes:", "allSubclasses"],
  1442. referencedClasses: []
  1443. }),
  1444. smalltalk.Behavior);
  1445. smalltalk.addMethod(
  1446. '_protocols',
  1447. smalltalk.method({
  1448. selector: 'protocols',
  1449. category: 'accessing',
  1450. fn: function (){
  1451. var self=this;
  1452. var protocols=nil;
  1453. protocols=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1454. 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", [])]);})]);})]);
  1455. return smalltalk.send(protocols, "_sort", []);
  1456. return self;},
  1457. source: unescape('protocols%0A%20%20%20%20%7C%20protocols%20%7C%0A%20%20%20%20protocols%20%3A%3D%20Array%20new.%0A%20%20%20%20self%20methodDictionary%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20%28protocols%20includes%3A%20each%20category%29%20ifFalse%3A%20%5B%0A%09%09protocols%20add%3A%20each%20category%5D%5D.%0A%20%20%20%20%5Eprotocols%20sort'),
  1458. messageSends: ["new", "do:", "methodDictionary", "ifFalse:", "includes:", "category", "add:", "sort"],
  1459. referencedClasses: [smalltalk.Array]
  1460. }),
  1461. smalltalk.Behavior);
  1462. smalltalk.addMethod(
  1463. '_protocolsDo_',
  1464. smalltalk.method({
  1465. selector: 'protocolsDo:',
  1466. category: 'accessing',
  1467. fn: function (aBlock){
  1468. var self=this;
  1469. var methodsByCategory=nil;
  1470. methodsByCategory=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  1471. 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]);})]);
  1472. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  1473. return self;},
  1474. source: unescape('protocolsDo%3A%20aBlock%0A%09%22Execute%20aBlock%20for%20each%20method%20category%20with%0A%09its%20collection%20of%20methods%20in%20the%20sort%20order%20of%20category%20name.%22%0A%0A%09%7C%20methodsByCategory%20%7C%0A%09methodsByCategory%20%3A%3D%20Dictionary%20new.%0A%09self%20methodDictionary%20values%20do%3A%20%5B%3Am%20%7C%0A%09%09%28methodsByCategory%20at%3A%20m%20category%20ifAbsentPut%3A%20%5BArray%20new%5D%29%0A%20%09%09%09add%3A%20m%5D.%20%0A%09self%20protocols%20do%3A%20%5B%3Acategory%20%7C%0A%09%09aBlock%20value%3A%20category%20value%3A%20%28methodsByCategory%20at%3A%20category%29%5D'),
  1475. messageSends: ["new", "do:", "values", "methodDictionary", "add:", "at:ifAbsentPut:", "category", "protocols", "value:value:", "at:"],
  1476. referencedClasses: [smalltalk.nil,smalltalk.Array]
  1477. }),
  1478. smalltalk.Behavior);
  1479. smalltalk.addMethod(
  1480. '_allInstanceVariableNames',
  1481. smalltalk.method({
  1482. selector: 'allInstanceVariableNames',
  1483. category: 'accessing',
  1484. fn: function (){
  1485. var self=this;
  1486. var result=nil;
  1487. result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []);
  1488. (($receiver = smalltalk.send(self, "_superclass", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})() : nil;
  1489. return result;
  1490. return self;},
  1491. source: unescape('allInstanceVariableNames%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20self%20instanceVariableNames%20copy.%0A%09self%20superclass%20ifNotNil%3A%20%5B%0A%09%20%20%20%20result%20addAll%3A%20self%20superclass%20allInstanceVariableNames%5D.%0A%09%5Eresult'),
  1492. messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "superclass", "addAll:", "allInstanceVariableNames"],
  1493. referencedClasses: []
  1494. }),
  1495. smalltalk.Behavior);
  1496. smalltalk.addMethod(
  1497. '_methodAt_',
  1498. smalltalk.method({
  1499. selector: 'methodAt:',
  1500. category: 'accessing',
  1501. fn: function (aString){
  1502. var self=this;
  1503. return smalltalk.methods(self)[aString];
  1504. return self;},
  1505. source: unescape('methodAt%3A%20aString%0A%09%3Creturn%20smalltalk.methods%28self%29%5BaString%5D%3E'),
  1506. messageSends: [],
  1507. referencedClasses: []
  1508. }),
  1509. smalltalk.Behavior);
  1510. smalltalk.addMethod(
  1511. '_methodsFor_stamp_',
  1512. smalltalk.method({
  1513. selector: 'methodsFor:stamp:',
  1514. category: 'accessing',
  1515. fn: function (aString, aStamp){
  1516. var self=this;
  1517. return smalltalk.send(self, "_methodsFor_", [aString]);
  1518. return self;},
  1519. source: unescape('methodsFor%3A%20aString%20stamp%3A%20aStamp%0A%09%22Added%20for%20compatibility%2C%20right%20now%20ignores%20stamp.%22%0A%09%5Eself%20methodsFor%3A%20aString'),
  1520. messageSends: ["methodsFor:"],
  1521. referencedClasses: []
  1522. }),
  1523. smalltalk.Behavior);
  1524. smalltalk.addMethod(
  1525. '_commentStamp_prior_',
  1526. smalltalk.method({
  1527. selector: 'commentStamp:prior:',
  1528. category: 'accessing',
  1529. fn: function (aStamp, prior){
  1530. var self=this;
  1531. return self;},
  1532. source: unescape('commentStamp%3A%20aStamp%20prior%3A%20prior%0A%20%20%20%20%20%20%20%20%20%22Ignored%20right%20now.%22'),
  1533. messageSends: [],
  1534. referencedClasses: []
  1535. }),
  1536. smalltalk.Behavior);
  1537. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  1538. smalltalk.addMethod(
  1539. '_category',
  1540. smalltalk.method({
  1541. selector: 'category',
  1542. category: 'accessing',
  1543. fn: function (){
  1544. var self=this;
  1545. return self.category;
  1546. return self;},
  1547. source: unescape('category%0A%09%3Creturn%20self.category%3E'),
  1548. messageSends: [],
  1549. referencedClasses: []
  1550. }),
  1551. smalltalk.Class);
  1552. smalltalk.addMethod(
  1553. '_category_',
  1554. smalltalk.method({
  1555. selector: 'category:',
  1556. category: 'accessing',
  1557. fn: function (aString){
  1558. var self=this;
  1559. self.category = aString;
  1560. return self;},
  1561. source: unescape('category%3A%20aString%0A%09%3Cself.category%20%3D%20aString%3E'),
  1562. messageSends: [],
  1563. referencedClasses: []
  1564. }),
  1565. smalltalk.Class);
  1566. smalltalk.addMethod(
  1567. '_subclass_instanceVariableNames_',
  1568. smalltalk.method({
  1569. selector: 'subclass:instanceVariableNames:',
  1570. category: 'class creation',
  1571. fn: function (aString, anotherString){
  1572. var self=this;
  1573. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  1574. return self;},
  1575. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil'),
  1576. messageSends: ["subclass:instanceVariableNames:category:"],
  1577. referencedClasses: []
  1578. }),
  1579. smalltalk.Class);
  1580. smalltalk.addMethod(
  1581. '_subclass_instanceVariableNames_category_',
  1582. smalltalk.method({
  1583. selector: 'subclass:instanceVariableNames:category:',
  1584. category: 'class creation',
  1585. fn: function (aString, aString2, aString3){
  1586. var self=this;
  1587. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  1588. return self;},
  1589. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3'),
  1590. messageSends: ["superclass:subclass:instanceVariableNames:category:", "new"],
  1591. referencedClasses: [smalltalk.nil]
  1592. }),
  1593. smalltalk.Class);
  1594. smalltalk.addMethod(
  1595. '_isClass',
  1596. smalltalk.method({
  1597. selector: 'isClass',
  1598. category: 'testing',
  1599. fn: function (){
  1600. var self=this;
  1601. return true;
  1602. return self;},
  1603. source: unescape('isClass%0A%09%5Etrue'),
  1604. messageSends: [],
  1605. referencedClasses: []
  1606. }),
  1607. smalltalk.Class);
  1608. smalltalk.addMethod(
  1609. '_printString',
  1610. smalltalk.method({
  1611. selector: 'printString',
  1612. category: 'printing',
  1613. fn: function (){
  1614. var self=this;
  1615. return smalltalk.send(self, "_name", []);
  1616. return self;},
  1617. source: unescape('printString%0A%09%5Eself%20name'),
  1618. messageSends: ["name"],
  1619. referencedClasses: []
  1620. }),
  1621. smalltalk.Class);
  1622. smalltalk.addMethod(
  1623. '_rename_',
  1624. smalltalk.method({
  1625. selector: 'rename:',
  1626. category: 'accessing',
  1627. fn: function (aString){
  1628. var self=this;
  1629. smalltalk[aString] = self;
  1630. delete smalltalk[self.className];
  1631. self.className = aString;
  1632. ;
  1633. return self;},
  1634. source: unescape('rename%3A%20aString%0A%09%3C%0A%09%09smalltalk%5BaString%5D%20%3D%20self%3B%0A%09%09delete%20smalltalk%5Bself.className%5D%3B%0A%09%09self.className%20%3D%20aString%3B%0A%09%3E'),
  1635. messageSends: [],
  1636. referencedClasses: []
  1637. }),
  1638. smalltalk.Class);
  1639. smalltalk.addMethod(
  1640. '_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_',
  1641. smalltalk.method({
  1642. selector: 'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:',
  1643. category: 'class creation',
  1644. fn: function (aString, aString2, classVars, pools, aString3){
  1645. var self=this;
  1646. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, aString2, aString3]);
  1647. return self;},
  1648. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20classVariableNames%3A%20classVars%20poolDictionaries%3A%20pools%20category%3A%20aString3%0A%09%22Just%20ignore%20class%20variables%20and%20pools.%20Added%20for%20compatibility.%22%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3'),
  1649. messageSends: ["subclass:instanceVariableNames:category:"],
  1650. referencedClasses: []
  1651. }),
  1652. smalltalk.Class);
  1653. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  1654. smalltalk.addMethod(
  1655. '_instanceClass',
  1656. smalltalk.method({
  1657. selector: 'instanceClass',
  1658. category: 'accessing',
  1659. fn: function (){
  1660. var self=this;
  1661. return self.instanceClass;
  1662. return self;},
  1663. source: unescape('instanceClass%0A%09%3Creturn%20self.instanceClass%3E'),
  1664. messageSends: [],
  1665. referencedClasses: []
  1666. }),
  1667. smalltalk.Metaclass);
  1668. smalltalk.addMethod(
  1669. '_instanceVariableNames_',
  1670. smalltalk.method({
  1671. selector: 'instanceVariableNames:',
  1672. category: 'accessing',
  1673. fn: function (aCollection){
  1674. var self=this;
  1675. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  1676. return self;},
  1677. source: unescape('instanceVariableNames%3A%20aCollection%0A%09ClassBuilder%20new%0A%09%20%20%20%20class%3A%20self%20instanceVariableNames%3A%20aCollection'),
  1678. messageSends: ["class:instanceVariableNames:", "new"],
  1679. referencedClasses: [smalltalk.nil]
  1680. }),
  1681. smalltalk.Metaclass);
  1682. smalltalk.addMethod(
  1683. '_isMetaclass',
  1684. smalltalk.method({
  1685. selector: 'isMetaclass',
  1686. category: 'testing',
  1687. fn: function (){
  1688. var self=this;
  1689. return true;
  1690. return self;},
  1691. source: unescape('isMetaclass%0A%09%5Etrue'),
  1692. messageSends: [],
  1693. referencedClasses: []
  1694. }),
  1695. smalltalk.Metaclass);
  1696. smalltalk.addMethod(
  1697. '_printString',
  1698. smalltalk.method({
  1699. selector: 'printString',
  1700. category: 'printing',
  1701. fn: function (){
  1702. var self=this;
  1703. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  1704. return self;},
  1705. source: unescape('printString%0A%09%5Eself%20instanceClass%20name%2C%20%27%20class%27'),
  1706. messageSends: [unescape("%2C"), "name", "instanceClass"],
  1707. referencedClasses: []
  1708. }),
  1709. smalltalk.Metaclass);
  1710. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  1711. smalltalk.addMethod(
  1712. '_source',
  1713. smalltalk.method({
  1714. selector: 'source',
  1715. category: 'accessing',
  1716. fn: function (){
  1717. var self=this;
  1718. return (($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1719. return self;},
  1720. source: unescape('source%0A%09%5E%28self%20basicAt%3A%20%27source%27%29%20ifNil%3A%20%5B%27%27%5D'),
  1721. messageSends: ["ifNil:", "basicAt:"],
  1722. referencedClasses: []
  1723. }),
  1724. smalltalk.CompiledMethod);
  1725. smalltalk.addMethod(
  1726. '_source_',
  1727. smalltalk.method({
  1728. selector: 'source:',
  1729. category: 'accessing',
  1730. fn: function (aString){
  1731. var self=this;
  1732. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  1733. return self;},
  1734. source: unescape('source%3A%20aString%0A%09self%20basicAt%3A%20%27source%27%20put%3A%20aString'),
  1735. messageSends: ["basicAt:put:"],
  1736. referencedClasses: []
  1737. }),
  1738. smalltalk.CompiledMethod);
  1739. smalltalk.addMethod(
  1740. '_category',
  1741. smalltalk.method({
  1742. selector: 'category',
  1743. category: 'accessing',
  1744. fn: function (){
  1745. var self=this;
  1746. return (($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1747. return self;},
  1748. source: unescape('category%0A%09%5E%28self%20basicAt%3A%20%27category%27%29%20ifNil%3A%20%5B%27%27%5D'),
  1749. messageSends: ["ifNil:", "basicAt:"],
  1750. referencedClasses: []
  1751. }),
  1752. smalltalk.CompiledMethod);
  1753. smalltalk.addMethod(
  1754. '_category_',
  1755. smalltalk.method({
  1756. selector: 'category:',
  1757. category: 'accessing',
  1758. fn: function (aString){
  1759. var self=this;
  1760. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  1761. return self;},
  1762. source: unescape('category%3A%20aString%0A%09self%20basicAt%3A%20%27category%27%20put%3A%20aString'),
  1763. messageSends: ["basicAt:put:"],
  1764. referencedClasses: []
  1765. }),
  1766. smalltalk.CompiledMethod);
  1767. smalltalk.addMethod(
  1768. '_selector',
  1769. smalltalk.method({
  1770. selector: 'selector',
  1771. category: 'accessing',
  1772. fn: function (){
  1773. var self=this;
  1774. return smalltalk.send(self, "_basicAt_", ["selector"]);
  1775. return self;},
  1776. source: unescape('selector%0A%09%5Eself%20basicAt%3A%20%27selector%27'),
  1777. messageSends: ["basicAt:"],
  1778. referencedClasses: []
  1779. }),
  1780. smalltalk.CompiledMethod);
  1781. smalltalk.addMethod(
  1782. '_selector_',
  1783. smalltalk.method({
  1784. selector: 'selector:',
  1785. category: 'accessing',
  1786. fn: function (aString){
  1787. var self=this;
  1788. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  1789. return self;},
  1790. source: unescape('selector%3A%20aString%0A%09self%20basicAt%3A%20%27selector%27%20put%3A%20aString'),
  1791. messageSends: ["basicAt:put:"],
  1792. referencedClasses: []
  1793. }),
  1794. smalltalk.CompiledMethod);
  1795. smalltalk.addMethod(
  1796. '_fn',
  1797. smalltalk.method({
  1798. selector: 'fn',
  1799. category: 'accessing',
  1800. fn: function (){
  1801. var self=this;
  1802. return smalltalk.send(self, "_basicAt_", ["fn"]);
  1803. return self;},
  1804. source: unescape('fn%0A%09%5Eself%20basicAt%3A%20%27fn%27'),
  1805. messageSends: ["basicAt:"],
  1806. referencedClasses: []
  1807. }),
  1808. smalltalk.CompiledMethod);
  1809. smalltalk.addMethod(
  1810. '_fn_',
  1811. smalltalk.method({
  1812. selector: 'fn:',
  1813. category: 'accessing',
  1814. fn: function (aBlock){
  1815. var self=this;
  1816. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  1817. return self;},
  1818. source: unescape('fn%3A%20aBlock%0A%09self%20basicAt%3A%20%27fn%27%20put%3A%20aBlock'),
  1819. messageSends: ["basicAt:put:"],
  1820. referencedClasses: []
  1821. }),
  1822. smalltalk.CompiledMethod);
  1823. smalltalk.addMethod(
  1824. '_messageSends',
  1825. smalltalk.method({
  1826. selector: 'messageSends',
  1827. category: 'accessing',
  1828. fn: function (){
  1829. var self=this;
  1830. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  1831. return self;},
  1832. source: unescape('messageSends%0A%09%5Eself%20basicAt%3A%20%27messageSends%27'),
  1833. messageSends: ["basicAt:"],
  1834. referencedClasses: []
  1835. }),
  1836. smalltalk.CompiledMethod);
  1837. smalltalk.addMethod(
  1838. '_methodClass',
  1839. smalltalk.method({
  1840. selector: 'methodClass',
  1841. category: 'accessing',
  1842. fn: function (){
  1843. var self=this;
  1844. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  1845. return self;},
  1846. source: unescape('methodClass%0A%09%5Eself%20basicAt%3A%20%27methodClass%27'),
  1847. messageSends: ["basicAt:"],
  1848. referencedClasses: []
  1849. }),
  1850. smalltalk.CompiledMethod);
  1851. smalltalk.addMethod(
  1852. '_referencedClasses',
  1853. smalltalk.method({
  1854. selector: 'referencedClasses',
  1855. category: 'accessing',
  1856. fn: function (){
  1857. var self=this;
  1858. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  1859. return self;},
  1860. source: unescape('referencedClasses%0A%09%5Eself%20basicAt%3A%20%27referencedClasses%27'),
  1861. messageSends: ["basicAt:"],
  1862. referencedClasses: []
  1863. }),
  1864. smalltalk.CompiledMethod);
  1865. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1866. smalltalk.addMethod(
  1867. '__eq',
  1868. smalltalk.method({
  1869. selector: '=',
  1870. category: 'comparing',
  1871. fn: function (aNumber){
  1872. var self=this;
  1873. return Number(self) == aNumber;
  1874. return self;},
  1875. source: unescape('%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20Number%28self%29%20%3D%3D%20aNumber%3E'),
  1876. messageSends: [],
  1877. referencedClasses: []
  1878. }),
  1879. smalltalk.Number);
  1880. smalltalk.addMethod(
  1881. '__gt',
  1882. smalltalk.method({
  1883. selector: '>',
  1884. category: 'comparing',
  1885. fn: function (aNumber){
  1886. var self=this;
  1887. return self > aNumber;
  1888. return self;},
  1889. source: unescape('%3E%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3E%3E%20aNumber%3E'),
  1890. messageSends: [],
  1891. referencedClasses: []
  1892. }),
  1893. smalltalk.Number);
  1894. smalltalk.addMethod(
  1895. '__lt',
  1896. smalltalk.method({
  1897. selector: '<',
  1898. category: 'comparing',
  1899. fn: function (aNumber){
  1900. var self=this;
  1901. return self < aNumber;
  1902. return self;},
  1903. source: unescape('%3C%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3C%20aNumber%3E'),
  1904. messageSends: [],
  1905. referencedClasses: []
  1906. }),
  1907. smalltalk.Number);
  1908. smalltalk.addMethod(
  1909. '__gt_eq',
  1910. smalltalk.method({
  1911. selector: '>=',
  1912. category: 'comparing',
  1913. fn: function (aNumber){
  1914. var self=this;
  1915. return self >= aNumber;
  1916. return self;},
  1917. source: unescape('%3E%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3E%3E%3D%20aNumber%3E'),
  1918. messageSends: [],
  1919. referencedClasses: []
  1920. }),
  1921. smalltalk.Number);
  1922. smalltalk.addMethod(
  1923. '__lt_eq',
  1924. smalltalk.method({
  1925. selector: '<=',
  1926. category: 'comparing',
  1927. fn: function (aNumber){
  1928. var self=this;
  1929. return self <= aNumber;
  1930. return self;},
  1931. source: unescape('%3C%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3C%3D%20aNumber%3E'),
  1932. messageSends: [],
  1933. referencedClasses: []
  1934. }),
  1935. smalltalk.Number);
  1936. smalltalk.addMethod(
  1937. '__plus',
  1938. smalltalk.method({
  1939. selector: '+',
  1940. category: 'arithmetic',
  1941. fn: function (aNumber){
  1942. var self=this;
  1943. return self + aNumber;
  1944. return self;},
  1945. source: unescape('+%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20+%20aNumber%3E'),
  1946. messageSends: [],
  1947. referencedClasses: []
  1948. }),
  1949. smalltalk.Number);
  1950. smalltalk.addMethod(
  1951. '__minus',
  1952. smalltalk.method({
  1953. selector: '-',
  1954. category: 'arithmetic',
  1955. fn: function (aNumber){
  1956. var self=this;
  1957. return self - aNumber;
  1958. return self;},
  1959. source: unescape('-%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20-%20aNumber%3E'),
  1960. messageSends: [],
  1961. referencedClasses: []
  1962. }),
  1963. smalltalk.Number);
  1964. smalltalk.addMethod(
  1965. '__star',
  1966. smalltalk.method({
  1967. selector: '*',
  1968. category: 'arithmetic',
  1969. fn: function (aNumber){
  1970. var self=this;
  1971. return self * aNumber;
  1972. return self;},
  1973. source: unescape('*%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20*%20aNumber%3E'),
  1974. messageSends: [],
  1975. referencedClasses: []
  1976. }),
  1977. smalltalk.Number);
  1978. smalltalk.addMethod(
  1979. '__slash',
  1980. smalltalk.method({
  1981. selector: '/',
  1982. category: 'arithmetic',
  1983. fn: function (aNumber){
  1984. var self=this;
  1985. return self / aNumber;
  1986. return self;},
  1987. source: unescape('/%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20/%20aNumber%3E'),
  1988. messageSends: [],
  1989. referencedClasses: []
  1990. }),
  1991. smalltalk.Number);
  1992. smalltalk.addMethod(
  1993. '_max_',
  1994. smalltalk.method({
  1995. selector: 'max:',
  1996. category: 'arithmetic',
  1997. fn: function (aNumber){
  1998. var self=this;
  1999. return Math.max(self, aNumber);;
  2000. return self;},
  2001. source: unescape('max%3A%20aNumber%0A%09%3Creturn%20Math.max%28self%2C%20aNumber%29%3B%3E'),
  2002. messageSends: [],
  2003. referencedClasses: []
  2004. }),
  2005. smalltalk.Number);
  2006. smalltalk.addMethod(
  2007. '_min_',
  2008. smalltalk.method({
  2009. selector: 'min:',
  2010. category: 'arithmetic',
  2011. fn: function (aNumber){
  2012. var self=this;
  2013. return Math.min(self, aNumber);;
  2014. return self;},
  2015. source: unescape('min%3A%20aNumber%0A%09%3Creturn%20Math.min%28self%2C%20aNumber%29%3B%3E'),
  2016. messageSends: [],
  2017. referencedClasses: []
  2018. }),
  2019. smalltalk.Number);
  2020. smalltalk.addMethod(
  2021. '_rounded',
  2022. smalltalk.method({
  2023. selector: 'rounded',
  2024. category: 'converting',
  2025. fn: function (){
  2026. var self=this;
  2027. return Math.round(self);;
  2028. return self;},
  2029. source: unescape('rounded%0A%09%3Creturn%20Math.round%28self%29%3B%3E'),
  2030. messageSends: [],
  2031. referencedClasses: []
  2032. }),
  2033. smalltalk.Number);
  2034. smalltalk.addMethod(
  2035. '_truncated',
  2036. smalltalk.method({
  2037. selector: 'truncated',
  2038. category: 'converting',
  2039. fn: function (){
  2040. var self=this;
  2041. return Math.floor(self);;
  2042. return self;},
  2043. source: unescape('truncated%0A%09%3Creturn%20Math.floor%28self%29%3B%3E'),
  2044. messageSends: [],
  2045. referencedClasses: []
  2046. }),
  2047. smalltalk.Number);
  2048. smalltalk.addMethod(
  2049. '_to_',
  2050. smalltalk.method({
  2051. selector: 'to:',
  2052. category: 'converting',
  2053. fn: function (aNumber){
  2054. var self=this;
  2055. var array=nil;
  2056. var first=nil;
  2057. var last=nil;
  2058. var count=nil;
  2059. first=smalltalk.send(self, "_truncated", []);
  2060. last=(($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);
  2061. count=(1);
  2062. (($receiver = (($receiver = first).klass === smalltalk.Number) ? $receiver <=last : smalltalk.send($receiver, "__lt_eq", [last])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", ["Wrong interval"]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", ["Wrong interval"]);})]);
  2063. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  2064. 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)]);})]);
  2065. return array;
  2066. return self;},
  2067. source: unescape('to%3A%20aNumber%0A%09%7C%20array%20first%20last%20count%20%7C%0A%09first%20%3A%3D%20self%20truncated.%0A%09last%20%3A%3D%20aNumber%20truncated%20+%201.%0A%09count%20%3A%3D%201.%0A%09%28first%20%3C%3D%20last%29%20ifFalse%3A%20%5Bself%20error%3A%20%27Wrong%20interval%27%5D.%0A%09array%20%3A%3D%20Array%20new.%0A%09%28last%20-%20first%29%20timesRepeat%3A%20%5B%0A%09%20%20%20%20array%20at%3A%20count%20put%3A%20first.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%09%20%20%20%20first%20%3A%3D%20first%20+%201%5D.%0A%09%5Earray'),
  2068. messageSends: ["truncated", unescape("+"), "ifFalse:", unescape("%3C%3D"), "error:", "new", "timesRepeat:", unescape("-"), "at:put:"],
  2069. referencedClasses: [smalltalk.Array]
  2070. }),
  2071. smalltalk.Number);
  2072. smalltalk.addMethod(
  2073. '_timesRepeat_',
  2074. smalltalk.method({
  2075. selector: 'timesRepeat:',
  2076. category: 'enumerating',
  2077. fn: function (aBlock){
  2078. var self=this;
  2079. var integer=nil;
  2080. var count=nil;
  2081. integer=smalltalk.send(self, "_truncated", []);
  2082. count=(1);
  2083. (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)]);})()}})();
  2084. return self;},
  2085. source: unescape('timesRepeat%3A%20aBlock%0A%09%7C%20integer%20count%20%7C%0A%09integer%20%3A%3D%20self%20truncated.%0A%09count%20%3A%3D%201.%0A%09%5Bcount%20%3E%20self%5D%20whileFalse%3A%20%5B%0A%09%20%20%20%20aBlock%20value.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201%5D'),
  2086. messageSends: ["truncated", "whileFalse:", unescape("%3E"), "value", unescape("+")],
  2087. referencedClasses: []
  2088. }),
  2089. smalltalk.Number);
  2090. smalltalk.addMethod(
  2091. '_to_do_',
  2092. smalltalk.method({
  2093. selector: 'to:do:',
  2094. category: 'enumerating',
  2095. fn: function (aNumber, aBlock){
  2096. var self=this;
  2097. return smalltalk.send(smalltalk.send(self, "_to_", [aNumber]), "_do_", [aBlock]);
  2098. return self;},
  2099. source: unescape('to%3A%20aNumber%20do%3A%20aBlock%0A%09%5E%28self%20to%3A%20aNumber%29%20do%3A%20aBlock'),
  2100. messageSends: ["do:", "to:"],
  2101. referencedClasses: []
  2102. }),
  2103. smalltalk.Number);
  2104. smalltalk.addMethod(
  2105. '_asString',
  2106. smalltalk.method({
  2107. selector: 'asString',
  2108. category: 'converting',
  2109. fn: function (){
  2110. var self=this;
  2111. return smalltalk.send(self, "_printString", []);
  2112. return self;},
  2113. source: unescape('asString%0A%09%5Eself%20printString'),
  2114. messageSends: ["printString"],
  2115. referencedClasses: []
  2116. }),
  2117. smalltalk.Number);
  2118. smalltalk.addMethod(
  2119. '_asJavascript',
  2120. smalltalk.method({
  2121. selector: 'asJavascript',
  2122. category: 'converting',
  2123. fn: function (){
  2124. var self=this;
  2125. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  2126. return self;},
  2127. source: unescape('asJavascript%0A%09%5E%27%28%27%2C%20self%20printString%2C%20%27%29%27'),
  2128. messageSends: [unescape("%2C"), "printString"],
  2129. referencedClasses: []
  2130. }),
  2131. smalltalk.Number);
  2132. smalltalk.addMethod(
  2133. '_printString',
  2134. smalltalk.method({
  2135. selector: 'printString',
  2136. category: 'printing',
  2137. fn: function (){
  2138. var self=this;
  2139. return String(self);
  2140. return self;},
  2141. source: unescape('printString%0A%09%3Creturn%20String%28self%29%3E'),
  2142. messageSends: [],
  2143. referencedClasses: []
  2144. }),
  2145. smalltalk.Number);
  2146. smalltalk.addMethod(
  2147. '_isNumber',
  2148. smalltalk.method({
  2149. selector: 'isNumber',
  2150. category: 'testing',
  2151. fn: function (){
  2152. var self=this;
  2153. return true;
  2154. return self;},
  2155. source: unescape('isNumber%0A%09%5Etrue'),
  2156. messageSends: [],
  2157. referencedClasses: []
  2158. }),
  2159. smalltalk.Number);
  2160. smalltalk.addMethod(
  2161. '_atRandom',
  2162. smalltalk.method({
  2163. selector: 'atRandom',
  2164. category: 'converting',
  2165. fn: function (){
  2166. var self=this;
  2167. 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)]);
  2168. return self;},
  2169. source: unescape('atRandom%0A%20%20%20%20%5E%28Random%20new%20next%20*%20self%29%20truncated%20+%201'),
  2170. messageSends: [unescape("+"), "truncated", unescape("*"), "next", "new"],
  2171. referencedClasses: [smalltalk.nil]
  2172. }),
  2173. smalltalk.Number);
  2174. smalltalk.addMethod(
  2175. '__at',
  2176. smalltalk.method({
  2177. selector: '@',
  2178. category: 'converting',
  2179. fn: function (aNumber){
  2180. var self=this;
  2181. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, aNumber]);
  2182. return self;},
  2183. source: unescape('@%20aNumber%0A%09%5EPoint%20x%3A%20self%20y%3A%20aNumber'),
  2184. messageSends: ["x:y:"],
  2185. referencedClasses: [smalltalk.nil]
  2186. }),
  2187. smalltalk.Number);
  2188. smalltalk.addMethod(
  2189. '_asPoint',
  2190. smalltalk.method({
  2191. selector: 'asPoint',
  2192. category: 'converting',
  2193. fn: function (){
  2194. var self=this;
  2195. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, self]);
  2196. return self;},
  2197. source: unescape('asPoint%0A%09%5EPoint%20x%3A%20self%20y%3A%20self'),
  2198. messageSends: ["x:y:"],
  2199. referencedClasses: [smalltalk.nil]
  2200. }),
  2201. smalltalk.Number);
  2202. smalltalk.addMethod(
  2203. '_clearInterval',
  2204. smalltalk.method({
  2205. selector: 'clearInterval',
  2206. category: 'timeouts/intervals',
  2207. fn: function (){
  2208. var self=this;
  2209. clearInterval(Number(self));
  2210. return self;},
  2211. source: unescape('clearInterval%0A%09%3CclearInterval%28Number%28self%29%29%3E'),
  2212. messageSends: [],
  2213. referencedClasses: []
  2214. }),
  2215. smalltalk.Number);
  2216. smalltalk.addMethod(
  2217. '_asJSONObject',
  2218. smalltalk.method({
  2219. selector: 'asJSONObject',
  2220. category: 'converting',
  2221. fn: function (){
  2222. var self=this;
  2223. return self;
  2224. return self;},
  2225. source: unescape('asJSONObject%0A%09%5Eself'),
  2226. messageSends: [],
  2227. referencedClasses: []
  2228. }),
  2229. smalltalk.Number);
  2230. smalltalk.addMethod(
  2231. '_clearTimeout',
  2232. smalltalk.method({
  2233. selector: 'clearTimeout',
  2234. category: 'timeouts/intervals',
  2235. fn: function (){
  2236. var self=this;
  2237. clearTimeout(Number(self));
  2238. return self;},
  2239. source: unescape('clearTimeout%0A%09%3CclearTimeout%28Number%28self%29%29%3E'),
  2240. messageSends: [],
  2241. referencedClasses: []
  2242. }),
  2243. smalltalk.Number);
  2244. smalltalk.addMethod(
  2245. '_modulo_',
  2246. smalltalk.method({
  2247. selector: 'modulo:',
  2248. category: 'arithmetic',
  2249. fn: function (aNumber){
  2250. var self=this;
  2251. return self % aNumber;
  2252. return self;},
  2253. source: unescape('modulo%3A%20aNumber%0A%09%3Creturn%20self%20%25%20aNumber%3E'),
  2254. messageSends: [],
  2255. referencedClasses: []
  2256. }),
  2257. smalltalk.Number);
  2258. smalltalk.addMethod(
  2259. '_even',
  2260. smalltalk.method({
  2261. selector: 'even',
  2262. category: 'testing',
  2263. fn: function (){
  2264. var self=this;
  2265. return (0) == smalltalk.send(self, "_modulo_", [(2)]);
  2266. return self;},
  2267. source: unescape('even%0A%09%5E%200%20%3D%20%28self%20modulo%3A%202%29'),
  2268. messageSends: [unescape("%3D"), "modulo:"],
  2269. referencedClasses: []
  2270. }),
  2271. smalltalk.Number);
  2272. smalltalk.addMethod(
  2273. '_odd',
  2274. smalltalk.method({
  2275. selector: 'odd',
  2276. category: 'testing',
  2277. fn: function (){
  2278. var self=this;
  2279. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  2280. return self;},
  2281. source: unescape('odd%0A%09%5E%20self%20even%20not'),
  2282. messageSends: ["not", "even"],
  2283. referencedClasses: []
  2284. }),
  2285. smalltalk.Number);
  2286. smalltalk.addMethod(
  2287. '_negated',
  2288. smalltalk.method({
  2289. selector: 'negated',
  2290. category: 'arithmetic',
  2291. fn: function (){
  2292. var self=this;
  2293. return (0) - self;
  2294. return self;},
  2295. source: unescape('negated%0A%09%5E0%20-%20self'),
  2296. messageSends: [unescape("-")],
  2297. referencedClasses: []
  2298. }),
  2299. smalltalk.Number);
  2300. smalltalk.addMethod(
  2301. '_pi',
  2302. smalltalk.method({
  2303. selector: 'pi',
  2304. category: 'instance creation',
  2305. fn: function (){
  2306. var self=this;
  2307. return Math.PI;
  2308. return self;},
  2309. source: unescape('pi%0A%09%3Creturn%20Math.PI%3E'),
  2310. messageSends: [],
  2311. referencedClasses: []
  2312. }),
  2313. smalltalk.Number.klass);
  2314. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  2315. smalltalk.addMethod(
  2316. '_compiledSource',
  2317. smalltalk.method({
  2318. selector: 'compiledSource',
  2319. category: 'accessing',
  2320. fn: function (){
  2321. var self=this;
  2322. return self.toString();
  2323. return self;},
  2324. source: unescape('compiledSource%0A%09%3Creturn%20self.toString%28%29%3E'),
  2325. messageSends: [],
  2326. referencedClasses: []
  2327. }),
  2328. smalltalk.BlockClosure);
  2329. smalltalk.addMethod(
  2330. '_whileTrue_',
  2331. smalltalk.method({
  2332. selector: 'whileTrue:',
  2333. category: 'controlling',
  2334. fn: function (aBlock){
  2335. var self=this;
  2336. while(self()) {aBlock()};
  2337. return self;},
  2338. source: unescape('whileTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28self%28%29%29%20%7BaBlock%28%29%7D%3E'),
  2339. messageSends: [],
  2340. referencedClasses: []
  2341. }),
  2342. smalltalk.BlockClosure);
  2343. smalltalk.addMethod(
  2344. '_whileFalse_',
  2345. smalltalk.method({
  2346. selector: 'whileFalse:',
  2347. category: 'controlling',
  2348. fn: function (aBlock){
  2349. var self=this;
  2350. while(!self()) {aBlock()};
  2351. return self;},
  2352. source: unescape('whileFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28%21self%28%29%29%20%7BaBlock%28%29%7D%3E'),
  2353. messageSends: [],
  2354. referencedClasses: []
  2355. }),
  2356. smalltalk.BlockClosure);
  2357. smalltalk.addMethod(
  2358. '_value',
  2359. smalltalk.method({
  2360. selector: 'value',
  2361. category: 'evaluating',
  2362. fn: function (){
  2363. var self=this;
  2364. return self();;
  2365. return self;},
  2366. source: unescape('value%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28%29%3B%3E'),
  2367. messageSends: [],
  2368. referencedClasses: []
  2369. }),
  2370. smalltalk.BlockClosure);
  2371. smalltalk.addMethod(
  2372. '_value_',
  2373. smalltalk.method({
  2374. selector: 'value:',
  2375. category: 'evaluating',
  2376. fn: function (anArg){
  2377. var self=this;
  2378. return self(anArg);;
  2379. return self;},
  2380. source: unescape('value%3A%20anArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28anArg%29%3B%3E'),
  2381. messageSends: [],
  2382. referencedClasses: []
  2383. }),
  2384. smalltalk.BlockClosure);
  2385. smalltalk.addMethod(
  2386. '_value_value_',
  2387. smalltalk.method({
  2388. selector: 'value:value:',
  2389. category: 'evaluating',
  2390. fn: function (firstArg, secondArg){
  2391. var self=this;
  2392. return self(firstArg, secondArg);;
  2393. return self;},
  2394. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%29%3B%3E'),
  2395. messageSends: [],
  2396. referencedClasses: []
  2397. }),
  2398. smalltalk.BlockClosure);
  2399. smalltalk.addMethod(
  2400. '_value_value_value_',
  2401. smalltalk.method({
  2402. selector: 'value:value:value:',
  2403. category: 'evaluating',
  2404. fn: function (firstArg, secondArg, thirdArg){
  2405. var self=this;
  2406. return self(firstArg, secondArg, thirdArg);;
  2407. return self;},
  2408. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%3E'),
  2409. messageSends: [],
  2410. referencedClasses: []
  2411. }),
  2412. smalltalk.BlockClosure);
  2413. smalltalk.addMethod(
  2414. '_valueWithPossibleArguments_',
  2415. smalltalk.method({
  2416. selector: 'valueWithPossibleArguments:',
  2417. category: 'evaluating',
  2418. fn: function (aCollection){
  2419. var self=this;
  2420. return self.apply(null, aCollection);;
  2421. return self;},
  2422. source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%3Creturn%20self.apply%28null%2C%20aCollection%29%3B%3E'),
  2423. messageSends: [],
  2424. referencedClasses: []
  2425. }),
  2426. smalltalk.BlockClosure);
  2427. smalltalk.addMethod(
  2428. '_on_do_',
  2429. smalltalk.method({
  2430. selector: 'on:do:',
  2431. category: 'error handling',
  2432. fn: function (anErrorClass, aBlock){
  2433. var self=this;
  2434. 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", []);})]);})]);
  2435. return self;},
  2436. source: unescape('on%3A%20anErrorClass%20do%3A%20aBlock%0A%09self%20try%3A%20self%20catch%3A%20%5B%3Aerror%20%7C%0A%09%20%20%20%20%28error%20isKindOf%3A%20anErrorClass%29%20%0A%09%20%20%20%20%20ifTrue%3A%20%5BaBlock%20value%3A%20error%5D%0A%09%20%20%20%20%20ifFalse%3A%20%5Berror%20signal%5D%5D'),
  2437. messageSends: ["try:catch:", "ifTrue:ifFalse:", "isKindOf:", "value:", "signal"],
  2438. referencedClasses: []
  2439. }),
  2440. smalltalk.BlockClosure);
  2441. smalltalk.addMethod(
  2442. '_valueWithTimeout_',
  2443. smalltalk.method({
  2444. selector: 'valueWithTimeout:',
  2445. category: 'timeout/interval',
  2446. fn: function (aNumber){
  2447. var self=this;
  2448. return setTimeout(self, aNumber);
  2449. return self;},
  2450. source: unescape('valueWithTimeout%3A%20aNumber%0A%09%3Creturn%20setTimeout%28self%2C%20aNumber%29%3E'),
  2451. messageSends: [],
  2452. referencedClasses: []
  2453. }),
  2454. smalltalk.BlockClosure);
  2455. smalltalk.addMethod(
  2456. '_valueWithInterval_',
  2457. smalltalk.method({
  2458. selector: 'valueWithInterval:',
  2459. category: 'timeout/interval',
  2460. fn: function (aNumber){
  2461. var self=this;
  2462. return setInterval(self, aNumber);
  2463. return self;},
  2464. source: unescape('valueWithInterval%3A%20aNumber%0A%09%3Creturn%20setInterval%28self%2C%20aNumber%29%3E'),
  2465. messageSends: [],
  2466. referencedClasses: []
  2467. }),
  2468. smalltalk.BlockClosure);
  2469. smalltalk.addMethod(
  2470. '_printString',
  2471. smalltalk.method({
  2472. selector: 'printString',
  2473. category: 'printing',
  2474. fn: function (){
  2475. var self=this;
  2476. 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_", [smalltalk.send(self, "_compiledSource", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);return smalltalk.send($rec, "_cr", []);})(aStream);})]);
  2477. return self;},
  2478. source: unescape('printString%0A%09%5E%20String%20streamContents%3A%20%5B%3AaStream%7C%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09nextPutAll%3A%20super%20printString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09nextPutAll%3A%20%27%28%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09nextPutAll%3A%20self%20compiledSource%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09nextPutAll%3A%20%27%29%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09cr.%0A%20%20%20%20%20%20%20%20%20%20%20%5D'),
  2479. messageSends: ["streamContents:", "nextPutAll:", "printString", "compiledSource", "cr"],
  2480. referencedClasses: [smalltalk.String]
  2481. }),
  2482. smalltalk.BlockClosure);
  2483. smalltalk.addMethod(
  2484. '_whileFalse',
  2485. smalltalk.method({
  2486. selector: 'whileFalse',
  2487. category: 'controlling',
  2488. fn: function (){
  2489. var self=this;
  2490. smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
  2491. return self;},
  2492. source: unescape('whileFalse%0A%09%22inlined%20in%20the%20Compiler%22%0A%09self%20whileFalse%3A%20%5B%5D'),
  2493. messageSends: ["whileFalse:"],
  2494. referencedClasses: []
  2495. }),
  2496. smalltalk.BlockClosure);
  2497. smalltalk.addMethod(
  2498. '_whileTrue',
  2499. smalltalk.method({
  2500. selector: 'whileTrue',
  2501. category: 'controlling',
  2502. fn: function (){
  2503. var self=this;
  2504. smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
  2505. return self;},
  2506. source: unescape('whileTrue%0A%09%22inlined%20in%20the%20Compiler%22%0A%09self%20whileTrue%3A%20%5B%5D'),
  2507. messageSends: ["whileTrue:"],
  2508. referencedClasses: []
  2509. }),
  2510. smalltalk.BlockClosure);
  2511. smalltalk.addMethod(
  2512. '_new',
  2513. smalltalk.method({
  2514. selector: 'new',
  2515. category: 'evaluating',
  2516. fn: function (){
  2517. var self=this;
  2518. return new self();
  2519. return self;},
  2520. source: unescape('new%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28%29%3E'),
  2521. messageSends: [],
  2522. referencedClasses: []
  2523. }),
  2524. smalltalk.BlockClosure);
  2525. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  2526. smalltalk.addMethod(
  2527. '__eq',
  2528. smalltalk.method({
  2529. selector: '=',
  2530. category: 'comparing',
  2531. fn: function (aBoolean){
  2532. var self=this;
  2533. return Boolean(self == true) == aBoolean;
  2534. return self;},
  2535. source: unescape('%3D%20aBoolean%0A%09%3Creturn%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%3E'),
  2536. messageSends: [],
  2537. referencedClasses: []
  2538. }),
  2539. smalltalk.Boolean);
  2540. smalltalk.addMethod(
  2541. '_shallowCopy',
  2542. smalltalk.method({
  2543. selector: 'shallowCopy',
  2544. category: 'copying',
  2545. fn: function (){
  2546. var self=this;
  2547. return self;
  2548. return self;},
  2549. source: unescape('shallowCopy%0A%09%5Eself'),
  2550. messageSends: [],
  2551. referencedClasses: []
  2552. }),
  2553. smalltalk.Boolean);
  2554. smalltalk.addMethod(
  2555. '_deepCopy',
  2556. smalltalk.method({
  2557. selector: 'deepCopy',
  2558. category: 'copying',
  2559. fn: function (){
  2560. var self=this;
  2561. return self;
  2562. return self;},
  2563. source: unescape('deepCopy%0A%09%5Eself'),
  2564. messageSends: [],
  2565. referencedClasses: []
  2566. }),
  2567. smalltalk.Boolean);
  2568. smalltalk.addMethod(
  2569. '_ifTrue_',
  2570. smalltalk.method({
  2571. selector: 'ifTrue:',
  2572. category: 'controlling',
  2573. fn: function (aBlock){
  2574. var self=this;
  2575. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  2576. return self;},
  2577. source: unescape('ifTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D'),
  2578. messageSends: ["ifTrue:ifFalse:"],
  2579. referencedClasses: []
  2580. }),
  2581. smalltalk.Boolean);
  2582. smalltalk.addMethod(
  2583. '_ifFalse_',
  2584. smalltalk.method({
  2585. selector: 'ifFalse:',
  2586. category: 'controlling',
  2587. fn: function (aBlock){
  2588. var self=this;
  2589. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  2590. return self;},
  2591. source: unescape('ifFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock'),
  2592. messageSends: ["ifTrue:ifFalse:"],
  2593. referencedClasses: []
  2594. }),
  2595. smalltalk.Boolean);
  2596. smalltalk.addMethod(
  2597. '_ifFalse_ifTrue_',
  2598. smalltalk.method({
  2599. selector: 'ifFalse:ifTrue:',
  2600. category: 'controlling',
  2601. fn: function (aBlock, anotherBlock){
  2602. var self=this;
  2603. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  2604. return self;},
  2605. source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock'),
  2606. messageSends: ["ifTrue:ifFalse:"],
  2607. referencedClasses: []
  2608. }),
  2609. smalltalk.Boolean);
  2610. smalltalk.addMethod(
  2611. '_ifTrue_ifFalse_',
  2612. smalltalk.method({
  2613. selector: 'ifTrue:ifFalse:',
  2614. category: 'controlling',
  2615. fn: function (aBlock, anotherBlock){
  2616. var self=this;
  2617. if(self == true) {
  2618. return aBlock();
  2619. } else {
  2620. return anotherBlock();
  2621. }
  2622. ;
  2623. return self;},
  2624. source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  2625. messageSends: [],
  2626. referencedClasses: []
  2627. }),
  2628. smalltalk.Boolean);
  2629. smalltalk.addMethod(
  2630. '_and_',
  2631. smalltalk.method({
  2632. selector: 'and:',
  2633. category: 'controlling',
  2634. fn: function (aBlock){
  2635. var self=this;
  2636. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  2637. return self;},
  2638. source: unescape('and%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20aBlock%0A%09%20%20%20%20ifFalse%3A%20%5Bfalse%5D'),
  2639. messageSends: ["ifTrue:ifFalse:", unescape("%3D")],
  2640. referencedClasses: []
  2641. }),
  2642. smalltalk.Boolean);
  2643. smalltalk.addMethod(
  2644. '_or_',
  2645. smalltalk.method({
  2646. selector: 'or:',
  2647. category: 'controlling',
  2648. fn: function (aBlock){
  2649. var self=this;
  2650. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  2651. return self;},
  2652. source: unescape('or%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20aBlock'),
  2653. messageSends: ["ifTrue:ifFalse:", unescape("%3D")],
  2654. referencedClasses: []
  2655. }),
  2656. smalltalk.Boolean);
  2657. smalltalk.addMethod(
  2658. '_not',
  2659. smalltalk.method({
  2660. selector: 'not',
  2661. category: 'controlling',
  2662. fn: function (){
  2663. var self=this;
  2664. return smalltalk.send(self, "__eq", [false]);
  2665. return self;},
  2666. source: unescape('not%0A%09%5Eself%20%3D%20false'),
  2667. messageSends: [unescape("%3D")],
  2668. referencedClasses: []
  2669. }),
  2670. smalltalk.Boolean);
  2671. smalltalk.addMethod(
  2672. '_printString',
  2673. smalltalk.method({
  2674. selector: 'printString',
  2675. category: 'printing',
  2676. fn: function (){
  2677. var self=this;
  2678. return self.toString();
  2679. return self;},
  2680. source: unescape('printString%0A%09%3Creturn%20self.toString%28%29%3E'),
  2681. messageSends: [],
  2682. referencedClasses: []
  2683. }),
  2684. smalltalk.Boolean);
  2685. smalltalk.addMethod(
  2686. '_asJSONObject',
  2687. smalltalk.method({
  2688. selector: 'asJSONObject',
  2689. category: 'comparing',
  2690. fn: function (){
  2691. var self=this;
  2692. return self;
  2693. return self;},
  2694. source: unescape('asJSONObject%0A%09%5Eself'),
  2695. messageSends: [],
  2696. referencedClasses: []
  2697. }),
  2698. smalltalk.Boolean);
  2699. smalltalk.addMethod(
  2700. '_&',
  2701. smalltalk.method({
  2702. selector: '&',
  2703. category: 'controlling',
  2704. fn: function (aBoolean){
  2705. var self=this;
  2706. if(self == true) {
  2707. return aBoolean;
  2708. } else {
  2709. return false;
  2710. }
  2711. ;
  2712. return self;},
  2713. source: unescape('%26%20aBoolean%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBoolean%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20false%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  2714. messageSends: [],
  2715. referencedClasses: []
  2716. }),
  2717. smalltalk.Boolean);
  2718. smalltalk.addMethod(
  2719. '_|',
  2720. smalltalk.method({
  2721. selector: '|',
  2722. category: 'controlling',
  2723. fn: function (aBoolean){
  2724. var self=this;
  2725. if(self == true) {
  2726. return true;
  2727. } else {
  2728. return aBoolean;
  2729. }
  2730. ;
  2731. return self;},
  2732. source: unescape('%7C%20aBoolean%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20true%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20aBoolean%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  2733. messageSends: [],
  2734. referencedClasses: []
  2735. }),
  2736. smalltalk.Boolean);
  2737. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  2738. smalltalk.Date.comment=unescape('The%20Date%20class%20is%20used%20to%20work%20with%20dates%20and%20times.')
  2739. smalltalk.addMethod(
  2740. '_year',
  2741. smalltalk.method({
  2742. selector: 'year',
  2743. category: 'accessing',
  2744. fn: function (){
  2745. var self=this;
  2746. return self.getFullYear();
  2747. return self;},
  2748. source: unescape('year%0A%09%3Creturn%20self.getFullYear%28%29%3E'),
  2749. messageSends: [],
  2750. referencedClasses: []
  2751. }),
  2752. smalltalk.Date);
  2753. smalltalk.addMethod(
  2754. '_month',
  2755. smalltalk.method({
  2756. selector: 'month',
  2757. category: 'accessing',
  2758. fn: function (){
  2759. var self=this;
  2760. return self.getMonth() + 1;
  2761. return self;},
  2762. source: unescape('month%0A%09%3Creturn%20self.getMonth%28%29%20+%201%3E'),
  2763. messageSends: [],
  2764. referencedClasses: []
  2765. }),
  2766. smalltalk.Date);
  2767. smalltalk.addMethod(
  2768. '_month_',
  2769. smalltalk.method({
  2770. selector: 'month:',
  2771. category: 'accessing',
  2772. fn: function (aNumber){
  2773. var self=this;
  2774. self.setMonth(aNumber - 1);
  2775. return self;},
  2776. source: unescape('month%3A%20aNumber%0A%09%3Cself.setMonth%28aNumber%20-%201%29%3E'),
  2777. messageSends: [],
  2778. referencedClasses: []
  2779. }),
  2780. smalltalk.Date);
  2781. smalltalk.addMethod(
  2782. '_day',
  2783. smalltalk.method({
  2784. selector: 'day',
  2785. category: 'accessing',
  2786. fn: function (){
  2787. var self=this;
  2788. return smalltalk.send(self, "_dayOfWeek", []);
  2789. return self;},
  2790. source: unescape('day%0A%09%5Eself%20dayOfWeek'),
  2791. messageSends: ["dayOfWeek"],
  2792. referencedClasses: []
  2793. }),
  2794. smalltalk.Date);
  2795. smalltalk.addMethod(
  2796. '_dayOfWeek',
  2797. smalltalk.method({
  2798. selector: 'dayOfWeek',
  2799. category: 'accessing',
  2800. fn: function (){
  2801. var self=this;
  2802. return self.getDay() + 1;
  2803. return self;},
  2804. source: unescape('dayOfWeek%0A%09%3Creturn%20self.getDay%28%29%20+%201%3E'),
  2805. messageSends: [],
  2806. referencedClasses: []
  2807. }),
  2808. smalltalk.Date);
  2809. smalltalk.addMethod(
  2810. '_dayOfWeek_',
  2811. smalltalk.method({
  2812. selector: 'dayOfWeek:',
  2813. category: 'accessing',
  2814. fn: function (aNumber){
  2815. var self=this;
  2816. return self.setDay(aNumber - 1);
  2817. return self;},
  2818. source: unescape('dayOfWeek%3A%20aNumber%0A%09%3Creturn%20self.setDay%28aNumber%20-%201%29%3E'),
  2819. messageSends: [],
  2820. referencedClasses: []
  2821. }),
  2822. smalltalk.Date);
  2823. smalltalk.addMethod(
  2824. '_day_',
  2825. smalltalk.method({
  2826. selector: 'day:',
  2827. category: 'accessing',
  2828. fn: function (aNumber){
  2829. var self=this;
  2830. smalltalk.send(self, "_day_", [aNumber]);
  2831. return self;},
  2832. source: unescape('day%3A%20aNumber%0A%09self%20day%3A%20aNumber'),
  2833. messageSends: ["day:"],
  2834. referencedClasses: []
  2835. }),
  2836. smalltalk.Date);
  2837. smalltalk.addMethod(
  2838. '_year_',
  2839. smalltalk.method({
  2840. selector: 'year:',
  2841. category: 'accessing',
  2842. fn: function (aNumber){
  2843. var self=this;
  2844. self.setFullYear(aNumber);
  2845. return self;},
  2846. source: unescape('year%3A%20aNumber%0A%09%3Cself.setFullYear%28aNumber%29%3E'),
  2847. messageSends: [],
  2848. referencedClasses: []
  2849. }),
  2850. smalltalk.Date);
  2851. smalltalk.addMethod(
  2852. '_dayOfMonth',
  2853. smalltalk.method({
  2854. selector: 'dayOfMonth',
  2855. category: 'accessing',
  2856. fn: function (){
  2857. var self=this;
  2858. return self.getDate();
  2859. return self;},
  2860. source: unescape('dayOfMonth%0A%09%3Creturn%20self.getDate%28%29%3E'),
  2861. messageSends: [],
  2862. referencedClasses: []
  2863. }),
  2864. smalltalk.Date);
  2865. smalltalk.addMethod(
  2866. '_dayOfMonth_',
  2867. smalltalk.method({
  2868. selector: 'dayOfMonth:',
  2869. category: 'accessing',
  2870. fn: function (aNumber){
  2871. var self=this;
  2872. self.setDate(aNumber);
  2873. return self;},
  2874. source: unescape('dayOfMonth%3A%20aNumber%0A%09%3Cself.setDate%28aNumber%29%3E'),
  2875. messageSends: [],
  2876. referencedClasses: []
  2877. }),
  2878. smalltalk.Date);
  2879. smalltalk.addMethod(
  2880. '_asString',
  2881. smalltalk.method({
  2882. selector: 'asString',
  2883. category: 'converting',
  2884. fn: function (){
  2885. var self=this;
  2886. return self.toString();
  2887. return self;},
  2888. source: unescape('asString%0A%09%3Creturn%20self.toString%28%29%3E'),
  2889. messageSends: [],
  2890. referencedClasses: []
  2891. }),
  2892. smalltalk.Date);
  2893. smalltalk.addMethod(
  2894. '_printString',
  2895. smalltalk.method({
  2896. selector: 'printString',
  2897. category: 'printing',
  2898. fn: function (){
  2899. var self=this;
  2900. return smalltalk.send(self, "_asString", []);
  2901. return self;},
  2902. source: unescape('printString%0A%09%5Eself%20asString'),
  2903. messageSends: ["asString"],
  2904. referencedClasses: []
  2905. }),
  2906. smalltalk.Date);
  2907. smalltalk.addMethod(
  2908. '_asMilliseconds',
  2909. smalltalk.method({
  2910. selector: 'asMilliseconds',
  2911. category: 'converting',
  2912. fn: function (){
  2913. var self=this;
  2914. return smalltalk.send(self, "_time", []);
  2915. return self;},
  2916. source: unescape('asMilliseconds%0A%09%5Eself%20time'),
  2917. messageSends: ["time"],
  2918. referencedClasses: []
  2919. }),
  2920. smalltalk.Date);
  2921. smalltalk.addMethod(
  2922. '_time',
  2923. smalltalk.method({
  2924. selector: 'time',
  2925. category: 'accessing',
  2926. fn: function (){
  2927. var self=this;
  2928. return self.getTime();
  2929. return self;},
  2930. source: unescape('time%0A%09%3Creturn%20self.getTime%28%29%3E'),
  2931. messageSends: [],
  2932. referencedClasses: []
  2933. }),
  2934. smalltalk.Date);
  2935. smalltalk.addMethod(
  2936. '_time_',
  2937. smalltalk.method({
  2938. selector: 'time:',
  2939. category: 'accessing',
  2940. fn: function (aNumber){
  2941. var self=this;
  2942. self.setTime(aNumber);
  2943. return self;},
  2944. source: unescape('time%3A%20aNumber%0A%09%3Cself.setTime%28aNumber%29%3E'),
  2945. messageSends: [],
  2946. referencedClasses: []
  2947. }),
  2948. smalltalk.Date);
  2949. smalltalk.addMethod(
  2950. '_asDateString',
  2951. smalltalk.method({
  2952. selector: 'asDateString',
  2953. category: 'converting',
  2954. fn: function (){
  2955. var self=this;
  2956. return self.toDateString();
  2957. return self;},
  2958. source: unescape('asDateString%0A%09%3Creturn%20self.toDateString%28%29%3E'),
  2959. messageSends: [],
  2960. referencedClasses: []
  2961. }),
  2962. smalltalk.Date);
  2963. smalltalk.addMethod(
  2964. '_asTimeString',
  2965. smalltalk.method({
  2966. selector: 'asTimeString',
  2967. category: 'converting',
  2968. fn: function (){
  2969. var self=this;
  2970. return self.toTimeString();
  2971. return self;},
  2972. source: unescape('asTimeString%0A%09%3Creturn%20self.toTimeString%28%29%3E'),
  2973. messageSends: [],
  2974. referencedClasses: []
  2975. }),
  2976. smalltalk.Date);
  2977. smalltalk.addMethod(
  2978. '_asLocaleString',
  2979. smalltalk.method({
  2980. selector: 'asLocaleString',
  2981. category: 'converting',
  2982. fn: function (){
  2983. var self=this;
  2984. return self.toLocaleString();
  2985. return self;},
  2986. source: unescape('asLocaleString%0A%09%3Creturn%20self.toLocaleString%28%29%3E'),
  2987. messageSends: [],
  2988. referencedClasses: []
  2989. }),
  2990. smalltalk.Date);
  2991. smalltalk.addMethod(
  2992. '_asNumber',
  2993. smalltalk.method({
  2994. selector: 'asNumber',
  2995. category: 'converting',
  2996. fn: function (){
  2997. var self=this;
  2998. return smalltalk.send(self, "_asMilliseconds", []);
  2999. return self;},
  3000. source: unescape('asNumber%0A%09%5Eself%20asMilliseconds'),
  3001. messageSends: ["asMilliseconds"],
  3002. referencedClasses: []
  3003. }),
  3004. smalltalk.Date);
  3005. smalltalk.addMethod(
  3006. '_hours_',
  3007. smalltalk.method({
  3008. selector: 'hours:',
  3009. category: 'accessing',
  3010. fn: function (aNumber){
  3011. var self=this;
  3012. self.setHours(aNumber);
  3013. return self;},
  3014. source: unescape('hours%3A%20aNumber%0A%09%3Cself.setHours%28aNumber%29%3E'),
  3015. messageSends: [],
  3016. referencedClasses: []
  3017. }),
  3018. smalltalk.Date);
  3019. smalltalk.addMethod(
  3020. '_minutes_',
  3021. smalltalk.method({
  3022. selector: 'minutes:',
  3023. category: 'accessing',
  3024. fn: function (aNumber){
  3025. var self=this;
  3026. self.setMinutes(aNumber);
  3027. return self;},
  3028. source: unescape('minutes%3A%20aNumber%0A%09%3Cself.setMinutes%28aNumber%29%3E'),
  3029. messageSends: [],
  3030. referencedClasses: []
  3031. }),
  3032. smalltalk.Date);
  3033. smalltalk.addMethod(
  3034. '_seconds_',
  3035. smalltalk.method({
  3036. selector: 'seconds:',
  3037. category: 'accessing',
  3038. fn: function (aNumber){
  3039. var self=this;
  3040. self.setSeconds(aNumber);
  3041. return self;},
  3042. source: unescape('seconds%3A%20aNumber%0A%09%3Cself.setSeconds%28aNumber%29%3E'),
  3043. messageSends: [],
  3044. referencedClasses: []
  3045. }),
  3046. smalltalk.Date);
  3047. smalltalk.addMethod(
  3048. '_milliseconds_',
  3049. smalltalk.method({
  3050. selector: 'milliseconds:',
  3051. category: 'accessing',
  3052. fn: function (aNumber){
  3053. var self=this;
  3054. self.setMilliseconds(aNumber);
  3055. return self;},
  3056. source: unescape('milliseconds%3A%20aNumber%0A%09%3Cself.setMilliseconds%28aNumber%29%3E'),
  3057. messageSends: [],
  3058. referencedClasses: []
  3059. }),
  3060. smalltalk.Date);
  3061. smalltalk.addMethod(
  3062. '_hours',
  3063. smalltalk.method({
  3064. selector: 'hours',
  3065. category: 'accessing',
  3066. fn: function (){
  3067. var self=this;
  3068. return self.getHours();
  3069. return self;},
  3070. source: unescape('hours%0A%09%3Creturn%20self.getHours%28%29%3E'),
  3071. messageSends: [],
  3072. referencedClasses: []
  3073. }),
  3074. smalltalk.Date);
  3075. smalltalk.addMethod(
  3076. '_minutes',
  3077. smalltalk.method({
  3078. selector: 'minutes',
  3079. category: 'accessing',
  3080. fn: function (){
  3081. var self=this;
  3082. return self.getMinutes();
  3083. return self;},
  3084. source: unescape('minutes%0A%09%3Creturn%20self.getMinutes%28%29%3E'),
  3085. messageSends: [],
  3086. referencedClasses: []
  3087. }),
  3088. smalltalk.Date);
  3089. smalltalk.addMethod(
  3090. '_seconds',
  3091. smalltalk.method({
  3092. selector: 'seconds',
  3093. category: 'accessing',
  3094. fn: function (){
  3095. var self=this;
  3096. return self.getSeconds();
  3097. return self;},
  3098. source: unescape('seconds%0A%09%3Creturn%20self.getSeconds%28%29%3E'),
  3099. messageSends: [],
  3100. referencedClasses: []
  3101. }),
  3102. smalltalk.Date);
  3103. smalltalk.addMethod(
  3104. '_milliseconds',
  3105. smalltalk.method({
  3106. selector: 'milliseconds',
  3107. category: 'accessing',
  3108. fn: function (){
  3109. var self=this;
  3110. return self.getMilliseconds();
  3111. return self;},
  3112. source: unescape('milliseconds%0A%09%3Creturn%20self.getMilliseconds%28%29%3E'),
  3113. messageSends: [],
  3114. referencedClasses: []
  3115. }),
  3116. smalltalk.Date);
  3117. smalltalk.addMethod(
  3118. '__lt',
  3119. smalltalk.method({
  3120. selector: '<',
  3121. category: 'comparing',
  3122. fn: function (aDate){
  3123. var self=this;
  3124. return self < aDate;
  3125. return self;},
  3126. source: unescape('%3C%20aDate%0A%09%3Creturn%20self%20%3C%20aDate%3E'),
  3127. messageSends: [],
  3128. referencedClasses: []
  3129. }),
  3130. smalltalk.Date);
  3131. smalltalk.addMethod(
  3132. '__gt',
  3133. smalltalk.method({
  3134. selector: '>',
  3135. category: 'comparing',
  3136. fn: function (aDate){
  3137. var self=this;
  3138. return self > aDate;
  3139. return self;},
  3140. source: unescape('%3E%20aDate%0A%09%3Creturn%20self%20%3E%3E%20aDate%3E'),
  3141. messageSends: [],
  3142. referencedClasses: []
  3143. }),
  3144. smalltalk.Date);
  3145. smalltalk.addMethod(
  3146. '__lt_eq',
  3147. smalltalk.method({
  3148. selector: '<=',
  3149. category: 'comparing',
  3150. fn: function (aDate){
  3151. var self=this;
  3152. self <= aDate;
  3153. return self;},
  3154. source: unescape('%3C%3D%20aDate%0A%09%3Cself%20%3C%3D%20aDate%3E'),
  3155. messageSends: [],
  3156. referencedClasses: []
  3157. }),
  3158. smalltalk.Date);
  3159. smalltalk.addMethod(
  3160. '__gt_eq',
  3161. smalltalk.method({
  3162. selector: '>=',
  3163. category: 'comparing',
  3164. fn: function (aDate){
  3165. var self=this;
  3166. self >= aDate;
  3167. return self;},
  3168. source: unescape('%3E%3D%20aDate%0A%09%3Cself%20%3E%3E%3D%20aDate%3E'),
  3169. messageSends: [],
  3170. referencedClasses: []
  3171. }),
  3172. smalltalk.Date);
  3173. smalltalk.addMethod(
  3174. '__minus',
  3175. smalltalk.method({
  3176. selector: '-',
  3177. category: 'arithmetic',
  3178. fn: function (aDate){
  3179. var self=this;
  3180. return self - aDate;
  3181. return self;},
  3182. source: unescape('-%20aDate%0A%09%3Creturn%20self%20-%20aDate%3E'),
  3183. messageSends: [],
  3184. referencedClasses: []
  3185. }),
  3186. smalltalk.Date);
  3187. smalltalk.addMethod(
  3188. '__plus',
  3189. smalltalk.method({
  3190. selector: '+',
  3191. category: 'arithmetic',
  3192. fn: function (aDate){
  3193. var self=this;
  3194. return self + aDate;
  3195. return self;},
  3196. source: unescape('+%20aDate%0A%09%3Creturn%20self%20+%20aDate%3E'),
  3197. messageSends: [],
  3198. referencedClasses: []
  3199. }),
  3200. smalltalk.Date);
  3201. smalltalk.addMethod(
  3202. '_asJSONObject',
  3203. smalltalk.method({
  3204. selector: 'asJSONObject',
  3205. category: 'converting',
  3206. fn: function (){
  3207. var self=this;
  3208. return self;
  3209. return self;},
  3210. source: unescape('asJSONObject%0A%09%5Eself'),
  3211. messageSends: [],
  3212. referencedClasses: []
  3213. }),
  3214. smalltalk.Date);
  3215. smalltalk.addMethod(
  3216. '_new_',
  3217. smalltalk.method({
  3218. selector: 'new:',
  3219. category: 'instance creation',
  3220. fn: function (anObject){
  3221. var self=this;
  3222. return new Date(anObject);
  3223. return self;},
  3224. source: unescape('new%3A%20anObject%0A%09%3Creturn%20new%20Date%28anObject%29%3E'),
  3225. messageSends: [],
  3226. referencedClasses: []
  3227. }),
  3228. smalltalk.Date.klass);
  3229. smalltalk.addMethod(
  3230. '_fromString_',
  3231. smalltalk.method({
  3232. selector: 'fromString:',
  3233. category: 'instance creation',
  3234. fn: function (aString){
  3235. var self=this;
  3236. return smalltalk.send(self, "_new_", [aString]);
  3237. return self;},
  3238. source: unescape('fromString%3A%20aString%0A%09%22Example%3A%20Date%20fromString%28%272011/04/15%2000%3A00%3A00%27%29%22%0A%09%5Eself%20new%3A%20aString'),
  3239. messageSends: ["new:"],
  3240. referencedClasses: []
  3241. }),
  3242. smalltalk.Date.klass);
  3243. smalltalk.addMethod(
  3244. '_fromSeconds_',
  3245. smalltalk.method({
  3246. selector: 'fromSeconds:',
  3247. category: 'instance creation',
  3248. fn: function (aNumber){
  3249. var self=this;
  3250. return smalltalk.send(self, "_fromMilliseconds_", [(($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])]);
  3251. return self;},
  3252. source: unescape('fromSeconds%3A%20aNumber%0A%09%5Eself%20fromMilliseconds%3A%20aNumber%20*%201000'),
  3253. messageSends: ["fromMilliseconds:", unescape("*")],
  3254. referencedClasses: []
  3255. }),
  3256. smalltalk.Date.klass);
  3257. smalltalk.addMethod(
  3258. '_fromMilliseconds_',
  3259. smalltalk.method({
  3260. selector: 'fromMilliseconds:',
  3261. category: 'instance creation',
  3262. fn: function (aNumber){
  3263. var self=this;
  3264. return smalltalk.send(self, "_new_", [aNumber]);
  3265. return self;},
  3266. source: unescape('fromMilliseconds%3A%20aNumber%0A%09%5Eself%20new%3A%20aNumber'),
  3267. messageSends: ["new:"],
  3268. referencedClasses: []
  3269. }),
  3270. smalltalk.Date.klass);
  3271. smalltalk.addMethod(
  3272. '_today',
  3273. smalltalk.method({
  3274. selector: 'today',
  3275. category: 'instance creation',
  3276. fn: function (){
  3277. var self=this;
  3278. return smalltalk.send(self, "_new", []);
  3279. return self;},
  3280. source: unescape('today%0A%09%5Eself%20new'),
  3281. messageSends: ["new"],
  3282. referencedClasses: []
  3283. }),
  3284. smalltalk.Date.klass);
  3285. smalltalk.addMethod(
  3286. '_now',
  3287. smalltalk.method({
  3288. selector: 'now',
  3289. category: 'instance creation',
  3290. fn: function (){
  3291. var self=this;
  3292. return smalltalk.send(self, "_today", []);
  3293. return self;},
  3294. source: unescape('now%0A%09%5Eself%20today'),
  3295. messageSends: ["today"],
  3296. referencedClasses: []
  3297. }),
  3298. smalltalk.Date.klass);
  3299. smalltalk.addMethod(
  3300. '_millisecondsToRun_',
  3301. smalltalk.method({
  3302. selector: 'millisecondsToRun:',
  3303. category: 'instance creation',
  3304. fn: function (aBlock){
  3305. var self=this;
  3306. var t=nil;
  3307. t=smalltalk.send((smalltalk.Date || Date), "_now", []);
  3308. smalltalk.send(aBlock, "_value", []);
  3309. return (($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]);
  3310. return self;},
  3311. source: unescape('millisecondsToRun%3A%20aBlock%0A%09%7C%20t%20%7C%0A%09t%20%3A%3D%20Date%20now.%0A%09aBlock%20value.%0A%09%5EDate%20now%20-%20t'),
  3312. messageSends: ["now", "value", unescape("-")],
  3313. referencedClasses: [smalltalk.Date]
  3314. }),
  3315. smalltalk.Date.klass);
  3316. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  3317. smalltalk.addMethod(
  3318. '_subclass_instanceVariableNames_',
  3319. smalltalk.method({
  3320. selector: 'subclass:instanceVariableNames:',
  3321. category: 'class creation',
  3322. fn: function (aString, anotherString){
  3323. var self=this;
  3324. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  3325. return self;},
  3326. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil'),
  3327. messageSends: ["subclass:instanceVariableNames:category:"],
  3328. referencedClasses: []
  3329. }),
  3330. smalltalk.UndefinedObject);
  3331. smalltalk.addMethod(
  3332. '_subclass_instanceVariableNames_category_',
  3333. smalltalk.method({
  3334. selector: 'subclass:instanceVariableNames:category:',
  3335. category: 'class creation',
  3336. fn: function (aString, aString2, aString3){
  3337. var self=this;
  3338. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  3339. return self;},
  3340. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3'),
  3341. messageSends: ["superclass:subclass:instanceVariableNames:category:", "new"],
  3342. referencedClasses: [smalltalk.nil]
  3343. }),
  3344. smalltalk.UndefinedObject);
  3345. smalltalk.addMethod(
  3346. '_shallowCopy',
  3347. smalltalk.method({
  3348. selector: 'shallowCopy',
  3349. category: 'copying',
  3350. fn: function (){
  3351. var self=this;
  3352. return self;
  3353. return self;},
  3354. source: unescape('shallowCopy%0A%09%5Eself'),
  3355. messageSends: [],
  3356. referencedClasses: []
  3357. }),
  3358. smalltalk.UndefinedObject);
  3359. smalltalk.addMethod(
  3360. '_deepCopy',
  3361. smalltalk.method({
  3362. selector: 'deepCopy',
  3363. category: 'copying',
  3364. fn: function (){
  3365. var self=this;
  3366. return self;
  3367. return self;},
  3368. source: unescape('deepCopy%0A%09%5Eself'),
  3369. messageSends: [],
  3370. referencedClasses: []
  3371. }),
  3372. smalltalk.UndefinedObject);
  3373. smalltalk.addMethod(
  3374. '_ifNil_',
  3375. smalltalk.method({
  3376. selector: 'ifNil:',
  3377. category: 'testing',
  3378. fn: function (aBlock){
  3379. var self=this;
  3380. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  3381. return self;},
  3382. source: unescape('ifNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D'),
  3383. messageSends: ["ifNil:ifNotNil:"],
  3384. referencedClasses: []
  3385. }),
  3386. smalltalk.UndefinedObject);
  3387. smalltalk.addMethod(
  3388. '_ifNotNil_',
  3389. smalltalk.method({
  3390. selector: 'ifNotNil:',
  3391. category: 'testing',
  3392. fn: function (aBlock){
  3393. var self=this;
  3394. return self;
  3395. return self;},
  3396. source: unescape('ifNotNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself'),
  3397. messageSends: [],
  3398. referencedClasses: []
  3399. }),
  3400. smalltalk.UndefinedObject);
  3401. smalltalk.addMethod(
  3402. '_ifNil_ifNotNil_',
  3403. smalltalk.method({
  3404. selector: 'ifNil:ifNotNil:',
  3405. category: 'testing',
  3406. fn: function (aBlock, anotherBlock){
  3407. var self=this;
  3408. return smalltalk.send(aBlock, "_value", []);
  3409. return self;},
  3410. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  3411. messageSends: ["value"],
  3412. referencedClasses: []
  3413. }),
  3414. smalltalk.UndefinedObject);
  3415. smalltalk.addMethod(
  3416. '_ifNotNil_ifNil_',
  3417. smalltalk.method({
  3418. selector: 'ifNotNil:ifNil:',
  3419. category: 'testing',
  3420. fn: function (aBlock, anotherBlock){
  3421. var self=this;
  3422. return smalltalk.send(anotherBlock, "_value", []);
  3423. return self;},
  3424. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EanotherBlock%20value'),
  3425. messageSends: ["value"],
  3426. referencedClasses: []
  3427. }),
  3428. smalltalk.UndefinedObject);
  3429. smalltalk.addMethod(
  3430. '_isNil',
  3431. smalltalk.method({
  3432. selector: 'isNil',
  3433. category: 'testing',
  3434. fn: function (){
  3435. var self=this;
  3436. return true;
  3437. return self;},
  3438. source: unescape('isNil%0A%09%5Etrue'),
  3439. messageSends: [],
  3440. referencedClasses: []
  3441. }),
  3442. smalltalk.UndefinedObject);
  3443. smalltalk.addMethod(
  3444. '_notNil',
  3445. smalltalk.method({
  3446. selector: 'notNil',
  3447. category: 'testing',
  3448. fn: function (){
  3449. var self=this;
  3450. return false;
  3451. return self;},
  3452. source: unescape('notNil%0A%09%5Efalse'),
  3453. messageSends: [],
  3454. referencedClasses: []
  3455. }),
  3456. smalltalk.UndefinedObject);
  3457. smalltalk.addMethod(
  3458. '_printString',
  3459. smalltalk.method({
  3460. selector: 'printString',
  3461. category: 'printing',
  3462. fn: function (){
  3463. var self=this;
  3464. return "nil";
  3465. return self;},
  3466. source: unescape('printString%0A%20%20%20%20%5E%27nil%27'),
  3467. messageSends: [],
  3468. referencedClasses: []
  3469. }),
  3470. smalltalk.UndefinedObject);
  3471. smalltalk.addMethod(
  3472. '_new',
  3473. smalltalk.method({
  3474. selector: 'new',
  3475. category: 'instance creation',
  3476. fn: function (){
  3477. var self=this;
  3478. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  3479. return self;},
  3480. source: unescape('new%0A%09%20%20%20%20self%20error%3A%20%27You%20cannot%20create%20new%20instances%20of%20UndefinedObject.%20Use%20nil%27'),
  3481. messageSends: ["error:"],
  3482. referencedClasses: []
  3483. }),
  3484. smalltalk.UndefinedObject.klass);
  3485. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  3486. smalltalk.addMethod(
  3487. '_size',
  3488. smalltalk.method({
  3489. selector: 'size',
  3490. category: 'accessing',
  3491. fn: function (){
  3492. var self=this;
  3493. smalltalk.send(self, "_subclassResponsibility", []);
  3494. return self;},
  3495. source: unescape('size%0A%09self%20subclassResponsibility'),
  3496. messageSends: ["subclassResponsibility"],
  3497. referencedClasses: []
  3498. }),
  3499. smalltalk.Collection);
  3500. smalltalk.addMethod(
  3501. '_readStream',
  3502. smalltalk.method({
  3503. selector: 'readStream',
  3504. category: 'accessing',
  3505. fn: function (){
  3506. var self=this;
  3507. return smalltalk.send(self, "_stream", []);
  3508. return self;},
  3509. source: unescape('readStream%0A%09%5Eself%20stream'),
  3510. messageSends: ["stream"],
  3511. referencedClasses: []
  3512. }),
  3513. smalltalk.Collection);
  3514. smalltalk.addMethod(
  3515. '_writeStream',
  3516. smalltalk.method({
  3517. selector: 'writeStream',
  3518. category: 'accessing',
  3519. fn: function (){
  3520. var self=this;
  3521. return smalltalk.send(self, "_stream", []);
  3522. return self;},
  3523. source: unescape('writeStream%0A%09%5Eself%20stream'),
  3524. messageSends: ["stream"],
  3525. referencedClasses: []
  3526. }),
  3527. smalltalk.Collection);
  3528. smalltalk.addMethod(
  3529. '_stream',
  3530. smalltalk.method({
  3531. selector: 'stream',
  3532. category: 'accessing',
  3533. fn: function (){
  3534. var self=this;
  3535. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  3536. return self;},
  3537. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self'),
  3538. messageSends: ["on:", "streamClass"],
  3539. referencedClasses: []
  3540. }),
  3541. smalltalk.Collection);
  3542. smalltalk.addMethod(
  3543. '_streamClass',
  3544. smalltalk.method({
  3545. selector: 'streamClass',
  3546. category: 'accessing',
  3547. fn: function (){
  3548. var self=this;
  3549. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  3550. return self;},
  3551. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass'),
  3552. messageSends: ["streamClass", "class"],
  3553. referencedClasses: []
  3554. }),
  3555. smalltalk.Collection);
  3556. smalltalk.addMethod(
  3557. '_add_',
  3558. smalltalk.method({
  3559. selector: 'add:',
  3560. category: 'adding/removing',
  3561. fn: function (anObject){
  3562. var self=this;
  3563. smalltalk.send(self, "_subclassResponsibility", []);
  3564. return self;},
  3565. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility'),
  3566. messageSends: ["subclassResponsibility"],
  3567. referencedClasses: []
  3568. }),
  3569. smalltalk.Collection);
  3570. smalltalk.addMethod(
  3571. '_addAll_',
  3572. smalltalk.method({
  3573. selector: 'addAll:',
  3574. category: 'adding/removing',
  3575. fn: function (aCollection){
  3576. var self=this;
  3577. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  3578. return aCollection;
  3579. return self;},
  3580. source: unescape('addAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20add%3A%20each%5D.%0A%09%5EaCollection'),
  3581. messageSends: ["do:", "add:"],
  3582. referencedClasses: []
  3583. }),
  3584. smalltalk.Collection);
  3585. smalltalk.addMethod(
  3586. '__comma',
  3587. smalltalk.method({
  3588. selector: ',',
  3589. category: 'copying',
  3590. fn: function (aCollection){
  3591. var self=this;
  3592. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  3593. return self;},
  3594. source: unescape('%2C%20aCollection%0A%09%5Eself%20copy%20%0A%09%20%20%20%20addAll%3A%20aCollection%3B%20%0A%09%20%20%20%20yourself'),
  3595. messageSends: ["addAll:", "yourself", "copy"],
  3596. referencedClasses: []
  3597. }),
  3598. smalltalk.Collection);
  3599. smalltalk.addMethod(
  3600. '_copyWith_',
  3601. smalltalk.method({
  3602. selector: 'copyWith:',
  3603. category: 'copying',
  3604. fn: function (anObject){
  3605. var self=this;
  3606. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  3607. return self;},
  3608. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself'),
  3609. messageSends: ["add:", "yourself", "copy"],
  3610. referencedClasses: []
  3611. }),
  3612. smalltalk.Collection);
  3613. smalltalk.addMethod(
  3614. '_copyWithAll_',
  3615. smalltalk.method({
  3616. selector: 'copyWithAll:',
  3617. category: 'copying',
  3618. fn: function (aCollection){
  3619. var self=this;
  3620. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  3621. return self;},
  3622. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself'),
  3623. messageSends: ["addAll:", "yourself", "copy"],
  3624. referencedClasses: []
  3625. }),
  3626. smalltalk.Collection);
  3627. smalltalk.addMethod(
  3628. '_asArray',
  3629. smalltalk.method({
  3630. selector: 'asArray',
  3631. category: 'converting',
  3632. fn: function (){
  3633. var self=this;
  3634. var array=nil;
  3635. var index=nil;
  3636. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  3637. index=(0);
  3638. 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]);})]);
  3639. return array;
  3640. return self;},
  3641. source: unescape('asArray%0A%09%7C%20array%20index%20%7C%0A%09array%20%3A%3D%20Array%20new.%0A%09index%20%3A%3D%200.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%20%20%20%20array%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Earray'),
  3642. messageSends: ["new", "do:", unescape("+"), "at:put:"],
  3643. referencedClasses: [smalltalk.Array]
  3644. }),
  3645. smalltalk.Collection);
  3646. smalltalk.addMethod(
  3647. '_do_',
  3648. smalltalk.method({
  3649. selector: 'do:',
  3650. category: 'enumerating',
  3651. fn: function (aBlock){
  3652. var self=this;
  3653. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  3654. return self;},
  3655. source: unescape('do%3A%20aBlock%0A%09%3Cfor%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%29%3B%7D%3E'),
  3656. messageSends: [],
  3657. referencedClasses: []
  3658. }),
  3659. smalltalk.Collection);
  3660. smalltalk.addMethod(
  3661. '_collect_',
  3662. smalltalk.method({
  3663. selector: 'collect:',
  3664. category: 'enumerating',
  3665. fn: function (aBlock){
  3666. var self=this;
  3667. var newCollection=nil;
  3668. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3669. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  3670. return newCollection;
  3671. return self;},
  3672. source: unescape('collect%3A%20aBlock%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20newCollection%20add%3A%20%28aBlock%20value%3A%20each%29%5D.%0A%09%5EnewCollection'),
  3673. messageSends: ["new", "class", "do:", "add:", "value:"],
  3674. referencedClasses: []
  3675. }),
  3676. smalltalk.Collection);
  3677. smalltalk.addMethod(
  3678. '_detect_',
  3679. smalltalk.method({
  3680. selector: 'detect:',
  3681. category: 'enumerating',
  3682. fn: function (aBlock){
  3683. var self=this;
  3684. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3685. return self;},
  3686. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D'),
  3687. messageSends: ["detect:ifNone:", "errorNotFound"],
  3688. referencedClasses: []
  3689. }),
  3690. smalltalk.Collection);
  3691. smalltalk.addMethod(
  3692. '_detect_ifNone_',
  3693. smalltalk.method({
  3694. selector: 'detect:ifNone:',
  3695. category: 'enumerating',
  3696. fn: function (aBlock, anotherBlock){
  3697. var self=this;
  3698. for(var i = 0; i < self.length; i++)
  3699. if(aBlock(self[i]))
  3700. return self[i];
  3701. return anotherBlock();
  3702. ;
  3703. return self;},
  3704. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%3C%0A%09%09for%28var%20i%20%3D%200%3B%20i%20%3C%20self.length%3B%20i++%29%0A%09%09%09if%28aBlock%28self%5Bi%5D%29%29%0A%09%09%09%09return%20self%5Bi%5D%3B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%3E'),
  3705. messageSends: [],
  3706. referencedClasses: []
  3707. }),
  3708. smalltalk.Collection);
  3709. smalltalk.addMethod(
  3710. '_do_separatedBy_',
  3711. smalltalk.method({
  3712. selector: 'do:separatedBy:',
  3713. category: 'enumerating',
  3714. fn: function (aBlock, anotherBlock){
  3715. var self=this;
  3716. var first=nil;
  3717. first=true;
  3718. 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]);})]);
  3719. return self;},
  3720. source: unescape('do%3A%20aBlock%20separatedBy%3A%20anotherBlock%0A%20%20%20%20%09%7C%20first%20%7C%0A%20%20%20%20%09first%20%3A%3D%20true.%0A%20%20%20%20%09self%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20first%0A%20%20%20%20%09%09ifTrue%3A%20%5Bfirst%20%3A%3D%20false%5D%0A%20%20%20%20%09%09ifFalse%3A%20%5BanotherBlock%20value%5D.%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%5D'),
  3721. messageSends: ["do:", "ifTrue:ifFalse:", "value", "value:"],
  3722. referencedClasses: []
  3723. }),
  3724. smalltalk.Collection);
  3725. smalltalk.addMethod(
  3726. '_inject_into_',
  3727. smalltalk.method({
  3728. selector: 'inject:into:',
  3729. category: 'enumerating',
  3730. fn: function (anObject, aBlock){
  3731. var self=this;
  3732. var result=nil;
  3733. result=anObject;
  3734. smalltalk.send(self, "_do_", [(function(each){return result=smalltalk.send(aBlock, "_value_value_", [result, each]);})]);
  3735. return result;
  3736. return self;},
  3737. source: unescape('inject%3A%20anObject%20into%3A%20aBlock%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20anObject.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%20%20%20%20result%20%3A%3D%20aBlock%20value%3A%20result%20value%3A%20each%5D.%0A%09%5Eresult'),
  3738. messageSends: ["do:", "value:value:"],
  3739. referencedClasses: []
  3740. }),
  3741. smalltalk.Collection);
  3742. smalltalk.addMethod(
  3743. '_reject_',
  3744. smalltalk.method({
  3745. selector: 'reject:',
  3746. category: 'enumerating',
  3747. fn: function (aBlock){
  3748. var self=this;
  3749. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  3750. return self;},
  3751. source: unescape('reject%3A%20aBlock%0A%09%5Eself%20select%3A%20%5B%3Aeach%20%7C%20%28aBlock%20value%3A%20each%29%20%3D%20false%5D'),
  3752. messageSends: ["select:", unescape("%3D"), "value:"],
  3753. referencedClasses: []
  3754. }),
  3755. smalltalk.Collection);
  3756. smalltalk.addMethod(
  3757. '_select_',
  3758. smalltalk.method({
  3759. selector: 'select:',
  3760. category: 'enumerating',
  3761. fn: function (aBlock){
  3762. var self=this;
  3763. var stream=nil;
  3764. stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  3765. 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]);})]);})]);
  3766. return smalltalk.send(stream, "_contents", []);
  3767. return self;},
  3768. source: unescape('select%3A%20aBlock%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20self%20class%20new%20writeStream.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20%28aBlock%20value%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09stream%20nextPut%3A%20each%5D%5D.%0A%09%5Estream%20contents'),
  3769. messageSends: ["writeStream", "new", "class", "do:", "ifTrue:", "value:", "nextPut:", "contents"],
  3770. referencedClasses: []
  3771. }),
  3772. smalltalk.Collection);
  3773. smalltalk.addMethod(
  3774. '_errorNotFound',
  3775. smalltalk.method({
  3776. selector: 'errorNotFound',
  3777. category: 'error handling',
  3778. fn: function (){
  3779. var self=this;
  3780. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  3781. return self;},
  3782. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27'),
  3783. messageSends: ["error:"],
  3784. referencedClasses: []
  3785. }),
  3786. smalltalk.Collection);
  3787. smalltalk.addMethod(
  3788. '_includes_',
  3789. smalltalk.method({
  3790. selector: 'includes:',
  3791. category: 'testing',
  3792. fn: function (anObject){
  3793. var self=this;
  3794. var i = self.length;
  3795. while (i--) {
  3796. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  3797. }
  3798. return false
  3799. ;
  3800. return self;},
  3801. source: unescape('includes%3A%20anObject%0A%09%3C%0A%09%09var%20i%20%3D%20self.length%3B%0A%09%09while%20%28i--%29%20%7B%0A%09%09%09if%20%28smalltalk.send%28self%5Bi%5D%2C%20%22__eq%22%2C%20%5BanObject%5D%29%29%20%7Breturn%20true%3B%7D%09%0A%09%09%7D%0A%09%09return%20false%0A%09%3E'),
  3802. messageSends: [],
  3803. referencedClasses: []
  3804. }),
  3805. smalltalk.Collection);
  3806. smalltalk.addMethod(
  3807. '_notEmpty',
  3808. smalltalk.method({
  3809. selector: 'notEmpty',
  3810. category: 'testing',
  3811. fn: function (){
  3812. var self=this;
  3813. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  3814. return self;},
  3815. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not'),
  3816. messageSends: ["not", "isEmpty"],
  3817. referencedClasses: []
  3818. }),
  3819. smalltalk.Collection);
  3820. smalltalk.addMethod(
  3821. '_isEmpty',
  3822. smalltalk.method({
  3823. selector: 'isEmpty',
  3824. category: 'testing',
  3825. fn: function (){
  3826. var self=this;
  3827. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  3828. return self;},
  3829. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200'),
  3830. messageSends: [unescape("%3D"), "size"],
  3831. referencedClasses: []
  3832. }),
  3833. smalltalk.Collection);
  3834. smalltalk.addMethod(
  3835. '_remove_',
  3836. smalltalk.method({
  3837. selector: 'remove:',
  3838. category: 'adding/removing',
  3839. fn: function (anObject){
  3840. var self=this;
  3841. smalltalk.send(self, "_subclassResponsibility", []);
  3842. return self;},
  3843. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20subclassResponsibility'),
  3844. messageSends: ["subclassResponsibility"],
  3845. referencedClasses: []
  3846. }),
  3847. smalltalk.Collection);
  3848. smalltalk.addMethod(
  3849. '_streamClass',
  3850. smalltalk.method({
  3851. selector: 'streamClass',
  3852. category: 'accessing',
  3853. fn: function (){
  3854. var self=this;
  3855. return (smalltalk.Stream || Stream);
  3856. return self;},
  3857. source: unescape('streamClass%0A%09%20%20%20%20%5EStream'),
  3858. messageSends: [],
  3859. referencedClasses: [smalltalk.nil]
  3860. }),
  3861. smalltalk.Collection.klass);
  3862. smalltalk.addMethod(
  3863. '_with_',
  3864. smalltalk.method({
  3865. selector: 'with:',
  3866. category: 'instance creation',
  3867. fn: function (anObject){
  3868. var self=this;
  3869. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3870. return self;},
  3871. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself'),
  3872. messageSends: ["add:", "yourself", "new"],
  3873. referencedClasses: []
  3874. }),
  3875. smalltalk.Collection.klass);
  3876. smalltalk.addMethod(
  3877. '_with_with_',
  3878. smalltalk.method({
  3879. selector: 'with:with:',
  3880. category: 'instance creation',
  3881. fn: function (anObject, anotherObject){
  3882. var self=this;
  3883. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3884. return self;},
  3885. source: unescape('with%3A%20anObject%20with%3A%20anotherObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09add%3A%20anotherObject%3B%0A%09%09yourself'),
  3886. messageSends: ["add:", "yourself", "new"],
  3887. referencedClasses: []
  3888. }),
  3889. smalltalk.Collection.klass);
  3890. smalltalk.addMethod(
  3891. '_with_with_with_',
  3892. smalltalk.method({
  3893. selector: 'with:with:with:',
  3894. category: 'instance creation',
  3895. fn: function (firstObject, secondObject, thirdObject){
  3896. var self=this;
  3897. 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", []));
  3898. return self;},
  3899. source: unescape('with%3A%20firstObject%20with%3A%20secondObject%20with%3A%20thirdObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20firstObject%3B%0A%09%09add%3A%20secondObject%3B%0A%09%09add%3A%20thirdObject%3B%0A%09%09yourself'),
  3900. messageSends: ["add:", "yourself", "new"],
  3901. referencedClasses: []
  3902. }),
  3903. smalltalk.Collection.klass);
  3904. smalltalk.addMethod(
  3905. '_withAll_',
  3906. smalltalk.method({
  3907. selector: 'withAll:',
  3908. category: 'instance creation',
  3909. fn: function (aCollection){
  3910. var self=this;
  3911. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3912. return self;},
  3913. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself'),
  3914. messageSends: ["addAll:", "yourself", "new"],
  3915. referencedClasses: []
  3916. }),
  3917. smalltalk.Collection.klass);
  3918. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel');
  3919. smalltalk.addMethod(
  3920. '_at_',
  3921. smalltalk.method({
  3922. selector: 'at:',
  3923. category: 'accessing',
  3924. fn: function (anIndex){
  3925. var self=this;
  3926. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3927. return self;},
  3928. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D'),
  3929. messageSends: ["at:ifAbsent:", "errorNotFound"],
  3930. referencedClasses: []
  3931. }),
  3932. smalltalk.SequenceableCollection);
  3933. smalltalk.addMethod(
  3934. '_at_ifAbsent_',
  3935. smalltalk.method({
  3936. selector: 'at:ifAbsent:',
  3937. category: 'accessing',
  3938. fn: function (anIndex, aBlock){
  3939. var self=this;
  3940. smalltalk.send(self, "_subclassResponsibility", []);
  3941. return self;},
  3942. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility'),
  3943. messageSends: ["subclassResponsibility"],
  3944. referencedClasses: []
  3945. }),
  3946. smalltalk.SequenceableCollection);
  3947. smalltalk.addMethod(
  3948. '_at_put_',
  3949. smalltalk.method({
  3950. selector: 'at:put:',
  3951. category: 'accessing',
  3952. fn: function (anIndex, anObject){
  3953. var self=this;
  3954. smalltalk.send(self, "_subclassResponsibility", []);
  3955. return self;},
  3956. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility'),
  3957. messageSends: ["subclassResponsibility"],
  3958. referencedClasses: []
  3959. }),
  3960. smalltalk.SequenceableCollection);
  3961. smalltalk.addMethod(
  3962. '_copyFrom_to_',
  3963. smalltalk.method({
  3964. selector: 'copyFrom:to:',
  3965. category: 'copying',
  3966. fn: function (anIndex, anotherIndex){
  3967. var self=this;
  3968. smalltalk.send(self, "_subclassResponsibility", []);
  3969. return self;},
  3970. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20subclassResponsibility'),
  3971. messageSends: ["subclassResponsibility"],
  3972. referencedClasses: []
  3973. }),
  3974. smalltalk.SequenceableCollection);
  3975. smalltalk.addMethod(
  3976. '_first',
  3977. smalltalk.method({
  3978. selector: 'first',
  3979. category: 'accessing',
  3980. fn: function (){
  3981. var self=this;
  3982. return smalltalk.send(self, "_at_", [(1)]);
  3983. return self;},
  3984. source: unescape('first%0A%09%5Eself%20at%3A%201'),
  3985. messageSends: ["at:"],
  3986. referencedClasses: []
  3987. }),
  3988. smalltalk.SequenceableCollection);
  3989. smalltalk.addMethod(
  3990. '_fourth',
  3991. smalltalk.method({
  3992. selector: 'fourth',
  3993. category: 'accessing',
  3994. fn: function (){
  3995. var self=this;
  3996. return smalltalk.send(self, "_at_", [(4)]);
  3997. return self;},
  3998. source: unescape('fourth%0A%09%5Eself%20at%3A%204'),
  3999. messageSends: ["at:"],
  4000. referencedClasses: []
  4001. }),
  4002. smalltalk.SequenceableCollection);
  4003. smalltalk.addMethod(
  4004. '_last',
  4005. smalltalk.method({
  4006. selector: 'last',
  4007. category: 'accessing',
  4008. fn: function (){
  4009. var self=this;
  4010. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  4011. return self;},
  4012. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size'),
  4013. messageSends: ["at:", "size"],
  4014. referencedClasses: []
  4015. }),
  4016. smalltalk.SequenceableCollection);
  4017. smalltalk.addMethod(
  4018. '_second',
  4019. smalltalk.method({
  4020. selector: 'second',
  4021. category: 'accessing',
  4022. fn: function (){
  4023. var self=this;
  4024. return smalltalk.send(self, "_at_", [(2)]);
  4025. return self;},
  4026. source: unescape('second%0A%09%5Eself%20at%3A%202'),
  4027. messageSends: ["at:"],
  4028. referencedClasses: []
  4029. }),
  4030. smalltalk.SequenceableCollection);
  4031. smalltalk.addMethod(
  4032. '_third',
  4033. smalltalk.method({
  4034. selector: 'third',
  4035. category: 'accessing',
  4036. fn: function (){
  4037. var self=this;
  4038. return smalltalk.send(self, "_at_", [(3)]);
  4039. return self;},
  4040. source: unescape('third%0A%09%5Eself%20at%3A%203'),
  4041. messageSends: ["at:"],
  4042. referencedClasses: []
  4043. }),
  4044. smalltalk.SequenceableCollection);
  4045. smalltalk.addMethod(
  4046. '_removeLast',
  4047. smalltalk.method({
  4048. selector: 'removeLast',
  4049. category: 'adding',
  4050. fn: function (){
  4051. var self=this;
  4052. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  4053. return self;},
  4054. source: unescape('removeLast%0A%09self%20remove%3A%20self%20last'),
  4055. messageSends: ["remove:", "last"],
  4056. referencedClasses: []
  4057. }),
  4058. smalltalk.SequenceableCollection);
  4059. smalltalk.addMethod(
  4060. '_addLast_',
  4061. smalltalk.method({
  4062. selector: 'addLast:',
  4063. category: 'adding',
  4064. fn: function (anObject){
  4065. var self=this;
  4066. smalltalk.send(self, "_add_", [anObject]);
  4067. return self;},
  4068. source: unescape('addLast%3A%20anObject%0A%09self%20add%3A%20anObject'),
  4069. messageSends: ["add:"],
  4070. referencedClasses: []
  4071. }),
  4072. smalltalk.SequenceableCollection);
  4073. smalltalk.addMethod(
  4074. '_withIndexDo_',
  4075. smalltalk.method({
  4076. selector: 'withIndexDo:',
  4077. category: 'enumerating',
  4078. fn: function (aBlock){
  4079. var self=this;
  4080. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  4081. return self;},
  4082. source: unescape('withIndexDo%3A%20aBlock%0A%09%3Cfor%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%2C%20i+1%29%3B%7D%3E'),
  4083. messageSends: [],
  4084. referencedClasses: []
  4085. }),
  4086. smalltalk.SequenceableCollection);
  4087. smalltalk.addMethod(
  4088. '_allButFirst',
  4089. smalltalk.method({
  4090. selector: 'allButFirst',
  4091. category: 'accessing',
  4092. fn: function (){
  4093. var self=this;
  4094. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  4095. return self;},
  4096. source: unescape('allButFirst%0A%09%5Eself%20copyFrom%3A%202%20to%3A%20self%20size'),
  4097. messageSends: ["copyFrom:to:", "size"],
  4098. referencedClasses: []
  4099. }),
  4100. smalltalk.SequenceableCollection);
  4101. smalltalk.addMethod(
  4102. '_allButLast',
  4103. smalltalk.method({
  4104. selector: 'allButLast',
  4105. category: 'accessing',
  4106. fn: function (){
  4107. var self=this;
  4108. return smalltalk.send(self, "_copyFrom_to_", [(1), (($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])]);
  4109. return self;},
  4110. source: unescape('allButLast%0A%09%5Eself%20copyFrom%3A%201%20to%3A%20self%20size%20-%201'),
  4111. messageSends: ["copyFrom:to:", unescape("-"), "size"],
  4112. referencedClasses: []
  4113. }),
  4114. smalltalk.SequenceableCollection);
  4115. smalltalk.addMethod(
  4116. '_indexOf_',
  4117. smalltalk.method({
  4118. selector: 'indexOf:',
  4119. category: 'accessing',
  4120. fn: function (anObject){
  4121. var self=this;
  4122. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  4123. return self;},
  4124. source: unescape('indexOf%3A%20anObject%0A%09%5Eself%20indexOf%3A%20anObject%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  4125. messageSends: ["indexOf:ifAbsent:", "errorNotFound"],
  4126. referencedClasses: []
  4127. }),
  4128. smalltalk.SequenceableCollection);
  4129. smalltalk.addMethod(
  4130. '_indexOf_ifAbsent_',
  4131. smalltalk.method({
  4132. selector: 'indexOf:ifAbsent:',
  4133. category: 'accessing',
  4134. fn: function (anObject, aBlock){
  4135. var self=this;
  4136. for(var i=0;i<self.length;i++){
  4137. if(self[i].__eq(anObject)) {return i+1}
  4138. }
  4139. return aBlock();
  4140. ;
  4141. return self;},
  4142. source: unescape('indexOf%3A%20anObject%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7B%0A%09%09%09if%28self%5Bi%5D.__eq%28anObject%29%29%20%7Breturn%20i+1%7D%0A%09%09%7D%0A%09%09return%20aBlock%28%29%3B%0A%09%3E'),
  4143. messageSends: [],
  4144. referencedClasses: []
  4145. }),
  4146. smalltalk.SequenceableCollection);
  4147. smalltalk.addClass('String', smalltalk.SequenceableCollection, [], 'Kernel');
  4148. smalltalk.addMethod(
  4149. '__eq',
  4150. smalltalk.method({
  4151. selector: '=',
  4152. category: 'comparing',
  4153. fn: function (aString){
  4154. var self=this;
  4155. return String(self) == aString;
  4156. return self;},
  4157. source: unescape('%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3D%3D%20aString%3E'),
  4158. messageSends: [],
  4159. referencedClasses: []
  4160. }),
  4161. smalltalk.String);
  4162. smalltalk.addMethod(
  4163. '_size',
  4164. smalltalk.method({
  4165. selector: 'size',
  4166. category: 'accessing',
  4167. fn: function (){
  4168. var self=this;
  4169. return self.length;
  4170. return self;},
  4171. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  4172. messageSends: [],
  4173. referencedClasses: []
  4174. }),
  4175. smalltalk.String);
  4176. smalltalk.addMethod(
  4177. '_at_',
  4178. smalltalk.method({
  4179. selector: 'at:',
  4180. category: 'accessing',
  4181. fn: function (anIndex){
  4182. var self=this;
  4183. return self[anIndex - 1];
  4184. return self;},
  4185. source: unescape('at%3A%20anIndex%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%3E'),
  4186. messageSends: [],
  4187. referencedClasses: []
  4188. }),
  4189. smalltalk.String);
  4190. smalltalk.addMethod(
  4191. '_at_put_',
  4192. smalltalk.method({
  4193. selector: 'at:put:',
  4194. category: 'accessing',
  4195. fn: function (anIndex, anObject){
  4196. var self=this;
  4197. smalltalk.send(self, "_errorReadOnly", []);
  4198. return self;},
  4199. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly'),
  4200. messageSends: ["errorReadOnly"],
  4201. referencedClasses: []
  4202. }),
  4203. smalltalk.String);
  4204. smalltalk.addMethod(
  4205. '_at_ifAbsent_',
  4206. smalltalk.method({
  4207. selector: 'at:ifAbsent:',
  4208. category: 'accessing',
  4209. fn: function (anIndex, aBlock){
  4210. var self=this;
  4211. (($receiver = smalltalk.send(self, "_at_", [anIndex])) == nil || $receiver == undefined) ? (function(){return aBlock;})() : $receiver;
  4212. return self;},
  4213. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%20%20%20%20%09%28self%20at%3A%20anIndex%29%20ifNil%3A%20%5BaBlock%5D'),
  4214. messageSends: ["ifNil:", "at:"],
  4215. referencedClasses: []
  4216. }),
  4217. smalltalk.String);
  4218. smalltalk.addMethod(
  4219. '_escaped',
  4220. smalltalk.method({
  4221. selector: 'escaped',
  4222. category: 'accessing',
  4223. fn: function (){
  4224. var self=this;
  4225. return escape(self);
  4226. return self;},
  4227. source: unescape('escaped%0A%09%3Creturn%20escape%28self%29%3E'),
  4228. messageSends: [],
  4229. referencedClasses: []
  4230. }),
  4231. smalltalk.String);
  4232. smalltalk.addMethod(
  4233. '_unescaped',
  4234. smalltalk.method({
  4235. selector: 'unescaped',
  4236. category: 'accessing',
  4237. fn: function (){
  4238. var self=this;
  4239. return unescape(self);
  4240. return self;},
  4241. source: unescape('unescaped%0A%09%3Creturn%20unescape%28self%29%3E'),
  4242. messageSends: [],
  4243. referencedClasses: []
  4244. }),
  4245. smalltalk.String);
  4246. smalltalk.addMethod(
  4247. '_add_',
  4248. smalltalk.method({
  4249. selector: 'add:',
  4250. category: 'adding',
  4251. fn: function (anObject){
  4252. var self=this;
  4253. smalltalk.send(self, "_errorReadOnly", []);
  4254. return self;},
  4255. source: unescape('add%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly'),
  4256. messageSends: ["errorReadOnly"],
  4257. referencedClasses: []
  4258. }),
  4259. smalltalk.String);
  4260. smalltalk.addMethod(
  4261. '__comma',
  4262. smalltalk.method({
  4263. selector: ',',
  4264. category: 'copying',
  4265. fn: function (aString){
  4266. var self=this;
  4267. return self + aString;
  4268. return self;},
  4269. source: unescape('%2C%20aString%0A%09%3Creturn%20self%20+%20aString%3E'),
  4270. messageSends: [],
  4271. referencedClasses: []
  4272. }),
  4273. smalltalk.String);
  4274. smalltalk.addMethod(
  4275. '_copyFrom_to_',
  4276. smalltalk.method({
  4277. selector: 'copyFrom:to:',
  4278. category: 'copying',
  4279. fn: function (anIndex, anotherIndex){
  4280. var self=this;
  4281. return self.substring(anIndex - 1, anotherIndex);
  4282. return self;},
  4283. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%3Creturn%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3E'),
  4284. messageSends: [],
  4285. referencedClasses: []
  4286. }),
  4287. smalltalk.String);
  4288. smalltalk.addMethod(
  4289. '_shallowCopy',
  4290. smalltalk.method({
  4291. selector: 'shallowCopy',
  4292. category: 'copying',
  4293. fn: function (){
  4294. var self=this;
  4295. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  4296. return self;},
  4297. source: unescape('shallowCopy%0A%20%20%20%20%09%5Eself%20class%20fromString%3A%20self'),
  4298. messageSends: ["fromString:", "class"],
  4299. referencedClasses: []
  4300. }),
  4301. smalltalk.String);
  4302. smalltalk.addMethod(
  4303. '_deepCopy',
  4304. smalltalk.method({
  4305. selector: 'deepCopy',
  4306. category: 'copying',
  4307. fn: function (){
  4308. var self=this;
  4309. return smalltalk.send(self, "_shallowCopy", []);
  4310. return self;},
  4311. source: unescape('deepCopy%0A%20%20%20%20%09%5Eself%20shallowCopy'),
  4312. messageSends: ["shallowCopy"],
  4313. referencedClasses: []
  4314. }),
  4315. smalltalk.String);
  4316. smalltalk.addMethod(
  4317. '_asSelector',
  4318. smalltalk.method({
  4319. selector: 'asSelector',
  4320. category: 'converting',
  4321. fn: function (){
  4322. var self=this;
  4323. var selector=nil;
  4324. selector=smalltalk.send("_", "__comma", [self]);
  4325. selector=smalltalk.send(selector, "_replace_with_", [":", "_"]);
  4326. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  4327. selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  4328. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  4329. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  4330. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  4331. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  4332. selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  4333. selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  4334. selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  4335. return selector;
  4336. return self;},
  4337. source: unescape('asSelector%0A%09%22If%20you%20change%20this%20method%2C%20change%20smalltalk.convertSelector%20too%20%28see%20js/boot.js%20file%29%22%0A%0A%09%7C%20selector%20%7C%0A%09selector%20%3A%3D%20%27_%27%2C%20self.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3A%27%20with%3A%20%27_%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B+%5D%27%20with%3A%20%27_plus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27-%27%20with%3A%20%27_minus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B*%5D%27%20with%3A%20%27_star%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B/%5D%27%20with%3A%20%27_slash%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3E%27%20with%3A%20%27_gt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3C%27%20with%3A%20%27_lt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3D%27%20with%3A%20%27_eq%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%2C%27%20with%3A%20%27_comma%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B@%5D%27%20with%3A%20%27_at%27.%0A%09%5Eselector'),
  4338. messageSends: [unescape("%2C"), "replace:with:"],
  4339. referencedClasses: []
  4340. }),
  4341. smalltalk.String);
  4342. smalltalk.addMethod(
  4343. '_asJavascript',
  4344. smalltalk.method({
  4345. selector: 'asJavascript',
  4346. category: 'converting',
  4347. fn: function (){
  4348. var self=this;
  4349. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  4350. return "unescape(\"" + escape(self) + "\")";
  4351. else
  4352. return "\"" + self + "\"";
  4353. ;
  4354. return self;},
  4355. source: unescape('asJavascript%0A%09%3C%0A%09%09if%28self.search%28/%5E%5Ba-zA-Z0-9_%3A.%24%20%5D*%24/%29%20%3D%3D%20-1%29%0A%09%09%09return%20%22unescape%28%5C%22%22%20+%20escape%28self%29%20+%20%22%5C%22%29%22%3B%0A%09%09else%0A%09%09%09return%20%22%5C%22%22%20+%20self%20+%20%22%5C%22%22%3B%0A%09%3E'),
  4356. messageSends: [],
  4357. referencedClasses: []
  4358. }),
  4359. smalltalk.String);
  4360. smalltalk.addMethod(
  4361. '_replace_with_',
  4362. smalltalk.method({
  4363. selector: 'replace:with:',
  4364. category: 'regular expressions',
  4365. fn: function (aString, anotherString){
  4366. var self=this;
  4367. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  4368. return self;},
  4369. source: unescape('replace%3A%20aString%20with%3A%20anotherString%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20aString%20flag%3A%20%27g%27%29%20with%3A%20anotherString'),
  4370. messageSends: ["replaceRegexp:with:", "fromString:flag:"],
  4371. referencedClasses: [smalltalk.RegularExpression]
  4372. }),
  4373. smalltalk.String);
  4374. smalltalk.addMethod(
  4375. '_replaceRegexp_with_',
  4376. smalltalk.method({
  4377. selector: 'replaceRegexp:with:',
  4378. category: 'regular expressions',
  4379. fn: function (aRegexp, aString){
  4380. var self=this;
  4381. return self.replace(aRegexp, aString);
  4382. return self;},
  4383. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%09%3Creturn%20self.replace%28aRegexp%2C%20aString%29%3E'),
  4384. messageSends: [],
  4385. referencedClasses: []
  4386. }),
  4387. smalltalk.String);
  4388. smalltalk.addMethod(
  4389. '_tokenize_',
  4390. smalltalk.method({
  4391. selector: 'tokenize:',
  4392. category: 'converting',
  4393. fn: function (aString){
  4394. var self=this;
  4395. return self.split(aString);
  4396. return self;},
  4397. source: unescape('tokenize%3A%20aString%0A%09%3Creturn%20self.split%28aString%29%3E'),
  4398. messageSends: [],
  4399. referencedClasses: []
  4400. }),
  4401. smalltalk.String);
  4402. smalltalk.addMethod(
  4403. '_match_',
  4404. smalltalk.method({
  4405. selector: 'match:',
  4406. category: 'regular expressions',
  4407. fn: function (aRegexp){
  4408. var self=this;
  4409. return self.search(aRegexp) != -1;
  4410. return self;},
  4411. source: unescape('match%3A%20aRegexp%0A%09%3Creturn%20self.search%28aRegexp%29%20%21%3D%20-1%3E'),
  4412. messageSends: [],
  4413. referencedClasses: []
  4414. }),
  4415. smalltalk.String);
  4416. smalltalk.addMethod(
  4417. '_asString',
  4418. smalltalk.method({
  4419. selector: 'asString',
  4420. category: 'converting',
  4421. fn: function (){
  4422. var self=this;
  4423. return self;
  4424. return self;},
  4425. source: unescape('asString%0A%20%20%20%20%09%5Eself'),
  4426. messageSends: [],
  4427. referencedClasses: []
  4428. }),
  4429. smalltalk.String);
  4430. smalltalk.addMethod(
  4431. '_asNumber',
  4432. smalltalk.method({
  4433. selector: 'asNumber',
  4434. category: 'converting',
  4435. fn: function (){
  4436. var self=this;
  4437. return Number(self);
  4438. return self;},
  4439. source: unescape('asNumber%0A%09%3Creturn%20Number%28self%29%3E'),
  4440. messageSends: [],
  4441. referencedClasses: []
  4442. }),
  4443. smalltalk.String);
  4444. smalltalk.addMethod(
  4445. '_asParser',
  4446. smalltalk.method({
  4447. selector: 'asParser',
  4448. category: 'converting',
  4449. fn: function (){
  4450. var self=this;
  4451. return smalltalk.send(smalltalk.send((smalltalk.PPStringParser || PPStringParser), "_new", []), "_string_", [self]);
  4452. return self;},
  4453. source: unescape('asParser%0A%20%20%20%20%09%5EPPStringParser%20new%20string%3A%20self'),
  4454. messageSends: ["string:", "new"],
  4455. referencedClasses: [smalltalk.nil]
  4456. }),
  4457. smalltalk.String);
  4458. smalltalk.addMethod(
  4459. '_asChoiceParser',
  4460. smalltalk.method({
  4461. selector: 'asChoiceParser',
  4462. category: 'converting',
  4463. fn: function (){
  4464. var self=this;
  4465. return smalltalk.send((smalltalk.PPChoiceParser || PPChoiceParser), "_withAll_", [smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asParser", []);})])]);
  4466. return self;},
  4467. source: unescape('asChoiceParser%0A%20%20%20%20%09%5EPPChoiceParser%20withAll%3A%20%28self%20asArray%20collect%3A%20%5B%3Aeach%20%7C%20each%20asParser%5D%29'),
  4468. messageSends: ["withAll:", "collect:", "asArray", "asParser"],
  4469. referencedClasses: [smalltalk.nil]
  4470. }),
  4471. smalltalk.String);
  4472. smalltalk.addMethod(
  4473. '_asCharacterParser',
  4474. smalltalk.method({
  4475. selector: 'asCharacterParser',
  4476. category: 'converting',
  4477. fn: function (){
  4478. var self=this;
  4479. return smalltalk.send(smalltalk.send((smalltalk.PPCharacterParser || PPCharacterParser), "_new", []), "_string_", [self]);
  4480. return self;},
  4481. source: unescape('asCharacterParser%0A%20%20%20%20%09%5EPPCharacterParser%20new%20string%3A%20self'),
  4482. messageSends: ["string:", "new"],
  4483. referencedClasses: [smalltalk.nil]
  4484. }),
  4485. smalltalk.String);
  4486. smalltalk.addMethod(
  4487. '_errorReadOnly',
  4488. smalltalk.method({
  4489. selector: 'errorReadOnly',
  4490. category: 'error handling',
  4491. fn: function (){
  4492. var self=this;
  4493. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  4494. return self;},
  4495. source: unescape('errorReadOnly%0A%20%20%20%20%09self%20error%3A%20%27Object%20is%20read-only%27'),
  4496. messageSends: ["error:"],
  4497. referencedClasses: []
  4498. }),
  4499. smalltalk.String);
  4500. smalltalk.addMethod(
  4501. '_printString',
  4502. smalltalk.method({
  4503. selector: 'printString',
  4504. category: 'printing',
  4505. fn: function (){
  4506. var self=this;
  4507. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  4508. return self;},
  4509. source: unescape('printString%0A%20%20%20%20%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27'),
  4510. messageSends: [unescape("%2C")],
  4511. referencedClasses: []
  4512. }),
  4513. smalltalk.String);
  4514. smalltalk.addMethod(
  4515. '_printNl',
  4516. smalltalk.method({
  4517. selector: 'printNl',
  4518. category: 'printing',
  4519. fn: function (){
  4520. var self=this;
  4521. console.log(self);
  4522. return self;},
  4523. source: unescape('printNl%0A%09%3Cconsole.log%28self%29%3E'),
  4524. messageSends: [],
  4525. referencedClasses: []
  4526. }),
  4527. smalltalk.String);
  4528. smalltalk.addMethod(
  4529. '_isString',
  4530. smalltalk.method({
  4531. selector: 'isString',
  4532. category: 'testing',
  4533. fn: function (){
  4534. var self=this;
  4535. return true;
  4536. return self;},
  4537. source: unescape('isString%0A%20%20%20%20%09%5Etrue'),
  4538. messageSends: [],
  4539. referencedClasses: []
  4540. }),
  4541. smalltalk.String);
  4542. smalltalk.addMethod(
  4543. '__gt',
  4544. smalltalk.method({
  4545. selector: '>',
  4546. category: 'comparing',
  4547. fn: function (aString){
  4548. var self=this;
  4549. return String(self) > aString;
  4550. return self;},
  4551. source: unescape('%3E%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%20aString%3E'),
  4552. messageSends: [],
  4553. referencedClasses: []
  4554. }),
  4555. smalltalk.String);
  4556. smalltalk.addMethod(
  4557. '__lt',
  4558. smalltalk.method({
  4559. selector: '<',
  4560. category: 'comparing',
  4561. fn: function (aString){
  4562. var self=this;
  4563. return String(self) < aString;
  4564. return self;},
  4565. source: unescape('%3C%20aString%0A%09%3Creturn%20String%28self%29%20%3C%20aString%3E'),
  4566. messageSends: [],
  4567. referencedClasses: []
  4568. }),
  4569. smalltalk.String);
  4570. smalltalk.addMethod(
  4571. '__gt_eq',
  4572. smalltalk.method({
  4573. selector: '>=',
  4574. category: 'comparing',
  4575. fn: function (aString){
  4576. var self=this;
  4577. return String(self) >= aString;
  4578. return self;},
  4579. source: unescape('%3E%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%3D%20aString%3E'),
  4580. messageSends: [],
  4581. referencedClasses: []
  4582. }),
  4583. smalltalk.String);
  4584. smalltalk.addMethod(
  4585. '__lt_eq',
  4586. smalltalk.method({
  4587. selector: '<=',
  4588. category: 'comparing',
  4589. fn: function (aString){
  4590. var self=this;
  4591. return String(self) <= aString;
  4592. return self;},
  4593. source: unescape('%3C%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3C%3D%20aString%3E'),
  4594. messageSends: [],
  4595. referencedClasses: []
  4596. }),
  4597. smalltalk.String);
  4598. smalltalk.addMethod(
  4599. '_remove_',
  4600. smalltalk.method({
  4601. selector: 'remove:',
  4602. category: 'adding',
  4603. fn: function (anObject){
  4604. var self=this;
  4605. smalltalk.send(self, "_errorReadOnly", []);
  4606. return self;},
  4607. source: unescape('remove%3A%20anObject%0A%09self%20errorReadOnly'),
  4608. messageSends: ["errorReadOnly"],
  4609. referencedClasses: []
  4610. }),
  4611. smalltalk.String);
  4612. smalltalk.addMethod(
  4613. '_asJSONObject',
  4614. smalltalk.method({
  4615. selector: 'asJSONObject',
  4616. category: 'converting',
  4617. fn: function (){
  4618. var self=this;
  4619. return self;
  4620. return self;},
  4621. source: unescape('asJSONObject%0A%09%5Eself'),
  4622. messageSends: [],
  4623. referencedClasses: []
  4624. }),
  4625. smalltalk.String);
  4626. smalltalk.addMethod(
  4627. '_trimLeft_',
  4628. smalltalk.method({
  4629. selector: 'trimLeft:',
  4630. category: 'regular expressions',
  4631. fn: function (separators){
  4632. var self=this;
  4633. 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"]), ""]);
  4634. return self;},
  4635. source: unescape('trimLeft%3A%20separators%0A%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20%27%5E%5B%27%2C%20separators%2C%20%27%5D+%27%20flag%3A%20%27g%27%29%20with%3A%20%27%27'),
  4636. messageSends: ["replaceRegexp:with:", "fromString:flag:", unescape("%2C")],
  4637. referencedClasses: [smalltalk.RegularExpression]
  4638. }),
  4639. smalltalk.String);
  4640. smalltalk.addMethod(
  4641. '_trimRight_',
  4642. smalltalk.method({
  4643. selector: 'trimRight:',
  4644. category: 'regular expressions',
  4645. fn: function (separators){
  4646. var self=this;
  4647. 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"]), ""]);
  4648. return self;},
  4649. source: unescape('trimRight%3A%20separators%0A%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20%27%5B%27%2C%20separators%2C%20%27%5D+%24%27%20flag%3A%20%27g%27%29%20with%3A%20%27%27'),
  4650. messageSends: ["replaceRegexp:with:", "fromString:flag:", unescape("%2C")],
  4651. referencedClasses: [smalltalk.RegularExpression]
  4652. }),
  4653. smalltalk.String);
  4654. smalltalk.addMethod(
  4655. '_trimLeft',
  4656. smalltalk.method({
  4657. selector: 'trimLeft',
  4658. category: 'regular expressions',
  4659. fn: function (){
  4660. var self=this;
  4661. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  4662. return self;},
  4663. source: unescape('trimLeft%0A%09%5Eself%20trimLeft%3A%20%27%5Cs%27'),
  4664. messageSends: ["trimLeft:"],
  4665. referencedClasses: []
  4666. }),
  4667. smalltalk.String);
  4668. smalltalk.addMethod(
  4669. '_trimRight',
  4670. smalltalk.method({
  4671. selector: 'trimRight',
  4672. category: 'regular expressions',
  4673. fn: function (){
  4674. var self=this;
  4675. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  4676. return self;},
  4677. source: unescape('trimRight%0A%09%5Eself%20trimRight%3A%20%27%5Cs%27'),
  4678. messageSends: ["trimRight:"],
  4679. referencedClasses: []
  4680. }),
  4681. smalltalk.String);
  4682. smalltalk.addMethod(
  4683. '_trimBoth',
  4684. smalltalk.method({
  4685. selector: 'trimBoth',
  4686. category: 'regular expressions',
  4687. fn: function (){
  4688. var self=this;
  4689. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  4690. return self;},
  4691. source: unescape('trimBoth%0A%09%5Eself%20trimBoth%3A%20%27%5Cs%27'),
  4692. messageSends: ["trimBoth:"],
  4693. referencedClasses: []
  4694. }),
  4695. smalltalk.String);
  4696. smalltalk.addMethod(
  4697. '_trimBoth_',
  4698. smalltalk.method({
  4699. selector: 'trimBoth:',
  4700. category: 'regular expressions',
  4701. fn: function (separators){
  4702. var self=this;
  4703. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  4704. return self;},
  4705. source: unescape('trimBoth%3A%20separators%0A%0A%20%20%20%20%09%5E%28self%20trimLeft%3A%20separators%29%20trimRight%3A%20separators'),
  4706. messageSends: ["trimRight:", "trimLeft:"],
  4707. referencedClasses: []
  4708. }),
  4709. smalltalk.String);
  4710. smalltalk.addMethod(
  4711. '_asLowercase',
  4712. smalltalk.method({
  4713. selector: 'asLowercase',
  4714. category: 'converting',
  4715. fn: function (){
  4716. var self=this;
  4717. return self.toLowerCase();
  4718. return self;},
  4719. source: unescape('asLowercase%0A%09%3Creturn%20self.toLowerCase%28%29%3E'),
  4720. messageSends: [],
  4721. referencedClasses: []
  4722. }),
  4723. smalltalk.String);
  4724. smalltalk.addMethod(
  4725. '_asUppercase',
  4726. smalltalk.method({
  4727. selector: 'asUppercase',
  4728. category: 'converting',
  4729. fn: function (){
  4730. var self=this;
  4731. return self.toUpperCase();
  4732. return self;},
  4733. source: unescape('asUppercase%0A%09%3Creturn%20self.toUpperCase%28%29%3E'),
  4734. messageSends: [],
  4735. referencedClasses: []
  4736. }),
  4737. smalltalk.String);
  4738. smalltalk.addMethod(
  4739. '_join_',
  4740. smalltalk.method({
  4741. selector: 'join:',
  4742. category: 'split join',
  4743. fn: function (aCollection){
  4744. var self=this;
  4745. 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]);})]);})]);
  4746. return self;},
  4747. source: unescape('join%3A%20aCollection%20%0A%09%5E%20String%0A%09%09streamContents%3A%20%5B%3Astream%20%7C%20aCollection%0A%09%09%09%09do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%20asString%5D%20%0A%09%09%09%09separatedBy%3A%20%5Bstream%20nextPutAll%3A%20self%5D%5D'),
  4748. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"],
  4749. referencedClasses: [smalltalk.String]
  4750. }),
  4751. smalltalk.String);
  4752. smalltalk.addMethod(
  4753. '_includesSubString_',
  4754. smalltalk.method({
  4755. selector: 'includesSubString:',
  4756. category: 'testing',
  4757. fn: function (subString){
  4758. var self=this;
  4759. return self.indexOf(subString) != -1 ;
  4760. return self;},
  4761. source: unescape('includesSubString%3A%20subString%0A%09%3C%20return%20self.indexOf%28subString%29%20%21%3D%20-1%20%3E'),
  4762. messageSends: [],
  4763. referencedClasses: []
  4764. }),
  4765. smalltalk.String);
  4766. smalltalk.addMethod(
  4767. '_asciiValue',
  4768. smalltalk.method({
  4769. selector: 'asciiValue',
  4770. category: 'accessing',
  4771. fn: function (){
  4772. var self=this;
  4773. return self.charCodeAt(0);;
  4774. return self;},
  4775. source: unescape('asciiValue%0A%09%3Creturn%20self.charCodeAt%280%29%3B%3E'),
  4776. messageSends: [],
  4777. referencedClasses: []
  4778. }),
  4779. smalltalk.String);
  4780. smalltalk.addMethod(
  4781. '_streamClass',
  4782. smalltalk.method({
  4783. selector: 'streamClass',
  4784. category: 'accessing',
  4785. fn: function (){
  4786. var self=this;
  4787. return (smalltalk.StringStream || StringStream);
  4788. return self;},
  4789. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream'),
  4790. messageSends: [],
  4791. referencedClasses: [smalltalk.nil]
  4792. }),
  4793. smalltalk.String.klass);
  4794. smalltalk.addMethod(
  4795. '_fromString_',
  4796. smalltalk.method({
  4797. selector: 'fromString:',
  4798. category: 'instance creation',
  4799. fn: function (aString){
  4800. var self=this;
  4801. return new self.fn(aString);
  4802. return self;},
  4803. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%3Creturn%20new%20self.fn%28aString%29%3E'),
  4804. messageSends: [],
  4805. referencedClasses: []
  4806. }),
  4807. smalltalk.String.klass);
  4808. smalltalk.addMethod(
  4809. '_cr',
  4810. smalltalk.method({
  4811. selector: 'cr',
  4812. category: 'accessing',
  4813. fn: function (){
  4814. var self=this;
  4815. return '\r';
  4816. return self;},
  4817. source: unescape('cr%0A%09%3Creturn%20%27%5Cr%27%3E'),
  4818. messageSends: [],
  4819. referencedClasses: []
  4820. }),
  4821. smalltalk.String.klass);
  4822. smalltalk.addMethod(
  4823. '_lf',
  4824. smalltalk.method({
  4825. selector: 'lf',
  4826. category: 'accessing',
  4827. fn: function (){
  4828. var self=this;
  4829. return '\n';
  4830. return self;},
  4831. source: unescape('lf%0A%09%3Creturn%20%27%5Cn%27%3E'),
  4832. messageSends: [],
  4833. referencedClasses: []
  4834. }),
  4835. smalltalk.String.klass);
  4836. smalltalk.addMethod(
  4837. '_space',
  4838. smalltalk.method({
  4839. selector: 'space',
  4840. category: 'accessing',
  4841. fn: function (){
  4842. var self=this;
  4843. return ' ';
  4844. return self;},
  4845. source: unescape('space%0A%09%3Creturn%20%27%20%27%3E'),
  4846. messageSends: [],
  4847. referencedClasses: []
  4848. }),
  4849. smalltalk.String.klass);
  4850. smalltalk.addMethod(
  4851. '_tab',
  4852. smalltalk.method({
  4853. selector: 'tab',
  4854. category: 'accessing',
  4855. fn: function (){
  4856. var self=this;
  4857. return '\t';
  4858. return self;},
  4859. source: unescape('tab%0A%09%3Creturn%20%27%5Ct%27%3E'),
  4860. messageSends: [],
  4861. referencedClasses: []
  4862. }),
  4863. smalltalk.String.klass);
  4864. smalltalk.addMethod(
  4865. '_crlf',
  4866. smalltalk.method({
  4867. selector: 'crlf',
  4868. category: 'accessing',
  4869. fn: function (){
  4870. var self=this;
  4871. return '\r\n';
  4872. return self;},
  4873. source: unescape('crlf%0A%09%3Creturn%20%27%5Cr%5Cn%27%3E'),
  4874. messageSends: [],
  4875. referencedClasses: []
  4876. }),
  4877. smalltalk.String.klass);
  4878. smalltalk.addMethod(
  4879. '_streamContents_',
  4880. smalltalk.method({
  4881. selector: 'streamContents:',
  4882. category: 'instance creation',
  4883. fn: function (blockWithArg){
  4884. var self=this;
  4885. var stream=nil;
  4886. stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]);
  4887. smalltalk.send(blockWithArg, "_value_", [stream]);
  4888. return smalltalk.send(stream, "_contents", []);
  4889. return self;},
  4890. source: unescape('streamContents%3A%20blockWithArg%0A%09%7Cstream%7C%0A%09stream%20%3A%3D%20%28self%20streamClass%20on%3A%20String%20new%29.%0A%09blockWithArg%20value%3A%20stream.%0A%09%5E%20stream%20contents'),
  4891. messageSends: ["on:", "streamClass", "new", "value:", "contents"],
  4892. referencedClasses: [smalltalk.String]
  4893. }),
  4894. smalltalk.String.klass);
  4895. smalltalk.addMethod(
  4896. '_value_',
  4897. smalltalk.method({
  4898. selector: 'value:',
  4899. category: 'instance creation',
  4900. fn: function (aUTFCharCode){
  4901. var self=this;
  4902. return String.fromCharCode(aUTFCharCode);;
  4903. return self;},
  4904. source: unescape('value%3A%20aUTFCharCode%0A%0A%09%3Creturn%20String.fromCharCode%28aUTFCharCode%29%3B%3E'),
  4905. messageSends: [],
  4906. referencedClasses: []
  4907. }),
  4908. smalltalk.String.klass);
  4909. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
  4910. smalltalk.addMethod(
  4911. '_size',
  4912. smalltalk.method({
  4913. selector: 'size',
  4914. category: 'accessing',
  4915. fn: function (){
  4916. var self=this;
  4917. return self.length;
  4918. return self;},
  4919. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  4920. messageSends: [],
  4921. referencedClasses: []
  4922. }),
  4923. smalltalk.Array);
  4924. smalltalk.addMethod(
  4925. '_at_put_',
  4926. smalltalk.method({
  4927. selector: 'at:put:',
  4928. category: 'accessing',
  4929. fn: function (anIndex, anObject){
  4930. var self=this;
  4931. return self[anIndex - 1] = anObject;
  4932. return self;},
  4933. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%3D%20anObject%3E'),
  4934. messageSends: [],
  4935. referencedClasses: []
  4936. }),
  4937. smalltalk.Array);
  4938. smalltalk.addMethod(
  4939. '_at_ifAbsent_',
  4940. smalltalk.method({
  4941. selector: 'at:ifAbsent:',
  4942. category: 'accessing',
  4943. fn: function (anIndex, aBlock){
  4944. var self=this;
  4945. var value = self[anIndex - 1];
  4946. if(value === undefined) {
  4947. return aBlock();
  4948. } else {
  4949. return value;
  4950. }
  4951. ;
  4952. return self;},
  4953. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%20%20%20%20var%20value%20%3D%20self%5BanIndex%20-%201%5D%3B%0A%09%20%20%20%20if%28value%20%3D%3D%3D%20undefined%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  4954. messageSends: [],
  4955. referencedClasses: []
  4956. }),
  4957. smalltalk.Array);
  4958. smalltalk.addMethod(
  4959. '_add_',
  4960. smalltalk.method({
  4961. selector: 'add:',
  4962. category: 'adding/removing',
  4963. fn: function (anObject){
  4964. var self=this;
  4965. self.push(anObject); return anObject;;
  4966. return self;},
  4967. source: unescape('add%3A%20anObject%0A%09%3Cself.push%28anObject%29%3B%20return%20anObject%3B%3E'),
  4968. messageSends: [],
  4969. referencedClasses: []
  4970. }),
  4971. smalltalk.Array);
  4972. smalltalk.addMethod(
  4973. '_shallowCopy',
  4974. smalltalk.method({
  4975. selector: 'shallowCopy',
  4976. category: 'copying',
  4977. fn: function (){
  4978. var self=this;
  4979. var newCollection=nil;
  4980. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4981. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  4982. return newCollection;
  4983. return self;},
  4984. source: unescape('shallowCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%5D.%0A%09%5EnewCollection'),
  4985. messageSends: ["new", "class", "do:", "add:"],
  4986. referencedClasses: []
  4987. }),
  4988. smalltalk.Array);
  4989. smalltalk.addMethod(
  4990. '_deepCopy',
  4991. smalltalk.method({
  4992. selector: 'deepCopy',
  4993. category: 'copying',
  4994. fn: function (){
  4995. var self=this;
  4996. var newCollection=nil;
  4997. newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4998. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);})]);
  4999. return newCollection;
  5000. return self;},
  5001. source: unescape('deepCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%20deepCopy%5D.%0A%09%5EnewCollection'),
  5002. messageSends: ["new", "class", "do:", "add:", "deepCopy"],
  5003. referencedClasses: []
  5004. }),
  5005. smalltalk.Array);
  5006. smalltalk.addMethod(
  5007. '_copyFrom_to_',
  5008. smalltalk.method({
  5009. selector: 'copyFrom:to:',
  5010. category: 'copying',
  5011. fn: function (anIndex, anotherIndex){
  5012. var self=this;
  5013. var array=nil;
  5014. array=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  5015. smalltalk.send(anIndex, "_to_do_", [anotherIndex, (function(each){return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);})]);
  5016. return array;
  5017. return self;},
  5018. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7C%20array%20%7C%0A%09array%20%3A%3D%20self%20class%20new.%0A%09anIndex%20to%3A%20anotherIndex%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20array%20add%3A%20%28self%20at%3A%20each%29%5D.%0A%09%5Earray'),
  5019. messageSends: ["new", "class", "to:do:", "add:", "at:"],
  5020. referencedClasses: []
  5021. }),
  5022. smalltalk.Array);
  5023. smalltalk.addMethod(
  5024. '_join_',
  5025. smalltalk.method({
  5026. selector: 'join:',
  5027. category: 'enumerating',
  5028. fn: function (aString){
  5029. var self=this;
  5030. return self.join(aString);
  5031. return self;},
  5032. source: unescape('join%3A%20aString%0A%09%3Creturn%20self.join%28aString%29%3E'),
  5033. messageSends: [],
  5034. referencedClasses: []
  5035. }),
  5036. smalltalk.Array);
  5037. smalltalk.addMethod(
  5038. '_asJavascript',
  5039. smalltalk.method({
  5040. selector: 'asJavascript',
  5041. category: 'converting',
  5042. fn: function (){
  5043. var self=this;
  5044. 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")]);
  5045. return self;},
  5046. source: unescape('asJavascript%0A%09%5E%27%5B%27%2C%20%28%28self%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJavascript%5D%29%20join%3A%20%27%2C%20%27%29%2C%20%20%27%5D%27'),
  5047. messageSends: [unescape("%2C"), "join:", "collect:", "asJavascript"],
  5048. referencedClasses: []
  5049. }),
  5050. smalltalk.Array);
  5051. smalltalk.addMethod(
  5052. '_sort',
  5053. smalltalk.method({
  5054. selector: 'sort',
  5055. category: 'enumerating',
  5056. fn: function (){
  5057. var self=this;
  5058. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  5059. return self;},
  5060. source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27'),
  5061. messageSends: ["basicPerform:"],
  5062. referencedClasses: []
  5063. }),
  5064. smalltalk.Array);
  5065. smalltalk.addMethod(
  5066. '_sort_',
  5067. smalltalk.method({
  5068. selector: 'sort:',
  5069. category: 'enumerating',
  5070. fn: function (aBlock){
  5071. var self=this;
  5072. return self.sort(function(a, b) {
  5073. if(aBlock(a,b)) {return -1} else {return 1}
  5074. })
  5075. ;
  5076. return self;},
  5077. source: unescape('sort%3A%20aBlock%0A%09%3C%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%20-1%7D%20else%20%7Breturn%201%7D%0A%09%09%7D%29%0A%09%3E'),
  5078. messageSends: [],
  5079. referencedClasses: []
  5080. }),
  5081. smalltalk.Array);
  5082. smalltalk.addMethod(
  5083. '_remove_',
  5084. smalltalk.method({
  5085. selector: 'remove:',
  5086. category: 'adding/removing',
  5087. fn: function (anObject){
  5088. var self=this;
  5089. for(var i=0;i<self.length;i++) {
  5090. if(self[i] == anObject) {
  5091. self.splice(i,1);
  5092. break;
  5093. }
  5094. }
  5095. ;
  5096. return self;},
  5097. source: unescape('remove%3A%20anObject%0A%09%3C%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09%09%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09%09%09self.splice%28i%2C1%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%3E'),
  5098. messageSends: [],
  5099. referencedClasses: []
  5100. }),
  5101. smalltalk.Array);
  5102. smalltalk.addMethod(
  5103. '_sorted',
  5104. smalltalk.method({
  5105. selector: 'sorted',
  5106. category: 'enumerating',
  5107. fn: function (){
  5108. var self=this;
  5109. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  5110. return self;},
  5111. source: unescape('sorted%0A%09%5Eself%20copy%20sort'),
  5112. messageSends: ["sort", "copy"],
  5113. referencedClasses: []
  5114. }),
  5115. smalltalk.Array);
  5116. smalltalk.addMethod(
  5117. '_sorted_',
  5118. smalltalk.method({
  5119. selector: 'sorted:',
  5120. category: 'enumerating',
  5121. fn: function (aBlock){
  5122. var self=this;
  5123. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  5124. return self;},
  5125. source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sort%3A%20aBlock'),
  5126. messageSends: ["sort:", "copy"],
  5127. referencedClasses: []
  5128. }),
  5129. smalltalk.Array);
  5130. smalltalk.addMethod(
  5131. '_asJSONObject',
  5132. smalltalk.method({
  5133. selector: 'asJSONObject',
  5134. category: 'converting',
  5135. fn: function (){
  5136. var self=this;
  5137. return smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONObject", []);})]);
  5138. return self;},
  5139. source: unescape('asJSONObject%0A%09%5Eself%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJSONObject%5D'),
  5140. messageSends: ["collect:", "asJSONObject"],
  5141. referencedClasses: []
  5142. }),
  5143. smalltalk.Array);
  5144. smalltalk.addMethod(
  5145. '_removeFrom_to_',
  5146. smalltalk.method({
  5147. selector: 'removeFrom:to:',
  5148. category: 'adding/removing',
  5149. fn: function (aNumber, anotherNumber){
  5150. var self=this;
  5151. self.splice(aNumber - 1,anotherNumber - 1);
  5152. return self;},
  5153. source: unescape('removeFrom%3A%20aNumber%20to%3A%20anotherNumber%0A%09%3Cself.splice%28aNumber%20-%201%2CanotherNumber%20-%201%29%3E'),
  5154. messageSends: [],
  5155. referencedClasses: []
  5156. }),
  5157. smalltalk.Array);
  5158. smalltalk.addMethod(
  5159. '_printString',
  5160. smalltalk.method({
  5161. selector: 'printString',
  5162. category: 'enumerating',
  5163. fn: function (){
  5164. var self=this;
  5165. var str=nil;
  5166. str=smalltalk.send("", "_writeStream", []);
  5167. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection), "__comma", [unescape("%20%28")])]);
  5168. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  5169. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  5170. return smalltalk.send(str, "_contents", []);
  5171. return self;},
  5172. source: unescape('printString%0A%09%7C%20str%20%7C%0A%09str%20%3A%3D%20%27%27%20writeStream.%0A%09str%20nextPutAll%3A%20super%20printString%2C%20%27%20%28%27.%0A%09self%20%0A%09%09do%3A%20%5B%3Aeach%20%7C%20str%20nextPutAll%3A%20each%20printString%5D%0A%09%09separatedBy%3A%20%5Bstr%20nextPutAll%3A%20%27%20%27%5D.%0A%09str%20nextPutAll%3A%20%27%29%27.%0A%09%5Estr%20contents'),
  5173. messageSends: ["writeStream", "nextPutAll:", unescape("%2C"), "printString", "do:separatedBy:", "contents"],
  5174. referencedClasses: []
  5175. }),
  5176. smalltalk.Array);
  5177. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  5178. smalltalk.addMethod(
  5179. '_compile_',
  5180. smalltalk.method({
  5181. selector: 'compile:',
  5182. category: 'evaluating',
  5183. fn: function (aString){
  5184. var self=this;
  5185. return self.compile(aString);
  5186. return self;},
  5187. source: unescape('compile%3A%20aString%0A%09%3Creturn%20self.compile%28aString%29%3E'),
  5188. messageSends: [],
  5189. referencedClasses: []
  5190. }),
  5191. smalltalk.RegularExpression);
  5192. smalltalk.addMethod(
  5193. '_exec_',
  5194. smalltalk.method({
  5195. selector: 'exec:',
  5196. category: 'evaluating',
  5197. fn: function (aString){
  5198. var self=this;
  5199. return self.exec(aString) || nil;
  5200. return self;},
  5201. source: unescape('exec%3A%20aString%0A%09%3Creturn%20self.exec%28aString%29%20%7C%7C%20nil%3E'),
  5202. messageSends: [],
  5203. referencedClasses: []
  5204. }),
  5205. smalltalk.RegularExpression);
  5206. smalltalk.addMethod(
  5207. '_test_',
  5208. smalltalk.method({
  5209. selector: 'test:',
  5210. category: 'evaluating',
  5211. fn: function (aString){
  5212. var self=this;
  5213. return self.test(aString);
  5214. return self;},
  5215. source: unescape('test%3A%20aString%0A%09%3Creturn%20self.test%28aString%29%3E'),
  5216. messageSends: [],
  5217. referencedClasses: []
  5218. }),
  5219. smalltalk.RegularExpression);
  5220. smalltalk.addMethod(
  5221. '_fromString_flag_',
  5222. smalltalk.method({
  5223. selector: 'fromString:flag:',
  5224. category: 'instance creation',
  5225. fn: function (aString, anotherString){
  5226. var self=this;
  5227. return new RegExp(aString, anotherString);
  5228. return self;},
  5229. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%3Creturn%20new%20RegExp%28aString%2C%20anotherString%29%3E'),
  5230. messageSends: [],
  5231. referencedClasses: []
  5232. }),
  5233. smalltalk.RegularExpression.klass);
  5234. smalltalk.addMethod(
  5235. '_fromString_',
  5236. smalltalk.method({
  5237. selector: 'fromString:',
  5238. category: 'instance creation',
  5239. fn: function (aString){
  5240. var self=this;
  5241. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  5242. return self;},
  5243. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27'),
  5244. messageSends: ["fromString:flag:"],
  5245. referencedClasses: []
  5246. }),
  5247. smalltalk.RegularExpression.klass);
  5248. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  5249. smalltalk.addMethod(
  5250. '_messageText',
  5251. smalltalk.method({
  5252. selector: 'messageText',
  5253. category: 'accessing',
  5254. fn: function (){
  5255. var self=this;
  5256. return self['@messageText'];
  5257. return self;},
  5258. source: unescape('messageText%0A%09%5EmessageText'),
  5259. messageSends: [],
  5260. referencedClasses: []
  5261. }),
  5262. smalltalk.Error);
  5263. smalltalk.addMethod(
  5264. '_messageText_',
  5265. smalltalk.method({
  5266. selector: 'messageText:',
  5267. category: 'accessing',
  5268. fn: function (aString){
  5269. var self=this;
  5270. self['@messageText']=aString;
  5271. return self;},
  5272. source: unescape('messageText%3A%20aString%0A%09messageText%20%3A%3D%20aString'),
  5273. messageSends: [],
  5274. referencedClasses: []
  5275. }),
  5276. smalltalk.Error);
  5277. smalltalk.addMethod(
  5278. '_signal',
  5279. smalltalk.method({
  5280. selector: 'signal',
  5281. category: 'signaling',
  5282. fn: function (){
  5283. var self=this;
  5284. self.context = thisContext; self.smalltalkError = true; throw(self);
  5285. return self;},
  5286. source: unescape('signal%0A%09%3Cself.context%20%3D%20thisContext%3B%20self.smalltalkError%20%3D%20true%3B%20throw%28self%29%3E'),
  5287. messageSends: [],
  5288. referencedClasses: []
  5289. }),
  5290. smalltalk.Error);
  5291. smalltalk.addMethod(
  5292. '_context',
  5293. smalltalk.method({
  5294. selector: 'context',
  5295. category: 'accessing',
  5296. fn: function (){
  5297. var self=this;
  5298. return self.context;
  5299. return self;},
  5300. source: unescape('context%0A%09%3Creturn%20self.context%3E'),
  5301. messageSends: [],
  5302. referencedClasses: []
  5303. }),
  5304. smalltalk.Error);
  5305. smalltalk.addMethod(
  5306. '_signal_',
  5307. smalltalk.method({
  5308. selector: 'signal:',
  5309. category: 'instance creation',
  5310. fn: function (aString){
  5311. var self=this;
  5312. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  5313. return self;},
  5314. source: unescape('signal%3A%20aString%0A%09%20%20%20%20%5Eself%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal'),
  5315. messageSends: ["messageText:", "signal", "new"],
  5316. referencedClasses: []
  5317. }),
  5318. smalltalk.Error.klass);
  5319. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel');
  5320. smalltalk.addMethod(
  5321. '_receiver',
  5322. smalltalk.method({
  5323. selector: 'receiver',
  5324. category: 'accessing',
  5325. fn: function (){
  5326. var self=this;
  5327. return self.receiver;
  5328. return self;},
  5329. source: unescape('receiver%0A%09%3Creturn%20self.receiver%3E'),
  5330. messageSends: [],
  5331. referencedClasses: []
  5332. }),
  5333. smalltalk.MethodContext);
  5334. smalltalk.addMethod(
  5335. '_selector',
  5336. smalltalk.method({
  5337. selector: 'selector',
  5338. category: 'accessing',
  5339. fn: function (){
  5340. var self=this;
  5341. return smalltalk.convertSelector(self.selector);
  5342. return self;},
  5343. source: unescape('selector%0A%09%3Creturn%20smalltalk.convertSelector%28self.selector%29%3E'),
  5344. messageSends: [],
  5345. referencedClasses: []
  5346. }),
  5347. smalltalk.MethodContext);
  5348. smalltalk.addMethod(
  5349. '_home',
  5350. smalltalk.method({
  5351. selector: 'home',
  5352. category: 'accessing',
  5353. fn: function (){
  5354. var self=this;
  5355. return self.homeContext;
  5356. return self;},
  5357. source: unescape('home%0A%09%3Creturn%20self.homeContext%3E'),
  5358. messageSends: [],
  5359. referencedClasses: []
  5360. }),
  5361. smalltalk.MethodContext);
  5362. smalltalk.addMethod(
  5363. '_temps',
  5364. smalltalk.method({
  5365. selector: 'temps',
  5366. category: 'accessing',
  5367. fn: function (){
  5368. var self=this;
  5369. return self.temps;
  5370. return self;},
  5371. source: unescape('temps%0A%09%3Creturn%20self.temps%3E'),
  5372. messageSends: [],
  5373. referencedClasses: []
  5374. }),
  5375. smalltalk.MethodContext);
  5376. smalltalk.addMethod(
  5377. '_printString',
  5378. smalltalk.method({
  5379. selector: 'printString',
  5380. category: 'accessing',
  5381. fn: function (){
  5382. var self=this;
  5383. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  5384. return self;},
  5385. source: unescape('printString%0A%09%5Esuper%20printString%2C%20%27%28%27%2C%20self%20asString%2C%20%27%29%27'),
  5386. messageSends: [unescape("%2C"), "printString", "asString"],
  5387. referencedClasses: []
  5388. }),
  5389. smalltalk.MethodContext);
  5390. smalltalk.addMethod(
  5391. '_asString',
  5392. smalltalk.method({
  5393. selector: 'asString',
  5394. category: 'accessing',
  5395. fn: function (){
  5396. var self=this;
  5397. 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", [])]);
  5398. return self;},
  5399. source: unescape('asString%0A%09%5Eself%20receiver%20class%20printString%2C%20%27%20%3E%3E%20%27%2C%20self%20selector'),
  5400. messageSends: [unescape("%2C"), "printString", "class", "receiver", "selector"],
  5401. referencedClasses: []
  5402. }),
  5403. smalltalk.MethodContext);
  5404. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  5405. smalltalk.addMethod(
  5406. '__eq',
  5407. smalltalk.method({
  5408. selector: '=',
  5409. category: 'comparing',
  5410. fn: function (anAssociation){
  5411. var self=this;
  5412. 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", [])]);})]);})]);
  5413. return self;},
  5414. source: unescape('%3D%20anAssociation%0A%09%5Eself%20class%20%3D%20anAssociation%20class%20and%3A%20%5B%0A%09%20%20%20%20self%20key%20%3D%20anAssociation%20key%20and%3A%20%5B%0A%09%09self%20value%20%3D%20anAssociation%20value%5D%5D'),
  5415. messageSends: ["and:", unescape("%3D"), "class", "key", "value"],
  5416. referencedClasses: []
  5417. }),
  5418. smalltalk.Association);
  5419. smalltalk.addMethod(
  5420. '_key_',
  5421. smalltalk.method({
  5422. selector: 'key:',
  5423. category: 'accessing',
  5424. fn: function (aKey){
  5425. var self=this;
  5426. self['@key']=aKey;
  5427. return self;},
  5428. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey'),
  5429. messageSends: [],
  5430. referencedClasses: []
  5431. }),
  5432. smalltalk.Association);
  5433. smalltalk.addMethod(
  5434. '_key',
  5435. smalltalk.method({
  5436. selector: 'key',
  5437. category: 'accessing',
  5438. fn: function (){
  5439. var self=this;
  5440. return self['@key'];
  5441. return self;},
  5442. source: unescape('key%0A%09%5Ekey'),
  5443. messageSends: [],
  5444. referencedClasses: []
  5445. }),
  5446. smalltalk.Association);
  5447. smalltalk.addMethod(
  5448. '_value_',
  5449. smalltalk.method({
  5450. selector: 'value:',
  5451. category: 'accessing',
  5452. fn: function (aValue){
  5453. var self=this;
  5454. self['@value']=aValue;
  5455. return self;},
  5456. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue'),
  5457. messageSends: [],
  5458. referencedClasses: []
  5459. }),
  5460. smalltalk.Association);
  5461. smalltalk.addMethod(
  5462. '_value',
  5463. smalltalk.method({
  5464. selector: 'value',
  5465. category: 'accessing',
  5466. fn: function (){
  5467. var self=this;
  5468. return self['@value'];
  5469. return self;},
  5470. source: unescape('value%0A%09%5Evalue'),
  5471. messageSends: [],
  5472. referencedClasses: []
  5473. }),
  5474. smalltalk.Association);
  5475. smalltalk.addMethod(
  5476. '_key_value_',
  5477. smalltalk.method({
  5478. selector: 'key:value:',
  5479. category: 'instance creation',
  5480. fn: function (aKey, aValue){
  5481. var self=this;
  5482. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5483. return self;},
  5484. source: unescape('key%3A%20aKey%20value%3A%20aValue%0A%09%20%20%20%20%5Eself%20new%0A%09%09key%3A%20aKey%3B%0A%09%09value%3A%20aValue%3B%0A%09%09yourself'),
  5485. messageSends: ["key:", "value:", "yourself", "new"],
  5486. referencedClasses: []
  5487. }),
  5488. smalltalk.Association.klass);
  5489. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  5490. smalltalk.addMethod(
  5491. '__eq',
  5492. smalltalk.method({
  5493. selector: '=',
  5494. category: 'comparing',
  5495. fn: function (aDictionary){
  5496. var self=this;
  5497. 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}})})();})]);
  5498. smalltalk.send(self, "_associationsDo_", [(function(assoc){return (($receiver = smalltalk.send(smalltalk.send(aDictionary, "_at_ifAbsent_", [smalltalk.send(assoc, "_key", []), (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]), "__eq", [smalltalk.send(assoc, "_value", [])])).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}})})();})]);})]);
  5499. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  5500. return self;
  5501. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  5502. source: unescape('%3D%20aDictionary%0A%09self%20class%20%3D%20aDictionary%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20associationsDo%3A%20%5B%3Aassoc%20%7C%0A%09%20%20%20%20%28aDictionary%20at%3A%20assoc%20key%20ifAbsent%3A%20%5B%5Efalse%5D%29%20%3D%20assoc%20value%20%0A%09%09ifFalse%3A%20%5B%5Efalse%5D%5D.%0A%09%5Etrue'),
  5503. messageSends: ["ifFalse:", unescape("%3D"), "class", "associationsDo:", "at:ifAbsent:", "key", "value"],
  5504. referencedClasses: []
  5505. }),
  5506. smalltalk.Dictionary);
  5507. smalltalk.addMethod(
  5508. '_shallowCopy',
  5509. smalltalk.method({
  5510. selector: 'shallowCopy',
  5511. category: 'copying',
  5512. fn: function (){
  5513. var self=this;
  5514. var copy=nil;
  5515. copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  5516. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  5517. return copy;
  5518. return self;},
  5519. source: unescape('shallowCopy%0A%09%7C%20copy%20%7C%0A%09copy%20%3A%3D%20self%20class%20new.%0A%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20copy%20at%3A%20each%20key%20%20put%3A%20each%20value%5D.%0A%09%5Ecopy'),
  5520. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "value"],
  5521. referencedClasses: []
  5522. }),
  5523. smalltalk.Dictionary);
  5524. smalltalk.addMethod(
  5525. '_initialize',
  5526. smalltalk.method({
  5527. selector: 'initialize',
  5528. category: 'initialization',
  5529. fn: function (){
  5530. var self=this;
  5531. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  5532. self['@keys']=[];
  5533. return self;},
  5534. source: unescape('initialize%0A%20%20%20%20%09super%20initialize.%0A%20%20%20%20%09keys%20%3A%3D%20%23%28%29'),
  5535. messageSends: ["initialize"],
  5536. referencedClasses: []
  5537. }),
  5538. smalltalk.Dictionary);
  5539. smalltalk.addMethod(
  5540. '_size',
  5541. smalltalk.method({
  5542. selector: 'size',
  5543. category: 'accessing',
  5544. fn: function (){
  5545. var self=this;
  5546. return smalltalk.send(self['@keys'], "_size", []);
  5547. return self;},
  5548. source: unescape('size%0A%09%5Ekeys%20size'),
  5549. messageSends: ["size"],
  5550. referencedClasses: []
  5551. }),
  5552. smalltalk.Dictionary);
  5553. smalltalk.addMethod(
  5554. '_associations',
  5555. smalltalk.method({
  5556. selector: 'associations',
  5557. category: 'accessing',
  5558. fn: function (){
  5559. var self=this;
  5560. var associations=nil;
  5561. associations=[];
  5562. 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])])]);})]);
  5563. return associations;
  5564. return self;},
  5565. source: unescape('associations%0A%09%7C%20associations%20%7C%0A%09associations%20%3A%3D%20%23%28%29.%0A%09keys%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20associations%20add%3A%20%28Association%20key%3A%20each%20value%3A%20%28self%20at%3A%20each%29%29%5D.%0A%09%5Eassociations'),
  5566. messageSends: ["do:", "add:", "key:value:", "at:"],
  5567. referencedClasses: [smalltalk.Association]
  5568. }),
  5569. smalltalk.Dictionary);
  5570. smalltalk.addMethod(
  5571. '_keys',
  5572. smalltalk.method({
  5573. selector: 'keys',
  5574. category: 'accessing',
  5575. fn: function (){
  5576. var self=this;
  5577. return smalltalk.send(self['@keys'], "_copy", []);
  5578. return self;},
  5579. source: unescape('keys%0A%09%5Ekeys%20copy'),
  5580. messageSends: ["copy"],
  5581. referencedClasses: []
  5582. }),
  5583. smalltalk.Dictionary);
  5584. smalltalk.addMethod(
  5585. '_values',
  5586. smalltalk.method({
  5587. selector: 'values',
  5588. category: 'accessing',
  5589. fn: function (){
  5590. var self=this;
  5591. return smalltalk.send(self['@keys'], "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  5592. return self;},
  5593. source: unescape('values%0A%20%20%20%20%09%5Ekeys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D'),
  5594. messageSends: ["collect:", "at:"],
  5595. referencedClasses: []
  5596. }),
  5597. smalltalk.Dictionary);
  5598. smalltalk.addMethod(
  5599. '_at_put_',
  5600. smalltalk.method({
  5601. selector: 'at:put:',
  5602. category: 'accessing',
  5603. fn: function (aKey, aValue){
  5604. var self=this;
  5605. (($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]);})]);
  5606. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  5607. return self;},
  5608. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%28keys%20includes%3A%20aKey%29%20ifFalse%3A%20%5Bkeys%20add%3A%20aKey%5D.%0A%09%5Eself%20basicAt%3A%20aKey%20put%3A%20aValue'),
  5609. messageSends: ["ifFalse:", "includes:", "add:", "basicAt:put:"],
  5610. referencedClasses: []
  5611. }),
  5612. smalltalk.Dictionary);
  5613. smalltalk.addMethod(
  5614. '_at_ifAbsent_',
  5615. smalltalk.method({
  5616. selector: 'at:ifAbsent:',
  5617. category: 'accessing',
  5618. fn: function (aKey, aBlock){
  5619. var self=this;
  5620. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  5621. return self;},
  5622. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20keys%20includes%3A%20aKey%29%0A%09%09ifTrue%3A%20%5Bself%20basicAt%3A%20aKey%5D%0A%09%09ifFalse%3A%20aBlock'),
  5623. messageSends: ["ifTrue:ifFalse:", "includes:", "keys", "basicAt:"],
  5624. referencedClasses: []
  5625. }),
  5626. smalltalk.Dictionary);
  5627. smalltalk.addMethod(
  5628. '_at_ifAbsentPut_',
  5629. smalltalk.method({
  5630. selector: 'at:ifAbsentPut:',
  5631. category: 'accessing',
  5632. fn: function (aKey, aBlock){
  5633. var self=this;
  5634. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  5635. return self;},
  5636. source: unescape('at%3A%20aKey%20ifAbsentPut%3A%20aBlock%0A%20%20%20%20%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5B%0A%20%20%20%20%09%20%20%20%20self%20at%3A%20aKey%20put%3A%20aBlock%20value%5D'),
  5637. messageSends: ["at:ifAbsent:", "at:put:", "value"],
  5638. referencedClasses: []
  5639. }),
  5640. smalltalk.Dictionary);
  5641. smalltalk.addMethod(
  5642. '_at_ifPresent_',
  5643. smalltalk.method({
  5644. selector: 'at:ifPresent:',
  5645. category: 'accessing',
  5646. fn: function (aKey, aBlock){
  5647. var self=this;
  5648. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  5649. return self;},
  5650. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D'),
  5651. messageSends: ["ifNotNil:", "basicAt:", "value:", "at:"],
  5652. referencedClasses: []
  5653. }),
  5654. smalltalk.Dictionary);
  5655. smalltalk.addMethod(
  5656. '_at_ifPresent_ifAbsent_',
  5657. smalltalk.method({
  5658. selector: 'at:ifPresent:ifAbsent:',
  5659. category: 'accessing',
  5660. fn: function (aKey, aBlock, anotherBlock){
  5661. var self=this;
  5662. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  5663. return self;},
  5664. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%20ifAbsent%3A%20anotherBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%0A%09%20%20%20%20ifNil%3A%20anotherBlock%0A%09%20%20%20%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D'),
  5665. messageSends: ["ifNil:ifNotNil:", "basicAt:", "value:", "at:"],
  5666. referencedClasses: []
  5667. }),
  5668. smalltalk.Dictionary);
  5669. smalltalk.addMethod(
  5670. '_add_',
  5671. smalltalk.method({
  5672. selector: 'add:',
  5673. category: 'adding/removing',
  5674. fn: function (anAssociation){
  5675. var self=this;
  5676. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  5677. return self;},
  5678. source: unescape('add%3A%20anAssociation%0A%20%20%20%20%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value'),
  5679. messageSends: ["at:put:", "key", "value"],
  5680. referencedClasses: []
  5681. }),
  5682. smalltalk.Dictionary);
  5683. smalltalk.addMethod(
  5684. '_addAll_',
  5685. smalltalk.method({
  5686. selector: 'addAll:',
  5687. category: 'adding/removing',
  5688. fn: function (aDictionary){
  5689. var self=this;
  5690. smalltalk.send(self, "_addAll_", [smalltalk.send(aDictionary, "_associations", [])], smalltalk.Collection);
  5691. return aDictionary;
  5692. return self;},
  5693. source: unescape('addAll%3A%20aDictionary%0A%20%20%20%20%09super%20addAll%3A%20aDictionary%20associations.%0A%20%20%20%20%09%5EaDictionary'),
  5694. messageSends: ["addAll:", "associations"],
  5695. referencedClasses: []
  5696. }),
  5697. smalltalk.Dictionary);
  5698. smalltalk.addMethod(
  5699. '__comma',
  5700. smalltalk.method({
  5701. selector: ',',
  5702. category: 'copying',
  5703. fn: function (aCollection){
  5704. var self=this;
  5705. smalltalk.send(self, "_shouldNotImplement", []);
  5706. return self;},
  5707. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement'),
  5708. messageSends: ["shouldNotImplement"],
  5709. referencedClasses: []
  5710. }),
  5711. smalltalk.Dictionary);
  5712. smalltalk.addMethod(
  5713. '_copyFrom_to_',
  5714. smalltalk.method({
  5715. selector: 'copyFrom:to:',
  5716. category: 'copying',
  5717. fn: function (anIndex, anotherIndex){
  5718. var self=this;
  5719. smalltalk.send(self, "_shouldNotImplement", []);
  5720. return self;},
  5721. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement'),
  5722. messageSends: ["shouldNotImplement"],
  5723. referencedClasses: []
  5724. }),
  5725. smalltalk.Dictionary);
  5726. smalltalk.addMethod(
  5727. '_associationsDo_',
  5728. smalltalk.method({
  5729. selector: 'associationsDo:',
  5730. category: 'enumerating',
  5731. fn: function (aBlock){
  5732. var self=this;
  5733. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  5734. return self;},
  5735. source: unescape('associationsDo%3A%20aBlock%0A%20%20%20%20%09self%20associations%20do%3A%20aBlock'),
  5736. messageSends: ["do:", "associations"],
  5737. referencedClasses: []
  5738. }),
  5739. smalltalk.Dictionary);
  5740. smalltalk.addMethod(
  5741. '_keysAndValuesDo_',
  5742. smalltalk.method({
  5743. selector: 'keysAndValuesDo:',
  5744. category: 'enumerating',
  5745. fn: function (aBlock){
  5746. var self=this;
  5747. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  5748. return self;},
  5749. source: unescape('keysAndValuesDo%3A%20aBlock%0A%20%20%20%20%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%20key%20value%3A%20each%20value%5D'),
  5750. messageSends: ["associationsDo:", "value:value:", "key", "value"],
  5751. referencedClasses: []
  5752. }),
  5753. smalltalk.Dictionary);
  5754. smalltalk.addMethod(
  5755. '_do_',
  5756. smalltalk.method({
  5757. selector: 'do:',
  5758. category: 'enumerating',
  5759. fn: function (aBlock){
  5760. var self=this;
  5761. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  5762. return self;},
  5763. source: unescape('do%3A%20aBlock%0A%20%20%20%20%09self%20values%20do%3A%20aBlock'),
  5764. messageSends: ["do:", "values"],
  5765. referencedClasses: []
  5766. }),
  5767. smalltalk.Dictionary);
  5768. smalltalk.addMethod(
  5769. '_select_',
  5770. smalltalk.method({
  5771. selector: 'select:',
  5772. category: 'enumerating',
  5773. fn: function (aBlock){
  5774. var self=this;
  5775. var newDict=nil;
  5776. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  5777. 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]);})]);})]);
  5778. return newDict;
  5779. return self;},
  5780. source: unescape('select%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%20%20%20%20%09%5EnewDict'),
  5781. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "value:", "at:put:"],
  5782. referencedClasses: []
  5783. }),
  5784. smalltalk.Dictionary);
  5785. smalltalk.addMethod(
  5786. '_collect_',
  5787. smalltalk.method({
  5788. selector: 'collect:',
  5789. category: 'enumerating',
  5790. fn: function (aBlock){
  5791. var self=this;
  5792. var newDict=nil;
  5793. newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  5794. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  5795. return newDict;
  5796. return self;},
  5797. source: unescape('collect%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20newDict%20at%3A%20key%20put%3A%20%28aBlock%20value%3A%20value%29%5D.%0A%20%20%20%20%09%5EnewDict'),
  5798. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "value:"],
  5799. referencedClasses: []
  5800. }),
  5801. smalltalk.Dictionary);
  5802. smalltalk.addMethod(
  5803. '_detect_ifNone_',
  5804. smalltalk.method({
  5805. selector: 'detect:ifNone:',
  5806. category: 'enumerating',
  5807. fn: function (aBlock, anotherBlock){
  5808. var self=this;
  5809. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  5810. return self;},
  5811. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock'),
  5812. messageSends: ["detect:ifNone:", "values"],
  5813. referencedClasses: []
  5814. }),
  5815. smalltalk.Dictionary);
  5816. smalltalk.addMethod(
  5817. '_includes_',
  5818. smalltalk.method({
  5819. selector: 'includes:',
  5820. category: 'enumerating',
  5821. fn: function (anObject){
  5822. var self=this;
  5823. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  5824. return self;},
  5825. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject'),
  5826. messageSends: ["includes:", "values"],
  5827. referencedClasses: []
  5828. }),
  5829. smalltalk.Dictionary);
  5830. smalltalk.addMethod(
  5831. '_remove_',
  5832. smalltalk.method({
  5833. selector: 'remove:',
  5834. category: 'adding/removing',
  5835. fn: function (aKey){
  5836. var self=this;
  5837. smalltalk.send(self, "_removeKey_", [aKey]);
  5838. return self;},
  5839. source: unescape('remove%3A%20aKey%0A%20%20%20%20self%20removeKey%3A%20aKey'),
  5840. messageSends: ["removeKey:"],
  5841. referencedClasses: []
  5842. }),
  5843. smalltalk.Dictionary);
  5844. smalltalk.addMethod(
  5845. '_removeKey_',
  5846. smalltalk.method({
  5847. selector: 'removeKey:',
  5848. category: 'adding/removing',
  5849. fn: function (aKey){
  5850. var self=this;
  5851. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  5852. return self;},
  5853. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20keys%20remove%3A%20aKey'),
  5854. messageSends: ["remove:"],
  5855. referencedClasses: []
  5856. }),
  5857. smalltalk.Dictionary);
  5858. smalltalk.addMethod(
  5859. '_at_',
  5860. smalltalk.method({
  5861. selector: 'at:',
  5862. category: 'accessing',
  5863. fn: function (aKey){
  5864. var self=this;
  5865. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  5866. return self;},
  5867. source: unescape('at%3A%20aKey%0A%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  5868. messageSends: ["at:ifAbsent:", "errorNotFound"],
  5869. referencedClasses: []
  5870. }),
  5871. smalltalk.Dictionary);
  5872. smalltalk.addMethod(
  5873. '_asJSONObject',
  5874. smalltalk.method({
  5875. selector: 'asJSONObject',
  5876. category: 'converting',
  5877. fn: function (){
  5878. var self=this;
  5879. var object=nil;
  5880. object=smalltalk.send((smalltalk.Object || Object), "_new", []);
  5881. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(object, "_basicAt_put_", [key, smalltalk.send(value, "_asJSONObject", [])]);})]);
  5882. return object;
  5883. return self;},
  5884. source: unescape('asJSONObject%0A%09%7C%20object%20%7C%0A%09object%20%3A%3D%20Object%20new.%0A%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%09object%20basicAt%3A%20key%20put%3A%20value%20asJSONObject%5D.%0A%09%5Eobject'),
  5885. messageSends: ["new", "keysAndValuesDo:", "basicAt:put:", "asJSONObject"],
  5886. referencedClasses: [smalltalk.Object]
  5887. }),
  5888. smalltalk.Dictionary);
  5889. smalltalk.addMethod(
  5890. '_printString',
  5891. smalltalk.method({
  5892. selector: 'printString',
  5893. category: 'printing',
  5894. fn: function (){
  5895. var self=this;
  5896. 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")]);})]);
  5897. return self;},
  5898. source: unescape('printString%0A%09%5E%20String%20streamContents%3A%20%5B%3AaStream%7C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09nextPutAll%3A%20super%20printString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09nextPutAll%3A%20%27%28%27.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09self%20associations%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09do%3A%20%5B%3AanAssociation%7C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09nextPutAll%3A%20anAssociation%20key%20printString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09nextPutAll%3A%20%27%20-%3E%20%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09nextPutAll%3A%20anAssociation%20value%20printString%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%20%2C%20%27%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09aStream%20nextPutAll%3A%20%27%29%27.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D'),
  5899. messageSends: ["streamContents:", "nextPutAll:", "printString", "do:separatedBy:", "associations", "key", "value"],
  5900. referencedClasses: [smalltalk.String]
  5901. }),
  5902. smalltalk.Dictionary);
  5903. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  5904. smalltalk.addMethod(
  5905. '_superclass_subclass_',
  5906. smalltalk.method({
  5907. selector: 'superclass:subclass:',
  5908. category: 'class creation',
  5909. fn: function (aClass, aString){
  5910. var self=this;
  5911. smalltalk.send(self, "_superclass_subclass_instanceVariableNames_category_", [aClass, aString, "", nil]);
  5912. return self;},
  5913. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%0A%09self%20superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20%27%27%20category%3A%20nil'),
  5914. messageSends: ["superclass:subclass:instanceVariableNames:category:"],
  5915. referencedClasses: []
  5916. }),
  5917. smalltalk.ClassBuilder);
  5918. smalltalk.addMethod(
  5919. '_superclass_subclass_instanceVariableNames_category_',
  5920. smalltalk.method({
  5921. selector: 'superclass:subclass:instanceVariableNames:category:',
  5922. category: 'class creation',
  5923. fn: function (aClass, aString, aString2, aString3){
  5924. var self=this;
  5925. var newClass=nil;
  5926. newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2])]);
  5927. smalltalk.send(self, "_setupClass_", [newClass]);
  5928. smalltalk.send(newClass, "_category_", [(($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]);
  5929. return self;},
  5930. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%7C%20newClass%20%7C%0A%09newClass%20%3A%3D%20self%20addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20%28self%20instanceVariableNamesFor%3A%20aString2%29.%0A%09self%20setupClass%3A%20newClass.%0A%09newClass%20category%3A%20%28aString3%20ifNil%3A%20%5B%27unclassified%27%5D%29'),
  5931. messageSends: ["addSubclassOf:named:instanceVariableNames:", "instanceVariableNamesFor:", "setupClass:", "category:", "ifNil:"],
  5932. referencedClasses: []
  5933. }),
  5934. smalltalk.ClassBuilder);
  5935. smalltalk.addMethod(
  5936. '_class_instanceVariableNames_',
  5937. smalltalk.method({
  5938. selector: 'class:instanceVariableNames:',
  5939. category: 'class creation',
  5940. fn: function (aClass, aString){
  5941. var self=this;
  5942. (($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"])]);})]);
  5943. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  5944. smalltalk.send(self, "_setupClass_", [aClass]);
  5945. return self;},
  5946. source: unescape('class%3A%20aClass%20instanceVariableNames%3A%20aString%0A%09aClass%20isMetaclass%20ifFalse%3A%20%5Bself%20error%3A%20aClass%20name%2C%20%27%20is%20not%20a%20metaclass%27%5D.%0A%09aClass%20basicAt%3A%20%27iVarNames%27%20put%3A%20%28self%20instanceVariableNamesFor%3A%20aString%29.%0A%09self%20setupClass%3A%20aClass'),
  5947. messageSends: ["ifFalse:", "isMetaclass", "error:", unescape("%2C"), "name", "basicAt:put:", "instanceVariableNamesFor:", "setupClass:"],
  5948. referencedClasses: []
  5949. }),
  5950. smalltalk.ClassBuilder);
  5951. smalltalk.addMethod(
  5952. '_instanceVariableNamesFor_',
  5953. smalltalk.method({
  5954. selector: 'instanceVariableNamesFor:',
  5955. category: 'private',
  5956. fn: function (aString){
  5957. var self=this;
  5958. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  5959. return self;},
  5960. source: unescape('instanceVariableNamesFor%3A%20aString%0A%09%5E%28aString%20tokenize%3A%20%27%20%27%29%20reject%3A%20%5B%3Aeach%20%7C%20each%20isEmpty%5D'),
  5961. messageSends: ["reject:", "tokenize:", "isEmpty"],
  5962. referencedClasses: []
  5963. }),
  5964. smalltalk.ClassBuilder);
  5965. smalltalk.addMethod(
  5966. '_addSubclassOf_named_instanceVariableNames_',
  5967. smalltalk.method({
  5968. selector: 'addSubclassOf:named:instanceVariableNames:',
  5969. category: 'private',
  5970. fn: function (aClass, aString, aCollection){
  5971. var self=this;
  5972. smalltalk.addClass(aString, aClass, aCollection);
  5973. return smalltalk[aString];
  5974. return self;},
  5975. source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%0A%09%3Csmalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%3E'),
  5976. messageSends: [],
  5977. referencedClasses: []
  5978. }),
  5979. smalltalk.ClassBuilder);
  5980. smalltalk.addMethod(
  5981. '_setupClass_',
  5982. smalltalk.method({
  5983. selector: 'setupClass:',
  5984. category: 'private',
  5985. fn: function (aClass){
  5986. var self=this;
  5987. smalltalk.init(aClass);;
  5988. return self;},
  5989. source: unescape('setupClass%3A%20aClass%0A%09%3Csmalltalk.init%28aClass%29%3B%3E'),
  5990. messageSends: [],
  5991. referencedClasses: []
  5992. }),
  5993. smalltalk.ClassBuilder);
  5994. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  5995. smalltalk.addMethod(
  5996. '_initialize',
  5997. smalltalk.method({
  5998. selector: 'initialize',
  5999. category: 'initialization',
  6000. fn: function (){
  6001. var self=this;
  6002. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  6003. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  6004. return self;},
  6005. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.'),
  6006. messageSends: ["initialize", "new"],
  6007. referencedClasses: [smalltalk.nil]
  6008. }),
  6009. smalltalk.ClassCategoryReader);
  6010. smalltalk.addMethod(
  6011. '_class_category_',
  6012. smalltalk.method({
  6013. selector: 'class:category:',
  6014. category: 'accessing',
  6015. fn: function (aClass, aString){
  6016. var self=this;
  6017. self['@class']=aClass;
  6018. self['@category']=aString;
  6019. return self;},
  6020. source: unescape('class%3A%20aClass%20category%3A%20aString%0A%09class%20%3A%3D%20aClass.%0A%09category%20%3A%3D%20aString'),
  6021. messageSends: [],
  6022. referencedClasses: []
  6023. }),
  6024. smalltalk.ClassCategoryReader);
  6025. smalltalk.addMethod(
  6026. '_scanFrom_',
  6027. smalltalk.method({
  6028. selector: 'scanFrom:',
  6029. category: 'fileIn',
  6030. fn: function (aChunkParser){
  6031. var self=this;
  6032. var chunk=nil;
  6033. (function(){while(!(function(){chunk=smalltalk.send(aChunkParser, "_nextChunk", []);return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  6034. return self;},
  6035. source: unescape('scanFrom%3A%20aChunkParser%0A%09%7C%20chunk%20%7C%0A%09%5Bchunk%20%3A%3D%20aChunkParser%20nextChunk.%0A%09chunk%20isEmpty%5D%20whileFalse%3A%20%5B%0A%09%20%20%20%20self%20compileMethod%3A%20chunk%5D'),
  6036. messageSends: ["whileFalse:", "nextChunk", "isEmpty", "compileMethod:"],
  6037. referencedClasses: []
  6038. }),
  6039. smalltalk.ClassCategoryReader);
  6040. smalltalk.addMethod(
  6041. '_compileMethod_',
  6042. smalltalk.method({
  6043. selector: 'compileMethod:',
  6044. category: 'private',
  6045. fn: function (aString){
  6046. var self=this;
  6047. var method=nil;
  6048. method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self['@class']]);
  6049. smalltalk.send(method, "_category_", [self['@category']]);
  6050. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  6051. return self;},
  6052. source: unescape('compileMethod%3A%20aString%0A%09%7C%20method%20%7C%0A%09method%20%3A%3D%20Compiler%20new%20load%3A%20aString%20forClass%3A%20class.%0A%09method%20category%3A%20category.%0A%09class%20addCompiledMethod%3A%20method'),
  6053. messageSends: ["load:forClass:", "new", "category:", "addCompiledMethod:"],
  6054. referencedClasses: [smalltalk.Compiler]
  6055. }),
  6056. smalltalk.ClassCategoryReader);
  6057. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  6058. smalltalk.addMethod(
  6059. '_collection',
  6060. smalltalk.method({
  6061. selector: 'collection',
  6062. category: 'accessing',
  6063. fn: function (){
  6064. var self=this;
  6065. return self['@collection'];
  6066. return self;},
  6067. source: unescape('collection%0A%09%5Ecollection'),
  6068. messageSends: [],
  6069. referencedClasses: []
  6070. }),
  6071. smalltalk.Stream);
  6072. smalltalk.addMethod(
  6073. '_setCollection_',
  6074. smalltalk.method({
  6075. selector: 'setCollection:',
  6076. category: 'accessing',
  6077. fn: function (aCollection){
  6078. var self=this;
  6079. self['@collection']=aCollection;
  6080. return self;},
  6081. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection'),
  6082. messageSends: [],
  6083. referencedClasses: []
  6084. }),
  6085. smalltalk.Stream);
  6086. smalltalk.addMethod(
  6087. '_position',
  6088. smalltalk.method({
  6089. selector: 'position',
  6090. category: 'accessing',
  6091. fn: function (){
  6092. var self=this;
  6093. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return self['@position']=(0);})() : $receiver;
  6094. return self;},
  6095. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D'),
  6096. messageSends: ["ifNil:"],
  6097. referencedClasses: []
  6098. }),
  6099. smalltalk.Stream);
  6100. smalltalk.addMethod(
  6101. '_position_',
  6102. smalltalk.method({
  6103. selector: 'position:',
  6104. category: 'accessing',
  6105. fn: function (anInteger){
  6106. var self=this;
  6107. self['@position']=anInteger;
  6108. return self;},
  6109. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger'),
  6110. messageSends: [],
  6111. referencedClasses: []
  6112. }),
  6113. smalltalk.Stream);
  6114. smalltalk.addMethod(
  6115. '_streamSize',
  6116. smalltalk.method({
  6117. selector: 'streamSize',
  6118. category: 'accessing',
  6119. fn: function (){
  6120. var self=this;
  6121. return self['@streamSize'];
  6122. return self;},
  6123. source: unescape('streamSize%0A%09%5EstreamSize'),
  6124. messageSends: [],
  6125. referencedClasses: []
  6126. }),
  6127. smalltalk.Stream);
  6128. smalltalk.addMethod(
  6129. '_setStreamSize_',
  6130. smalltalk.method({
  6131. selector: 'setStreamSize:',
  6132. category: 'accessing',
  6133. fn: function (anInteger){
  6134. var self=this;
  6135. self['@streamSize']=anInteger;
  6136. return self;},
  6137. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger'),
  6138. messageSends: [],
  6139. referencedClasses: []
  6140. }),
  6141. smalltalk.Stream);
  6142. smalltalk.addMethod(
  6143. '_contents',
  6144. smalltalk.method({
  6145. selector: 'contents',
  6146. category: 'accessing',
  6147. fn: function (){
  6148. var self=this;
  6149. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  6150. return self;},
  6151. source: unescape('contents%0A%09%5Eself%20collection%0A%09%20%20%20%20copyFrom%3A%201%20%0A%09%20%20%20%20to%3A%20self%20streamSize'),
  6152. messageSends: ["copyFrom:to:", "collection", "streamSize"],
  6153. referencedClasses: []
  6154. }),
  6155. smalltalk.Stream);
  6156. smalltalk.addMethod(
  6157. '_size',
  6158. smalltalk.method({
  6159. selector: 'size',
  6160. category: 'accessing',
  6161. fn: function (){
  6162. var self=this;
  6163. return smalltalk.send(self, "_streamSize", []);
  6164. return self;},
  6165. source: unescape('size%0A%09%5Eself%20streamSize'),
  6166. messageSends: ["streamSize"],
  6167. referencedClasses: []
  6168. }),
  6169. smalltalk.Stream);
  6170. smalltalk.addMethod(
  6171. '_reset',
  6172. smalltalk.method({
  6173. selector: 'reset',
  6174. category: 'actions',
  6175. fn: function (){
  6176. var self=this;
  6177. smalltalk.send(self, "_position_", [(0)]);
  6178. return self;},
  6179. source: unescape('reset%0A%09self%20position%3A%200'),
  6180. messageSends: ["position:"],
  6181. referencedClasses: []
  6182. }),
  6183. smalltalk.Stream);
  6184. smalltalk.addMethod(
  6185. '_close',
  6186. smalltalk.method({
  6187. selector: 'close',
  6188. category: 'actions',
  6189. fn: function (){
  6190. var self=this;
  6191. return self;},
  6192. source: unescape('close'),
  6193. messageSends: [],
  6194. referencedClasses: []
  6195. }),
  6196. smalltalk.Stream);
  6197. smalltalk.addMethod(
  6198. '_flush',
  6199. smalltalk.method({
  6200. selector: 'flush',
  6201. category: 'actions',
  6202. fn: function (){
  6203. var self=this;
  6204. return self;},
  6205. source: unescape('flush'),
  6206. messageSends: [],
  6207. referencedClasses: []
  6208. }),
  6209. smalltalk.Stream);
  6210. smalltalk.addMethod(
  6211. '_resetContents',
  6212. smalltalk.method({
  6213. selector: 'resetContents',
  6214. category: 'actions',
  6215. fn: function (){
  6216. var self=this;
  6217. smalltalk.send(self, "_reset", []);
  6218. smalltalk.send(self, "_setStreamSize_", [(0)]);
  6219. return self;},
  6220. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200'),
  6221. messageSends: ["reset", "setStreamSize:"],
  6222. referencedClasses: []
  6223. }),
  6224. smalltalk.Stream);
  6225. smalltalk.addMethod(
  6226. '_do_',
  6227. smalltalk.method({
  6228. selector: 'do:',
  6229. category: 'enumerating',
  6230. fn: function (aBlock){
  6231. var self=this;
  6232. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  6233. return self;},
  6234. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D'),
  6235. messageSends: ["whileFalse:", "atEnd", "value:", "next"],
  6236. referencedClasses: []
  6237. }),
  6238. smalltalk.Stream);
  6239. smalltalk.addMethod(
  6240. '_setToEnd',
  6241. smalltalk.method({
  6242. selector: 'setToEnd',
  6243. category: 'positioning',
  6244. fn: function (){
  6245. var self=this;
  6246. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  6247. return self;},
  6248. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size'),
  6249. messageSends: ["position:", "size"],
  6250. referencedClasses: []
  6251. }),
  6252. smalltalk.Stream);
  6253. smalltalk.addMethod(
  6254. '_skip_',
  6255. smalltalk.method({
  6256. selector: 'skip:',
  6257. category: 'positioning',
  6258. fn: function (anInteger){
  6259. var self=this;
  6260. 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)])]);
  6261. return self;},
  6262. source: unescape('skip%3A%20anInteger%0A%09self%20position%3A%20%28%28self%20position%20+%20anInteger%29%20min%3A%20self%20size%20max%3A%200%29'),
  6263. messageSends: ["position:", "min:max:", unescape("+"), "position", "size"],
  6264. referencedClasses: []
  6265. }),
  6266. smalltalk.Stream);
  6267. smalltalk.addMethod(
  6268. '_next',
  6269. smalltalk.method({
  6270. selector: 'next',
  6271. category: 'reading',
  6272. fn: function (){
  6273. var self=this;
  6274. smalltalk.send(self, "_position_", [(($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])]);
  6275. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  6276. return self;},
  6277. source: unescape('next%0A%09self%20position%3A%20self%20position%20+%201.%20%0A%09%5Ecollection%20at%3A%20self%20position'),
  6278. messageSends: ["position:", unescape("+"), "position", "at:"],
  6279. referencedClasses: []
  6280. }),
  6281. smalltalk.Stream);
  6282. smalltalk.addMethod(
  6283. '_next_',
  6284. smalltalk.method({
  6285. selector: 'next:',
  6286. category: 'reading',
  6287. fn: function (anInteger){
  6288. var self=this;
  6289. var tempCollection=nil;
  6290. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  6291. 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", [])]);})]);})]);
  6292. return tempCollection;
  6293. return self;},
  6294. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20add%3A%20self%20next%5D%5D.%0A%09%5EtempCollection'),
  6295. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", "add:", "next"],
  6296. referencedClasses: []
  6297. }),
  6298. smalltalk.Stream);
  6299. smalltalk.addMethod(
  6300. '_nextPut_',
  6301. smalltalk.method({
  6302. selector: 'nextPut:',
  6303. category: 'writing',
  6304. fn: function (anObject){
  6305. var self=this;
  6306. smalltalk.send(self, "_position_", [(($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])]);
  6307. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  6308. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  6309. return self;},
  6310. source: unescape('nextPut%3A%20anObject%0A%09self%20position%3A%20self%20position%20+%201.%0A%09self%20collection%20at%3A%20self%20position%20put%3A%20anObject.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29'),
  6311. messageSends: ["position:", unescape("+"), "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"],
  6312. referencedClasses: []
  6313. }),
  6314. smalltalk.Stream);
  6315. smalltalk.addMethod(
  6316. '_nextPutAll_',
  6317. smalltalk.method({
  6318. selector: 'nextPutAll:',
  6319. category: 'writing',
  6320. fn: function (aCollection){
  6321. var self=this;
  6322. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  6323. return self;},
  6324. source: unescape('nextPutAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20nextPut%3A%20each%5D'),
  6325. messageSends: ["do:", "nextPut:"],
  6326. referencedClasses: []
  6327. }),
  6328. smalltalk.Stream);
  6329. smalltalk.addMethod(
  6330. '_peek',
  6331. smalltalk.method({
  6332. selector: 'peek',
  6333. category: 'reading',
  6334. fn: function (){
  6335. var self=this;
  6336. 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)])]);})]);
  6337. return self;},
  6338. source: unescape('peek%0A%09%5Eself%20atEnd%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20collection%20at%3A%20self%20position%20+%201%5D'),
  6339. messageSends: ["ifFalse:", "atEnd", "at:", "collection", unescape("+"), "position"],
  6340. referencedClasses: []
  6341. }),
  6342. smalltalk.Stream);
  6343. smalltalk.addMethod(
  6344. '_atEnd',
  6345. smalltalk.method({
  6346. selector: 'atEnd',
  6347. category: 'testing',
  6348. fn: function (){
  6349. var self=this;
  6350. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  6351. return self;},
  6352. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size'),
  6353. messageSends: [unescape("%3D"), "position", "size"],
  6354. referencedClasses: []
  6355. }),
  6356. smalltalk.Stream);
  6357. smalltalk.addMethod(
  6358. '_atStart',
  6359. smalltalk.method({
  6360. selector: 'atStart',
  6361. category: 'testing',
  6362. fn: function (){
  6363. var self=this;
  6364. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  6365. return self;},
  6366. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200'),
  6367. messageSends: [unescape("%3D"), "position"],
  6368. referencedClasses: []
  6369. }),
  6370. smalltalk.Stream);
  6371. smalltalk.addMethod(
  6372. '_isEmpty',
  6373. smalltalk.method({
  6374. selector: 'isEmpty',
  6375. category: 'testing',
  6376. fn: function (){
  6377. var self=this;
  6378. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  6379. return self;},
  6380. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200'),
  6381. messageSends: [unescape("%3D"), "size"],
  6382. referencedClasses: []
  6383. }),
  6384. smalltalk.Stream);
  6385. smalltalk.addMethod(
  6386. '_on_',
  6387. smalltalk.method({
  6388. selector: 'on:',
  6389. category: 'instance creation',
  6390. fn: function (aCollection){
  6391. var self=this;
  6392. 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", []));
  6393. return self;},
  6394. source: unescape('on%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%20%0A%09%09setCollection%3A%20aCollection%3B%0A%09%09setStreamSize%3A%20aCollection%20size%3B%0A%09%09yourself'),
  6395. messageSends: ["setCollection:", "setStreamSize:", "size", "yourself", "new"],
  6396. referencedClasses: []
  6397. }),
  6398. smalltalk.Stream.klass);
  6399. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  6400. smalltalk.addMethod(
  6401. '_next_',
  6402. smalltalk.method({
  6403. selector: 'next:',
  6404. category: 'reading',
  6405. fn: function (anInteger){
  6406. var self=this;
  6407. var tempCollection=nil;
  6408. tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  6409. 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", [])]);})]);})]);
  6410. return tempCollection;
  6411. return self;},
  6412. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20%3A%3D%20tempCollection%2C%20self%20next%5D%5D.%0A%09%5EtempCollection'),
  6413. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", unescape("%2C"), "next"],
  6414. referencedClasses: []
  6415. }),
  6416. smalltalk.StringStream);
  6417. smalltalk.addMethod(
  6418. '_nextPut_',
  6419. smalltalk.method({
  6420. selector: 'nextPut:',
  6421. category: 'writing',
  6422. fn: function (aString){
  6423. var self=this;
  6424. smalltalk.send(self, "_nextPutAll_", [aString]);
  6425. return self;},
  6426. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString'),
  6427. messageSends: ["nextPutAll:"],
  6428. referencedClasses: []
  6429. }),
  6430. smalltalk.StringStream);
  6431. smalltalk.addMethod(
  6432. '_nextPutAll_',
  6433. smalltalk.method({
  6434. selector: 'nextPutAll:',
  6435. category: 'writing',
  6436. fn: function (aString){
  6437. var self=this;
  6438. 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", [])])])]);
  6439. 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", [])])]);
  6440. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  6441. return self;},
  6442. source: unescape('nextPutAll%3A%20aString%0A%09self%20setCollection%3A%20%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%201%20to%3A%20self%20position%29%2C%0A%09%20%20%20%20aString%2C%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%20%28self%20position%20+%201%20+%20aString%20size%29%20to%3A%20self%20collection%20size%29.%0A%09self%20position%3A%20self%20position%20+%20aString%20size.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29'),
  6443. messageSends: ["setCollection:", unescape("%2C"), "copyFrom:to:", "collection", "position", unescape("+"), "size", "position:", "setStreamSize:", "max:", "streamSize"],
  6444. referencedClasses: []
  6445. }),
  6446. smalltalk.StringStream);
  6447. smalltalk.addMethod(
  6448. '_cr',
  6449. smalltalk.method({
  6450. selector: 'cr',
  6451. category: 'writing',
  6452. fn: function (){
  6453. var self=this;
  6454. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  6455. return self;},
  6456. source: unescape('cr%0A%09%5Eself%20nextPutAll%3A%20String%20cr'),
  6457. messageSends: ["nextPutAll:", "cr"],
  6458. referencedClasses: [smalltalk.String]
  6459. }),
  6460. smalltalk.StringStream);
  6461. smalltalk.addMethod(
  6462. '_crlf',
  6463. smalltalk.method({
  6464. selector: 'crlf',
  6465. category: 'writing',
  6466. fn: function (){
  6467. var self=this;
  6468. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  6469. return self;},
  6470. source: unescape('crlf%0A%09%5Eself%20nextPutAll%3A%20String%20crlf'),
  6471. messageSends: ["nextPutAll:", "crlf"],
  6472. referencedClasses: [smalltalk.String]
  6473. }),
  6474. smalltalk.StringStream);
  6475. smalltalk.addMethod(
  6476. '_lf',
  6477. smalltalk.method({
  6478. selector: 'lf',
  6479. category: 'writing',
  6480. fn: function (){
  6481. var self=this;
  6482. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  6483. return self;},
  6484. source: unescape('lf%0A%09%5Eself%20nextPutAll%3A%20String%20lf'),
  6485. messageSends: ["nextPutAll:", "lf"],
  6486. referencedClasses: [smalltalk.String]
  6487. }),
  6488. smalltalk.StringStream);
  6489. smalltalk.addMethod(
  6490. '_space',
  6491. smalltalk.method({
  6492. selector: 'space',
  6493. category: 'writing',
  6494. fn: function (){
  6495. var self=this;
  6496. smalltalk.send(self, "_nextPut_", [" "]);
  6497. return self;},
  6498. source: unescape('space%0A%09self%20nextPut%3A%20%27%20%27'),
  6499. messageSends: ["nextPut:"],
  6500. referencedClasses: []
  6501. }),
  6502. smalltalk.StringStream);
  6503. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  6504. smalltalk.addMethod(
  6505. '_class_',
  6506. smalltalk.method({
  6507. selector: 'class:',
  6508. category: 'accessing',
  6509. fn: function (aClass){
  6510. var self=this;
  6511. self['@class']=aClass;
  6512. return self;},
  6513. source: unescape('class%3A%20aClass%0A%09class%20%3A%3D%20aClass'),
  6514. messageSends: [],
  6515. referencedClasses: []
  6516. }),
  6517. smalltalk.ClassCommentReader);
  6518. smalltalk.addMethod(
  6519. '_scanFrom_',
  6520. smalltalk.method({
  6521. selector: 'scanFrom:',
  6522. category: 'fileIn',
  6523. fn: function (aChunkParser){
  6524. var self=this;
  6525. var chunk=nil;
  6526. chunk=smalltalk.send(aChunkParser, "_nextChunk", []);
  6527. (($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]);})]);
  6528. return self;},
  6529. source: unescape('scanFrom%3A%20aChunkParser%0A%09%7C%20chunk%20%7C%0A%09chunk%20%3A%3D%20aChunkParser%20nextChunk.%0A%09chunk%20isEmpty%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20setComment%3A%20chunk%5D.'),
  6530. messageSends: ["nextChunk", "ifFalse:", "isEmpty", "setComment:"],
  6531. referencedClasses: []
  6532. }),
  6533. smalltalk.ClassCommentReader);
  6534. smalltalk.addMethod(
  6535. '_initialize',
  6536. smalltalk.method({
  6537. selector: 'initialize',
  6538. category: 'initialization',
  6539. fn: function (){
  6540. var self=this;
  6541. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  6542. self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []);
  6543. return self;},
  6544. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.'),
  6545. messageSends: ["initialize", "new"],
  6546. referencedClasses: [smalltalk.nil]
  6547. }),
  6548. smalltalk.ClassCommentReader);
  6549. smalltalk.addMethod(
  6550. '_setComment_',
  6551. smalltalk.method({
  6552. selector: 'setComment:',
  6553. category: 'private',
  6554. fn: function (aString){
  6555. var self=this;
  6556. smalltalk.send(self['@class'], "_comment_", [aString]);
  6557. return self;},
  6558. source: unescape('setComment%3A%20aString%0A%20%20%20%20class%20comment%3A%20aString'),
  6559. messageSends: ["comment:"],
  6560. referencedClasses: []
  6561. }),
  6562. smalltalk.ClassCommentReader);
  6563. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  6564. smalltalk.addMethod(
  6565. '_next',
  6566. smalltalk.method({
  6567. selector: 'next',
  6568. category: 'accessing',
  6569. fn: function (){
  6570. var self=this;
  6571. return Math.random();
  6572. return self;},
  6573. source: unescape('next%0A%09%3Creturn%20Math.random%28%29%3E'),
  6574. messageSends: [],
  6575. referencedClasses: []
  6576. }),
  6577. smalltalk.Random);
  6578. smalltalk.addMethod(
  6579. '_next_',
  6580. smalltalk.method({
  6581. selector: 'next:',
  6582. category: 'accessing',
  6583. fn: function (anInteger){
  6584. var self=this;
  6585. return smalltalk.send((1), "_to_collect_", [anInteger, (function(each){return smalltalk.send(self, "_next", []);})]);
  6586. return self;},
  6587. source: unescape('next%3A%20anInteger%0A%20%20%20%20%5E1%20to%3A%20anInteger%20collect%3A%20%5B%3Aeach%20%7C%20self%20next%5D'),
  6588. messageSends: ["to:collect:", "next"],
  6589. referencedClasses: []
  6590. }),
  6591. smalltalk.Random);
  6592. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  6593. smalltalk.addMethod(
  6594. '_x',
  6595. smalltalk.method({
  6596. selector: 'x',
  6597. category: 'accessing',
  6598. fn: function (){
  6599. var self=this;
  6600. return self['@x'];
  6601. return self;},
  6602. source: unescape('x%0A%09%5Ex'),
  6603. messageSends: [],
  6604. referencedClasses: []
  6605. }),
  6606. smalltalk.Point);
  6607. smalltalk.addMethod(
  6608. '_y',
  6609. smalltalk.method({
  6610. selector: 'y',
  6611. category: 'accessing',
  6612. fn: function (){
  6613. var self=this;
  6614. return self['@y'];
  6615. return self;},
  6616. source: unescape('y%0A%09%5Ey'),
  6617. messageSends: [],
  6618. referencedClasses: []
  6619. }),
  6620. smalltalk.Point);
  6621. smalltalk.addMethod(
  6622. '_y_',
  6623. smalltalk.method({
  6624. selector: 'y:',
  6625. category: 'accessing',
  6626. fn: function (aNumber){
  6627. var self=this;
  6628. self['@y']=aNumber;
  6629. return self;},
  6630. source: unescape('y%3A%20aNumber%0A%09y%20%3A%3D%20aNumber'),
  6631. messageSends: [],
  6632. referencedClasses: []
  6633. }),
  6634. smalltalk.Point);
  6635. smalltalk.addMethod(
  6636. '_x_',
  6637. smalltalk.method({
  6638. selector: 'x:',
  6639. category: 'accessing',
  6640. fn: function (aNumber){
  6641. var self=this;
  6642. self['@x']=aNumber;
  6643. return self;},
  6644. source: unescape('x%3A%20aNumber%0A%09x%20%3A%3D%20aNumber'),
  6645. messageSends: [],
  6646. referencedClasses: []
  6647. }),
  6648. smalltalk.Point);
  6649. smalltalk.addMethod(
  6650. '__star',
  6651. smalltalk.method({
  6652. selector: '*',
  6653. category: 'arithmetic',
  6654. fn: function (aPoint){
  6655. var self=this;
  6656. 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", [])])]);
  6657. return self;},
  6658. source: unescape('*%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20*%20aPoint%20asPoint%20x%20y%3A%20self%20y%20*%20aPoint%20asPoint%20y'),
  6659. messageSends: ["x:y:", unescape("*"), "x", "asPoint", "y"],
  6660. referencedClasses: [smalltalk.Point]
  6661. }),
  6662. smalltalk.Point);
  6663. smalltalk.addMethod(
  6664. '__plus',
  6665. smalltalk.method({
  6666. selector: '+',
  6667. category: 'arithmetic',
  6668. fn: function (aPoint){
  6669. var self=this;
  6670. 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", [])])]);
  6671. return self;},
  6672. source: unescape('+%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20+%20aPoint%20asPoint%20x%20y%3A%20self%20y%20+%20aPoint%20asPoint%20y'),
  6673. messageSends: ["x:y:", unescape("+"), "x", "asPoint", "y"],
  6674. referencedClasses: [smalltalk.Point]
  6675. }),
  6676. smalltalk.Point);
  6677. smalltalk.addMethod(
  6678. '__minus',
  6679. smalltalk.method({
  6680. selector: '-',
  6681. category: 'arithmetic',
  6682. fn: function (aPoint){
  6683. var self=this;
  6684. 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", [])])]);
  6685. return self;},
  6686. source: unescape('-%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20-%20aPoint%20asPoint%20x%20y%3A%20self%20y%20-%20aPoint%20asPoint%20y'),
  6687. messageSends: ["x:y:", unescape("-"), "x", "asPoint", "y"],
  6688. referencedClasses: [smalltalk.Point]
  6689. }),
  6690. smalltalk.Point);
  6691. smalltalk.addMethod(
  6692. '__slash',
  6693. smalltalk.method({
  6694. selector: '/',
  6695. category: 'arithmetic',
  6696. fn: function (aPoint){
  6697. var self=this;
  6698. 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", [])])]);
  6699. return self;},
  6700. source: unescape('/%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20/%20aPoint%20asPoint%20x%20y%3A%20self%20y%20/%20aPoint%20asPoint%20y'),
  6701. messageSends: ["x:y:", unescape("/"), "x", "asPoint", "y"],
  6702. referencedClasses: [smalltalk.Point]
  6703. }),
  6704. smalltalk.Point);
  6705. smalltalk.addMethod(
  6706. '_asPoint',
  6707. smalltalk.method({
  6708. selector: 'asPoint',
  6709. category: 'converting',
  6710. fn: function (){
  6711. var self=this;
  6712. return self;
  6713. return self;},
  6714. source: unescape('asPoint%0A%09%5Eself'),
  6715. messageSends: [],
  6716. referencedClasses: []
  6717. }),
  6718. smalltalk.Point);
  6719. smalltalk.addMethod(
  6720. '_x_y_',
  6721. smalltalk.method({
  6722. selector: 'x:y:',
  6723. category: 'instance creation',
  6724. fn: function (aNumber, anotherNumber){
  6725. var self=this;
  6726. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  6727. return self;},
  6728. source: unescape('x%3A%20aNumber%20y%3A%20anotherNumber%0A%09%5Eself%20new%0A%09%09x%3A%20aNumber%3B%0A%09%09y%3A%20anotherNumber%3B%0A%09%09yourself'),
  6729. messageSends: ["x:", "y:", "yourself", "new"],
  6730. referencedClasses: []
  6731. }),
  6732. smalltalk.Point.klass);
  6733. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  6734. smalltalk.addMethod(
  6735. '_selector',
  6736. smalltalk.method({
  6737. selector: 'selector',
  6738. category: 'accessing',
  6739. fn: function (){
  6740. var self=this;
  6741. return self['@selector'];
  6742. return self;},
  6743. source: unescape('selector%0A%09%5Eselector'),
  6744. messageSends: [],
  6745. referencedClasses: []
  6746. }),
  6747. smalltalk.Message);
  6748. smalltalk.addMethod(
  6749. '_selector_',
  6750. smalltalk.method({
  6751. selector: 'selector:',
  6752. category: 'accessing',
  6753. fn: function (aString){
  6754. var self=this;
  6755. self['@selector']=aString;
  6756. return self;},
  6757. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString'),
  6758. messageSends: [],
  6759. referencedClasses: []
  6760. }),
  6761. smalltalk.Message);
  6762. smalltalk.addMethod(
  6763. '_arguments_',
  6764. smalltalk.method({
  6765. selector: 'arguments:',
  6766. category: 'accessing',
  6767. fn: function (anArray){
  6768. var self=this;
  6769. self['@arguments']=anArray;
  6770. return self;},
  6771. source: unescape('arguments%3A%20anArray%0A%09arguments%20%3A%3D%20anArray'),
  6772. messageSends: [],
  6773. referencedClasses: []
  6774. }),
  6775. smalltalk.Message);
  6776. smalltalk.addMethod(
  6777. '_arguments',
  6778. smalltalk.method({
  6779. selector: 'arguments',
  6780. category: 'accessing',
  6781. fn: function (){
  6782. var self=this;
  6783. return self['@arguments'];
  6784. return self;},
  6785. source: unescape('arguments%0A%09%5Earguments'),
  6786. messageSends: [],
  6787. referencedClasses: []
  6788. }),
  6789. smalltalk.Message);
  6790. smalltalk.addMethod(
  6791. '_selector_arguments_',
  6792. smalltalk.method({
  6793. selector: 'selector:arguments:',
  6794. category: 'instance creation',
  6795. fn: function (aString, anArray){
  6796. var self=this;
  6797. return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  6798. return self;},
  6799. source: unescape('selector%3A%20aString%20arguments%3A%20anArray%0A%09%5Eself%20new%0A%09%09selector%3A%20aString%3B%0A%09%09arguments%3A%20anArray%3B%0A%09%09yourself'),
  6800. messageSends: ["selector:", "arguments:", "yourself", "new"],
  6801. referencedClasses: []
  6802. }),
  6803. smalltalk.Message.klass);
  6804. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  6805. smalltalk.addMethod(
  6806. '_message',
  6807. smalltalk.method({
  6808. selector: 'message',
  6809. category: 'accessing',
  6810. fn: function (){
  6811. var self=this;
  6812. return self['@message'];
  6813. return self;},
  6814. source: unescape('message%0A%09%5Emessage'),
  6815. messageSends: [],
  6816. referencedClasses: []
  6817. }),
  6818. smalltalk.MessageNotUnderstood);
  6819. smalltalk.addMethod(
  6820. '_message_',
  6821. smalltalk.method({
  6822. selector: 'message:',
  6823. category: 'accessing',
  6824. fn: function (aMessage){
  6825. var self=this;
  6826. self['@message']=aMessage;
  6827. return self;},
  6828. source: unescape('message%3A%20aMessage%0A%09message%20%3A%3D%20aMessage'),
  6829. messageSends: [],
  6830. referencedClasses: []
  6831. }),
  6832. smalltalk.MessageNotUnderstood);
  6833. smalltalk.addMethod(
  6834. '_receiver',
  6835. smalltalk.method({
  6836. selector: 'receiver',
  6837. category: 'accessing',
  6838. fn: function (){
  6839. var self=this;
  6840. return self['@receiver'];
  6841. return self;},
  6842. source: unescape('receiver%0A%09%5Ereceiver'),
  6843. messageSends: [],
  6844. referencedClasses: []
  6845. }),
  6846. smalltalk.MessageNotUnderstood);
  6847. smalltalk.addMethod(
  6848. '_receiver_',
  6849. smalltalk.method({
  6850. selector: 'receiver:',
  6851. category: 'accessing',
  6852. fn: function (anObject){
  6853. var self=this;
  6854. self['@receiver']=anObject;
  6855. return self;},
  6856. source: unescape('receiver%3A%20anObject%0A%09receiver%20%3A%3D%20anObject'),
  6857. messageSends: [],
  6858. referencedClasses: []
  6859. }),
  6860. smalltalk.MessageNotUnderstood);
  6861. smalltalk.addMethod(
  6862. '_messageText',
  6863. smalltalk.method({
  6864. selector: 'messageText',
  6865. category: 'accessing',
  6866. fn: function (){
  6867. var self=this;
  6868. 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", [])]);
  6869. return self;},
  6870. source: unescape('messageText%0A%09%5Eself%20receiver%20asString%2C%20%27%20does%20not%20understand%20%23%27%2C%20self%20message%20selector'),
  6871. messageSends: [unescape("%2C"), "asString", "receiver", "selector", "message"],
  6872. referencedClasses: []
  6873. }),
  6874. smalltalk.MessageNotUnderstood);
  6875. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel');
  6876. smalltalk.addMethod(
  6877. '_handleError_',
  6878. smalltalk.method({
  6879. selector: 'handleError:',
  6880. category: 'error handling',
  6881. fn: function (anError){
  6882. var self=this;
  6883. (($receiver = smalltalk.send(anError, "_context", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})() : nil;
  6884. smalltalk.send(self, "_logError_", [anError]);
  6885. return self;},
  6886. source: unescape('handleError%3A%20anError%0A%09anError%20context%20ifNotNil%3A%20%5Bself%20logErrorContext%3A%20anError%20context%5D.%0A%09self%20logError%3A%20anError'),
  6887. messageSends: ["ifNotNil:", "context", "logErrorContext:", "logError:"],
  6888. referencedClasses: []
  6889. }),
  6890. smalltalk.ErrorHandler);
  6891. smalltalk.addMethod(
  6892. '_logContext_',
  6893. smalltalk.method({
  6894. selector: 'logContext:',
  6895. category: 'private',
  6896. fn: function (aContext){
  6897. var self=this;
  6898. (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;
  6899. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  6900. return self;},
  6901. source: unescape('logContext%3A%20aContext%0A%09aContext%20home%20ifNotNil%3A%20%5B%0A%09%09self%20logContext%3A%20aContext%20home%5D.%0A%09self%20log%3A%20aContext%20receiver%20asString%2C%20%27%3E%3E%27%2C%20aContext%20selector'),
  6902. messageSends: ["ifNotNil:", "home", "logContext:", "log:", unescape("%2C"), "asString", "receiver", "selector"],
  6903. referencedClasses: []
  6904. }),
  6905. smalltalk.ErrorHandler);
  6906. smalltalk.addMethod(
  6907. '_logErrorContext_',
  6908. smalltalk.method({
  6909. selector: 'logErrorContext:',
  6910. category: 'private',
  6911. fn: function (aContext){
  6912. var self=this;
  6913. (($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;
  6914. return self;},
  6915. source: unescape('logErrorContext%3A%20aContext%0A%09aContext%20ifNotNil%3A%20%5B%0A%09%09aContext%20home%20ifNotNil%3A%20%5B%0A%09%09%09self%20logContext%3A%20aContext%20home%5D%5D'),
  6916. messageSends: ["ifNotNil:", "home", "logContext:"],
  6917. referencedClasses: []
  6918. }),
  6919. smalltalk.ErrorHandler);
  6920. smalltalk.addMethod(
  6921. '_logError_',
  6922. smalltalk.method({
  6923. selector: 'logError:',
  6924. category: 'private',
  6925. fn: function (anError){
  6926. var self=this;
  6927. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  6928. return self;},
  6929. source: unescape('logError%3A%20anError%0A%09self%20log%3A%20anError%20messageText'),
  6930. messageSends: ["log:", "messageText"],
  6931. referencedClasses: []
  6932. }),
  6933. smalltalk.ErrorHandler);
  6934. smalltalk.addMethod(
  6935. '_log_',
  6936. smalltalk.method({
  6937. selector: 'log:',
  6938. category: 'private',
  6939. fn: function (aString){
  6940. var self=this;
  6941. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [aString]);
  6942. return self;},
  6943. source: unescape('log%3A%20aString%0A%09console%20log%3A%20aString'),
  6944. messageSends: ["log:"],
  6945. referencedClasses: []
  6946. }),
  6947. smalltalk.ErrorHandler);
  6948. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  6949. smalltalk.addMethod(
  6950. '_current',
  6951. smalltalk.method({
  6952. selector: 'current',
  6953. category: 'accessing',
  6954. fn: function (){
  6955. var self=this;
  6956. return self['@current'];
  6957. return self;},
  6958. source: unescape('current%0A%09%5Ecurrent'),
  6959. messageSends: [],
  6960. referencedClasses: []
  6961. }),
  6962. smalltalk.ErrorHandler.klass);
  6963. smalltalk.addMethod(
  6964. '_initialize',
  6965. smalltalk.method({
  6966. selector: 'initialize',
  6967. category: 'initialization',
  6968. fn: function (){
  6969. var self=this;
  6970. smalltalk.send(self, "_register", []);
  6971. return self;},
  6972. source: unescape('initialize%0A%09self%20register'),
  6973. messageSends: ["register"],
  6974. referencedClasses: []
  6975. }),
  6976. smalltalk.ErrorHandler.klass);
  6977. smalltalk.addMethod(
  6978. '_register',
  6979. smalltalk.method({
  6980. selector: 'register',
  6981. category: 'initialization',
  6982. fn: function (){
  6983. var self=this;
  6984. smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  6985. return self;},
  6986. source: unescape('register%0A%09ErrorHandler%20setCurrent%3A%20self%20new'),
  6987. messageSends: ["setCurrent:", "new"],
  6988. referencedClasses: [smalltalk.ErrorHandler]
  6989. }),
  6990. smalltalk.ErrorHandler.klass);
  6991. smalltalk.addMethod(
  6992. '_setCurrent_',
  6993. smalltalk.method({
  6994. selector: 'setCurrent:',
  6995. category: 'accessing',
  6996. fn: function (anHandler){
  6997. var self=this;
  6998. self['@current']=anHandler;
  6999. return self;},
  7000. source: unescape('setCurrent%3A%20anHandler%0A%09current%20%3A%3D%20anHandler'),
  7001. messageSends: [],
  7002. referencedClasses: []
  7003. }),
  7004. smalltalk.ErrorHandler.klass);
  7005. smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
  7006. smalltalk.addMethod(
  7007. '_main',
  7008. smalltalk.method({
  7009. selector: 'main',
  7010. category: 'not yet classified',
  7011. fn: function (){
  7012. var self=this;
  7013. var result=nil;
  7014. result=smalltalk.send((0), "_tinyBenchmarks", []);
  7015. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("0%20tinyBenchmarks%20%3D%3E%20"), "__comma", [smalltalk.send(result, "_asString", [])])]);
  7016. result=smalltalk.send((0), "_jstinyBenchmarks", []);
  7017. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(unescape("0%20jstinyBenchmarks%20%3D%3E%20"), "__comma", [smalltalk.send(result, "_asString", [])])]);
  7018. return self;},
  7019. source: unescape('main%0A%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%200%20tinyBenchmarks.%0A%09console%20log%3A%20%270%20tinyBenchmarks%20%3D%3E%20%27%20%2C%20result%20asString.%0A%09result%20%3A%3D%200%20jstinyBenchmarks.%0A%09console%20log%3A%20%270%20jstinyBenchmarks%20%3D%3E%20%27%20%2C%20result%20asString'),
  7020. messageSends: ["tinyBenchmarks", "log:", unescape("%2C"), "asString", "jstinyBenchmarks"],
  7021. referencedClasses: []
  7022. }),
  7023. smalltalk.Benchfib.klass);
  7024. smalltalk.addMethod(
  7025. '_benchFib',
  7026. smalltalk.method({
  7027. selector: 'benchFib',
  7028. category: '*Benchfib',
  7029. fn: function (){
  7030. var self=this;
  7031. return (($receiver = self < (2)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (1);})() : (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (1);}), (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
  7032. return self;},
  7033. source: unescape('benchFib%0A%09%22Handy%20send-heavy%20benchmark%22%0A%09%22%28result%20//%20seconds%20to%20run%29%20%3D%20approx%20calls%20per%20second%22%0A%09%22%20%7C%20r%20t%20%7C%0A%09%20%20t%20%3A%3D%20Time%20millisecondsToRun%3A%20%5Br%20%3A%3D%2026%20benchFib%5D.%0A%09%20%20%28r%20*%201000%29%20//%20t%22%0A%09%22138000%20on%20a%20Mac%208100/100%22%0A%09%5E%20self%20%3C%202%0A%09%09ifTrue%3A%20%5B1%5D%20%0A%09%09ifFalse%3A%20%5B%28self-1%29%20benchFib%20+%20%28self-2%29%20benchFib%20+%201%5D'),
  7034. messageSends: ["ifTrue:ifFalse:", unescape("%3C"), unescape("+"), "benchFib", unescape("-")],
  7035. referencedClasses: []
  7036. }),
  7037. smalltalk.Number);
  7038. smalltalk.addMethod(
  7039. '_benchmark',
  7040. smalltalk.method({
  7041. selector: 'benchmark',
  7042. category: '*Benchfib',
  7043. fn: function (){
  7044. var self=this;
  7045. var size=nil;
  7046. var flags=nil;
  7047. var prime=nil;
  7048. var k=nil;
  7049. var count=nil;
  7050. size=(8190);
  7051. smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send((smalltalk.Array || Array), "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return (($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);})]);})]);
  7052. return count;
  7053. return self;},
  7054. source: unescape('benchmark%20%20%22Handy%20bytecode-heavy%20benchmark%22%0A%09%22%28500000%20//%20time%20to%20run%29%20%3D%20approx%20bytecodes%20per%20second%22%0A%09%225000000%20//%20%28Time%20millisecondsToRun%3A%20%5B10%20benchmark%5D%29%20*%201000%22%0A%09%223059000%20on%20a%20Mac%208100/100%22%0A%20%20%20%20%7C%20size%20flags%20prime%20k%20count%20%7C%0A%20%20%20%20size%20%3A%3D%208190.%0A%20%20%20%201%20to%3A%20self%20do%3A%0A%20%20%20%20%20%20%20%20%5B%3Aiter%20%7C%0A%20%20%20%20%20%20%20%20count%20%3A%3D%200.%0A%20%20%20%20%20%20%20%20flags%20%3A%3D%20Array%20new.%0A%20%20%20%20%20%20%20%20size%20timesRepeat%3A%20%5B%20flags%20add%3A%20true%5D.%0A%20%20%20%20%20%20%20%201%20to%3A%20size%20do%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%5B%3Ai%20%7C%20%28flags%20at%3A%20i%29%20ifTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bprime%20%3A%3D%20i+1.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20i%20+%20prime.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bk%20%3C%3D%20size%5D%20whileTrue%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Bflags%20at%3A%20k%20put%3A%20false.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20k%20%3A%3D%20k%20+%20prime%5D.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20count%20%3A%3D%20count%20+%201%5D%5D%5D.%0A%20%20%20%20%5E%20count'),
  7055. messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "at:", unescape("+"), "whileTrue:", unescape("%3C%3D"), "at:put:"],
  7056. referencedClasses: [smalltalk.Array]
  7057. }),
  7058. smalltalk.Number);
  7059. smalltalk.addMethod(
  7060. '_tinyBenchmarks',
  7061. smalltalk.method({
  7062. selector: 'tinyBenchmarks',
  7063. category: '*Benchfib',
  7064. fn: function (){
  7065. var self=this;
  7066. var t1=nil;
  7067. var t2=nil;
  7068. var r=nil;
  7069. var n1=nil;
  7070. var n2=nil;
  7071. n1=(1);
  7072. (function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
  7073. n2=(28);
  7074. (function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
  7075. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
  7076. return self;},
  7077. source: unescape('tinyBenchmarks%0A%09%22Report%20the%20results%20of%20running%20the%20two%20tiny%20Squeak%20benchmarks.%0A%09ar%209/10/1999%3A%20Adjusted%20to%20run%20at%20least%201%20sec%20to%20get%20more%20stable%20results%22%0A%09%220%20tinyBenchmarks%22%0A%09%22On%20a%20292%20MHz%20G3%20Mac%3A%2022727272%20bytecodes/sec%3B%20984169%20sends/sec%22%0A%09%22On%20a%20400%20MHz%20PII/Win98%3A%20%2018028169%20bytecodes/sec%3B%201081272%20sends/sec%22%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20benchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2028.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20benchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23benchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
  7078. messageSends: ["whileTrue:", "millisecondsToRun:", "benchmark", unescape("%3C"), unescape("*"), "benchFib", unescape("+"), unescape("%2C"), "printString", unescape("/")],
  7079. referencedClasses: [smalltalk.Date]
  7080. }),
  7081. smalltalk.Number);
  7082. smalltalk.addMethod(
  7083. '_jsbenchFib',
  7084. smalltalk.method({
  7085. selector: 'jsbenchFib',
  7086. category: '*Benchfib',
  7087. fn: function (){
  7088. var self=this;
  7089. if (this < 2) {
  7090. return 1;
  7091. } else {
  7092. return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
  7093. return self;},
  7094. source: unescape('jsbenchFib%0A%20%0A%09%3Cif%20%28this%20%3C%202%29%20%7B%0Areturn%201%3B%0A%7D%20else%20%7B%0Areturn%20%28this-1%29._jsbenchFib%28%29%20+%20%28this-2%29._jsbenchFib%28%29%20+%201%3B%7D%3E'),
  7095. messageSends: [],
  7096. referencedClasses: []
  7097. }),
  7098. smalltalk.Number);
  7099. smalltalk.addMethod(
  7100. '_jsbenchmark',
  7101. smalltalk.method({
  7102. selector: 'jsbenchmark',
  7103. category: '*Benchfib',
  7104. fn: function (){
  7105. var self=this;
  7106. var size = 8190;
  7107. var count;
  7108. for (var z=0;z<this;z++) {
  7109. count = 0;
  7110. var flags = new Array();
  7111. for (var p=0; p<size; p++) {
  7112. flags[p] = true;
  7113. }
  7114. for (var i=1;i<=size;i++) {
  7115. if (flags[i-1]) {
  7116. var prime = i+1;
  7117. var k = i + prime;
  7118. while (k <= size) {
  7119. flags[k-1] = false;
  7120. k = k + prime;
  7121. }
  7122. count = count + 1;
  7123. }
  7124. }
  7125. }
  7126. return count;
  7127. return self;},
  7128. source: unescape('jsbenchmark%0A%0A%3C%0Avar%20size%20%3D%208190%3B%0Avar%20count%3B%0Afor%20%28var%20z%3D0%3Bz%3Cthis%3Bz++%29%20%7B%0A%20%20count%20%3D%200%3B%0A%20%20var%20flags%20%3D%20new%20Array%28%29%3B%0A%20%20for%20%28var%20p%3D0%3B%20p%3Csize%3B%20p++%29%20%7B%0A%20%20%20%20flags%5Bp%5D%20%3D%20true%3B%0A%20%20%7D%0A%20%20for%20%28var%20i%3D1%3Bi%3C%3Dsize%3Bi++%29%20%7B%0A%20%20%20%20if%20%28flags%5Bi-1%5D%29%20%7B%0A%20%20%20%20%20%20var%20prime%20%3D%20i+1%3B%0A%20%20%20%20%20%20var%20k%20%3D%20i%20+%20prime%3B%0A%20%20%20%20%20%20while%20%28k%20%3C%3D%20size%29%20%7B%0A%20%20%20%20%20%20%20%20flags%5Bk-1%5D%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20k%20%3D%20k%20+%20prime%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20count%20%3D%20count%20+%201%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0Areturn%20count%3E'),
  7129. messageSends: [],
  7130. referencedClasses: []
  7131. }),
  7132. smalltalk.Number);
  7133. smalltalk.addMethod(
  7134. '_jstinyBenchmarks',
  7135. smalltalk.method({
  7136. selector: 'jstinyBenchmarks',
  7137. category: '*Benchfib',
  7138. fn: function (){
  7139. var self=this;
  7140. var t1=nil;
  7141. var t2=nil;
  7142. var r=nil;
  7143. var n1=nil;
  7144. var n2=nil;
  7145. n1=(1);
  7146. (function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
  7147. n2=(28);
  7148. (function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
  7149. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
  7150. return self;},
  7151. source: unescape('jstinyBenchmarks%0A%09%220%20jstinyBenchmarks%22%0A%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20jsbenchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2028.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20jsbenchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23jsbenchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
  7152. messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", unescape("%3C"), unescape("*"), "jsbenchFib", unescape("+"), unescape("%2C"), "printString", unescape("/")],
  7153. referencedClasses: [smalltalk.Date]
  7154. }),
  7155. smalltalk.Number);
  7156. smalltalk.init(smalltalk.Object);
  7157. smalltalk.classes()._do_(function(each) {each._initialize()});
  7158. smalltalk.Benchfib._main()