1
0

Kernel.deploy.js 162 KB

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