1
0

Kernel.deploy.js 159 KB

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