1
0

Kernel.deploy.js 138 KB

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