Kernel.deploy.js 145 KB

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