Kernel.deploy.js 147 KB

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