Kernel.deploy.js 149 KB

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