1
0

Kernel.deploy.js 161 KB

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