jtalk.deploy.js 161 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495
  1. function Smalltalk(){};
  2. function SmalltalkObject(){};
  3. function SmalltalkBehavior(){};
  4. function SmalltalkClass(){};
  5. function SmalltalkMetaclass(){
  6. this.meta = true;
  7. };
  8. function SmalltalkMethod(){};
  9. function SmalltalkNil(){};
  10. var nil = new SmalltalkNil();
  11. var smalltalk = new Smalltalk();
  12. smalltalk.klass = function(spec) {
  13. var spec = spec || {};
  14. var that;
  15. if(spec.meta) {
  16. that = new SmalltalkMetaclass();
  17. } else {
  18. that = new (smalltalk.klass({meta: true})).fn;
  19. that.klass.instanceClass = that;
  20. that.className = spec.className;
  21. that.klass.className = that.className + ' class';
  22. }
  23. that.fn = spec.fn || function(){};
  24. that.superclass = spec.superclass;
  25. that.iVarNames = spec.iVarNames || [];
  26. if(that.superclass) {
  27. that.klass.superclass = that.superclass.klass;
  28. }
  29. that.category = spec.category || "";
  30. that.fn.prototype.methods = {};
  31. that.fn.prototype.klass = that;
  32. return that;
  33. };
  34. smalltalk.method = function(spec) {
  35. var that = new SmalltalkMethod();
  36. that.selector = spec.selector;
  37. that.category = spec.category;
  38. that.source = spec.source;
  39. that.fn = spec.fn;
  40. return that
  41. };
  42. smalltalk.init = function(klass) {
  43. var subclasses = smalltalk.subclasses(klass);
  44. for(var i=0;i<klass.iVarNames.length;i++) {
  45. klass.fn.prototype["@"+klass.iVarNames[i]] = nil;
  46. }
  47. if(klass.superclass && klass.superclass !== nil) {
  48. klass.fn.prototype.__proto__ = klass.superclass.fn.prototype;
  49. for(var i=0;i<klass.superclass.iVarNames.length;i++) {
  50. if(!klass["@"+klass.superclass.iVarNames[i]]) {
  51. klass.fn.prototype["@"+klass.superclass.iVarNames[i]] = nil;
  52. }
  53. }
  54. }
  55. for(var i=0;i<subclasses.length;i++) {
  56. smalltalk.init(subclasses[i]);
  57. }
  58. if(klass.klass && !klass.meta) {
  59. smalltalk.init(klass.klass);
  60. }
  61. };
  62. smalltalk.classes = function() {
  63. var classes = [];
  64. for(var i in smalltalk) {
  65. if(i.search(/^[A-Z]/g) != -1) {
  66. classes.push(smalltalk[i]);
  67. }
  68. }
  69. return classes
  70. };
  71. smalltalk.subclasses = function(klass) {
  72. var subclasses = [];
  73. var classes = smalltalk.classes();
  74. for(var i in classes) {
  75. if(classes[i].fn) {
  76. //Metaclasses
  77. if(classes[i].klass && classes[i].klass.superclass === klass) {
  78. subclasses.push(classes[i].klass);
  79. }
  80. //Classes
  81. if(classes[i].superclass === klass) {
  82. subclasses.push(classes[i]);
  83. }
  84. }
  85. }
  86. return subclasses;
  87. };
  88. smalltalk.mapClassName = function(className, category, fn, superclass) {
  89. smalltalk[className] = smalltalk.klass({
  90. className: className,
  91. category: category,
  92. superclass: superclass,
  93. fn: fn
  94. });
  95. };
  96. smalltalk.addClass = function(className, superclass, iVarNames, category) {
  97. if(smalltalk[className]) {
  98. smalltalk[className].superclass = superclass;
  99. smalltalk[className].iVarNames = iVarNames;
  100. } else {
  101. smalltalk[className] = smalltalk.klass({
  102. className: className,
  103. iVarNames: iVarNames,
  104. superclass: superclass
  105. });
  106. }
  107. smalltalk[className].category = category || '';
  108. };
  109. smalltalk.addMethod = function(jsSelector, method, klass) {
  110. klass.fn.prototype[jsSelector] = method.fn;
  111. klass.fn.prototype.methods[method.selector] = method;
  112. };
  113. smalltalk.mapClassName("Object", "Kernel", SmalltalkObject);
  114. smalltalk.mapClassName("Smalltalk", "Kernel", Smalltalk, smalltalk.Object);
  115. smalltalk.mapClassName("Behavior", "Kernel", SmalltalkBehavior, smalltalk.Object);
  116. smalltalk.mapClassName("Class", "Kernel", SmalltalkClass, smalltalk.Behavior);
  117. smalltalk.mapClassName("Metaclass", "Kernel", SmalltalkMetaclass, smalltalk.Behavior);
  118. smalltalk.mapClassName("CompiledMethod", "Kernel", SmalltalkMethod, smalltalk.Object);
  119. smalltalk.Object.klass.superclass = smalltalk.Class
  120. smalltalk.mapClassName("Number", "Kernel", Number, smalltalk.Object);
  121. smalltalk.mapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
  122. smalltalk.mapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
  123. smalltalk.mapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object);
  124. smalltalk.mapClassName("Collection", "Kernel", null, smalltalk.Object);
  125. smalltalk.mapClassName("String", "Kernel", String, smalltalk.Collection);
  126. smalltalk.mapClassName("RegularExpression", "Kernel", RegExp, smalltalk.String);
  127. smalltalk.mapClassName("Array", "Kernel", Array, smalltalk.Collection);
  128. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  129. smalltalk.addMethod(
  130. '__eq',
  131. smalltalk.method({
  132. selector: '=',
  133. category: 'comparing',
  134. fn: function (anObject){
  135. var self=this;
  136. return (function(){return self == anObject})();
  137. return self;},
  138. source: unescape('%3D%20anObject%0A%09%5E%7B%27return%20self%20%3D%3D%20anObject%27%7D%0A')}),
  139. smalltalk.Object);
  140. smalltalk.addMethod(
  141. '_~_eq',
  142. smalltalk.method({
  143. selector: '~=',
  144. category: 'comparing',
  145. fn: function (anObject){
  146. var self=this;
  147. return self.__eq(anObject).__eq_eq(false);
  148. return self;},
  149. source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%3D%20false%0A')}),
  150. smalltalk.Object);
  151. smalltalk.addMethod(
  152. '_initialize',
  153. smalltalk.method({
  154. selector: 'initialize',
  155. category: 'initialization',
  156. fn: function (){
  157. var self=this;
  158. return self;},
  159. source: unescape('initialize%0A')}),
  160. smalltalk.Object);
  161. smalltalk.addMethod(
  162. '_yourself',
  163. smalltalk.method({
  164. selector: 'yourself',
  165. category: 'accessing',
  166. fn: function (){
  167. var self=this;
  168. return self;
  169. return self;},
  170. source: unescape('yourself%0A%09%5Eself%0A')}),
  171. smalltalk.Object);
  172. smalltalk.addMethod(
  173. '_class',
  174. smalltalk.method({
  175. selector: 'class',
  176. category: 'accessing',
  177. fn: function (){
  178. var self=this;
  179. return (function(){return self.klass})();
  180. return self;},
  181. source: unescape('class%0A%09%5E%7B%27return%20self.klass%27%7D%0A')}),
  182. smalltalk.Object);
  183. smalltalk.addMethod(
  184. '_size',
  185. smalltalk.method({
  186. selector: 'size',
  187. category: 'accessing',
  188. fn: function (){
  189. var self=this;
  190. self._error_("Object not indexable");
  191. return self;},
  192. source: unescape('size%0A%09self%20error%3A%20%27Object%20not%20indexable%27%0A')}),
  193. smalltalk.Object);
  194. smalltalk.addMethod(
  195. '_copy',
  196. smalltalk.method({
  197. selector: 'copy',
  198. category: 'copying',
  199. fn: function (){
  200. var self=this;
  201. return self._shallowCopy()._postCopy();
  202. return self;},
  203. source: unescape('copy%0A%09%5Eself%20shallowCopy%20postCopy%0A')}),
  204. smalltalk.Object);
  205. smalltalk.addMethod(
  206. '_shallowCopy',
  207. smalltalk.method({
  208. selector: 'shallowCopy',
  209. category: 'copying',
  210. fn: function (){
  211. var self=this;
  212. return (function(){
  213. var copy = self.klass._new();
  214. for(var i in self) {
  215. if(/^@.+/.test(i)) {
  216. copy[i] = self[i];
  217. }
  218. }
  219. return copy;
  220. })();
  221. return self;},
  222. source: unescape('shallowCopy%0A%09%5E%7B%27%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%27%7D%0A')}),
  223. smalltalk.Object);
  224. smalltalk.addMethod(
  225. '_deepCopy',
  226. smalltalk.method({
  227. selector: 'deepCopy',
  228. category: 'copying',
  229. fn: function (){
  230. var self=this;
  231. (function(){
  232. var copy = self.klass._new();
  233. for(var i in self) {
  234. if(/^@.+/.test(i)) {
  235. copy[i] = self[i]._deepCopy();
  236. }
  237. }
  238. return copy;
  239. })();
  240. return self;},
  241. source: unescape('deepCopy%0A%09%7B%27%09%20%20%20%20%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D._deepCopy%28%29%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%27%7D.%0A')}),
  242. smalltalk.Object);
  243. smalltalk.addMethod(
  244. '_postCopy',
  245. smalltalk.method({
  246. selector: 'postCopy',
  247. category: 'copying',
  248. fn: function (){
  249. var self=this;
  250. return self;},
  251. source: unescape('postCopy%0A')}),
  252. smalltalk.Object);
  253. smalltalk.addMethod(
  254. '__minus_gt',
  255. smalltalk.method({
  256. selector: '->',
  257. category: 'converting',
  258. fn: function (anObject){
  259. var self=this;
  260. return smalltalk.Association._key_value_(self,anObject);
  261. return self;},
  262. source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject%0A')}),
  263. smalltalk.Object);
  264. smalltalk.addMethod(
  265. '_asString',
  266. smalltalk.method({
  267. selector: 'asString',
  268. category: 'converting',
  269. fn: function (){
  270. var self=this;
  271. return self._printString();
  272. return self;},
  273. source: unescape('asString%0A%09%5Eself%20printString%0A')}),
  274. smalltalk.Object);
  275. smalltalk.addMethod(
  276. '_asJavascript',
  277. smalltalk.method({
  278. selector: 'asJavascript',
  279. category: 'converting',
  280. fn: function (){
  281. var self=this;
  282. return self._asString();
  283. return self;},
  284. source: unescape('asJavascript%0A%09%5Eself%20asString%0A')}),
  285. smalltalk.Object);
  286. smalltalk.addMethod(
  287. '_perform_',
  288. smalltalk.method({
  289. selector: 'perform:',
  290. category: 'message handling',
  291. fn: function (aSymbol){
  292. var self=this;
  293. return self._perform_withArguments_(aSymbol,[]);
  294. return self;},
  295. source: unescape('perform%3A%20aSymbol%0A%09%5Eself%20perform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A')}),
  296. smalltalk.Object);
  297. smalltalk.addMethod(
  298. '_perform_withArguments_',
  299. smalltalk.method({
  300. selector: 'perform:withArguments:',
  301. category: 'error handling',
  302. fn: function (aSymbol, aCollection){
  303. var self=this;
  304. return self._basicPerform_withArguments_(aSymbol._asSelector(),aCollection);
  305. return self;},
  306. source: unescape('perform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5Eself%20basicPerform%3A%20aSymbol%20asSelector%20withArguments%3A%20aCollection%0A')}),
  307. smalltalk.Object);
  308. smalltalk.addMethod(
  309. '_instVarAt_',
  310. smalltalk.method({
  311. selector: 'instVarAt:',
  312. category: 'accessing',
  313. fn: function (aString){
  314. var self=this;
  315. return (function(){
  316. var value = self['@'+aString];
  317. if(typeof(value) == 'undefined') {
  318. return nil;
  319. } else {
  320. return value;
  321. }
  322. })();
  323. return self;},
  324. source: unescape('instVarAt%3A%20aString%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5B%27%27@%27%27+aString%5D%3B%0A%09%20%20%20%20if%28typeof%28value%29%20%3D%3D%20%27%27undefined%27%27%29%20%7B%0A%09%09return%20nil%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  325. smalltalk.Object);
  326. smalltalk.addMethod(
  327. '_instVarAt_put_',
  328. smalltalk.method({
  329. selector: 'instVarAt:put:',
  330. category: 'accessing',
  331. fn: function (aString, anObject){
  332. var self=this;
  333. return (function(){self['@' + aString] = anObject})();
  334. return self;},
  335. source: unescape('instVarAt%3A%20aString%20put%3A%20anObject%0A%09%5E%7B%27self%5B%27%27@%27%27%20+%20aString%5D%20%3D%20anObject%27%7D%0A')}),
  336. smalltalk.Object);
  337. smalltalk.addMethod(
  338. '_basicAt_',
  339. smalltalk.method({
  340. selector: 'basicAt:',
  341. category: 'accessing',
  342. fn: function (aString){
  343. var self=this;
  344. return (function(){
  345. var value = self[aString];
  346. if(typeof(value) == 'undefined') {
  347. return nil;
  348. } else {
  349. return value;
  350. }
  351. })();
  352. return self;},
  353. source: unescape('basicAt%3A%20aString%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5BaString%5D%3B%0A%09%20%20%20%20if%28typeof%28value%29%20%3D%3D%20%27%27undefined%27%27%29%20%7B%0A%09%09return%20nil%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  354. smalltalk.Object);
  355. smalltalk.addMethod(
  356. '_basicAt_put_',
  357. smalltalk.method({
  358. selector: 'basicAt:put:',
  359. category: 'accessing',
  360. fn: function (aString, anObject){
  361. var self=this;
  362. return (function(){return self[aString] = anObject})();
  363. return self;},
  364. source: unescape('basicAt%3A%20aString%20put%3A%20anObject%0A%09%5E%7B%27return%20self%5BaString%5D%20%3D%20anObject%27%7D%0A')}),
  365. smalltalk.Object);
  366. smalltalk.addMethod(
  367. '_error_',
  368. smalltalk.method({
  369. selector: 'error:',
  370. category: 'error handling',
  371. fn: function (aString){
  372. var self=this;
  373. smalltalk.Error._signal_(aString);
  374. return self;},
  375. source: unescape('error%3A%20aString%0A%09Error%20signal%3A%20aString%0A')}),
  376. smalltalk.Object);
  377. smalltalk.addMethod(
  378. '_subclassResponsibility',
  379. smalltalk.method({
  380. selector: 'subclassResponsibility',
  381. category: 'error handling',
  382. fn: function (){
  383. var self=this;
  384. self._error_("This method is a responsibility of a subclass");
  385. return self;},
  386. source: unescape('subclassResponsibility%0A%09self%20error%3A%20%27This%20method%20is%20a%20responsibility%20of%20a%20subclass%27%0A')}),
  387. smalltalk.Object);
  388. smalltalk.addMethod(
  389. '_shouldNotImplement',
  390. smalltalk.method({
  391. selector: 'shouldNotImplement',
  392. category: 'error handling',
  393. fn: function (){
  394. var self=this;
  395. self._error_("This method should not be implemented in ".__comma(self._class()._name()));
  396. return self;},
  397. source: unescape('shouldNotImplement%0A%09self%20error%3A%20%27This%20method%20should%20not%20be%20implemented%20in%20%27%2C%20self%20class%20name%0A')}),
  398. smalltalk.Object);
  399. smalltalk.addMethod(
  400. '_try_catch_',
  401. smalltalk.method({
  402. selector: 'try:catch:',
  403. category: 'error handling',
  404. fn: function (aBlock, anotherBlock){
  405. var self=this;
  406. (function(){try{aBlock()} catch(e) {anotherBlock(e)}})();
  407. return self;},
  408. source: unescape('try%3A%20aBlock%20catch%3A%20anotherBlock%0A%09%7B%27try%7BaBlock%28%29%7D%20catch%28e%29%20%7BanotherBlock%28e%29%7D%27%7D%0A')}),
  409. smalltalk.Object);
  410. smalltalk.addMethod(
  411. '_printString',
  412. smalltalk.method({
  413. selector: 'printString',
  414. category: 'printing',
  415. fn: function (){
  416. var self=this;
  417. return "a ".__comma(self._class()._name());
  418. return self;},
  419. source: unescape('printString%0A%09%5E%27a%20%27%2C%20self%20class%20name%0A')}),
  420. smalltalk.Object);
  421. smalltalk.addMethod(
  422. '_printNl',
  423. smalltalk.method({
  424. selector: 'printNl',
  425. category: 'printing',
  426. fn: function (){
  427. var self=this;
  428. (function(){console.log(self)})();
  429. return self;},
  430. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A')}),
  431. smalltalk.Object);
  432. smalltalk.addMethod(
  433. '_isKindOf_',
  434. smalltalk.method({
  435. selector: 'isKindOf:',
  436. category: 'testing',
  437. fn: function (aClass){
  438. var self=this;
  439. return self._isMemberOf_(aClass)._ifTrue_ifFalse_((function(){return true;}),(function(){return self._class()._inheritsFrom_(aClass);}));
  440. return self;},
  441. source: unescape('isKindOf%3A%20aClass%0A%09%5E%28self%20isMemberOf%3A%20aClass%29%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20class%20inheritsFrom%3A%20aClass%5D%0A')}),
  442. smalltalk.Object);
  443. smalltalk.addMethod(
  444. '_isMemberOf_',
  445. smalltalk.method({
  446. selector: 'isMemberOf:',
  447. category: 'testing',
  448. fn: function (aClass){
  449. var self=this;
  450. return self._class().__eq(aClass);
  451. return self;},
  452. source: unescape('isMemberOf%3A%20aClass%0A%09%5Eself%20class%20%3D%20aClass%0A')}),
  453. smalltalk.Object);
  454. smalltalk.addMethod(
  455. '_ifNil_',
  456. smalltalk.method({
  457. selector: 'ifNil:',
  458. category: 'testing',
  459. fn: function (aBlock){
  460. var self=this;
  461. return self;
  462. return self;},
  463. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%0A')}),
  464. smalltalk.Object);
  465. smalltalk.addMethod(
  466. '_ifNil_ifNotNil_',
  467. smalltalk.method({
  468. selector: 'ifNil:ifNotNil:',
  469. category: 'testing',
  470. fn: function (aBlock, anotherBlock){
  471. var self=this;
  472. return anotherBlock._value();
  473. return self;},
  474. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A')}),
  475. smalltalk.Object);
  476. smalltalk.addMethod(
  477. '_ifNotNil_',
  478. smalltalk.method({
  479. selector: 'ifNotNil:',
  480. category: 'testing',
  481. fn: function (aBlock){
  482. var self=this;
  483. return aBlock._value();
  484. return self;},
  485. source: unescape('ifNotNil%3A%20aBlock%0A%09%5EaBlock%20value%0A')}),
  486. smalltalk.Object);
  487. smalltalk.addMethod(
  488. '_ifNotNil_ifNil_',
  489. smalltalk.method({
  490. selector: 'ifNotNil:ifNil:',
  491. category: 'testing',
  492. fn: function (aBlock, anotherBlock){
  493. var self=this;
  494. return aBlock._value();
  495. return self;},
  496. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A')}),
  497. smalltalk.Object);
  498. smalltalk.addMethod(
  499. '_isNil',
  500. smalltalk.method({
  501. selector: 'isNil',
  502. category: 'testing',
  503. fn: function (){
  504. var self=this;
  505. return false;
  506. return self;},
  507. source: unescape('isNil%0A%09%5Efalse%0A')}),
  508. smalltalk.Object);
  509. smalltalk.addMethod(
  510. '_notNil',
  511. smalltalk.method({
  512. selector: 'notNil',
  513. category: 'testing',
  514. fn: function (){
  515. var self=this;
  516. return self._isNil()._not();
  517. return self;},
  518. source: unescape('notNil%0A%09%5Eself%20isNil%20not%0A')}),
  519. smalltalk.Object);
  520. smalltalk.addMethod(
  521. '_isClass',
  522. smalltalk.method({
  523. selector: 'isClass',
  524. category: 'testing',
  525. fn: function (){
  526. var self=this;
  527. return false;
  528. return self;},
  529. source: unescape('isClass%0A%09%5Efalse%0A')}),
  530. smalltalk.Object);
  531. smalltalk.addMethod(
  532. '_isMetaclass',
  533. smalltalk.method({
  534. selector: 'isMetaclass',
  535. category: 'testing',
  536. fn: function (){
  537. var self=this;
  538. return false;
  539. return self;},
  540. source: unescape('isMetaclass%0A%09%5Efalse%0A')}),
  541. smalltalk.Object);
  542. smalltalk.addMethod(
  543. '_isNumber',
  544. smalltalk.method({
  545. selector: 'isNumber',
  546. category: 'testing',
  547. fn: function (){
  548. var self=this;
  549. return false;
  550. return self;},
  551. source: unescape('isNumber%0A%09%5Efalse%0A')}),
  552. smalltalk.Object);
  553. smalltalk.addMethod(
  554. '_isString',
  555. smalltalk.method({
  556. selector: 'isString',
  557. category: 'testing',
  558. fn: function (){
  559. var self=this;
  560. return false;
  561. return self;},
  562. source: unescape('isString%0A%09%5Efalse%0A')}),
  563. smalltalk.Object);
  564. smalltalk.addMethod(
  565. '_isParseFailure',
  566. smalltalk.method({
  567. selector: 'isParseFailure',
  568. category: 'testing',
  569. fn: function (){
  570. var self=this;
  571. return false;
  572. return self;},
  573. source: unescape('isParseFailure%0A%09%5Efalse%0A')}),
  574. smalltalk.Object);
  575. smalltalk.addMethod(
  576. '_basicPerform_',
  577. smalltalk.method({
  578. selector: 'basicPerform:',
  579. category: 'error handling',
  580. fn: function (aSymbol){
  581. var self=this;
  582. return self._basicPerform_withArguments_(aSymbol,[]);
  583. return self;},
  584. source: unescape('basicPerform%3A%20aSymbol%20%0A%20%20%20%20%5Eself%20basicPerform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A')}),
  585. smalltalk.Object);
  586. smalltalk.addMethod(
  587. '_basicPerform_withArguments_',
  588. smalltalk.method({
  589. selector: 'basicPerform:withArguments:',
  590. category: 'error handling',
  591. fn: function (aSymbol, aCollection){
  592. var self=this;
  593. return (function(){return self[aSymbol].apply(self, aCollection);})();
  594. return self;},
  595. source: unescape('basicPerform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5E%7B%27return%20self%5BaSymbol%5D.apply%28self%2C%20aCollection%29%3B%27%7D%0A')}),
  596. smalltalk.Object);
  597. smalltalk.addMethod(
  598. '_appendToBrush_',
  599. smalltalk.method({
  600. selector: 'appendToBrush:',
  601. category: '*Canvas',
  602. fn: function (aTagBrush){
  603. var self=this;
  604. aTagBrush._append_(self._asString());
  605. return self;},
  606. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20append%3A%20self%20asString%0A')}),
  607. smalltalk.Object);
  608. smalltalk.addMethod(
  609. '_basicDelete_',
  610. smalltalk.method({
  611. selector: 'basicDelete:',
  612. category: 'accessing',
  613. fn: function (aString){
  614. var self=this;
  615. (function(){delete self[aString]})();
  616. return self;},
  617. source: unescape('basicDelete%3A%20aString%0A%20%20%20%20%7B%27delete%20self%5BaString%5D%27%7D%0A')}),
  618. smalltalk.Object);
  619. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  620. smalltalk.addMethod(
  621. '_classes',
  622. smalltalk.method({
  623. selector: 'classes',
  624. category: 'accessing',
  625. fn: function (){
  626. var self=this;
  627. return (function(){return self.classes()})();
  628. return self;},
  629. source: unescape('classes%0A%09%5E%7B%27return%20self.classes%28%29%27%7D%0A')}),
  630. smalltalk.Smalltalk);
  631. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  632. smalltalk.addMethod(
  633. '_current',
  634. smalltalk.method({
  635. selector: 'current',
  636. category: 'accessing',
  637. fn: function (){
  638. var self=this;
  639. return (function(){return smalltalk})();
  640. return self;},
  641. source: unescape('current%0A%09%20%20%20%20%5E%7B%27return%20smalltalk%27%7D%0A')}),
  642. smalltalk.Smalltalk.klass);
  643. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  644. smalltalk.addMethod(
  645. '_new',
  646. smalltalk.method({
  647. selector: 'new',
  648. category: 'instance creation',
  649. fn: function (){
  650. var self=this;
  651. return (function($rec){$rec._initialize();return $rec._yourself();})(self._basicNew());
  652. return self;},
  653. source: unescape('new%0A%09%5Eself%20basicNew%20%0A%09%20%20%20%20initialize%3B%0A%09%20%20%20%20yourself%0A')}),
  654. smalltalk.Behavior);
  655. smalltalk.addMethod(
  656. '_basicNew',
  657. smalltalk.method({
  658. selector: 'basicNew',
  659. category: 'instance creation',
  660. fn: function (){
  661. var self=this;
  662. return (function(){return new self.fn();})();
  663. return self;},
  664. source: unescape('basicNew%0A%09%5E%7B%27return%20new%20self.fn%28%29%3B%27%7D%0A')}),
  665. smalltalk.Behavior);
  666. smalltalk.addMethod(
  667. '_name',
  668. smalltalk.method({
  669. selector: 'name',
  670. category: 'accessing',
  671. fn: function (){
  672. var self=this;
  673. return (function(){return self.className || nil})();
  674. return self;},
  675. source: unescape('name%0A%09%5E%7B%27return%20self.className%20%7C%7C%20nil%27%7D%0A')}),
  676. smalltalk.Behavior);
  677. smalltalk.addMethod(
  678. '_superclass',
  679. smalltalk.method({
  680. selector: 'superclass',
  681. category: 'accessing',
  682. fn: function (){
  683. var self=this;
  684. return (function(){return self.superclass || nil})();
  685. return self;},
  686. source: unescape('superclass%0A%09%5E%7B%27return%20self.superclass%20%7C%7C%20nil%27%7D%0A')}),
  687. smalltalk.Behavior);
  688. smalltalk.addMethod(
  689. '_subclasses',
  690. smalltalk.method({
  691. selector: 'subclasses',
  692. category: 'accessing',
  693. fn: function (){
  694. var self=this;
  695. return (function(){return smalltalk.subclasses(self)})();
  696. return self;},
  697. source: unescape('subclasses%0A%09%5E%7B%27return%20smalltalk.subclasses%28self%29%27%7D%0A')}),
  698. smalltalk.Behavior);
  699. smalltalk.addMethod(
  700. '_allSubclasses',
  701. smalltalk.method({
  702. selector: 'allSubclasses',
  703. category: 'accessing',
  704. fn: function (){
  705. var self=this;
  706. var result=nil;
  707. result=self._subclasses();
  708. self._subclasses()._do_((function(each){return result._addAll_(each._allSubclasses());}));
  709. return result;
  710. return self;},
  711. source: unescape('allSubclasses%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20self%20subclasses.%0A%09self%20subclasses%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20result%20addAll%3A%20each%20allSubclasses%5D.%0A%09%5Eresult%0A')}),
  712. smalltalk.Behavior);
  713. smalltalk.addMethod(
  714. '_withAllSubclasses',
  715. smalltalk.method({
  716. selector: 'withAllSubclasses',
  717. category: 'accessing',
  718. fn: function (){
  719. var self=this;
  720. return (function($rec){$rec._addAll_(self._allSubclasses());return $rec._yourself();})(smalltalk.Array._with_(self));
  721. return self;},
  722. source: unescape('withAllSubclasses%0A%09%5E%28Array%20with%3A%20self%29%20addAll%3A%20self%20allSubclasses%3B%20yourself%0A')}),
  723. smalltalk.Behavior);
  724. smalltalk.addMethod(
  725. '_prototype',
  726. smalltalk.method({
  727. selector: 'prototype',
  728. category: 'accessing',
  729. fn: function (){
  730. var self=this;
  731. return (function(){return self.fn.prototype})();
  732. return self;},
  733. source: unescape('prototype%0A%09%5E%7B%27return%20self.fn.prototype%27%7D%0A')}),
  734. smalltalk.Behavior);
  735. smalltalk.addMethod(
  736. '_methodDictionary',
  737. smalltalk.method({
  738. selector: 'methodDictionary',
  739. category: 'accessing',
  740. fn: function (){
  741. var self=this;
  742. return (function(){var dict = smalltalk.Dictionary._new();
  743. var methods = self.fn.prototype.methods;
  744. for(var i in methods) {
  745. if(methods[i].selector) {
  746. dict._at_put_(methods[i].selector, methods[i]);
  747. }
  748. };
  749. return dict})();
  750. return self;},
  751. source: unescape('methodDictionary%0A%09%5E%7B%27var%20dict%20%3D%20smalltalk.Dictionary._new%28%29%3B%0A%09var%20methods%20%3D%20self.fn.prototype.methods%3B%0A%09for%28var%20i%20in%20methods%29%20%7B%0A%09%09if%28methods%5Bi%5D.selector%29%20%7B%0A%09%09%09dict._at_put_%28methods%5Bi%5D.selector%2C%20methods%5Bi%5D%29%3B%0A%09%09%7D%0A%09%7D%3B%0A%09return%20dict%27%7D%0A')}),
  752. smalltalk.Behavior);
  753. smalltalk.addMethod(
  754. '_instVarNames',
  755. smalltalk.method({
  756. selector: 'instVarNames',
  757. category: '',
  758. fn: function () { var self = this; return function () {return self.iVarNames;}(); return self; },
  759. source: unescape('')}),
  760. smalltalk.Behavior);
  761. smalltalk.addMethod(
  762. '_methodsFor_',
  763. smalltalk.method({
  764. selector: 'methodsFor:',
  765. category: 'accessing',
  766. fn: function (aString){
  767. var self=this;
  768. return (function($rec){$rec._class_category_(self,aString);return $rec._yourself();})(smalltalk.ClassCategoryReader._new());
  769. return self;},
  770. source: unescape('methodsFor%3A%20aString%0A%09%5EClassCategoryReader%20new%0A%09%20%20%20%20class%3A%20self%20category%3A%20aString%3B%0A%09%20%20%20%20yourself%0A')}),
  771. smalltalk.Behavior);
  772. smalltalk.addMethod(
  773. '_addCompiledMethod_',
  774. smalltalk.method({
  775. selector: 'addCompiledMethod:',
  776. category: 'accessing',
  777. fn: function (aMethod){
  778. var self=this;
  779. (function(){self.fn.prototype[aMethod.selector._asSelector()] = aMethod.fn;
  780. self.fn.prototype.methods[aMethod.selector] = aMethod})();
  781. return self;},
  782. source: unescape('addCompiledMethod%3A%20aMethod%0A%09%7B%27self.fn.prototype%5BaMethod.selector._asSelector%28%29%5D%20%3D%20aMethod.fn%3B%0A%09self.fn.prototype.methods%5BaMethod.selector%5D%20%3D%20aMethod%27%7D%0A')}),
  783. smalltalk.Behavior);
  784. smalltalk.addMethod(
  785. '_instanceVariableNames',
  786. smalltalk.method({
  787. selector: 'instanceVariableNames',
  788. category: 'accessing',
  789. fn: function (){
  790. var self=this;
  791. return (function(){return self.iVarNames})();
  792. return self;},
  793. source: unescape('instanceVariableNames%0A%09%5E%7B%27return%20self.iVarNames%27%7D%0A')}),
  794. smalltalk.Behavior);
  795. smalltalk.addMethod(
  796. '_comment',
  797. smalltalk.method({
  798. selector: 'comment',
  799. category: 'accessing',
  800. fn: function (){
  801. var self=this;
  802. return self._basicAt_("comment")._ifNil_((function(){return "";}));
  803. return self;},
  804. source: unescape('comment%0A%20%20%20%20%5E%28self%20basicAt%3A%20%27comment%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  805. smalltalk.Behavior);
  806. smalltalk.addMethod(
  807. '_comment_',
  808. smalltalk.method({
  809. selector: 'comment:',
  810. category: 'accessing',
  811. fn: function (aString){
  812. var self=this;
  813. self._basicAt_put_("comment",aString);
  814. return self;},
  815. source: unescape('comment%3A%20aString%0A%20%20%20%20self%20basicAt%3A%20%27comment%27%20put%3A%20aString%0A')}),
  816. smalltalk.Behavior);
  817. smalltalk.addMethod(
  818. '_commentStamp',
  819. smalltalk.method({
  820. selector: 'commentStamp',
  821. category: 'accessing',
  822. fn: function (){
  823. var self=this;
  824. return (function($rec){$rec._class_(self);return $rec._yourself();})(smalltalk.ClassCommentReader._new());
  825. return self;},
  826. source: unescape('commentStamp%0A%20%20%20%20%5EClassCommentReader%20new%0A%09class%3A%20self%3B%0A%09yourself%0A')}),
  827. smalltalk.Behavior);
  828. smalltalk.addMethod(
  829. '_removeCompiledMethod_',
  830. smalltalk.method({
  831. selector: 'removeCompiledMethod:',
  832. category: 'accessing',
  833. fn: function (aMethod){
  834. var self=this;
  835. (function(){delete self.fn.prototype[aMethod.selector._asSelector()];
  836. delete self.fn.prototype.methods[aMethod.selector]})();
  837. return self;},
  838. source: unescape('removeCompiledMethod%3A%20aMethod%0A%09%7B%27delete%20self.fn.prototype%5BaMethod.selector._asSelector%28%29%5D%3B%0A%09delete%20self.fn.prototype.methods%5BaMethod.selector%5D%27%7D%0A')}),
  839. smalltalk.Behavior);
  840. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  841. smalltalk.addMethod(
  842. '_category',
  843. smalltalk.method({
  844. selector: 'category',
  845. category: 'accessing',
  846. fn: function (){
  847. var self=this;
  848. return (function(){return self.category})();
  849. return self;},
  850. source: unescape('category%0A%09%5E%7B%27return%20self.category%27%7D%0A')}),
  851. smalltalk.Class);
  852. smalltalk.addMethod(
  853. '_category_',
  854. smalltalk.method({
  855. selector: 'category:',
  856. category: 'accessing',
  857. fn: function (aString){
  858. var self=this;
  859. (function(){self.category = aString})();
  860. return self;},
  861. source: unescape('category%3A%20aString%0A%09%7B%27self.category%20%3D%20aString%27%7D%0A')}),
  862. smalltalk.Class);
  863. smalltalk.addMethod(
  864. '_subclass_instanceVariableNames_',
  865. smalltalk.method({
  866. selector: 'subclass:instanceVariableNames:',
  867. category: 'class creation',
  868. fn: function (aString, anotherString){
  869. var self=this;
  870. return self._subclass_instanceVariableNames_category_(aString,anotherString,nil);
  871. return self;},
  872. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A')}),
  873. smalltalk.Class);
  874. smalltalk.addMethod(
  875. '_subclass_instanceVariableNames_category_',
  876. smalltalk.method({
  877. selector: 'subclass:instanceVariableNames:category:',
  878. category: 'class creation',
  879. fn: function (aString, aString2, aString3){
  880. var self=this;
  881. return smalltalk.ClassBuilder._new()._superclass_subclass_instanceVariableNames_category_(self,aString,aString2,aString3);
  882. return self;},
  883. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A')}),
  884. smalltalk.Class);
  885. smalltalk.addMethod(
  886. '_isClass',
  887. smalltalk.method({
  888. selector: 'isClass',
  889. category: 'testing',
  890. fn: function (){
  891. var self=this;
  892. return true;
  893. return self;},
  894. source: unescape('isClass%0A%09%5Etrue%0A')}),
  895. smalltalk.Class);
  896. smalltalk.addMethod(
  897. '_printString',
  898. smalltalk.method({
  899. selector: 'printString',
  900. category: 'printing',
  901. fn: function (){
  902. var self=this;
  903. return self._name();
  904. return self;},
  905. source: unescape('printString%0A%09%5Eself%20name%0A')}),
  906. smalltalk.Class);
  907. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  908. smalltalk.addMethod(
  909. '_instanceClass',
  910. smalltalk.method({
  911. selector: 'instanceClass',
  912. category: 'accessing',
  913. fn: function (){
  914. var self=this;
  915. return (function(){return self.instanceClass})();
  916. return self;},
  917. source: unescape('instanceClass%0A%09%5E%7B%27return%20self.instanceClass%27%7D%0A')}),
  918. smalltalk.Metaclass);
  919. smalltalk.addMethod(
  920. '_instanceVariableNames_',
  921. smalltalk.method({
  922. selector: 'instanceVariableNames:',
  923. category: 'accessing',
  924. fn: function (aCollection){
  925. var self=this;
  926. smalltalk.ClassBuilder._new()._class_instanceVariableNames_(self,aCollection);
  927. return self;},
  928. source: unescape('instanceVariableNames%3A%20aCollection%0A%09ClassBuilder%20new%0A%09%20%20%20%20class%3A%20self%20instanceVariableNames%3A%20aCollection%0A')}),
  929. smalltalk.Metaclass);
  930. smalltalk.addMethod(
  931. '_isMetaclass',
  932. smalltalk.method({
  933. selector: 'isMetaclass',
  934. category: 'testing',
  935. fn: function (){
  936. var self=this;
  937. return true;
  938. return self;},
  939. source: unescape('isMetaclass%0A%09%5Etrue%0A')}),
  940. smalltalk.Metaclass);
  941. smalltalk.addMethod(
  942. '_printString',
  943. smalltalk.method({
  944. selector: 'printString',
  945. category: 'printing',
  946. fn: function (){
  947. var self=this;
  948. return self._instanceClass()._name().__comma(" class");
  949. return self;},
  950. source: unescape('printString%0A%09%5Eself%20instanceClass%20name%2C%20%27%20class%27%0A')}),
  951. smalltalk.Metaclass);
  952. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  953. smalltalk.addMethod(
  954. '_source',
  955. smalltalk.method({
  956. selector: 'source',
  957. category: 'accessing',
  958. fn: function (){
  959. var self=this;
  960. return self._basicAt_("source")._ifNil_((function(){return "";}));
  961. return self;},
  962. source: unescape('source%0A%09%5E%28self%20basicAt%3A%20%27source%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  963. smalltalk.CompiledMethod);
  964. smalltalk.addMethod(
  965. '_source_',
  966. smalltalk.method({
  967. selector: 'source:',
  968. category: 'accessing',
  969. fn: function (aString){
  970. var self=this;
  971. self._basicAt_put_("source",aString);
  972. return self;},
  973. source: unescape('source%3A%20aString%0A%09self%20basicAt%3A%20%27source%27%20put%3A%20aString%0A')}),
  974. smalltalk.CompiledMethod);
  975. smalltalk.addMethod(
  976. '_category',
  977. smalltalk.method({
  978. selector: 'category',
  979. category: 'accessing',
  980. fn: function (){
  981. var self=this;
  982. return self._basicAt_("category")._ifNil_((function(){return "";}));
  983. return self;},
  984. source: unescape('category%0A%09%5E%28self%20basicAt%3A%20%27category%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  985. smalltalk.CompiledMethod);
  986. smalltalk.addMethod(
  987. '_category_',
  988. smalltalk.method({
  989. selector: 'category:',
  990. category: 'accessing',
  991. fn: function (aString){
  992. var self=this;
  993. self._basicAt_put_("category",aString);
  994. return self;},
  995. source: unescape('category%3A%20aString%0A%09self%20basicAt%3A%20%27category%27%20put%3A%20aString%0A')}),
  996. smalltalk.CompiledMethod);
  997. smalltalk.addMethod(
  998. '_selector',
  999. smalltalk.method({
  1000. selector: 'selector',
  1001. category: 'accessing',
  1002. fn: function (){
  1003. var self=this;
  1004. return self._basicAt_("selector");
  1005. return self;},
  1006. source: unescape('selector%0A%09%5Eself%20basicAt%3A%20%27selector%27%0A')}),
  1007. smalltalk.CompiledMethod);
  1008. smalltalk.addMethod(
  1009. '_selector_',
  1010. smalltalk.method({
  1011. selector: 'selector:',
  1012. category: 'accessing',
  1013. fn: function (aString){
  1014. var self=this;
  1015. self._basicAt_put_("selector",aString);
  1016. return self;},
  1017. source: unescape('selector%3A%20aString%0A%09self%20basicAt%3A%20%27selector%27%20put%3A%20aString%0A')}),
  1018. smalltalk.CompiledMethod);
  1019. smalltalk.addMethod(
  1020. '_fn',
  1021. smalltalk.method({
  1022. selector: 'fn',
  1023. category: 'accessing',
  1024. fn: function (){
  1025. var self=this;
  1026. return self._basicAt_("fn");
  1027. return self;},
  1028. source: unescape('fn%0A%09%5Eself%20basicAt%3A%20%27fn%27%0A')}),
  1029. smalltalk.CompiledMethod);
  1030. smalltalk.addMethod(
  1031. '_fn_',
  1032. smalltalk.method({
  1033. selector: 'fn:',
  1034. category: 'accessing',
  1035. fn: function (aBlock){
  1036. var self=this;
  1037. self._basicAt_put_("fn",aBlock);
  1038. return self;},
  1039. source: unescape('fn%3A%20aBlock%0A%09self%20basicAt%3A%20%27fn%27%20put%3A%20aBlock%0A')}),
  1040. smalltalk.CompiledMethod);
  1041. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1042. smalltalk.addMethod(
  1043. '__eq',
  1044. smalltalk.method({
  1045. selector: '=',
  1046. category: 'comparing',
  1047. fn: function (aNumber){
  1048. var self=this;
  1049. return (function(){return Number(self) == aNumber})();
  1050. return self;},
  1051. source: unescape('%3D%20aNumber%0A%09%5E%7B%27return%20Number%28self%29%20%3D%3D%20aNumber%27%7D%0A')}),
  1052. smalltalk.Number);
  1053. smalltalk.addMethod(
  1054. '__gt',
  1055. smalltalk.method({
  1056. selector: '>',
  1057. category: 'comparing',
  1058. fn: function (aNumber){
  1059. var self=this;
  1060. return (function(){return self > aNumber})();
  1061. return self;},
  1062. source: unescape('%3E%20aNumber%0A%09%5E%7B%27return%20self%20%3E%20aNumber%27%7D%0A')}),
  1063. smalltalk.Number);
  1064. smalltalk.addMethod(
  1065. '__lt',
  1066. smalltalk.method({
  1067. selector: '<',
  1068. category: 'comparing',
  1069. fn: function (aNumber){
  1070. var self=this;
  1071. return (function(){return self < aNumber})();
  1072. return self;},
  1073. source: unescape('%3C%20aNumber%0A%09%5E%7B%27return%20self%20%3C%20aNumber%27%7D%0A')}),
  1074. smalltalk.Number);
  1075. smalltalk.addMethod(
  1076. '__gt_eq',
  1077. smalltalk.method({
  1078. selector: '>=',
  1079. category: 'comparing',
  1080. fn: function (aNumber){
  1081. var self=this;
  1082. return (function(){return self >= aNumber})();
  1083. return self;},
  1084. source: unescape('%3E%3D%20aNumber%0A%09%5E%7B%27return%20self%20%3E%3D%20aNumber%27%7D%0A')}),
  1085. smalltalk.Number);
  1086. smalltalk.addMethod(
  1087. '__lt_eq',
  1088. smalltalk.method({
  1089. selector: '<=',
  1090. category: 'comparing',
  1091. fn: function (aNumber){
  1092. var self=this;
  1093. return (function(){return self <= aNumber})();
  1094. return self;},
  1095. source: unescape('%3C%3D%20aNumber%0A%09%5E%7B%27return%20self%20%3C%3D%20aNumber%27%7D%0A')}),
  1096. smalltalk.Number);
  1097. smalltalk.addMethod(
  1098. '__plus',
  1099. smalltalk.method({
  1100. selector: '+',
  1101. category: 'arithmetic',
  1102. fn: function (aNumber){
  1103. var self=this;
  1104. return (function(){return self + aNumber})();
  1105. return self;},
  1106. source: unescape('+%20aNumber%0A%09%5E%7B%27return%20self%20+%20aNumber%27%7D%0A')}),
  1107. smalltalk.Number);
  1108. smalltalk.addMethod(
  1109. '__minus',
  1110. smalltalk.method({
  1111. selector: '-',
  1112. category: 'arithmetic',
  1113. fn: function (aNumber){
  1114. var self=this;
  1115. return (function(){return self - aNumber})();
  1116. return self;},
  1117. source: unescape('-%20aNumber%0A%09%5E%7B%27return%20self%20-%20aNumber%27%7D%0A')}),
  1118. smalltalk.Number);
  1119. smalltalk.addMethod(
  1120. '__star',
  1121. smalltalk.method({
  1122. selector: '*',
  1123. category: 'arithmetic',
  1124. fn: function (aNumber){
  1125. var self=this;
  1126. return (function(){return self * aNumber})();
  1127. return self;},
  1128. source: unescape('*%20aNumber%0A%09%5E%7B%27return%20self%20*%20aNumber%27%7D%0A')}),
  1129. smalltalk.Number);
  1130. smalltalk.addMethod(
  1131. '__slash',
  1132. smalltalk.method({
  1133. selector: '/',
  1134. category: 'arithmetic',
  1135. fn: function (aNumber){
  1136. var self=this;
  1137. return (function(){return self / aNumber})();
  1138. return self;},
  1139. source: unescape('/%20aNumber%0A%09%5E%7B%27return%20self%20/%20aNumber%27%7D%0A')}),
  1140. smalltalk.Number);
  1141. smalltalk.addMethod(
  1142. '_max_',
  1143. smalltalk.method({
  1144. selector: 'max:',
  1145. category: 'arithmetic',
  1146. fn: function (aNumber){
  1147. var self=this;
  1148. return (function(){return Math.max(self, aNumber);})();
  1149. return self;},
  1150. source: unescape('max%3A%20aNumber%0A%09%5E%7B%27return%20Math.max%28self%2C%20aNumber%29%3B%27%7D%0A')}),
  1151. smalltalk.Number);
  1152. smalltalk.addMethod(
  1153. '_min_',
  1154. smalltalk.method({
  1155. selector: 'min:',
  1156. category: 'arithmetic',
  1157. fn: function (aNumber){
  1158. var self=this;
  1159. return (function(){return Math.min(self, aNumber);})();
  1160. return self;},
  1161. source: unescape('min%3A%20aNumber%0A%09%5E%7B%27return%20Math.min%28self%2C%20aNumber%29%3B%27%7D%0A')}),
  1162. smalltalk.Number);
  1163. smalltalk.addMethod(
  1164. '_rounded',
  1165. smalltalk.method({
  1166. selector: 'rounded',
  1167. category: 'converting',
  1168. fn: function (){
  1169. var self=this;
  1170. return (function(){return Math.round(self);})();
  1171. return self;},
  1172. source: unescape('rounded%0A%09%5E%7B%27return%20Math.round%28self%29%3B%27%7D%0A')}),
  1173. smalltalk.Number);
  1174. smalltalk.addMethod(
  1175. '_truncated',
  1176. smalltalk.method({
  1177. selector: 'truncated',
  1178. category: 'converting',
  1179. fn: function (){
  1180. var self=this;
  1181. return (function(){return Math.floor(self);})();
  1182. return self;},
  1183. source: unescape('truncated%0A%09%5E%7B%27return%20Math.floor%28self%29%3B%27%7D%0A')}),
  1184. smalltalk.Number);
  1185. smalltalk.addMethod(
  1186. '_to_',
  1187. smalltalk.method({
  1188. selector: 'to:',
  1189. category: 'converting',
  1190. fn: function (aNumber){
  1191. var self=this;
  1192. var array=nil;
  1193. var first=nil;
  1194. var last=nil;
  1195. var count=nil;
  1196. first=self._truncated();
  1197. last=aNumber._truncated().__plus((1));
  1198. count=(1);
  1199. first.__lt_eq(last)._ifFalse_((function(){return self._error_("Wrong interval");}));
  1200. array=smalltalk.Array._new();
  1201. last.__minus(first)._timesRepeat_((function(){array._at_put_(count,first);count=count.__plus((1));return first=first.__plus((1));}));
  1202. return array;
  1203. return self;},
  1204. source: unescape('to%3A%20aNumber%0A%09%7C%20array%20first%20last%20count%20%7C%0A%09first%20%3A%3D%20self%20truncated.%0A%09last%20%3A%3D%20aNumber%20truncated%20+%201.%0A%09count%20%3A%3D%201.%0A%09%28first%20%3C%3D%20last%29%20ifFalse%3A%20%5Bself%20error%3A%20%27Wrong%20interval%27%5D.%0A%09array%20%3A%3D%20Array%20new.%0A%09%28last%20-%20first%29%20timesRepeat%3A%20%5B%0A%09%20%20%20%20array%20at%3A%20count%20put%3A%20first.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%09%20%20%20%20first%20%3A%3D%20first%20+%201%5D.%0A%09%5Earray%0A')}),
  1205. smalltalk.Number);
  1206. smalltalk.addMethod(
  1207. '_timesRepeat_',
  1208. smalltalk.method({
  1209. selector: 'timesRepeat:',
  1210. category: 'enumerating',
  1211. fn: function (aBlock){
  1212. var self=this;
  1213. var integer=nil;
  1214. var count=nil;
  1215. integer=self._truncated();
  1216. count=(1);
  1217. (function(){return count.__gt(self);})._whileFalse_((function(){aBlock._value();return count=count.__plus((1));}));
  1218. return self;},
  1219. source: unescape('timesRepeat%3A%20aBlock%0A%09%7C%20integer%20count%20%7C%0A%09integer%20%3A%3D%20self%20truncated.%0A%09count%20%3A%3D%201.%0A%09%5Bcount%20%3E%20self%5D%20whileFalse%3A%20%5B%0A%09%20%20%20%20aBlock%20value.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201%5D%0A')}),
  1220. smalltalk.Number);
  1221. smalltalk.addMethod(
  1222. '_to_do_',
  1223. smalltalk.method({
  1224. selector: 'to:do:',
  1225. category: 'enumerating',
  1226. fn: function (aNumber, aBlock){
  1227. var self=this;
  1228. return self._to_(aNumber)._do_(aBlock);
  1229. return self;},
  1230. source: unescape('to%3A%20aNumber%20do%3A%20aBlock%0A%09%5E%28self%20to%3A%20aNumber%29%20do%3A%20aBlock%0A')}),
  1231. smalltalk.Number);
  1232. smalltalk.addMethod(
  1233. '_asString',
  1234. smalltalk.method({
  1235. selector: 'asString',
  1236. category: 'converting',
  1237. fn: function (){
  1238. var self=this;
  1239. return self._printString();
  1240. return self;},
  1241. source: unescape('asString%0A%09%5Eself%20printString%0A')}),
  1242. smalltalk.Number);
  1243. smalltalk.addMethod(
  1244. '_asJavascript',
  1245. smalltalk.method({
  1246. selector: 'asJavascript',
  1247. category: 'converting',
  1248. fn: function (){
  1249. var self=this;
  1250. return unescape("%28").__comma(self._printString()).__comma(unescape("%29"));
  1251. return self;},
  1252. source: unescape('asJavascript%0A%09%5E%27%28%27%2C%20self%20printString%2C%20%27%29%27%0A')}),
  1253. smalltalk.Number);
  1254. smalltalk.addMethod(
  1255. '_printString',
  1256. smalltalk.method({
  1257. selector: 'printString',
  1258. category: 'printing',
  1259. fn: function (){
  1260. var self=this;
  1261. return (function(){return String(self)})();
  1262. return self;},
  1263. source: unescape('printString%0A%09%5E%7B%27return%20String%28self%29%27%7D%0A')}),
  1264. smalltalk.Number);
  1265. smalltalk.addMethod(
  1266. '_isNumber',
  1267. smalltalk.method({
  1268. selector: 'isNumber',
  1269. category: 'testing',
  1270. fn: function (){
  1271. var self=this;
  1272. return true;
  1273. return self;},
  1274. source: unescape('isNumber%0A%09%5Etrue%0A')}),
  1275. smalltalk.Number);
  1276. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1277. smalltalk.addMethod(
  1278. '_compiledSource',
  1279. smalltalk.method({
  1280. selector: 'compiledSource',
  1281. category: 'accessing',
  1282. fn: function (){
  1283. var self=this;
  1284. return (function(){return self.toString()})();
  1285. return self;},
  1286. source: unescape('compiledSource%0A%09%5E%7B%27return%20self.toString%28%29%27%7D%0A')}),
  1287. smalltalk.BlockClosure);
  1288. smalltalk.addMethod(
  1289. '_whileTrue_',
  1290. smalltalk.method({
  1291. selector: 'whileTrue:',
  1292. category: 'controlling',
  1293. fn: function (aBlock){
  1294. var self=this;
  1295. (function(){while(self()) {aBlock()}})();
  1296. return self;},
  1297. source: unescape('whileTrue%3A%20aBlock%0A%09%7B%27while%28self%28%29%29%20%7BaBlock%28%29%7D%27%7D%0A')}),
  1298. smalltalk.BlockClosure);
  1299. smalltalk.addMethod(
  1300. '_whileFalse_',
  1301. smalltalk.method({
  1302. selector: 'whileFalse:',
  1303. category: 'controlling',
  1304. fn: function (aBlock){
  1305. var self=this;
  1306. (function(){while(!self()) {aBlock()}})();
  1307. return self;},
  1308. source: unescape('whileFalse%3A%20aBlock%0A%09%7B%27while%28%21self%28%29%29%20%7BaBlock%28%29%7D%27%7D%0A')}),
  1309. smalltalk.BlockClosure);
  1310. smalltalk.addMethod(
  1311. '_value',
  1312. smalltalk.method({
  1313. selector: 'value',
  1314. category: 'evaluating',
  1315. fn: function (){
  1316. var self=this;
  1317. return (function(){return self();})();
  1318. return self;},
  1319. source: unescape('value%0A%09%5E%7B%27return%20self%28%29%3B%27%7D%0A')}),
  1320. smalltalk.BlockClosure);
  1321. smalltalk.addMethod(
  1322. '_value_',
  1323. smalltalk.method({
  1324. selector: 'value:',
  1325. category: 'evaluating',
  1326. fn: function (anArg){
  1327. var self=this;
  1328. return (function(){return self(anArg);})();
  1329. return self;},
  1330. source: unescape('value%3A%20anArg%0A%09%5E%7B%27return%20self%28anArg%29%3B%27%7D%0A')}),
  1331. smalltalk.BlockClosure);
  1332. smalltalk.addMethod(
  1333. '_value_value_',
  1334. smalltalk.method({
  1335. selector: 'value:value:',
  1336. category: 'evaluating',
  1337. fn: function (firstArg, secondArg){
  1338. var self=this;
  1339. return (function(){return self(firstArg, secondArg);})();
  1340. return self;},
  1341. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%5E%7B%27return%20self%28firstArg%2C%20secondArg%29%3B%27%7D%0A')}),
  1342. smalltalk.BlockClosure);
  1343. smalltalk.addMethod(
  1344. '_value_value_value_',
  1345. smalltalk.method({
  1346. selector: 'value:value:value:',
  1347. category: 'evaluating',
  1348. fn: function (firstArg, secondArg, thirdArg){
  1349. var self=this;
  1350. return (function(){return self(firstArg, secondArg, thirdArg);})();
  1351. return self;},
  1352. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%5E%7B%27return%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%27%7D%0A')}),
  1353. smalltalk.BlockClosure);
  1354. smalltalk.addMethod(
  1355. '_valueWithPossibleArguments_',
  1356. smalltalk.method({
  1357. selector: 'valueWithPossibleArguments:',
  1358. category: 'evaluating',
  1359. fn: function (aCollection){
  1360. var self=this;
  1361. return (function(){return self.apply(null, aCollection);})();
  1362. return self;},
  1363. source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%5E%7B%27return%20self.apply%28null%2C%20aCollection%29%3B%27%7D%0A')}),
  1364. smalltalk.BlockClosure);
  1365. smalltalk.addMethod(
  1366. '_on_do_',
  1367. smalltalk.method({
  1368. selector: 'on:do:',
  1369. category: 'error handling',
  1370. fn: function (anErrorClass, aBlock){
  1371. var self=this;
  1372. self._try_catch_(self,(function(error){return error._isKindOf_(anErrorClass)._ifTrue_ifFalse_((function(){return aBlock._value();}),(function(){return error._signal();}));}));
  1373. return self;},
  1374. source: unescape('on%3A%20anErrorClass%20do%3A%20aBlock%0A%09self%20try%3A%20self%20catch%3A%20%5B%3Aerror%20%7C%0A%09%20%20%20%20%28error%20isKindOf%3A%20anErrorClass%29%20%0A%09%20%20%20%20%20ifTrue%3A%20%5BaBlock%20value%5D%0A%09%20%20%20%20%20ifFalse%3A%20%5Berror%20signal%5D%5D%0A')}),
  1375. smalltalk.BlockClosure);
  1376. smalltalk.addMethod(
  1377. '_appendToJQuery_',
  1378. smalltalk.method({
  1379. selector: 'appendToJQuery:',
  1380. category: '*JQuery',
  1381. fn: function (aJQuery){
  1382. var self=this;
  1383. var canvas=nil;
  1384. canvas=smalltalk.HTMLCanvas._new();
  1385. self._value_(canvas);
  1386. aJQuery._append_(canvas);
  1387. return self;},
  1388. source: unescape('appendToJQuery%3A%20aJQuery%0A%09%7C%20canvas%20%7C%0A%09canvas%20%3A%3D%20HTMLCanvas%20new.%0A%09self%20value%3A%20canvas.%0A%09aJQuery%20append%3A%20canvas%0A')}),
  1389. smalltalk.BlockClosure);
  1390. smalltalk.addMethod(
  1391. '_appendToBrush_',
  1392. smalltalk.method({
  1393. selector: 'appendToBrush:',
  1394. category: '*Canvas',
  1395. fn: function (aTagBrush){
  1396. var self=this;
  1397. aTagBrush._appendBlock_(self);
  1398. return self;},
  1399. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20appendBlock%3A%20self%0A')}),
  1400. smalltalk.BlockClosure);
  1401. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  1402. smalltalk.addMethod(
  1403. '__eq',
  1404. smalltalk.method({
  1405. selector: '=',
  1406. category: 'comparing',
  1407. fn: function (aBoolean){
  1408. var self=this;
  1409. return (function(){return Boolean(self == true) == aBoolean})();
  1410. return self;},
  1411. source: unescape('%3D%20aBoolean%0A%20%20%20%20%09%5E%7B%27return%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%27%7D%0A')}),
  1412. smalltalk.Boolean);
  1413. smalltalk.addMethod(
  1414. '_shallowCopy',
  1415. smalltalk.method({
  1416. selector: 'shallowCopy',
  1417. category: 'copying',
  1418. fn: function (){
  1419. var self=this;
  1420. return self;
  1421. return self;},
  1422. source: unescape('shallowCopy%0A%09%5Eself%0A')}),
  1423. smalltalk.Boolean);
  1424. smalltalk.addMethod(
  1425. '_deepCopy',
  1426. smalltalk.method({
  1427. selector: 'deepCopy',
  1428. category: 'copying',
  1429. fn: function (){
  1430. var self=this;
  1431. return self;
  1432. return self;},
  1433. source: unescape('deepCopy%0A%09%5Eself%0A')}),
  1434. smalltalk.Boolean);
  1435. smalltalk.addMethod(
  1436. '_ifTrue_',
  1437. smalltalk.method({
  1438. selector: 'ifTrue:',
  1439. category: 'controlling',
  1440. fn: function (aBlock){
  1441. var self=this;
  1442. return self._ifTrue_ifFalse_(aBlock,(function(){return nil;}));
  1443. return self;},
  1444. source: unescape('ifTrue%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D%0A')}),
  1445. smalltalk.Boolean);
  1446. smalltalk.addMethod(
  1447. '_ifFalse_',
  1448. smalltalk.method({
  1449. selector: 'ifFalse:',
  1450. category: 'controlling',
  1451. fn: function (aBlock){
  1452. var self=this;
  1453. return self._ifTrue_ifFalse_((function(){return nil;}),aBlock);
  1454. return self;},
  1455. source: unescape('ifFalse%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock%0A')}),
  1456. smalltalk.Boolean);
  1457. smalltalk.addMethod(
  1458. '_ifFalse_ifTrue_',
  1459. smalltalk.method({
  1460. selector: 'ifFalse:ifTrue:',
  1461. category: 'controlling',
  1462. fn: function (aBlock, anotherBlock){
  1463. var self=this;
  1464. return self._ifTrue_ifFalse_(anotherBlock,aBlock);
  1465. return self;},
  1466. source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock%0A')}),
  1467. smalltalk.Boolean);
  1468. smalltalk.addMethod(
  1469. '_ifTrue_ifFalse_',
  1470. smalltalk.method({
  1471. selector: 'ifTrue:ifFalse:',
  1472. category: 'controlling',
  1473. fn: function (aBlock, anotherBlock){
  1474. var self=this;
  1475. return (function(){
  1476. if(self == true) {
  1477. return aBlock();
  1478. } else {
  1479. return anotherBlock();
  1480. }
  1481. })();
  1482. return self;},
  1483. source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%5E%7B%27%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  1484. smalltalk.Boolean);
  1485. smalltalk.addMethod(
  1486. '_and_',
  1487. smalltalk.method({
  1488. selector: 'and:',
  1489. category: 'controlling',
  1490. fn: function (aBlock){
  1491. var self=this;
  1492. return self.__eq(true)._ifTrue_ifFalse_(aBlock,(function(){return false;}));
  1493. return self;},
  1494. source: unescape('and%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20aBlock%0A%09%20%20%20%20ifFalse%3A%20%5Bfalse%5D%0A')}),
  1495. smalltalk.Boolean);
  1496. smalltalk.addMethod(
  1497. '_or_',
  1498. smalltalk.method({
  1499. selector: 'or:',
  1500. category: 'controlling',
  1501. fn: function (aBlock){
  1502. var self=this;
  1503. return self.__eq(true)._ifTrue_ifFalse_((function(){return true;}),aBlock);
  1504. return self;},
  1505. source: unescape('or%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20aBlock%0A')}),
  1506. smalltalk.Boolean);
  1507. smalltalk.addMethod(
  1508. '_not',
  1509. smalltalk.method({
  1510. selector: 'not',
  1511. category: 'controlling',
  1512. fn: function (){
  1513. var self=this;
  1514. return self.__eq(false);
  1515. return self;},
  1516. source: unescape('not%0A%09%5Eself%20%3D%20false%0A')}),
  1517. smalltalk.Boolean);
  1518. smalltalk.addMethod(
  1519. '_printString',
  1520. smalltalk.method({
  1521. selector: 'printString',
  1522. category: 'printing',
  1523. fn: function (){
  1524. var self=this;
  1525. return (function(){return self.toString()})();
  1526. return self;},
  1527. source: unescape('printString%0A%09%5E%7B%27return%20self.toString%28%29%27%7D%0A')}),
  1528. smalltalk.Boolean);
  1529. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  1530. smalltalk.addMethod(
  1531. '_subclass_instanceVariableNames_',
  1532. smalltalk.method({
  1533. selector: 'subclass:instanceVariableNames:',
  1534. category: 'class creation',
  1535. fn: function (aString, anotherString){
  1536. var self=this;
  1537. return self._subclass_instanceVariableNames_category_(aString,anotherString,nil);
  1538. return self;},
  1539. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A')}),
  1540. smalltalk.UndefinedObject);
  1541. smalltalk.addMethod(
  1542. '_subclass_instanceVariableNames_category_',
  1543. smalltalk.method({
  1544. selector: 'subclass:instanceVariableNames:category:',
  1545. category: 'class creation',
  1546. fn: function (aString, aString2, aString3){
  1547. var self=this;
  1548. return smalltalk.ClassBuilder._new()._superclass_subclass_instanceVariableNames_category_(self,aString,aString2,aString3);
  1549. return self;},
  1550. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A')}),
  1551. smalltalk.UndefinedObject);
  1552. smalltalk.addMethod(
  1553. '_shallowCopy',
  1554. smalltalk.method({
  1555. selector: 'shallowCopy',
  1556. category: 'copying',
  1557. fn: function (){
  1558. var self=this;
  1559. return self;
  1560. return self;},
  1561. source: unescape('shallowCopy%0A%09%5Eself%0A')}),
  1562. smalltalk.UndefinedObject);
  1563. smalltalk.addMethod(
  1564. '_deepCopy',
  1565. smalltalk.method({
  1566. selector: 'deepCopy',
  1567. category: 'copying',
  1568. fn: function (){
  1569. var self=this;
  1570. return self;
  1571. return self;},
  1572. source: unescape('deepCopy%0A%09%5Eself%0A')}),
  1573. smalltalk.UndefinedObject);
  1574. smalltalk.addMethod(
  1575. '_ifNil_',
  1576. smalltalk.method({
  1577. selector: 'ifNil:',
  1578. category: 'testing',
  1579. fn: function (aBlock){
  1580. var self=this;
  1581. return self._ifNil_ifNotNil_(aBlock,(function(){return nil;}));
  1582. return self;},
  1583. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D%0A')}),
  1584. smalltalk.UndefinedObject);
  1585. smalltalk.addMethod(
  1586. '_ifNotNil_',
  1587. smalltalk.method({
  1588. selector: 'ifNotNil:',
  1589. category: 'testing',
  1590. fn: function (aBlock){
  1591. var self=this;
  1592. return self;
  1593. return self;},
  1594. source: unescape('ifNotNil%3A%20aBlock%0A%09%5Eself%0A')}),
  1595. smalltalk.UndefinedObject);
  1596. smalltalk.addMethod(
  1597. '_ifNil_ifNotNil_',
  1598. smalltalk.method({
  1599. selector: 'ifNil:ifNotNil:',
  1600. category: 'testing',
  1601. fn: function (aBlock, anotherBlock){
  1602. var self=this;
  1603. return aBlock._value();
  1604. return self;},
  1605. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A')}),
  1606. smalltalk.UndefinedObject);
  1607. smalltalk.addMethod(
  1608. '_ifNotNil_ifNil_',
  1609. smalltalk.method({
  1610. selector: 'ifNotNil:ifNil:',
  1611. category: 'testing',
  1612. fn: function (aBlock, anotherBlock){
  1613. var self=this;
  1614. return anotherBlock._value();
  1615. return self;},
  1616. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A')}),
  1617. smalltalk.UndefinedObject);
  1618. smalltalk.addMethod(
  1619. '_isNil',
  1620. smalltalk.method({
  1621. selector: 'isNil',
  1622. category: 'testing',
  1623. fn: function (){
  1624. var self=this;
  1625. return true;
  1626. return self;},
  1627. source: unescape('isNil%0A%09%5Etrue%0A')}),
  1628. smalltalk.UndefinedObject);
  1629. smalltalk.addMethod(
  1630. '_notNil',
  1631. smalltalk.method({
  1632. selector: 'notNil',
  1633. category: 'testing',
  1634. fn: function (){
  1635. var self=this;
  1636. return false;
  1637. return self;},
  1638. source: unescape('notNil%0A%09%5Efalse%0A')}),
  1639. smalltalk.UndefinedObject);
  1640. smalltalk.addMethod(
  1641. '_printString',
  1642. smalltalk.method({
  1643. selector: 'printString',
  1644. category: 'printing',
  1645. fn: function (){
  1646. var self=this;
  1647. return "nil";
  1648. return self;},
  1649. source: unescape('printString%0A%20%20%20%20%5E%27nil%27%0A')}),
  1650. smalltalk.UndefinedObject);
  1651. smalltalk.addMethod(
  1652. '_new',
  1653. smalltalk.method({
  1654. selector: 'new',
  1655. category: 'instance creation',
  1656. fn: function (){
  1657. var self=this;
  1658. self._error_("You cannot create new instances of UndefinedObject. Use nil");
  1659. return self;},
  1660. source: unescape('new%0A%09%20%20%20%20self%20error%3A%20%27You%20cannot%20create%20new%20instances%20of%20UndefinedObject.%20Use%20nil%27%0A')}),
  1661. smalltalk.UndefinedObject.klass);
  1662. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  1663. smalltalk.addMethod(
  1664. '_size',
  1665. smalltalk.method({
  1666. selector: 'size',
  1667. category: 'accessing',
  1668. fn: function (){
  1669. var self=this;
  1670. self._subclassResponsibility();
  1671. return self;},
  1672. source: unescape('size%0A%09self%20subclassResponsibility%0A')}),
  1673. smalltalk.Collection);
  1674. smalltalk.addMethod(
  1675. '_at_',
  1676. smalltalk.method({
  1677. selector: 'at:',
  1678. category: 'accessing',
  1679. fn: function (anIndex){
  1680. var self=this;
  1681. return self._at_ifAbsent_(anIndex,(function(){return self._errorNotFound();}));
  1682. return self;},
  1683. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D%0A')}),
  1684. smalltalk.Collection);
  1685. smalltalk.addMethod(
  1686. '_at_put_',
  1687. smalltalk.method({
  1688. selector: 'at:put:',
  1689. category: 'accessing',
  1690. fn: function (anIndex, anObject){
  1691. var self=this;
  1692. self._subclassResponsibility();
  1693. return self;},
  1694. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility%0A')}),
  1695. smalltalk.Collection);
  1696. smalltalk.addMethod(
  1697. '_at_ifAbsent_',
  1698. smalltalk.method({
  1699. selector: 'at:ifAbsent:',
  1700. category: 'accessing',
  1701. fn: function (anIndex, aBlock){
  1702. var self=this;
  1703. self._subclassResponsibility();
  1704. return self;},
  1705. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility%0A')}),
  1706. smalltalk.Collection);
  1707. smalltalk.addMethod(
  1708. '_first',
  1709. smalltalk.method({
  1710. selector: 'first',
  1711. category: 'accessing',
  1712. fn: function (){
  1713. var self=this;
  1714. return self._at_((1));
  1715. return self;},
  1716. source: unescape('first%0A%09%5Eself%20at%3A%201%0A')}),
  1717. smalltalk.Collection);
  1718. smalltalk.addMethod(
  1719. '_second',
  1720. smalltalk.method({
  1721. selector: 'second',
  1722. category: 'accessing',
  1723. fn: function (){
  1724. var self=this;
  1725. return self._at_((2));
  1726. return self;},
  1727. source: unescape('second%0A%09%5Eself%20at%3A%202%0A')}),
  1728. smalltalk.Collection);
  1729. smalltalk.addMethod(
  1730. '_third',
  1731. smalltalk.method({
  1732. selector: 'third',
  1733. category: 'accessing',
  1734. fn: function (){
  1735. var self=this;
  1736. return self._at_((3));
  1737. return self;},
  1738. source: unescape('third%0A%09%5Eself%20at%3A%203%0A')}),
  1739. smalltalk.Collection);
  1740. smalltalk.addMethod(
  1741. '_fourth',
  1742. smalltalk.method({
  1743. selector: 'fourth',
  1744. category: 'accessing',
  1745. fn: function (){
  1746. var self=this;
  1747. return self._at_((4));
  1748. return self;},
  1749. source: unescape('fourth%0A%09%5Eself%20at%3A%204%0A')}),
  1750. smalltalk.Collection);
  1751. smalltalk.addMethod(
  1752. '_last',
  1753. smalltalk.method({
  1754. selector: 'last',
  1755. category: 'accessing',
  1756. fn: function (){
  1757. var self=this;
  1758. return self._at_(self._size());
  1759. return self;},
  1760. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size%0A')}),
  1761. smalltalk.Collection);
  1762. smalltalk.addMethod(
  1763. '_readStream',
  1764. smalltalk.method({
  1765. selector: 'readStream',
  1766. category: 'accessing',
  1767. fn: function (){
  1768. var self=this;
  1769. return self._stream();
  1770. return self;},
  1771. source: unescape('readStream%0A%09%5Eself%20stream%0A')}),
  1772. smalltalk.Collection);
  1773. smalltalk.addMethod(
  1774. '_writeStream',
  1775. smalltalk.method({
  1776. selector: 'writeStream',
  1777. category: 'accessing',
  1778. fn: function (){
  1779. var self=this;
  1780. return self._stream();
  1781. return self;},
  1782. source: unescape('writeStream%0A%09%5Eself%20stream%0A')}),
  1783. smalltalk.Collection);
  1784. smalltalk.addMethod(
  1785. '_stream',
  1786. smalltalk.method({
  1787. selector: 'stream',
  1788. category: 'accessing',
  1789. fn: function (){
  1790. var self=this;
  1791. return self._streamClass()._on_(self);
  1792. return self;},
  1793. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self%0A')}),
  1794. smalltalk.Collection);
  1795. smalltalk.addMethod(
  1796. '_streamClass',
  1797. smalltalk.method({
  1798. selector: 'streamClass',
  1799. category: 'accessing',
  1800. fn: function (){
  1801. var self=this;
  1802. return self._class()._streamClass();
  1803. return self;},
  1804. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass%0A')}),
  1805. smalltalk.Collection);
  1806. smalltalk.addMethod(
  1807. '_add_',
  1808. smalltalk.method({
  1809. selector: 'add:',
  1810. category: 'adding/removing',
  1811. fn: function (anObject){
  1812. var self=this;
  1813. self._subclassResponsibility();
  1814. return self;},
  1815. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility%0A')}),
  1816. smalltalk.Collection);
  1817. smalltalk.addMethod(
  1818. '_addAll_',
  1819. smalltalk.method({
  1820. selector: 'addAll:',
  1821. category: 'adding/removing',
  1822. fn: function (aCollection){
  1823. var self=this;
  1824. aCollection._do_((function(each){return self._add_(each);}));
  1825. return aCollection;
  1826. return self;},
  1827. source: unescape('addAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20add%3A%20each%5D.%0A%09%5EaCollection%0A')}),
  1828. smalltalk.Collection);
  1829. smalltalk.addMethod(
  1830. '__comma',
  1831. smalltalk.method({
  1832. selector: ',',
  1833. category: 'copying',
  1834. fn: function (aCollection){
  1835. var self=this;
  1836. return (function($rec){$rec._addAll_(aCollection);return $rec._yourself();})(self._copy());
  1837. return self;},
  1838. source: unescape('%2C%20aCollection%0A%09%5Eself%20copy%20%0A%09%20%20%20%20addAll%3A%20aCollection%3B%20%0A%09%20%20%20%20yourself%0A')}),
  1839. smalltalk.Collection);
  1840. smalltalk.addMethod(
  1841. '_copyFrom_to_',
  1842. smalltalk.method({
  1843. selector: 'copyFrom:to:',
  1844. category: 'copying',
  1845. fn: function (anIndex, anotherIndex){
  1846. var self=this;
  1847. self._subclassResponsibility();
  1848. return self;},
  1849. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20subclassResponsibility%0A')}),
  1850. smalltalk.Collection);
  1851. smalltalk.addMethod(
  1852. '_copyWith_',
  1853. smalltalk.method({
  1854. selector: 'copyWith:',
  1855. category: 'copying',
  1856. fn: function (anObject){
  1857. var self=this;
  1858. return (function($rec){$rec._add_(anObject);return $rec._yourself();})(self._copy());
  1859. return self;},
  1860. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself%0A')}),
  1861. smalltalk.Collection);
  1862. smalltalk.addMethod(
  1863. '_copyWithAll_',
  1864. smalltalk.method({
  1865. selector: 'copyWithAll:',
  1866. category: 'copying',
  1867. fn: function (aCollection){
  1868. var self=this;
  1869. return (function($rec){$rec._addAll_(aCollection);return $rec._yourself();})(self._copy());
  1870. return self;},
  1871. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself%0A')}),
  1872. smalltalk.Collection);
  1873. smalltalk.addMethod(
  1874. '_asArray',
  1875. smalltalk.method({
  1876. selector: 'asArray',
  1877. category: 'converting',
  1878. fn: function (){
  1879. var self=this;
  1880. var array=nil;
  1881. var index=nil;
  1882. array=smalltalk.Array._new();
  1883. index=(0);
  1884. self._do_((function(each){index=index.__plus((1));return array._at_put_(index,each);}));
  1885. return array;
  1886. return self;},
  1887. source: unescape('asArray%0A%09%7C%20array%20index%20%7C%0A%09array%20%3A%3D%20Array%20new.%0A%09index%20%3A%3D%200.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%20%20%20%20array%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Earray%0A')}),
  1888. smalltalk.Collection);
  1889. smalltalk.addMethod(
  1890. '_do_',
  1891. smalltalk.method({
  1892. selector: 'do:',
  1893. category: 'enumerating',
  1894. fn: function (aBlock){
  1895. var self=this;
  1896. (function(){for(var i=0;i<self.length;i++){aBlock(self[i]);}})();
  1897. return self;},
  1898. source: unescape('do%3A%20aBlock%0A%09%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%29%3B%7D%27%7D%0A')}),
  1899. smalltalk.Collection);
  1900. smalltalk.addMethod(
  1901. '_collect_',
  1902. smalltalk.method({
  1903. selector: 'collect:',
  1904. category: 'enumerating',
  1905. fn: function (aBlock){
  1906. var self=this;
  1907. var stream=nil;
  1908. stream=self._class()._new()._writeStream();
  1909. self._do_((function(each){return stream._nextPut_(aBlock._value_(each));}));
  1910. return stream._contents();
  1911. return self;},
  1912. source: unescape('collect%3A%20aBlock%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20self%20class%20new%20writeStream.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20stream%20nextPut%3A%20%28aBlock%20value%3A%20each%29%5D.%0A%09%5Estream%20contents%0A')}),
  1913. smalltalk.Collection);
  1914. smalltalk.addMethod(
  1915. '_detect_',
  1916. smalltalk.method({
  1917. selector: 'detect:',
  1918. category: 'enumerating',
  1919. fn: function (aBlock){
  1920. var self=this;
  1921. return self._detect_ifNone_(aBlock,(function(){return self._errorNotFound();}));
  1922. return self;},
  1923. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D%0A')}),
  1924. smalltalk.Collection);
  1925. smalltalk.addMethod(
  1926. '_detect_ifNone_',
  1927. smalltalk.method({
  1928. selector: 'detect:ifNone:',
  1929. category: 'enumerating',
  1930. fn: function (aBlock, anotherBlock){
  1931. var self=this;
  1932. return (function(){
  1933. for(var i = 0; i < self.length; i++)
  1934. if(aBlock(self[i]))
  1935. return self[i];
  1936. return anotherBlock();
  1937. })();
  1938. return self;},
  1939. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5E%7B%27%0A%09for%28var%20i%20%3D%200%3B%20i%20%3C%20self.length%3B%20i++%29%0A%09%09if%28aBlock%28self%5Bi%5D%29%29%0A%09%09%09return%20self%5Bi%5D%3B%0A%09return%20anotherBlock%28%29%3B%0A%09%27%7D%0A')}),
  1940. smalltalk.Collection);
  1941. smalltalk.addMethod(
  1942. '_do_separatedBy_',
  1943. smalltalk.method({
  1944. selector: 'do:separatedBy:',
  1945. category: 'enumerating',
  1946. fn: function (aBlock, anotherBlock){
  1947. var self=this;
  1948. var first=nil;
  1949. first=true;
  1950. self._do_((function(each){first._ifTrue_ifFalse_((function(){return first=false;}),(function(){return anotherBlock._value();}));return aBlock._value_(each);}));
  1951. return self;},
  1952. source: unescape('do%3A%20aBlock%20separatedBy%3A%20anotherBlock%0A%20%20%20%20%09%7C%20first%20%7C%0A%20%20%20%20%09first%20%3A%3D%20true.%0A%20%20%20%20%09self%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20first%0A%20%20%20%20%09%09ifTrue%3A%20%5Bfirst%20%3A%3D%20false%5D%0A%20%20%20%20%09%09ifFalse%3A%20%5BanotherBlock%20value%5D.%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%5D%0A')}),
  1953. smalltalk.Collection);
  1954. smalltalk.addMethod(
  1955. '_inject_into_',
  1956. smalltalk.method({
  1957. selector: 'inject:into:',
  1958. category: 'enumerating',
  1959. fn: function (anObject, aBlock){
  1960. var self=this;
  1961. var result=nil;
  1962. result=anObject;
  1963. self._do_((function(each){return result=aBlock._value_value_(result,each);}));
  1964. return result;
  1965. return self;},
  1966. source: unescape('inject%3A%20anObject%20into%3A%20aBlock%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20anObject.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%20%20%20%20result%20%3A%3D%20aBlock%20value%3A%20result%20value%3A%20each%5D.%0A%09%5Eresult%0A')}),
  1967. smalltalk.Collection);
  1968. smalltalk.addMethod(
  1969. '_reject_',
  1970. smalltalk.method({
  1971. selector: 'reject:',
  1972. category: 'enumerating',
  1973. fn: function (aBlock){
  1974. var self=this;
  1975. return self._select_((function(each){return aBlock._value_(each).__eq(false);}));
  1976. return self;},
  1977. source: unescape('reject%3A%20aBlock%0A%09%5Eself%20select%3A%20%5B%3Aeach%20%7C%20%28aBlock%20value%3A%20each%29%20%3D%20false%5D%0A')}),
  1978. smalltalk.Collection);
  1979. smalltalk.addMethod(
  1980. '_select_',
  1981. smalltalk.method({
  1982. selector: 'select:',
  1983. category: 'enumerating',
  1984. fn: function (aBlock){
  1985. var self=this;
  1986. var stream=nil;
  1987. stream=self._class()._new()._writeStream();
  1988. self._do_((function(each){return aBlock._value_(each)._ifTrue_((function(){return stream._nextPut_(each);}));}));
  1989. return stream._contents();
  1990. return self;},
  1991. source: unescape('select%3A%20aBlock%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20self%20class%20new%20writeStream.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20%28aBlock%20value%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09stream%20nextPut%3A%20each%5D%5D.%0A%09%5Estream%20contents%0A')}),
  1992. smalltalk.Collection);
  1993. smalltalk.addMethod(
  1994. '_errorNotFound',
  1995. smalltalk.method({
  1996. selector: 'errorNotFound',
  1997. category: 'error handling',
  1998. fn: function (){
  1999. var self=this;
  2000. self._error_("Object is not in the collection");
  2001. return self;},
  2002. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27%0A')}),
  2003. smalltalk.Collection);
  2004. smalltalk.addMethod(
  2005. '_includes_',
  2006. smalltalk.method({
  2007. selector: 'includes:',
  2008. category: 'testing',
  2009. fn: function (anObject){
  2010. var self=this;
  2011. return (function(){
  2012. var i = self.length;
  2013. while (i--) {
  2014. if (self[i].__eq(anObject)) {
  2015. return true;
  2016. }
  2017. }
  2018. return false;
  2019. })();
  2020. return self;},
  2021. source: unescape('includes%3A%20anObject%0A%09%5E%7B%27%0A%09%09var%20i%20%3D%20self.length%3B%0A%09%09while%20%28i--%29%20%7B%0A%09%09%09if%20%28self%5Bi%5D.__eq%28anObject%29%29%20%7B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%09%0A%09%09%7D%0A%09%09return%20false%3B%0A%0A%09%27%7D%0A')}),
  2022. smalltalk.Collection);
  2023. smalltalk.addMethod(
  2024. '_notEmpty',
  2025. smalltalk.method({
  2026. selector: 'notEmpty',
  2027. category: 'testing',
  2028. fn: function (){
  2029. var self=this;
  2030. return self._isEmpty()._not();
  2031. return self;},
  2032. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not%0A')}),
  2033. smalltalk.Collection);
  2034. smalltalk.addMethod(
  2035. '_isEmpty',
  2036. smalltalk.method({
  2037. selector: 'isEmpty',
  2038. category: 'testing',
  2039. fn: function (){
  2040. var self=this;
  2041. return self._size().__eq((0));
  2042. return self;},
  2043. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A')}),
  2044. smalltalk.Collection);
  2045. smalltalk.addMethod(
  2046. '_remove_',
  2047. smalltalk.method({
  2048. selector: 'remove:',
  2049. category: 'adding/removing',
  2050. fn: function (anObject){
  2051. var self=this;
  2052. self._subclassResponsibility();
  2053. return self;},
  2054. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  2055. smalltalk.Collection);
  2056. smalltalk.addMethod(
  2057. '_streamClass',
  2058. smalltalk.method({
  2059. selector: 'streamClass',
  2060. category: 'accessing',
  2061. fn: function (){
  2062. var self=this;
  2063. return smalltalk.Stream;
  2064. return self;},
  2065. source: unescape('streamClass%0A%09%20%20%20%20%5EStream%0A')}),
  2066. smalltalk.Collection.klass);
  2067. smalltalk.addMethod(
  2068. '_with_',
  2069. smalltalk.method({
  2070. selector: 'with:',
  2071. category: 'instance creation',
  2072. fn: function (anObject){
  2073. var self=this;
  2074. return (function($rec){$rec._add_(anObject);return $rec._yourself();})(self._new());
  2075. return self;},
  2076. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself%0A')}),
  2077. smalltalk.Collection.klass);
  2078. smalltalk.addMethod(
  2079. '_with_with_',
  2080. smalltalk.method({
  2081. selector: 'with:with:',
  2082. category: 'instance creation',
  2083. fn: function (anObject, anotherObject){
  2084. var self=this;
  2085. return (function($rec){$rec._add_(anObject);$rec._add_(anotherObject);return $rec._yourself();})(self._new());
  2086. return self;},
  2087. source: unescape('with%3A%20anObject%20with%3A%20anotherObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09add%3A%20anotherObject%3B%0A%09%09yourself%0A')}),
  2088. smalltalk.Collection.klass);
  2089. smalltalk.addMethod(
  2090. '_with_with_with_',
  2091. smalltalk.method({
  2092. selector: 'with:with:with:',
  2093. category: 'instance creation',
  2094. fn: function (firstObject, secondObject, thirdObject){
  2095. var self=this;
  2096. return (function($rec){$rec._add_(firstObject);$rec._add_(secondObject);$rec._add_(thirdObject);return $rec._yourself();})(self._new());
  2097. return self;},
  2098. source: unescape('with%3A%20firstObject%20with%3A%20secondObject%20with%3A%20thirdObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20firstObject%3B%0A%09%09add%3A%20secondObject%3B%0A%09%09add%3A%20thirdObject%3B%0A%09%09yourself%0A')}),
  2099. smalltalk.Collection.klass);
  2100. smalltalk.addMethod(
  2101. '_withAll_',
  2102. smalltalk.method({
  2103. selector: 'withAll:',
  2104. category: 'instance creation',
  2105. fn: function (aCollection){
  2106. var self=this;
  2107. return (function($rec){$rec._addAll_(aCollection);return $rec._yourself();})(self._new());
  2108. return self;},
  2109. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself%0A')}),
  2110. smalltalk.Collection.klass);
  2111. smalltalk.addClass('String', smalltalk.Collection, [], 'Kernel');
  2112. smalltalk.addMethod(
  2113. '__eq',
  2114. smalltalk.method({
  2115. selector: '=',
  2116. category: 'comparing',
  2117. fn: function (aString){
  2118. var self=this;
  2119. return (function(){return String(self) == aString})();
  2120. return self;},
  2121. source: unescape('%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3D%3D%20aString%27%7D%0A')}),
  2122. smalltalk.String);
  2123. smalltalk.addMethod(
  2124. '_size',
  2125. smalltalk.method({
  2126. selector: 'size',
  2127. category: 'accessing',
  2128. fn: function (){
  2129. var self=this;
  2130. return (function(){return self.length})();
  2131. return self;},
  2132. source: unescape('size%0A%09%5E%7B%27return%20self.length%27%7D%0A')}),
  2133. smalltalk.String);
  2134. smalltalk.addMethod(
  2135. '_at_',
  2136. smalltalk.method({
  2137. selector: 'at:',
  2138. category: 'accessing',
  2139. fn: function (anIndex){
  2140. var self=this;
  2141. return (function(){return self[anIndex - 1] || nil;})();
  2142. return self;},
  2143. source: unescape('at%3A%20anIndex%0A%20%20%20%20%09%5E%7B%27return%20self%5BanIndex%20-%201%5D%20%7C%7C%20nil%3B%27%7D%0A')}),
  2144. smalltalk.String);
  2145. smalltalk.addMethod(
  2146. '_at_put_',
  2147. smalltalk.method({
  2148. selector: 'at:put:',
  2149. category: 'accessing',
  2150. fn: function (anIndex, anObject){
  2151. var self=this;
  2152. self._errorReadOnly();
  2153. return self;},
  2154. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A')}),
  2155. smalltalk.String);
  2156. smalltalk.addMethod(
  2157. '_at_ifAbsent_',
  2158. smalltalk.method({
  2159. selector: 'at:ifAbsent:',
  2160. category: 'accessing',
  2161. fn: function (anIndex, aBlock){
  2162. var self=this;
  2163. self._at_(anIndex)._ifNil_((function(){return aBlock;}));
  2164. return self;},
  2165. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%20%20%20%20%09%28self%20at%3A%20anIndex%29%20ifNil%3A%20%5BaBlock%5D%0A')}),
  2166. smalltalk.String);
  2167. smalltalk.addMethod(
  2168. '_escaped',
  2169. smalltalk.method({
  2170. selector: 'escaped',
  2171. category: 'accessing',
  2172. fn: function (){
  2173. var self=this;
  2174. return (function(){return escape(self)})();
  2175. return self;},
  2176. source: unescape('escaped%0A%09%5E%7B%27return%20escape%28self%29%27%7D%0A')}),
  2177. smalltalk.String);
  2178. smalltalk.addMethod(
  2179. '_unescaped',
  2180. smalltalk.method({
  2181. selector: 'unescaped',
  2182. category: 'accessing',
  2183. fn: function (){
  2184. var self=this;
  2185. return (function(){return unescape(self)})();
  2186. return self;},
  2187. source: unescape('unescaped%0A%09%5E%7B%27return%20unescape%28self%29%27%7D%0A')}),
  2188. smalltalk.String);
  2189. smalltalk.addMethod(
  2190. '_add_',
  2191. smalltalk.method({
  2192. selector: 'add:',
  2193. category: 'adding',
  2194. fn: function (anObject){
  2195. var self=this;
  2196. self._errorReadOnly();
  2197. return self;},
  2198. source: unescape('add%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A')}),
  2199. smalltalk.String);
  2200. smalltalk.addMethod(
  2201. '__comma',
  2202. smalltalk.method({
  2203. selector: ',',
  2204. category: 'copying',
  2205. fn: function (aString){
  2206. var self=this;
  2207. return (function(){return self + aString})();
  2208. return self;},
  2209. source: unescape('%2C%20aString%0A%20%20%20%20%09%5E%7B%27return%20self%20+%20aString%27%7D%0A')}),
  2210. smalltalk.String);
  2211. smalltalk.addMethod(
  2212. '_copyFrom_to_',
  2213. smalltalk.method({
  2214. selector: 'copyFrom:to:',
  2215. category: 'copying',
  2216. fn: function (anIndex, anotherIndex){
  2217. var self=this;
  2218. return (function(){return self.substring(anIndex - 1, anotherIndex);})();
  2219. return self;},
  2220. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%20%20%20%20%09%5E%7B%27return%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3B%27%7D%0A')}),
  2221. smalltalk.String);
  2222. smalltalk.addMethod(
  2223. '_shallowCopy',
  2224. smalltalk.method({
  2225. selector: 'shallowCopy',
  2226. category: 'copying',
  2227. fn: function (){
  2228. var self=this;
  2229. return self._class()._fromString_(self);
  2230. return self;},
  2231. source: unescape('shallowCopy%0A%20%20%20%20%09%5Eself%20class%20fromString%3A%20self%0A')}),
  2232. smalltalk.String);
  2233. smalltalk.addMethod(
  2234. '_deepCopy',
  2235. smalltalk.method({
  2236. selector: 'deepCopy',
  2237. category: 'copying',
  2238. fn: function (){
  2239. var self=this;
  2240. return self._shallowCopy();
  2241. return self;},
  2242. source: unescape('deepCopy%0A%20%20%20%20%09%5Eself%20shallowCopy%0A')}),
  2243. smalltalk.String);
  2244. smalltalk.addMethod(
  2245. '_asSelector',
  2246. smalltalk.method({
  2247. selector: 'asSelector',
  2248. category: 'converting',
  2249. fn: function (){
  2250. var self=this;
  2251. var selector=nil;
  2252. selector="_".__comma(self);
  2253. selector=selector._replace_with_(":","_");
  2254. selector=selector._replace_with_(unescape("%5B+%5D"),"_plus");
  2255. selector=selector._replace_with_(unescape("-"),"_minus");
  2256. selector=selector._replace_with_(unescape("%5B*%5D"),"_star");
  2257. selector=selector._replace_with_(unescape("%5B/%5D"),"_slash");
  2258. selector=selector._replace_with_(unescape("%3E"),"_gt");
  2259. selector=selector._replace_with_(unescape("%3C"),"_lt");
  2260. selector=selector._replace_with_(unescape("%3D"),"_eq");
  2261. selector=selector._replace_with_(unescape("%2C"),"_comma");
  2262. selector=selector._replace_with_(unescape("%5B@%5D"),"_at");
  2263. return selector;
  2264. return self;},
  2265. source: unescape('asSelector%0A%09%7C%20selector%20%7C%0A%09selector%20%3A%3D%20%27_%27%2C%20self.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3A%27%20with%3A%20%27_%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B+%5D%27%20with%3A%20%27_plus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27-%27%20with%3A%20%27_minus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B*%5D%27%20with%3A%20%27_star%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B/%5D%27%20with%3A%20%27_slash%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3E%27%20with%3A%20%27_gt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3C%27%20with%3A%20%27_lt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3D%27%20with%3A%20%27_eq%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%2C%27%20with%3A%20%27_comma%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B@%5D%27%20with%3A%20%27_at%27.%0A%09%5Eselector%0A')}),
  2266. smalltalk.String);
  2267. smalltalk.addMethod(
  2268. '_asJavascript',
  2269. smalltalk.method({
  2270. selector: 'asJavascript',
  2271. category: 'converting',
  2272. fn: function (){
  2273. var self=this;
  2274. return (function(){
  2275. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2276. return "unescape(\"" + escape(self) + "\")";
  2277. else
  2278. return "\"" + self + "\"";
  2279. })();
  2280. return self;},
  2281. source: unescape('asJavascript%0A%09%5E%7B%27%0A%09if%28self.search%28/%5E%5Ba-zA-Z0-9_%3A.%24%20%5D*%24/%29%20%3D%3D%20-1%29%0A%09%09return%20%22unescape%28%5C%22%22%20+%20escape%28self%29%20+%20%22%5C%22%29%22%3B%0A%09else%0A%09%09return%20%22%5C%22%22%20+%20self%20+%20%22%5C%22%22%3B%0A%09%27%7D%0A')}),
  2282. smalltalk.String);
  2283. smalltalk.addMethod(
  2284. '_replace_with_',
  2285. smalltalk.method({
  2286. selector: 'replace:with:',
  2287. category: 'regular expressions',
  2288. fn: function (aString, anotherString){
  2289. var self=this;
  2290. return self._replaceRegexp_with_(smalltalk.RegularExpression._fromString_flag_(aString,"g"),anotherString);
  2291. return self;},
  2292. source: unescape('replace%3A%20aString%20with%3A%20anotherString%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20aString%20flag%3A%20%27g%27%29%20with%3A%20anotherString%0A')}),
  2293. smalltalk.String);
  2294. smalltalk.addMethod(
  2295. '_replaceRegexp_with_',
  2296. smalltalk.method({
  2297. selector: 'replaceRegexp:with:',
  2298. category: 'regular expressions',
  2299. fn: function (aRegexp, aString){
  2300. var self=this;
  2301. return (function(){return self.replace(aRegexp, aString);})();
  2302. return self;},
  2303. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%20%20%20%20%09%5E%7B%27return%20self.replace%28aRegexp%2C%20aString%29%3B%27%7D%0A')}),
  2304. smalltalk.String);
  2305. smalltalk.addMethod(
  2306. '_tokenize_',
  2307. smalltalk.method({
  2308. selector: 'tokenize:',
  2309. category: 'converting',
  2310. fn: function (aString){
  2311. var self=this;
  2312. return (function(){return self.split(aString)})();
  2313. return self;},
  2314. source: unescape('tokenize%3A%20aString%0A%09%5E%7B%27return%20self.split%28aString%29%27%7D%0A')}),
  2315. smalltalk.String);
  2316. smalltalk.addMethod(
  2317. '_match_',
  2318. smalltalk.method({
  2319. selector: 'match:',
  2320. category: 'regular expressions',
  2321. fn: function (aRegexp){
  2322. var self=this;
  2323. return (function(){return self.search(aRegexp) != -1})();
  2324. return self;},
  2325. source: unescape('match%3A%20aRegexp%0A%20%20%20%20%09%5E%7B%27return%20self.search%28aRegexp%29%20%21%3D%20-1%27%7D%0A')}),
  2326. smalltalk.String);
  2327. smalltalk.addMethod(
  2328. '_asString',
  2329. smalltalk.method({
  2330. selector: 'asString',
  2331. category: 'converting',
  2332. fn: function (){
  2333. var self=this;
  2334. return self;
  2335. return self;},
  2336. source: unescape('asString%0A%20%20%20%20%09%5Eself%0A')}),
  2337. smalltalk.String);
  2338. smalltalk.addMethod(
  2339. '_asNumber',
  2340. smalltalk.method({
  2341. selector: 'asNumber',
  2342. category: 'converting',
  2343. fn: function (){
  2344. var self=this;
  2345. return (function(){return Number(self);})();
  2346. return self;},
  2347. source: unescape('asNumber%0A%09%5E%7B%27return%20Number%28self%29%3B%27%7D%0A')}),
  2348. smalltalk.String);
  2349. smalltalk.addMethod(
  2350. '_asParser',
  2351. smalltalk.method({
  2352. selector: 'asParser',
  2353. category: 'converting',
  2354. fn: function (){
  2355. var self=this;
  2356. return smalltalk.PPStringParser._new()._string_(self);
  2357. return self;},
  2358. source: unescape('asParser%0A%20%20%20%20%09%5EPPStringParser%20new%20string%3A%20self%0A')}),
  2359. smalltalk.String);
  2360. smalltalk.addMethod(
  2361. '_asChoiceParser',
  2362. smalltalk.method({
  2363. selector: 'asChoiceParser',
  2364. category: 'converting',
  2365. fn: function (){
  2366. var self=this;
  2367. return smalltalk.PPChoiceParser._withAll_(self._asArray()._collect_((function(each){return each._asParser();})));
  2368. return self;},
  2369. source: unescape('asChoiceParser%0A%20%20%20%20%09%5EPPChoiceParser%20withAll%3A%20%28self%20asArray%20collect%3A%20%5B%3Aeach%20%7C%20each%20asParser%5D%29%0A')}),
  2370. smalltalk.String);
  2371. smalltalk.addMethod(
  2372. '_asCharacterParser',
  2373. smalltalk.method({
  2374. selector: 'asCharacterParser',
  2375. category: 'converting',
  2376. fn: function (){
  2377. var self=this;
  2378. return smalltalk.PPCharacterParser._new()._string_(self);
  2379. return self;},
  2380. source: unescape('asCharacterParser%0A%20%20%20%20%09%5EPPCharacterParser%20new%20string%3A%20self%0A')}),
  2381. smalltalk.String);
  2382. smalltalk.addMethod(
  2383. '_errorReadOnly',
  2384. smalltalk.method({
  2385. selector: 'errorReadOnly',
  2386. category: 'error handling',
  2387. fn: function (){
  2388. var self=this;
  2389. self._error_(unescape("Object%20is%20read-only"));
  2390. return self;},
  2391. source: unescape('errorReadOnly%0A%20%20%20%20%09self%20error%3A%20%27Object%20is%20read-only%27%0A')}),
  2392. smalltalk.String);
  2393. smalltalk.addMethod(
  2394. '_printString',
  2395. smalltalk.method({
  2396. selector: 'printString',
  2397. category: 'printing',
  2398. fn: function (){
  2399. var self=this;
  2400. return unescape("%27").__comma(self).__comma(unescape("%27"));
  2401. return self;},
  2402. source: unescape('printString%0A%20%20%20%20%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27%0A')}),
  2403. smalltalk.String);
  2404. smalltalk.addMethod(
  2405. '_printNl',
  2406. smalltalk.method({
  2407. selector: 'printNl',
  2408. category: 'printing',
  2409. fn: function (){
  2410. var self=this;
  2411. (function(){console.log(self)})();
  2412. return self;},
  2413. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A')}),
  2414. smalltalk.String);
  2415. smalltalk.addMethod(
  2416. '_isString',
  2417. smalltalk.method({
  2418. selector: 'isString',
  2419. category: 'testing',
  2420. fn: function (){
  2421. var self=this;
  2422. return true;
  2423. return self;},
  2424. source: unescape('isString%0A%20%20%20%20%09%5Etrue%0A')}),
  2425. smalltalk.String);
  2426. smalltalk.addMethod(
  2427. '_asJQuery',
  2428. smalltalk.method({
  2429. selector: 'asJQuery',
  2430. category: '*JQuery',
  2431. fn: function (){
  2432. var self=this;
  2433. return smalltalk.JQuery._fromString_(self);
  2434. return self;},
  2435. source: unescape('asJQuery%0A%20%20%20%20%5EJQuery%20fromString%3A%20self%0A')}),
  2436. smalltalk.String);
  2437. smalltalk.addMethod(
  2438. '_appendToJQuery_',
  2439. smalltalk.method({
  2440. selector: 'appendToJQuery:',
  2441. category: '*JQuery',
  2442. fn: function (aJQuery){
  2443. var self=this;
  2444. (function(){aJQuery._appendElement_(String(self))})();
  2445. return self;},
  2446. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20%7B%27aJQuery._appendElement_%28String%28self%29%29%27%7D%0A')}),
  2447. smalltalk.String);
  2448. smalltalk.addMethod(
  2449. '_appendToBrush_',
  2450. smalltalk.method({
  2451. selector: 'appendToBrush:',
  2452. category: '*Canvas',
  2453. fn: function (aTagBrush){
  2454. var self=this;
  2455. aTagBrush._appendString_(self);
  2456. return self;},
  2457. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20appendString%3A%20self%0A')}),
  2458. smalltalk.String);
  2459. smalltalk.addMethod(
  2460. '__gt',
  2461. smalltalk.method({
  2462. selector: '>',
  2463. category: 'comparing',
  2464. fn: function (aString){
  2465. var self=this;
  2466. return (function(){return String(self) > aString})();
  2467. return self;},
  2468. source: unescape('%3E%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3E%20aString%27%7D%0A')}),
  2469. smalltalk.String);
  2470. smalltalk.addMethod(
  2471. '__lt',
  2472. smalltalk.method({
  2473. selector: '<',
  2474. category: 'comparing',
  2475. fn: function (aString){
  2476. var self=this;
  2477. return (function(){return String(self) < aString})();
  2478. return self;},
  2479. source: unescape('%3C%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3C%20aString%27%7D%0A')}),
  2480. smalltalk.String);
  2481. smalltalk.addMethod(
  2482. '__gt_eq',
  2483. smalltalk.method({
  2484. selector: '>=',
  2485. category: 'comparing',
  2486. fn: function (aString){
  2487. var self=this;
  2488. return (function(){return String(self) >= aString})();
  2489. return self;},
  2490. source: unescape('%3E%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3E%3D%20aString%27%7D%0A')}),
  2491. smalltalk.String);
  2492. smalltalk.addMethod(
  2493. '__lt_eq',
  2494. smalltalk.method({
  2495. selector: '<=',
  2496. category: 'comparing',
  2497. fn: function (aString){
  2498. var self=this;
  2499. return (function(){return String(self) <= aString})();
  2500. return self;},
  2501. source: unescape('%3C%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3C%3D%20aString%27%7D%0A')}),
  2502. smalltalk.String);
  2503. smalltalk.addMethod(
  2504. '_remove_',
  2505. smalltalk.method({
  2506. selector: 'remove:',
  2507. category: 'adding',
  2508. fn: function (anObject){
  2509. var self=this;
  2510. self._errorReadOnly();
  2511. return self;},
  2512. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20errorReadOnly%0A')}),
  2513. smalltalk.String);
  2514. smalltalk.addMethod(
  2515. '_streamClass',
  2516. smalltalk.method({
  2517. selector: 'streamClass',
  2518. category: 'accessing',
  2519. fn: function (){
  2520. var self=this;
  2521. return smalltalk.StringStream;
  2522. return self;},
  2523. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream%0A')}),
  2524. smalltalk.String.klass);
  2525. smalltalk.addMethod(
  2526. '_fromString_',
  2527. smalltalk.method({
  2528. selector: 'fromString:',
  2529. category: 'instance creation',
  2530. fn: function (aString){
  2531. var self=this;
  2532. return (function(){return new self.fn(aString);})();
  2533. return self;},
  2534. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5E%7B%27return%20new%20self.fn%28aString%29%3B%27%7D%0A')}),
  2535. smalltalk.String.klass);
  2536. smalltalk.addMethod(
  2537. '_cr',
  2538. smalltalk.method({
  2539. selector: 'cr',
  2540. category: 'accessing',
  2541. fn: function (){
  2542. var self=this;
  2543. return (function(){{return '\n'};})();
  2544. return self;},
  2545. source: unescape('cr%0A%09%20%20%20%20%5E%7B%27%7Breturn%20%27%27%5Cn%27%27%7D%3B%27%7D%0A')}),
  2546. smalltalk.String.klass);
  2547. smalltalk.addMethod(
  2548. '_lf',
  2549. smalltalk.method({
  2550. selector: 'lf',
  2551. category: 'accessing',
  2552. fn: function (){
  2553. var self=this;
  2554. return (function(){return '\r';})();
  2555. return self;},
  2556. source: unescape('lf%0A%09%20%20%20%20%5E%7B%27return%20%27%27%5Cr%27%27%3B%27%7D%0A')}),
  2557. smalltalk.String.klass);
  2558. smalltalk.addMethod(
  2559. '_space',
  2560. smalltalk.method({
  2561. selector: 'space',
  2562. category: 'accessing',
  2563. fn: function (){
  2564. var self=this;
  2565. return (function(){return ' ';})();
  2566. return self;},
  2567. source: unescape('space%0A%09%20%20%20%20%5E%7B%27return%20%27%27%20%27%27%3B%27%7D%0A')}),
  2568. smalltalk.String.klass);
  2569. smalltalk.addMethod(
  2570. '_tab',
  2571. smalltalk.method({
  2572. selector: 'tab',
  2573. category: 'accessing',
  2574. fn: function (){
  2575. var self=this;
  2576. return (function(){return '\t';})();
  2577. return self;},
  2578. source: unescape('tab%0A%09%20%20%20%20%5E%7B%27return%20%27%27%5Ct%27%27%3B%27%7D%0A')}),
  2579. smalltalk.String.klass);
  2580. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  2581. smalltalk.addMethod(
  2582. '_compile_',
  2583. smalltalk.method({
  2584. selector: 'compile:',
  2585. category: 'evaluating',
  2586. fn: function (aString){
  2587. var self=this;
  2588. return (function(){return self.compile(aString);})();
  2589. return self;},
  2590. source: unescape('compile%3A%20aString%0A%09%5E%7B%27return%20self.compile%28aString%29%3B%27%7D%0A')}),
  2591. smalltalk.RegularExpression);
  2592. smalltalk.addMethod(
  2593. '_exec_',
  2594. smalltalk.method({
  2595. selector: 'exec:',
  2596. category: 'evaluating',
  2597. fn: function (aString){
  2598. var self=this;
  2599. return (function(){return self.exec(aString);})();
  2600. return self;},
  2601. source: unescape('exec%3A%20aString%0A%09%5E%7B%27return%20self.exec%28aString%29%3B%27%7D%0A')}),
  2602. smalltalk.RegularExpression);
  2603. smalltalk.addMethod(
  2604. '_test_',
  2605. smalltalk.method({
  2606. selector: 'test:',
  2607. category: 'evaluating',
  2608. fn: function (aString){
  2609. var self=this;
  2610. return (function(){return self.test(aString);})();
  2611. return self;},
  2612. source: unescape('test%3A%20aString%0A%09%5E%7B%27return%20self.test%28aString%29%3B%27%7D%0A')}),
  2613. smalltalk.RegularExpression);
  2614. smalltalk.addMethod(
  2615. '_fromString_flag_',
  2616. smalltalk.method({
  2617. selector: 'fromString:flag:',
  2618. category: 'instance creation',
  2619. fn: function (aString, anotherString){
  2620. var self=this;
  2621. return (function(){return new RegExp(aString, anotherString);})();
  2622. return self;},
  2623. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%20%20%20%20%5E%7B%27return%20new%20RegExp%28aString%2C%20anotherString%29%3B%27%7D%0A')}),
  2624. smalltalk.RegularExpression.klass);
  2625. smalltalk.addMethod(
  2626. '_fromString_',
  2627. smalltalk.method({
  2628. selector: 'fromString:',
  2629. category: 'instance creation',
  2630. fn: function (aString){
  2631. var self=this;
  2632. return self._fromString_flag_(aString,"");
  2633. return self;},
  2634. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27%0A')}),
  2635. smalltalk.RegularExpression.klass);
  2636. smalltalk.addClass('Array', smalltalk.Collection, [], 'Kernel');
  2637. smalltalk.addMethod(
  2638. '_size',
  2639. smalltalk.method({
  2640. selector: 'size',
  2641. category: 'accessing',
  2642. fn: function (){
  2643. var self=this;
  2644. return (function(){return self.length})();
  2645. return self;},
  2646. source: unescape('size%0A%09%5E%7B%27return%20self.length%27%7D%0A')}),
  2647. smalltalk.Array);
  2648. smalltalk.addMethod(
  2649. '_at_put_',
  2650. smalltalk.method({
  2651. selector: 'at:put:',
  2652. category: 'accessing',
  2653. fn: function (anIndex, anObject){
  2654. var self=this;
  2655. return (function(){return self[anIndex - 1] = anObject})();
  2656. return self;},
  2657. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%5E%7B%27return%20self%5BanIndex%20-%201%5D%20%3D%20anObject%27%7D%0A')}),
  2658. smalltalk.Array);
  2659. smalltalk.addMethod(
  2660. '_at_ifAbsent_',
  2661. smalltalk.method({
  2662. selector: 'at:ifAbsent:',
  2663. category: 'accessing',
  2664. fn: function (anIndex, aBlock){
  2665. var self=this;
  2666. return (function(){
  2667. var value = self[anIndex - 1];
  2668. if(value === undefined) {
  2669. return aBlock();
  2670. } else {
  2671. return value;
  2672. }
  2673. })();
  2674. return self;},
  2675. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5BanIndex%20-%201%5D%3B%0A%09%20%20%20%20if%28value%20%3D%3D%3D%20undefined%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  2676. smalltalk.Array);
  2677. smalltalk.addMethod(
  2678. '_add_',
  2679. smalltalk.method({
  2680. selector: 'add:',
  2681. category: 'adding',
  2682. fn: function (anObject){
  2683. var self=this;
  2684. return (function(){self.push(anObject); return anObject;})();
  2685. return self;},
  2686. source: unescape('add%3A%20anObject%0A%09%5E%7B%27self.push%28anObject%29%3B%20return%20anObject%3B%27%7D%0A')}),
  2687. smalltalk.Array);
  2688. smalltalk.addMethod(
  2689. '_addLast_',
  2690. smalltalk.method({
  2691. selector: 'addLast:',
  2692. category: 'adding',
  2693. fn: function (anObject){
  2694. var self=this;
  2695. return self._add_(anObject);
  2696. return self;},
  2697. source: unescape('addLast%3A%20anObject%0A%09%5Eself%20add%3A%20anObject%0A')}),
  2698. smalltalk.Array);
  2699. smalltalk.addMethod(
  2700. '_shallowCopy',
  2701. smalltalk.method({
  2702. selector: 'shallowCopy',
  2703. category: 'copying',
  2704. fn: function (){
  2705. var self=this;
  2706. var newCollection=nil;
  2707. newCollection=self._class()._new();
  2708. self._do_((function(each){return newCollection._add_(each);}));
  2709. return newCollection;
  2710. return self;},
  2711. source: unescape('shallowCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%5D.%0A%09%5EnewCollection%0A')}),
  2712. smalltalk.Array);
  2713. smalltalk.addMethod(
  2714. '_deepCopy',
  2715. smalltalk.method({
  2716. selector: 'deepCopy',
  2717. category: 'copying',
  2718. fn: function (){
  2719. var self=this;
  2720. var newCollection=nil;
  2721. newCollection=self._class()._new();
  2722. self._do_((function(each){return newCollection._add_(each._deepCopy());}));
  2723. return newCollection;
  2724. return self;},
  2725. source: unescape('deepCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%20deepCopy%5D.%0A%09%5EnewCollection%0A')}),
  2726. smalltalk.Array);
  2727. smalltalk.addMethod(
  2728. '_copyFrom_to_',
  2729. smalltalk.method({
  2730. selector: 'copyFrom:to:',
  2731. category: 'copying',
  2732. fn: function (anIndex, anotherIndex){
  2733. var self=this;
  2734. var array=nil;
  2735. array=self._class()._new();
  2736. anIndex._to_do_(anotherIndex,(function(each){return array._add_(self._at_(each));}));
  2737. return array;
  2738. return self;},
  2739. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7C%20array%20%7C%0A%09array%20%3A%3D%20self%20class%20new.%0A%09anIndex%20to%3A%20anotherIndex%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20array%20add%3A%20%28self%20at%3A%20each%29%5D.%0A%09%5Earray%0A')}),
  2740. smalltalk.Array);
  2741. smalltalk.addMethod(
  2742. '_join_',
  2743. smalltalk.method({
  2744. selector: 'join:',
  2745. category: 'enumerating',
  2746. fn: function (aString){
  2747. var self=this;
  2748. return (function(){return self.join(aString);})();
  2749. return self;},
  2750. source: unescape('join%3A%20aString%0A%09%5E%7B%27return%20self.join%28aString%29%3B%27%7D%0A')}),
  2751. smalltalk.Array);
  2752. smalltalk.addMethod(
  2753. '_asJavascript',
  2754. smalltalk.method({
  2755. selector: 'asJavascript',
  2756. category: 'converting',
  2757. fn: function (){
  2758. var self=this;
  2759. return unescape("%5B").__comma(self._collect_((function(each){return each._asJavascript();}))._join_(unescape("%2C%20"))).__comma(unescape("%5D"));
  2760. return self;},
  2761. source: unescape('asJavascript%0A%09%5E%27%5B%27%2C%20%28%28self%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJavascript%5D%29%20join%3A%20%27%2C%20%27%29%2C%20%20%27%5D%27%0A')}),
  2762. smalltalk.Array);
  2763. smalltalk.addMethod(
  2764. '_sort',
  2765. smalltalk.method({
  2766. selector: 'sort',
  2767. category: 'enumerating',
  2768. fn: function (){
  2769. var self=this;
  2770. return self._copy()._basicPerform_("sort");
  2771. return self;},
  2772. source: unescape('sort%0A%20%20%20%20%5Eself%20copy%20basicPerform%3A%20%27sort%27%0A')}),
  2773. smalltalk.Array);
  2774. smalltalk.addMethod(
  2775. '_sort_',
  2776. smalltalk.method({
  2777. selector: 'sort:',
  2778. category: 'enumerating',
  2779. fn: function (aBlock){
  2780. var self=this;
  2781. return self._copy()._basicPerform_withArguments_("sort",smalltalk.Array._with_(aBlock));
  2782. return self;},
  2783. source: unescape('sort%3A%20aBlock%0A%20%20%20%20%5Eself%20copy%20basicPerform%3A%20%27sort%27%20withArguments%3A%20%28Array%20with%3A%20aBlock%29%0A')}),
  2784. smalltalk.Array);
  2785. smalltalk.addMethod(
  2786. '_remove_',
  2787. smalltalk.method({
  2788. selector: 'remove:',
  2789. category: 'adding',
  2790. fn: function (anObject){
  2791. var self=this;
  2792. (function(){for(var i=0;i<self.length;i++) {
  2793. if(self[i] == anObject) {
  2794. self.splice(i,1);
  2795. break;
  2796. }
  2797. }})();
  2798. return self;},
  2799. source: unescape('remove%3A%20anObject%0A%20%20%20%20%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09self.splice%28i%2C1%29%3B%0A%09%09break%3B%0A%09%7D%0A%20%20%20%20%7D%27%7D%0A')}),
  2800. smalltalk.Array);
  2801. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  2802. smalltalk.addMethod(
  2803. '_messageText',
  2804. smalltalk.method({
  2805. selector: 'messageText',
  2806. category: 'accessing',
  2807. fn: function (){
  2808. var self=this;
  2809. return self['@messageText'];
  2810. return self;},
  2811. source: unescape('messageText%0A%09%5EmessageText%0A')}),
  2812. smalltalk.Error);
  2813. smalltalk.addMethod(
  2814. '_messageText_',
  2815. smalltalk.method({
  2816. selector: 'messageText:',
  2817. category: 'accessing',
  2818. fn: function (aString){
  2819. var self=this;
  2820. self['@messageText']=aString;
  2821. return self;},
  2822. source: unescape('messageText%3A%20aString%0A%09messageText%20%3A%3D%20aString%0A')}),
  2823. smalltalk.Error);
  2824. smalltalk.addMethod(
  2825. '_signal',
  2826. smalltalk.method({
  2827. selector: 'signal',
  2828. category: 'signaling',
  2829. fn: function (){
  2830. var self=this;
  2831. return (function(){throw({smalltalkError: self})})();
  2832. return self;},
  2833. source: unescape('signal%0A%09%5E%7B%27throw%28%7BsmalltalkError%3A%20self%7D%29%27%7D%0A')}),
  2834. smalltalk.Error);
  2835. smalltalk.addMethod(
  2836. '_signal_',
  2837. smalltalk.method({
  2838. selector: 'signal:',
  2839. category: 'instance creation',
  2840. fn: function (aString){
  2841. var self=this;
  2842. return (function($rec){$rec._messageText_(aString);return $rec._signal();})(self._new());
  2843. return self;},
  2844. source: unescape('signal%3A%20aString%0A%09%20%20%20%20%5Eself%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal%0A')}),
  2845. smalltalk.Error.klass);
  2846. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  2847. smalltalk.addMethod(
  2848. '__eq',
  2849. smalltalk.method({
  2850. selector: '=',
  2851. category: 'comparing',
  2852. fn: function (anAssociation){
  2853. var self=this;
  2854. return self._class().__eq(anAssociation._class())._and_((function(){return self._key().__eq(anAssociation._key())._and_((function(){return self._value().__eq(anAssociation._value());}));}));
  2855. return self;},
  2856. source: unescape('%3D%20anAssociation%0A%09%5Eself%20class%20%3D%20anAssociation%20class%20and%3A%20%5B%0A%09%20%20%20%20self%20key%20%3D%20anAssociation%20key%20and%3A%20%5B%0A%09%09self%20value%20%3D%20anAssociation%20value%5D%5D%0A')}),
  2857. smalltalk.Association);
  2858. smalltalk.addMethod(
  2859. '_key_',
  2860. smalltalk.method({
  2861. selector: 'key:',
  2862. category: 'accessing',
  2863. fn: function (aKey){
  2864. var self=this;
  2865. self['@key']=aKey;
  2866. return self;},
  2867. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey%0A')}),
  2868. smalltalk.Association);
  2869. smalltalk.addMethod(
  2870. '_key',
  2871. smalltalk.method({
  2872. selector: 'key',
  2873. category: 'accessing',
  2874. fn: function (){
  2875. var self=this;
  2876. return self['@key'];
  2877. return self;},
  2878. source: unescape('key%0A%09%5Ekey%0A')}),
  2879. smalltalk.Association);
  2880. smalltalk.addMethod(
  2881. '_value_',
  2882. smalltalk.method({
  2883. selector: 'value:',
  2884. category: 'accessing',
  2885. fn: function (aValue){
  2886. var self=this;
  2887. self['@value']=aValue;
  2888. return self;},
  2889. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue%0A')}),
  2890. smalltalk.Association);
  2891. smalltalk.addMethod(
  2892. '_value',
  2893. smalltalk.method({
  2894. selector: 'value',
  2895. category: 'accessing',
  2896. fn: function (){
  2897. var self=this;
  2898. return self['@value'];
  2899. return self;},
  2900. source: unescape('value%0A%09%5Evalue%0A')}),
  2901. smalltalk.Association);
  2902. smalltalk.addMethod(
  2903. '_key_value_',
  2904. smalltalk.method({
  2905. selector: 'key:value:',
  2906. category: 'instance creation',
  2907. fn: function (aKey, aValue){
  2908. var self=this;
  2909. return (function($rec){$rec._key_(aKey);$rec._value_(aValue);return $rec._yourself();})(self._new());
  2910. return self;},
  2911. source: unescape('key%3A%20aKey%20value%3A%20aValue%0A%09%20%20%20%20%5Eself%20new%0A%09%09key%3A%20aKey%3B%0A%09%09value%3A%20aValue%3B%0A%09%09yourself%0A')}),
  2912. smalltalk.Association.klass);
  2913. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  2914. smalltalk.addMethod(
  2915. '__eq',
  2916. smalltalk.method({
  2917. selector: '=',
  2918. category: 'comparing',
  2919. fn: function (aDictionary){
  2920. var self=this;
  2921. try{self._class().__eq(aDictionary._class())._ifFalse_((function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();}));
  2922. self._associationsDo_((function(assoc){return aDictionary._at_ifAbsent_(assoc._key(),(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})).__eq(assoc._value())._ifFalse_((function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();}));}));
  2923. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  2924. return self;
  2925. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  2926. source: unescape('%3D%20aDictionary%0A%09self%20class%20%3D%20aDictionary%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20associationsDo%3A%20%5B%3Aassoc%20%7C%0A%09%20%20%20%20%28aDictionary%20at%3A%20assoc%20key%20ifAbsent%3A%20%5B%5Efalse%5D%29%20%3D%20assoc%20value%20%0A%09%09ifFalse%3A%20%5B%5Efalse%5D%5D.%0A%09%5Etrue%0A')}),
  2927. smalltalk.Dictionary);
  2928. smalltalk.addMethod(
  2929. '_shallowCopy',
  2930. smalltalk.method({
  2931. selector: 'shallowCopy',
  2932. category: 'copying',
  2933. fn: function (){
  2934. var self=this;
  2935. var copy=nil;
  2936. copy=self._class()._new();
  2937. self._associationsDo_((function(each){return copy._at_put_(each._key(),each._value());}));
  2938. return copy;
  2939. return self;},
  2940. source: unescape('shallowCopy%0A%09%7C%20copy%20%7C%0A%09copy%20%3A%3D%20self%20class%20new.%0A%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20copy%20at%3A%20each%20key%20%20put%3A%20each%20value%5D.%0A%09%5Ecopy%0A')}),
  2941. smalltalk.Dictionary);
  2942. smalltalk.addMethod(
  2943. '_initialize',
  2944. smalltalk.method({
  2945. selector: 'initialize',
  2946. category: 'initialization',
  2947. fn: function (){
  2948. var self=this;
  2949. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  2950. self['@keys']=[];
  2951. return self;},
  2952. source: unescape('initialize%0A%20%20%20%20%09super%20initialize.%0A%20%20%20%20%09keys%20%3A%3D%20%23%28%29%0A')}),
  2953. smalltalk.Dictionary);
  2954. smalltalk.addMethod(
  2955. '_size',
  2956. smalltalk.method({
  2957. selector: 'size',
  2958. category: 'accessing',
  2959. fn: function (){
  2960. var self=this;
  2961. return self['@keys']._size();
  2962. return self;},
  2963. source: unescape('size%0A%09%5Ekeys%20size%0A')}),
  2964. smalltalk.Dictionary);
  2965. smalltalk.addMethod(
  2966. '_associations',
  2967. smalltalk.method({
  2968. selector: 'associations',
  2969. category: 'accessing',
  2970. fn: function (){
  2971. var self=this;
  2972. var associations=nil;
  2973. associations=[];
  2974. self['@keys']._do_((function(each){return associations._add_(smalltalk.Association._key_value_(each,self._at_(each)));}));
  2975. return associations;
  2976. return self;},
  2977. source: unescape('associations%0A%09%7C%20associations%20%7C%0A%09associations%20%3A%3D%20%23%28%29.%0A%09keys%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20associations%20add%3A%20%28Association%20key%3A%20each%20value%3A%20%28self%20at%3A%20each%29%29%5D.%0A%09%5Eassociations%0A')}),
  2978. smalltalk.Dictionary);
  2979. smalltalk.addMethod(
  2980. '_keys',
  2981. smalltalk.method({
  2982. selector: 'keys',
  2983. category: 'accessing',
  2984. fn: function (){
  2985. var self=this;
  2986. return self['@keys']._copy();
  2987. return self;},
  2988. source: unescape('keys%0A%09%5Ekeys%20copy%0A')}),
  2989. smalltalk.Dictionary);
  2990. smalltalk.addMethod(
  2991. '_values',
  2992. smalltalk.method({
  2993. selector: 'values',
  2994. category: 'accessing',
  2995. fn: function (){
  2996. var self=this;
  2997. return self['@keys']._collect_((function(each){return self._at_(each);}));
  2998. return self;},
  2999. source: unescape('values%0A%20%20%20%20%09%5Ekeys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D%0A')}),
  3000. smalltalk.Dictionary);
  3001. smalltalk.addMethod(
  3002. '_at_put_',
  3003. smalltalk.method({
  3004. selector: 'at:put:',
  3005. category: 'accessing',
  3006. fn: function (aKey, aValue){
  3007. var self=this;
  3008. self['@keys']._includes_(aKey)._ifFalse_((function(){return self['@keys']._add_(aKey);}));
  3009. return self._basicAt_put_(aKey,aValue);
  3010. return self;},
  3011. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%28keys%20includes%3A%20aKey%29%20ifFalse%3A%20%5Bkeys%20add%3A%20aKey%5D.%0A%09%5Eself%20basicAt%3A%20aKey%20put%3A%20aValue%0A')}),
  3012. smalltalk.Dictionary);
  3013. smalltalk.addMethod(
  3014. '_at_ifAbsent_',
  3015. smalltalk.method({
  3016. selector: 'at:ifAbsent:',
  3017. category: 'accessing',
  3018. fn: function (aKey, aBlock){
  3019. var self=this;
  3020. return self._basicAt_(aKey)._ifNil_(aBlock);
  3021. return self;},
  3022. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%20ifNil%3A%20aBlock%0A')}),
  3023. smalltalk.Dictionary);
  3024. smalltalk.addMethod(
  3025. '_at_ifAbsentPut_',
  3026. smalltalk.method({
  3027. selector: 'at:ifAbsentPut:',
  3028. category: 'accessing',
  3029. fn: function (aKey, aBlock){
  3030. var self=this;
  3031. return self._at_ifAbsent_(aKey,(function(){return self._at_put_(aKey,aBlock._value());}));
  3032. return self;},
  3033. source: unescape('at%3A%20aKey%20ifAbsentPut%3A%20aBlock%0A%20%20%20%20%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5B%0A%20%20%20%20%09%20%20%20%20self%20at%3A%20aKey%20put%3A%20aBlock%20value%5D%0A')}),
  3034. smalltalk.Dictionary);
  3035. smalltalk.addMethod(
  3036. '_at_ifPresent_',
  3037. smalltalk.method({
  3038. selector: 'at:ifPresent:',
  3039. category: 'accessing',
  3040. fn: function (aKey, aBlock){
  3041. var self=this;
  3042. return self._basicAt_(aKey)._ifNotNil_((function(){return aBlock._value_(self._at_(aKey));}));
  3043. return self;},
  3044. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D%0A')}),
  3045. smalltalk.Dictionary);
  3046. smalltalk.addMethod(
  3047. '_at_ifPresent_ifAbsent_',
  3048. smalltalk.method({
  3049. selector: 'at:ifPresent:ifAbsent:',
  3050. category: 'accessing',
  3051. fn: function (aKey, aBlock, anotherBlock){
  3052. var self=this;
  3053. return self._basicAt_(aKey)._ifNil_ifNotNil_(anotherBlock,(function(){return aBlock._value_(self._at_(aKey));}));
  3054. return self;},
  3055. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%20ifAbsent%3A%20anotherBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%0A%09%20%20%20%20ifNil%3A%20anotherBlock%0A%09%20%20%20%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D%0A')}),
  3056. smalltalk.Dictionary);
  3057. smalltalk.addMethod(
  3058. '_add_',
  3059. smalltalk.method({
  3060. selector: 'add:',
  3061. category: 'adding/removing',
  3062. fn: function (anAssociation){
  3063. var self=this;
  3064. self._at_put_(anAssociation._key(),anAssociation._value());
  3065. return self;},
  3066. source: unescape('add%3A%20anAssociation%0A%20%20%20%20%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value%0A')}),
  3067. smalltalk.Dictionary);
  3068. smalltalk.addMethod(
  3069. '_addAll_',
  3070. smalltalk.method({
  3071. selector: 'addAll:',
  3072. category: 'adding/removing',
  3073. fn: function (aDictionary){
  3074. var self=this;
  3075. self.klass.superclass.fn.prototype['_addAll_'].apply(self, [aDictionary._associations()]);
  3076. return aDictionary;
  3077. return self;},
  3078. source: unescape('addAll%3A%20aDictionary%0A%20%20%20%20%09super%20addAll%3A%20aDictionary%20associations.%0A%20%20%20%20%09%5EaDictionary%0A')}),
  3079. smalltalk.Dictionary);
  3080. smalltalk.addMethod(
  3081. '__comma',
  3082. smalltalk.method({
  3083. selector: ',',
  3084. category: 'copying',
  3085. fn: function (aCollection){
  3086. var self=this;
  3087. self._shouldNotImplement();
  3088. return self;},
  3089. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement%0A')}),
  3090. smalltalk.Dictionary);
  3091. smalltalk.addMethod(
  3092. '_copyFrom_to_',
  3093. smalltalk.method({
  3094. selector: 'copyFrom:to:',
  3095. category: 'copying',
  3096. fn: function (anIndex, anotherIndex){
  3097. var self=this;
  3098. self._shouldNotImplement();
  3099. return self;},
  3100. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement%0A')}),
  3101. smalltalk.Dictionary);
  3102. smalltalk.addMethod(
  3103. '_associationsDo_',
  3104. smalltalk.method({
  3105. selector: 'associationsDo:',
  3106. category: 'enumerating',
  3107. fn: function (aBlock){
  3108. var self=this;
  3109. self._associations()._do_(aBlock);
  3110. return self;},
  3111. source: unescape('associationsDo%3A%20aBlock%0A%20%20%20%20%09self%20associations%20do%3A%20aBlock%0A')}),
  3112. smalltalk.Dictionary);
  3113. smalltalk.addMethod(
  3114. '_keysAndValuesDo_',
  3115. smalltalk.method({
  3116. selector: 'keysAndValuesDo:',
  3117. category: 'enumerating',
  3118. fn: function (aBlock){
  3119. var self=this;
  3120. self._associationsDo_((function(each){return aBlock._value_value_(each._key(),each._value());}));
  3121. return self;},
  3122. source: unescape('keysAndValuesDo%3A%20aBlock%0A%20%20%20%20%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%20key%20value%3A%20each%20value%5D%0A')}),
  3123. smalltalk.Dictionary);
  3124. smalltalk.addMethod(
  3125. '_do_',
  3126. smalltalk.method({
  3127. selector: 'do:',
  3128. category: 'enumerating',
  3129. fn: function (aBlock){
  3130. var self=this;
  3131. self._values()._do_(aBlock);
  3132. return self;},
  3133. source: unescape('do%3A%20aBlock%0A%20%20%20%20%09self%20values%20do%3A%20aBlock%0A')}),
  3134. smalltalk.Dictionary);
  3135. smalltalk.addMethod(
  3136. '_select_',
  3137. smalltalk.method({
  3138. selector: 'select:',
  3139. category: 'enumerating',
  3140. fn: function (aBlock){
  3141. var self=this;
  3142. var newDict=nil;
  3143. newDict=self._class()._new();
  3144. self._keysAndValuesDo_((function(key, value){return aBlock._value_(value)._ifTrue_((function(){return newDict._at_put_(key,value);}));}));
  3145. return newDict;
  3146. return self;},
  3147. source: unescape('select%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%20%20%20%20%09%5EnewDict%0A')}),
  3148. smalltalk.Dictionary);
  3149. smalltalk.addMethod(
  3150. '_collect_',
  3151. smalltalk.method({
  3152. selector: 'collect:',
  3153. category: 'enumerating',
  3154. fn: function (aBlock){
  3155. var self=this;
  3156. var newDict=nil;
  3157. newDict=self._class()._new();
  3158. self._keysAndValuesDo_((function(key, value){return aBlock._value_(value)._ifTrue_((function(){return newDict._at_put_(key,value);}));}));
  3159. return newDict;
  3160. return self;},
  3161. source: unescape('collect%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%20%20%20%20%09%5EnewDict%0A')}),
  3162. smalltalk.Dictionary);
  3163. smalltalk.addMethod(
  3164. '_detect_ifNone_',
  3165. smalltalk.method({
  3166. selector: 'detect:ifNone:',
  3167. category: 'enumerating',
  3168. fn: function (aBlock, anotherBlock){
  3169. var self=this;
  3170. return self._values()._detect_ifNone_(aBlock,anotherBlock);
  3171. return self;},
  3172. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A')}),
  3173. smalltalk.Dictionary);
  3174. smalltalk.addMethod(
  3175. '_includes_',
  3176. smalltalk.method({
  3177. selector: 'includes:',
  3178. category: 'enumerating',
  3179. fn: function (anObject){
  3180. var self=this;
  3181. return self._values()._includes_(anObject);
  3182. return self;},
  3183. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject%0A')}),
  3184. smalltalk.Dictionary);
  3185. smalltalk.addMethod(
  3186. '_remove_',
  3187. smalltalk.method({
  3188. selector: 'remove:',
  3189. category: 'adding/removing',
  3190. fn: function (aKey){
  3191. var self=this;
  3192. self._removeKey_(aKey);
  3193. return self;},
  3194. source: unescape('remove%3A%20aKey%0A%20%20%20%20self%20removeKey%3A%20aKey%0A')}),
  3195. smalltalk.Dictionary);
  3196. smalltalk.addMethod(
  3197. '_removeKey_',
  3198. smalltalk.method({
  3199. selector: 'removeKey:',
  3200. category: 'adding/removing',
  3201. fn: function (aKey){
  3202. var self=this;
  3203. self['@keys']._remove_(aKey);
  3204. return self;},
  3205. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20keys%20remove%3A%20aKey%0A')}),
  3206. smalltalk.Dictionary);
  3207. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  3208. smalltalk.addMethod(
  3209. '_superclass_subclass_',
  3210. smalltalk.method({
  3211. selector: 'superclass:subclass:',
  3212. category: 'class creation',
  3213. fn: function (aClass, aString){
  3214. var self=this;
  3215. self._superclass_subclass_instanceVariableNames_category_(aClass,aString,"",nil);
  3216. return self;},
  3217. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%0A%09self%20superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20%27%27%20category%3A%20nil%0A')}),
  3218. smalltalk.ClassBuilder);
  3219. smalltalk.addMethod(
  3220. '_superclass_subclass_instanceVariableNames_category_',
  3221. smalltalk.method({
  3222. selector: 'superclass:subclass:instanceVariableNames:category:',
  3223. category: 'class creation',
  3224. fn: function (aClass, aString, aString2, aString3){
  3225. var self=this;
  3226. var newClass=nil;
  3227. newClass=self._addSubclassOf_named_instanceVariableNames_(aClass,aString,self._instanceVariableNamesFor_(aString2));
  3228. self._setupClass_(newClass);
  3229. newClass._category_(aString3._ifNil_((function(){return "unclassified";})));
  3230. return self;},
  3231. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%7C%20newClass%20%7C%0A%09newClass%20%3A%3D%20self%20addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20%28self%20instanceVariableNamesFor%3A%20aString2%29.%0A%09self%20setupClass%3A%20newClass.%0A%09newClass%20category%3A%20%28aString3%20ifNil%3A%20%5B%27unclassified%27%5D%29%0A')}),
  3232. smalltalk.ClassBuilder);
  3233. smalltalk.addMethod(
  3234. '_class_instanceVariableNames_',
  3235. smalltalk.method({
  3236. selector: 'class:instanceVariableNames:',
  3237. category: 'class creation',
  3238. fn: function (aClass, aString){
  3239. var self=this;
  3240. aClass._isMetaclass()._ifFalse_((function(){return self._error_(aClass._name().__comma(" is not a metaclass"));}));
  3241. aClass._basicAt_put_("iVarNames",self._instanceVariableNamesFor_(aString));
  3242. self._setupClass_(aClass);
  3243. return self;},
  3244. source: unescape('class%3A%20aClass%20instanceVariableNames%3A%20aString%0A%09aClass%20isMetaclass%20ifFalse%3A%20%5Bself%20error%3A%20aClass%20name%2C%20%27%20is%20not%20a%20metaclass%27%5D.%0A%09aClass%20basicAt%3A%20%27iVarNames%27%20put%3A%20%28self%20instanceVariableNamesFor%3A%20aString%29.%0A%09self%20setupClass%3A%20aClass%0A')}),
  3245. smalltalk.ClassBuilder);
  3246. smalltalk.addMethod(
  3247. '_instanceVariableNamesFor_',
  3248. smalltalk.method({
  3249. selector: 'instanceVariableNamesFor:',
  3250. category: 'private',
  3251. fn: function (aString){
  3252. var self=this;
  3253. return aString._tokenize_(" ")._reject_((function(each){return each._isEmpty();}));
  3254. return self;},
  3255. source: unescape('instanceVariableNamesFor%3A%20aString%0A%09%5E%28aString%20tokenize%3A%20%27%20%27%29%20reject%3A%20%5B%3Aeach%20%7C%20each%20isEmpty%5D%0A')}),
  3256. smalltalk.ClassBuilder);
  3257. smalltalk.addMethod(
  3258. '_addSubclassOf_named_instanceVariableNames_',
  3259. smalltalk.method({
  3260. selector: 'addSubclassOf:named:instanceVariableNames:',
  3261. category: 'private',
  3262. fn: function (aClass, aString, aCollection){
  3263. var self=this;
  3264. return (function(){smalltalk.addClass(aString, aClass, aCollection);
  3265. return smalltalk[aString]})();
  3266. return self;},
  3267. source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%0A%09%5E%7B%27smalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%27%7D%0A')}),
  3268. smalltalk.ClassBuilder);
  3269. smalltalk.addMethod(
  3270. '_setupClass_',
  3271. smalltalk.method({
  3272. selector: 'setupClass:',
  3273. category: 'private',
  3274. fn: function (aClass){
  3275. var self=this;
  3276. (function(){smalltalk.init(aClass);})();
  3277. return self;},
  3278. source: unescape('setupClass%3A%20aClass%0A%09%7B%27smalltalk.init%28aClass%29%3B%27%7D%0A')}),
  3279. smalltalk.ClassBuilder);
  3280. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  3281. smalltalk.addMethod(
  3282. '_initialize',
  3283. smalltalk.method({
  3284. selector: 'initialize',
  3285. category: 'initialization',
  3286. fn: function (){
  3287. var self=this;
  3288. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  3289. self['@chunkParser']=smalltalk.ChunkParser._new();
  3290. return self;},
  3291. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A')}),
  3292. smalltalk.ClassCategoryReader);
  3293. smalltalk.addMethod(
  3294. '_class_category_',
  3295. smalltalk.method({
  3296. selector: 'class:category:',
  3297. category: 'accessing',
  3298. fn: function (aClass, aString){
  3299. var self=this;
  3300. self['@class']=aClass;
  3301. self['@category']=aString;
  3302. return self;},
  3303. source: unescape('class%3A%20aClass%20category%3A%20aString%0A%09class%20%3A%3D%20aClass.%0A%09category%20%3A%3D%20aString%0A')}),
  3304. smalltalk.ClassCategoryReader);
  3305. smalltalk.addMethod(
  3306. '_scanFrom_',
  3307. smalltalk.method({
  3308. selector: 'scanFrom:',
  3309. category: 'fileIn',
  3310. fn: function (aStream){
  3311. var self=this;
  3312. var nextChunk=nil;
  3313. nextChunk=self['@chunkParser']._emptyChunk().__slash(self['@chunkParser']._chunk())._parse_(aStream);
  3314. nextChunk._isEmptyChunk()._ifFalse_((function(){self._compileMethod_(nextChunk._contents());return self._scanFrom_(aStream);}));
  3315. return self;},
  3316. source: unescape('scanFrom%3A%20aStream%0A%09%7C%20nextChunk%20%7C%0A%09nextChunk%20%3A%3D%20%28chunkParser%20emptyChunk%20/%20chunkParser%20chunk%29%20parse%3A%20aStream.%0A%09nextChunk%20isEmptyChunk%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20compileMethod%3A%20nextChunk%20contents.%0A%09%20%20%20%20self%20scanFrom%3A%20aStream%5D.%0A')}),
  3317. smalltalk.ClassCategoryReader);
  3318. smalltalk.addMethod(
  3319. '_compileMethod_',
  3320. smalltalk.method({
  3321. selector: 'compileMethod:',
  3322. category: 'private',
  3323. fn: function (aString){
  3324. var self=this;
  3325. var method=nil;
  3326. method=smalltalk.Compiler._new()._load_forClass_(aString,self['@class']);
  3327. method._category_(self['@category']);
  3328. self['@class']._addCompiledMethod_(method);
  3329. return self;},
  3330. source: unescape('compileMethod%3A%20aString%0A%09%7C%20method%20%7C%0A%09method%20%3A%3D%20Compiler%20new%20load%3A%20aString%20forClass%3A%20class.%0A%09method%20category%3A%20category.%0A%09class%20addCompiledMethod%3A%20method%0A')}),
  3331. smalltalk.ClassCategoryReader);
  3332. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  3333. smalltalk.addMethod(
  3334. '_collection',
  3335. smalltalk.method({
  3336. selector: 'collection',
  3337. category: 'accessing',
  3338. fn: function (){
  3339. var self=this;
  3340. return self['@collection'];
  3341. return self;},
  3342. source: unescape('collection%0A%09%5Ecollection%0A')}),
  3343. smalltalk.Stream);
  3344. smalltalk.addMethod(
  3345. '_setCollection_',
  3346. smalltalk.method({
  3347. selector: 'setCollection:',
  3348. category: 'accessing',
  3349. fn: function (aCollection){
  3350. var self=this;
  3351. self['@collection']=aCollection;
  3352. return self;},
  3353. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection%0A')}),
  3354. smalltalk.Stream);
  3355. smalltalk.addMethod(
  3356. '_position',
  3357. smalltalk.method({
  3358. selector: 'position',
  3359. category: 'accessing',
  3360. fn: function (){
  3361. var self=this;
  3362. return self['@position']._ifNil_((function(){return self['@position']=(0);}));
  3363. return self;},
  3364. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D%0A')}),
  3365. smalltalk.Stream);
  3366. smalltalk.addMethod(
  3367. '_position_',
  3368. smalltalk.method({
  3369. selector: 'position:',
  3370. category: 'accessing',
  3371. fn: function (anInteger){
  3372. var self=this;
  3373. self['@position']=anInteger;
  3374. return self;},
  3375. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger%0A')}),
  3376. smalltalk.Stream);
  3377. smalltalk.addMethod(
  3378. '_streamSize',
  3379. smalltalk.method({
  3380. selector: 'streamSize',
  3381. category: 'accessing',
  3382. fn: function (){
  3383. var self=this;
  3384. return self['@streamSize'];
  3385. return self;},
  3386. source: unescape('streamSize%0A%09%5EstreamSize%0A')}),
  3387. smalltalk.Stream);
  3388. smalltalk.addMethod(
  3389. '_setStreamSize_',
  3390. smalltalk.method({
  3391. selector: 'setStreamSize:',
  3392. category: 'accessing',
  3393. fn: function (anInteger){
  3394. var self=this;
  3395. self['@streamSize']=anInteger;
  3396. return self;},
  3397. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger%0A')}),
  3398. smalltalk.Stream);
  3399. smalltalk.addMethod(
  3400. '_contents',
  3401. smalltalk.method({
  3402. selector: 'contents',
  3403. category: 'accessing',
  3404. fn: function (){
  3405. var self=this;
  3406. return self._collection()._copyFrom_to_((1),self._streamSize());
  3407. return self;},
  3408. source: unescape('contents%0A%09%5Eself%20collection%0A%09%20%20%20%20copyFrom%3A%201%20%0A%09%20%20%20%20to%3A%20self%20streamSize%0A')}),
  3409. smalltalk.Stream);
  3410. smalltalk.addMethod(
  3411. '_size',
  3412. smalltalk.method({
  3413. selector: 'size',
  3414. category: 'accessing',
  3415. fn: function (){
  3416. var self=this;
  3417. return self._streamSize();
  3418. return self;},
  3419. source: unescape('size%0A%09%5Eself%20streamSize%0A')}),
  3420. smalltalk.Stream);
  3421. smalltalk.addMethod(
  3422. '_reset',
  3423. smalltalk.method({
  3424. selector: 'reset',
  3425. category: 'actions',
  3426. fn: function (){
  3427. var self=this;
  3428. self._position_((0));
  3429. return self;},
  3430. source: unescape('reset%0A%09self%20position%3A%200%0A')}),
  3431. smalltalk.Stream);
  3432. smalltalk.addMethod(
  3433. '_close',
  3434. smalltalk.method({
  3435. selector: 'close',
  3436. category: 'actions',
  3437. fn: function (){
  3438. var self=this;
  3439. return self;},
  3440. source: unescape('close%0A')}),
  3441. smalltalk.Stream);
  3442. smalltalk.addMethod(
  3443. '_flush',
  3444. smalltalk.method({
  3445. selector: 'flush',
  3446. category: 'actions',
  3447. fn: function (){
  3448. var self=this;
  3449. return self;},
  3450. source: unescape('flush%0A')}),
  3451. smalltalk.Stream);
  3452. smalltalk.addMethod(
  3453. '_resetContents',
  3454. smalltalk.method({
  3455. selector: 'resetContents',
  3456. category: 'actions',
  3457. fn: function (){
  3458. var self=this;
  3459. self._reset();
  3460. self._setStreamSize_((0));
  3461. return self;},
  3462. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200%0A')}),
  3463. smalltalk.Stream);
  3464. smalltalk.addMethod(
  3465. '_do_',
  3466. smalltalk.method({
  3467. selector: 'do:',
  3468. category: 'enumerating',
  3469. fn: function (aBlock){
  3470. var self=this;
  3471. (function(){return self._atEnd();})._whileFalse_((function(){return aBlock._value_(self._next());}));
  3472. return self;},
  3473. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D%0A')}),
  3474. smalltalk.Stream);
  3475. smalltalk.addMethod(
  3476. '_setToEnd',
  3477. smalltalk.method({
  3478. selector: 'setToEnd',
  3479. category: 'positioning',
  3480. fn: function (){
  3481. var self=this;
  3482. self._position_(self._size());
  3483. return self;},
  3484. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size%0A')}),
  3485. smalltalk.Stream);
  3486. smalltalk.addMethod(
  3487. '_skip_',
  3488. smalltalk.method({
  3489. selector: 'skip:',
  3490. category: 'positioning',
  3491. fn: function (anInteger){
  3492. var self=this;
  3493. self._position_(self._position().__plus(anInteger)._min_max_(self._size(),(0)));
  3494. return self;},
  3495. source: unescape('skip%3A%20anInteger%0A%09self%20position%3A%20%28%28self%20position%20+%20anInteger%29%20min%3A%20self%20size%20max%3A%200%29%0A')}),
  3496. smalltalk.Stream);
  3497. smalltalk.addMethod(
  3498. '_next',
  3499. smalltalk.method({
  3500. selector: 'next',
  3501. category: 'reading',
  3502. fn: function (){
  3503. var self=this;
  3504. self._position_(self._position().__plus((1)));
  3505. return self['@collection']._at_(self._position());
  3506. return self;},
  3507. source: unescape('next%0A%09self%20position%3A%20self%20position%20+%201.%20%0A%09%5Ecollection%20at%3A%20self%20position%0A')}),
  3508. smalltalk.Stream);
  3509. smalltalk.addMethod(
  3510. '_next_',
  3511. smalltalk.method({
  3512. selector: 'next:',
  3513. category: 'reading',
  3514. fn: function (anInteger){
  3515. var self=this;
  3516. var tempCollection=nil;
  3517. tempCollection=self._collection()._class()._new();
  3518. anInteger._timesRepeat_((function(){return self._atEnd()._ifFalse_((function(){return tempCollection._add_(self._next());}));}));
  3519. return tempCollection;
  3520. return self;},
  3521. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20add%3A%20self%20next%5D%5D.%0A%09%5EtempCollection%0A')}),
  3522. smalltalk.Stream);
  3523. smalltalk.addMethod(
  3524. '_nextPut_',
  3525. smalltalk.method({
  3526. selector: 'nextPut:',
  3527. category: 'writing',
  3528. fn: function (anObject){
  3529. var self=this;
  3530. self._position_(self._position().__plus((1)));
  3531. self._collection()._at_put_(self._position(),anObject);
  3532. self._setStreamSize_(self._streamSize()._max_(self._position()));
  3533. return self;},
  3534. source: unescape('nextPut%3A%20anObject%0A%09self%20position%3A%20self%20position%20+%201.%0A%09self%20collection%20at%3A%20self%20position%20put%3A%20anObject.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29%0A')}),
  3535. smalltalk.Stream);
  3536. smalltalk.addMethod(
  3537. '_nextPutAll_',
  3538. smalltalk.method({
  3539. selector: 'nextPutAll:',
  3540. category: 'writing',
  3541. fn: function (aCollection){
  3542. var self=this;
  3543. aCollection._do_((function(each){return self._nextPut_(each);}));
  3544. return self;},
  3545. source: unescape('nextPutAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20nextPut%3A%20each%5D%0A')}),
  3546. smalltalk.Stream);
  3547. smalltalk.addMethod(
  3548. '_peek',
  3549. smalltalk.method({
  3550. selector: 'peek',
  3551. category: 'reading',
  3552. fn: function (){
  3553. var self=this;
  3554. return self._atEnd()._ifFalse_((function(){return self._collection()._at_(self._position().__plus((1)));}));
  3555. return self;},
  3556. source: unescape('peek%0A%09%5Eself%20atEnd%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20collection%20at%3A%20self%20position%20+%201%5D%0A')}),
  3557. smalltalk.Stream);
  3558. smalltalk.addMethod(
  3559. '_atEnd',
  3560. smalltalk.method({
  3561. selector: 'atEnd',
  3562. category: 'testing',
  3563. fn: function (){
  3564. var self=this;
  3565. return self._position().__eq(self._size());
  3566. return self;},
  3567. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size%0A')}),
  3568. smalltalk.Stream);
  3569. smalltalk.addMethod(
  3570. '_atStart',
  3571. smalltalk.method({
  3572. selector: 'atStart',
  3573. category: 'testing',
  3574. fn: function (){
  3575. var self=this;
  3576. return self._position().__eq((0));
  3577. return self;},
  3578. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200%0A')}),
  3579. smalltalk.Stream);
  3580. smalltalk.addMethod(
  3581. '_isEmpty',
  3582. smalltalk.method({
  3583. selector: 'isEmpty',
  3584. category: 'testing',
  3585. fn: function (){
  3586. var self=this;
  3587. return self._size().__eq((0));
  3588. return self;},
  3589. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A')}),
  3590. smalltalk.Stream);
  3591. smalltalk.addMethod(
  3592. '_on_',
  3593. smalltalk.method({
  3594. selector: 'on:',
  3595. category: 'instance creation',
  3596. fn: function (aCollection){
  3597. var self=this;
  3598. return (function($rec){$rec._setCollection_(aCollection);$rec._setStreamSize_(aCollection._size());return $rec._yourself();})(self._new());
  3599. return self;},
  3600. source: unescape('on%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%20%0A%09%09setCollection%3A%20aCollection%3B%0A%09%09setStreamSize%3A%20aCollection%20size%3B%0A%09%09yourself%0A')}),
  3601. smalltalk.Stream.klass);
  3602. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  3603. smalltalk.addMethod(
  3604. '_next_',
  3605. smalltalk.method({
  3606. selector: 'next:',
  3607. category: 'reading',
  3608. fn: function (anInteger){
  3609. var self=this;
  3610. var tempCollection=nil;
  3611. tempCollection=self._collection()._class()._new();
  3612. anInteger._timesRepeat_((function(){return self._atEnd()._ifFalse_((function(){return tempCollection=tempCollection.__comma(self._next());}));}));
  3613. return tempCollection;
  3614. return self;},
  3615. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20%3A%3D%20tempCollection%2C%20self%20next%5D%5D.%0A%09%5EtempCollection%0A')}),
  3616. smalltalk.StringStream);
  3617. smalltalk.addMethod(
  3618. '_nextPut_',
  3619. smalltalk.method({
  3620. selector: 'nextPut:',
  3621. category: 'writing',
  3622. fn: function (aString){
  3623. var self=this;
  3624. self._nextPutAll_(aString);
  3625. return self;},
  3626. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString%0A')}),
  3627. smalltalk.StringStream);
  3628. smalltalk.addMethod(
  3629. '_nextPutAll_',
  3630. smalltalk.method({
  3631. selector: 'nextPutAll:',
  3632. category: 'writing',
  3633. fn: function (aString){
  3634. var self=this;
  3635. self._setCollection_(self._collection()._copyFrom_to_((1),self._position()).__comma(aString).__comma(self._collection()._copyFrom_to_(self._position().__plus((1)).__plus(aString._size()),self._collection()._size())));
  3636. self._position_(self._position().__plus(aString._size()));
  3637. self._setStreamSize_(self._streamSize()._max_(self._position()));
  3638. return self;},
  3639. source: unescape('nextPutAll%3A%20aString%0A%09self%20setCollection%3A%20%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%201%20to%3A%20self%20position%29%2C%0A%09%20%20%20%20aString%2C%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%20%28self%20position%20+%201%20+%20aString%20size%29%20to%3A%20self%20collection%20size%29.%0A%09self%20position%3A%20self%20position%20+%20aString%20size.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29%0A')}),
  3640. smalltalk.StringStream);
  3641. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  3642. smalltalk.addMethod(
  3643. '_class_',
  3644. smalltalk.method({
  3645. selector: 'class:',
  3646. category: 'accessing',
  3647. fn: function (aClass){
  3648. var self=this;
  3649. self['@class']=aClass;
  3650. return self;},
  3651. source: unescape('class%3A%20aClass%0A%09class%20%3A%3D%20aClass%0A')}),
  3652. smalltalk.ClassCommentReader);
  3653. smalltalk.addMethod(
  3654. '_scanFrom_',
  3655. smalltalk.method({
  3656. selector: 'scanFrom:',
  3657. category: 'fileIn',
  3658. fn: function (aStream){
  3659. var self=this;
  3660. var nextChunk=nil;
  3661. nextChunk=self['@chunkParser']._emptyChunk().__slash(self['@chunkParser']._chunk())._parse_(aStream);
  3662. nextChunk._isEmptyChunk()._ifFalse_((function(){return self._setComment_(nextChunk._contents());}));
  3663. return self;},
  3664. source: unescape('scanFrom%3A%20aStream%0A%09%7C%20nextChunk%20%7C%0A%09nextChunk%20%3A%3D%20%28chunkParser%20emptyChunk%20/%20chunkParser%20chunk%29%20parse%3A%20aStream.%0A%09nextChunk%20isEmptyChunk%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20setComment%3A%20nextChunk%20contents%5D.%0A')}),
  3665. smalltalk.ClassCommentReader);
  3666. smalltalk.addMethod(
  3667. '_initialize',
  3668. smalltalk.method({
  3669. selector: 'initialize',
  3670. category: 'initialization',
  3671. fn: function (){
  3672. var self=this;
  3673. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  3674. self['@chunkParser']=smalltalk.ChunkParser._new();
  3675. return self;},
  3676. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A')}),
  3677. smalltalk.ClassCommentReader);
  3678. smalltalk.addMethod(
  3679. '_setComment_',
  3680. smalltalk.method({
  3681. selector: 'setComment:',
  3682. category: 'private',
  3683. fn: function (aString){
  3684. var self=this;
  3685. self['@class']._comment_(aString);
  3686. return self;},
  3687. source: unescape('setComment%3A%20aString%0A%20%20%20%20class%20comment%3A%20aString%0A')}),
  3688. smalltalk.ClassCommentReader);
  3689. smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
  3690. smalltalk.addMethod(
  3691. '_removeAttribute_',
  3692. smalltalk.method({
  3693. selector: 'removeAttribute:',
  3694. category: 'attributes',
  3695. fn: function (aString){
  3696. var self=this;
  3697. return self._call_withArgument_("removeAttribute",aString);
  3698. return self;},
  3699. source: unescape('removeAttribute%3A%20aString%0A%20%20%20%20%22Remove%20an%20attribute%20from%20each%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27removeAttribute%27%20withArgument%3A%20aString%0A')}),
  3700. smalltalk.JQuery);
  3701. smalltalk.addMethod(
  3702. '_attr_',
  3703. smalltalk.method({
  3704. selector: 'attr:',
  3705. category: 'attributes',
  3706. fn: function (aString){
  3707. var self=this;
  3708. return self._call_withArgument_("attr",aString);
  3709. return self;},
  3710. source: unescape('attr%3A%20aString%0A%20%20%20%20%22Get%20the%20value%20of%20an%20attribute%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27attr%27%20withArgument%3A%20aString%0A')}),
  3711. smalltalk.JQuery);
  3712. smalltalk.addMethod(
  3713. '_val',
  3714. smalltalk.method({
  3715. selector: 'val',
  3716. category: 'attributes',
  3717. fn: function (){
  3718. var self=this;
  3719. return self._call_("val");
  3720. return self;},
  3721. source: unescape('val%0A%20%20%20%20%22Get%20the%20current%20value%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27val%27%0A')}),
  3722. smalltalk.JQuery);
  3723. smalltalk.addMethod(
  3724. '_val_',
  3725. smalltalk.method({
  3726. selector: 'val:',
  3727. category: 'attributes',
  3728. fn: function (aString){
  3729. var self=this;
  3730. self._call_withArgument_("val",aString);
  3731. return self;},
  3732. source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString%0A')}),
  3733. smalltalk.JQuery);
  3734. smalltalk.addMethod(
  3735. '_cssAt_',
  3736. smalltalk.method({
  3737. selector: 'cssAt:',
  3738. category: 'css',
  3739. fn: function (aString){
  3740. var self=this;
  3741. return (function(){return self['@jquery'].css(aString)})();
  3742. return self;},
  3743. source: unescape('cssAt%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D.css%28aString%29%27%7D%0A')}),
  3744. smalltalk.JQuery);
  3745. smalltalk.addMethod(
  3746. '_cssAt_put_',
  3747. smalltalk.method({
  3748. selector: 'cssAt:put:',
  3749. category: 'css',
  3750. fn: function (aString, anotherString){
  3751. var self=this;
  3752. (function(){self['@jquery'].css(aString, anotherString)})();
  3753. return self;},
  3754. source: unescape('cssAt%3A%20aString%20put%3A%20anotherString%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.css%28aString%2C%20anotherString%29%27%7D%0A')}),
  3755. smalltalk.JQuery);
  3756. smalltalk.addMethod(
  3757. '_addClass_',
  3758. smalltalk.method({
  3759. selector: 'addClass:',
  3760. category: 'css',
  3761. fn: function (aString){
  3762. var self=this;
  3763. self._call_withArgument_("addClass",aString);
  3764. return self;},
  3765. source: unescape('addClass%3A%20aString%0A%20%20%20%20%22Adds%20the%20specified%20class%28es%29%20to%20each%20of%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20self%20call%3A%20%27addClass%27%20withArgument%3A%20aString%0A')}),
  3766. smalltalk.JQuery);
  3767. smalltalk.addMethod(
  3768. '_removeClass_',
  3769. smalltalk.method({
  3770. selector: 'removeClass:',
  3771. category: 'css',
  3772. fn: function (aString){
  3773. var self=this;
  3774. self._call_withArgument_("removeClass",aString);
  3775. return self;},
  3776. source: unescape('removeClass%3A%20aString%0A%20%20%20%20%22Remove%20a%20single%20class%2C%20multiple%20classes%2C%20or%20all%20classes%20from%20each%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20self%20call%3A%20%27removeClass%27%20withArgument%3A%20aString%0A')}),
  3777. smalltalk.JQuery);
  3778. smalltalk.addMethod(
  3779. '_toggleClass_',
  3780. smalltalk.method({
  3781. selector: 'toggleClass:',
  3782. category: 'css',
  3783. fn: function (aString){
  3784. var self=this;
  3785. self._call_withArgument_("toggleClass",aString);
  3786. return self;},
  3787. source: unescape('toggleClass%3A%20aString%0A%20%20%20%20%22Add%20or%20remove%20one%20or%20more%20classes%20from%20each%20element%20in%20the%20set%20of%20matched%20elements%2C%20depending%20on%20either%20the%20class%27s%20presence%20or%20the%20value%20of%20the%20switch%20argument.%22%0A%20%20%20%20self%20call%3A%20%27toggleClass%27%20withArgument%3A%20aString%0A')}),
  3788. smalltalk.JQuery);
  3789. smalltalk.addMethod(
  3790. '_height',
  3791. smalltalk.method({
  3792. selector: 'height',
  3793. category: 'css',
  3794. fn: function (){
  3795. var self=this;
  3796. return self._call_("height");
  3797. return self;},
  3798. source: unescape('height%20%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27height%27%0A')}),
  3799. smalltalk.JQuery);
  3800. smalltalk.addMethod(
  3801. '_height_',
  3802. smalltalk.method({
  3803. selector: 'height:',
  3804. category: 'css',
  3805. fn: function (anInteger){
  3806. var self=this;
  3807. self._call_withArgument_("height",anInteger);
  3808. return self;},
  3809. source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger%0A')}),
  3810. smalltalk.JQuery);
  3811. smalltalk.addMethod(
  3812. '_width_',
  3813. smalltalk.method({
  3814. selector: 'width:',
  3815. category: 'css',
  3816. fn: function (anInteger){
  3817. var self=this;
  3818. self._call_withArgument_("width",anInteger);
  3819. return self;},
  3820. source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger%0A')}),
  3821. smalltalk.JQuery);
  3822. smalltalk.addMethod(
  3823. '_width',
  3824. smalltalk.method({
  3825. selector: 'width',
  3826. category: 'css',
  3827. fn: function (){
  3828. var self=this;
  3829. return self._call_("width");
  3830. return self;},
  3831. source: unescape('width%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27width%27%0A')}),
  3832. smalltalk.JQuery);
  3833. smalltalk.addMethod(
  3834. '_innerHeight',
  3835. smalltalk.method({
  3836. selector: 'innerHeight',
  3837. category: 'css',
  3838. fn: function (){
  3839. var self=this;
  3840. return self._call_("innerHeight");
  3841. return self;},
  3842. source: unescape('innerHeight%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20but%20not%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27innerHeight%27%0A')}),
  3843. smalltalk.JQuery);
  3844. smalltalk.addMethod(
  3845. '_innerWidth',
  3846. smalltalk.method({
  3847. selector: 'innerWidth',
  3848. category: 'css',
  3849. fn: function (){
  3850. var self=this;
  3851. return self._call_("innerWidth");
  3852. return self;},
  3853. source: unescape('innerWidth%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20but%20not%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27innerWidth%27%0A')}),
  3854. smalltalk.JQuery);
  3855. smalltalk.addMethod(
  3856. '_outerHeight',
  3857. smalltalk.method({
  3858. selector: 'outerHeight',
  3859. category: 'css',
  3860. fn: function (){
  3861. var self=this;
  3862. return self._call_("outerHeight");
  3863. return self;},
  3864. source: unescape('outerHeight%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%2C%20border%2C%20and%20optionally%20margin.%22%0A%20%20%20%20%5Eself%20call%3A%20%27outerHeight%27%0A')}),
  3865. smalltalk.JQuery);
  3866. smalltalk.addMethod(
  3867. '_outerWidth',
  3868. smalltalk.method({
  3869. selector: 'outerWidth',
  3870. category: 'css',
  3871. fn: function (){
  3872. var self=this;
  3873. return self._call_("outerWidth");
  3874. return self;},
  3875. source: unescape('outerWidth%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20and%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27outerWidth%27%0A')}),
  3876. smalltalk.JQuery);
  3877. smalltalk.addMethod(
  3878. '_top',
  3879. smalltalk.method({
  3880. selector: 'top',
  3881. category: 'css',
  3882. fn: function (){
  3883. var self=this;
  3884. return self._call_("position")._basicAt_("top");
  3885. return self;},
  3886. source: unescape('top%0A%20%20%20%20%22Get%20the%20current%20y%20coordinate%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20offset%20parent.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27position%27%29%20basicAt%3A%20%27top%27%0A')}),
  3887. smalltalk.JQuery);
  3888. smalltalk.addMethod(
  3889. '_left',
  3890. smalltalk.method({
  3891. selector: 'left',
  3892. category: 'css',
  3893. fn: function (){
  3894. var self=this;
  3895. return self._call_("position")._basicAt_("left");
  3896. return self;},
  3897. source: unescape('left%0A%20%20%20%20%22Get%20the%20current%20x%20coordinate%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20offset%20parent.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27position%27%29%20basicAt%3A%20%27left%27%0A')}),
  3898. smalltalk.JQuery);
  3899. smalltalk.addMethod(
  3900. '_offsetLeft',
  3901. smalltalk.method({
  3902. selector: 'offsetLeft',
  3903. category: 'css',
  3904. fn: function (){
  3905. var self=this;
  3906. return self._call_("offset")._basicAt_("left");
  3907. return self;},
  3908. source: unescape('offsetLeft%0A%20%20%20%20%22Get%20the%20current%20coordinates%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20document.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27offset%27%29%20basicAt%3A%20%27left%27%0A')}),
  3909. smalltalk.JQuery);
  3910. smalltalk.addMethod(
  3911. '_offsetTop',
  3912. smalltalk.method({
  3913. selector: 'offsetTop',
  3914. category: 'css',
  3915. fn: function (){
  3916. var self=this;
  3917. return self._call_("offset")._basicAt_("top");
  3918. return self;},
  3919. source: unescape('offsetTop%0A%20%20%20%20%22Get%20the%20current%20coordinates%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20document.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27offset%27%29%20basicAt%3A%20%27top%27%0A')}),
  3920. smalltalk.JQuery);
  3921. smalltalk.addMethod(
  3922. '_scrollLeft',
  3923. smalltalk.method({
  3924. selector: 'scrollLeft',
  3925. category: 'css',
  3926. fn: function (){
  3927. var self=this;
  3928. return self._call_("scrollLeft");
  3929. return self;},
  3930. source: unescape('scrollLeft%0A%20%20%20%20%22Get%20the%20current%20horizontal%20position%20of%20the%20scroll%20bar%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27scrollLeft%27%0A')}),
  3931. smalltalk.JQuery);
  3932. smalltalk.addMethod(
  3933. '_scrollTop',
  3934. smalltalk.method({
  3935. selector: 'scrollTop',
  3936. category: 'css',
  3937. fn: function (){
  3938. var self=this;
  3939. return self._call_("scrollTop");
  3940. return self;},
  3941. source: unescape('scrollTop%0A%20%20%20%20%22Get%20the%20current%20vertical%20position%20of%20the%20scroll%20bar%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27scrollTop%27%0A')}),
  3942. smalltalk.JQuery);
  3943. smalltalk.addMethod(
  3944. '_scrollLeft_',
  3945. smalltalk.method({
  3946. selector: 'scrollLeft:',
  3947. category: 'css',
  3948. fn: function (anInteger){
  3949. var self=this;
  3950. self._call_withArgument_("scrollLeft",anInteger);
  3951. return self;},
  3952. source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger%0A')}),
  3953. smalltalk.JQuery);
  3954. smalltalk.addMethod(
  3955. '_scrollTop_',
  3956. smalltalk.method({
  3957. selector: 'scrollTop:',
  3958. category: 'css',
  3959. fn: function (anInteger){
  3960. var self=this;
  3961. self._call_withArgument_("scrollTop",anInteger);
  3962. return self;},
  3963. source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger%0A')}),
  3964. smalltalk.JQuery);
  3965. smalltalk.addMethod(
  3966. '_focus',
  3967. smalltalk.method({
  3968. selector: 'focus',
  3969. category: 'events',
  3970. fn: function (){
  3971. var self=this;
  3972. self._call_("focus");
  3973. return self;},
  3974. source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27%0A')}),
  3975. smalltalk.JQuery);
  3976. smalltalk.addMethod(
  3977. '_show',
  3978. smalltalk.method({
  3979. selector: 'show',
  3980. category: 'events',
  3981. fn: function (){
  3982. var self=this;
  3983. self._call_("show");
  3984. return self;},
  3985. source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27%0A')}),
  3986. smalltalk.JQuery);
  3987. smalltalk.addMethod(
  3988. '_hide',
  3989. smalltalk.method({
  3990. selector: 'hide',
  3991. category: 'events',
  3992. fn: function (){
  3993. var self=this;
  3994. self._call_("hide");
  3995. return self;},
  3996. source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27%0A')}),
  3997. smalltalk.JQuery);
  3998. smalltalk.addMethod(
  3999. '_remove',
  4000. smalltalk.method({
  4001. selector: 'remove',
  4002. category: 'events',
  4003. fn: function (){
  4004. var self=this;
  4005. self._call_("remove");
  4006. return self;},
  4007. source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27%0A')}),
  4008. smalltalk.JQuery);
  4009. smalltalk.addMethod(
  4010. '_on_do_',
  4011. smalltalk.method({
  4012. selector: 'on:do:',
  4013. category: 'events',
  4014. fn: function (anEventString, aBlock){
  4015. var self=this;
  4016. (function(){self['@jquery'].bind(anEventString, aBlock)})();
  4017. return self;},
  4018. source: unescape('on%3A%20anEventString%20do%3A%20aBlock%0A%20%20%20%20%22Attach%20aBlock%20for%20anEventString%20on%20the%20element%22%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.bind%28anEventString%2C%20aBlock%29%27%7D%0A')}),
  4019. smalltalk.JQuery);
  4020. smalltalk.addMethod(
  4021. '_removeEvents_',
  4022. smalltalk.method({
  4023. selector: 'removeEvents:',
  4024. category: 'events',
  4025. fn: function (aString){
  4026. var self=this;
  4027. self._call_withArgument_("unbind",aString);
  4028. return self;},
  4029. source: unescape('removeEvents%3A%20aString%0A%20%20%20%20%22Unbind%20all%20handlers%20attached%20to%20the%20event%20aString%22%0A%20%20%20%20self%20call%3A%20%27unbind%27%20withArgument%3A%20aString%0A')}),
  4030. smalltalk.JQuery);
  4031. smalltalk.addMethod(
  4032. '_append_',
  4033. smalltalk.method({
  4034. selector: 'append:',
  4035. category: 'DOM insertion',
  4036. fn: function (anObject){
  4037. var self=this;
  4038. anObject._appendToJQuery_(self);
  4039. return self;},
  4040. source: unescape('append%3A%20anObject%0A%20%20%20%20%22Append%20anObject%20at%20the%20end%20of%20the%20element.%22%0A%20%20%20%20anObject%20appendToJQuery%3A%20self%0A')}),
  4041. smalltalk.JQuery);
  4042. smalltalk.addMethod(
  4043. '_appendElement_',
  4044. smalltalk.method({
  4045. selector: 'appendElement:',
  4046. category: 'DOM insertion',
  4047. fn: function (anElement){
  4048. var self=this;
  4049. self._call_withArgument_("append",anElement);
  4050. return self;},
  4051. source: unescape('appendElement%3A%20anElement%0A%20%20%20%20%22Append%20anElement%20at%20the%20end%20of%20the%20element.%0A%20%20%20%20%20Dont%27t%20call%20this%20method%20directly%2C%20use%20%23append%3A%20instead%22%0A%20%20%20%20self%20call%3A%20%27append%27%20withArgument%3A%20anElement%0A')}),
  4052. smalltalk.JQuery);
  4053. smalltalk.addMethod(
  4054. '_appendToJQuery_',
  4055. smalltalk.method({
  4056. selector: 'appendToJQuery:',
  4057. category: 'DOM insertion',
  4058. fn: function (aJQuery){
  4059. var self=this;
  4060. aJQuery._appendElement_(self['@jquery']);
  4061. return self;},
  4062. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery%0A')}),
  4063. smalltalk.JQuery);
  4064. smalltalk.addMethod(
  4065. '_contents_',
  4066. smalltalk.method({
  4067. selector: 'contents:',
  4068. category: 'DOM insertion',
  4069. fn: function (anObject){
  4070. var self=this;
  4071. self._empty();
  4072. self._append_(anObject);
  4073. return self;},
  4074. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  4075. smalltalk.JQuery);
  4076. smalltalk.addMethod(
  4077. '_empty',
  4078. smalltalk.method({
  4079. selector: 'empty',
  4080. category: 'DOM insertion',
  4081. fn: function (){
  4082. var self=this;
  4083. self._call_("empty");
  4084. return self;},
  4085. source: unescape('empty%0A%20%20%20%20self%20call%3A%20%27empty%27%0A')}),
  4086. smalltalk.JQuery);
  4087. smalltalk.addMethod(
  4088. '_initializeWithJQueryObject_',
  4089. smalltalk.method({
  4090. selector: 'initializeWithJQueryObject:',
  4091. category: 'initialization',
  4092. fn: function (anObject){
  4093. var self=this;
  4094. self['@jquery']=anObject;
  4095. return self;},
  4096. source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject%0A')}),
  4097. smalltalk.JQuery);
  4098. smalltalk.addMethod(
  4099. '_call_',
  4100. smalltalk.method({
  4101. selector: 'call:',
  4102. category: 'private',
  4103. fn: function (aString){
  4104. var self=this;
  4105. return (function(){return self['@jquery'][aString]()})();
  4106. return self;},
  4107. source: unescape('call%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28%29%27%7D%0A')}),
  4108. smalltalk.JQuery);
  4109. smalltalk.addMethod(
  4110. '_call_withArgument_',
  4111. smalltalk.method({
  4112. selector: 'call:withArgument:',
  4113. category: 'private',
  4114. fn: function (aString, anObject){
  4115. var self=this;
  4116. return (function(){return self['@jquery'][aString](anObject)})();
  4117. return self;},
  4118. source: unescape('call%3A%20aString%20withArgument%3A%20anObject%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28anObject%29%27%7D%0A')}),
  4119. smalltalk.JQuery);
  4120. smalltalk.addMethod(
  4121. '_hasClass_',
  4122. smalltalk.method({
  4123. selector: 'hasClass:',
  4124. category: 'testing',
  4125. fn: function (aString){
  4126. var self=this;
  4127. return self._call_withArgument_("hasClass",aString);
  4128. return self;},
  4129. source: unescape('hasClass%3A%20aString%0A%20%20%20%20%22Determine%20whether%20any%20of%20the%20matched%20elements%20are%20assigned%20the%20given%20class.%22%0A%20%20%20%20%5Eself%20call%3A%20%27hasClass%27%20withArgument%3A%20aString%0A')}),
  4130. smalltalk.JQuery);
  4131. smalltalk.addMethod(
  4132. '_fromString_',
  4133. smalltalk.method({
  4134. selector: 'fromString:',
  4135. category: 'instance creation',
  4136. fn: function (aString){
  4137. var self=this;
  4138. var newJQuery=nil;
  4139. (function(){newJQuery = jQuery(String(aString))})();
  4140. return self._from_(newJQuery);
  4141. return self;},
  4142. source: unescape('fromString%3A%20aString%0A%20%20%20%20%7C%20newJQuery%20%7C%0A%20%20%20%20%7B%27newJQuery%20%3D%20jQuery%28String%28aString%29%29%27%7D.%0A%20%20%20%20%5Eself%20from%3A%20newJQuery%0A')}),
  4143. smalltalk.JQuery.klass);
  4144. smalltalk.addMethod(
  4145. '_from_',
  4146. smalltalk.method({
  4147. selector: 'from:',
  4148. category: 'instance creation',
  4149. fn: function (anObject){
  4150. var self=this;
  4151. return (function($rec){$rec._initializeWithJQueryObject_(anObject);return $rec._yourself();})(self._new());
  4152. return self;},
  4153. source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself%0A')}),
  4154. smalltalk.JQuery.klass);
  4155. smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
  4156. smalltalk.addMethod(
  4157. '_root_',
  4158. smalltalk.method({
  4159. selector: 'root:',
  4160. category: 'accessing',
  4161. fn: function (aTagBrush){
  4162. var self=this;
  4163. self['@root']=aTagBrush;
  4164. return self;},
  4165. source: unescape('root%3A%20aTagBrush%0A%20%20%20%20root%20%3A%3D%20aTagBrush%0A')}),
  4166. smalltalk.HTMLCanvas);
  4167. smalltalk.addMethod(
  4168. '_root',
  4169. smalltalk.method({
  4170. selector: 'root',
  4171. category: 'accessing',
  4172. fn: function (){
  4173. var self=this;
  4174. return self['@root'];
  4175. return self;},
  4176. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  4177. smalltalk.HTMLCanvas);
  4178. smalltalk.addMethod(
  4179. '_initialize',
  4180. smalltalk.method({
  4181. selector: 'initialize',
  4182. category: 'initialization',
  4183. fn: function (){
  4184. var self=this;
  4185. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  4186. self['@root']=smalltalk.TagBrush._fromString_canvas_("div",self);
  4187. return self;},
  4188. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20root%20%3A%3D%20TagBrush%20fromString%3A%20%27div%27%20canvas%3A%20self%0A')}),
  4189. smalltalk.HTMLCanvas);
  4190. smalltalk.addMethod(
  4191. '_with_',
  4192. smalltalk.method({
  4193. selector: 'with:',
  4194. category: 'adding',
  4195. fn: function (anObject){
  4196. var self=this;
  4197. return self._root()._with_(anObject);
  4198. return self;},
  4199. source: unescape('with%3A%20anObject%0A%20%20%20%20%5Eself%20root%20with%3A%20anObject%0A')}),
  4200. smalltalk.HTMLCanvas);
  4201. smalltalk.addMethod(
  4202. '_newTag_',
  4203. smalltalk.method({
  4204. selector: 'newTag:',
  4205. category: 'tags',
  4206. fn: function (aString){
  4207. var self=this;
  4208. return smalltalk.TagBrush._fromString_canvas_(aString,self);
  4209. return self;},
  4210. source: unescape('newTag%3A%20aString%0A%20%20%20%20%5ETagBrush%20fromString%3A%20aString%20canvas%3A%20self%0A')}),
  4211. smalltalk.HTMLCanvas);
  4212. smalltalk.addMethod(
  4213. '_tag_',
  4214. smalltalk.method({
  4215. selector: 'tag:',
  4216. category: 'tags',
  4217. fn: function (aString){
  4218. var self=this;
  4219. return self['@root']._addBrush_(self._newTag_(aString));
  4220. return self;},
  4221. source: unescape('tag%3A%20aString%0A%20%20%20%20%5Eroot%20addBrush%3A%20%28self%20newTag%3A%20aString%29%0A')}),
  4222. smalltalk.HTMLCanvas);
  4223. smalltalk.addMethod(
  4224. '_h1',
  4225. smalltalk.method({
  4226. selector: 'h1',
  4227. category: 'tags',
  4228. fn: function (){
  4229. var self=this;
  4230. return self._tag_("h1");
  4231. return self;},
  4232. source: unescape('h1%0A%20%20%20%20%5Eself%20tag%3A%20%27h1%27%0A')}),
  4233. smalltalk.HTMLCanvas);
  4234. smalltalk.addMethod(
  4235. '_h2',
  4236. smalltalk.method({
  4237. selector: 'h2',
  4238. category: 'tags',
  4239. fn: function (){
  4240. var self=this;
  4241. return self._tag_("h2");
  4242. return self;},
  4243. source: unescape('h2%0A%20%20%20%20%5Eself%20tag%3A%20%27h2%27%0A')}),
  4244. smalltalk.HTMLCanvas);
  4245. smalltalk.addMethod(
  4246. '_h3',
  4247. smalltalk.method({
  4248. selector: 'h3',
  4249. category: 'tags',
  4250. fn: function (){
  4251. var self=this;
  4252. return self._tag_("h3");
  4253. return self;},
  4254. source: unescape('h3%0A%20%20%20%20%5Eself%20tag%3A%20%27h3%27%0A')}),
  4255. smalltalk.HTMLCanvas);
  4256. smalltalk.addMethod(
  4257. '_h4',
  4258. smalltalk.method({
  4259. selector: 'h4',
  4260. category: 'tags',
  4261. fn: function (){
  4262. var self=this;
  4263. return self._tag_("h4");
  4264. return self;},
  4265. source: unescape('h4%0A%20%20%20%20%5Eself%20tag%3A%20%27h4%27%0A')}),
  4266. smalltalk.HTMLCanvas);
  4267. smalltalk.addMethod(
  4268. '_h5',
  4269. smalltalk.method({
  4270. selector: 'h5',
  4271. category: 'tags',
  4272. fn: function (){
  4273. var self=this;
  4274. return self._tag_("h5");
  4275. return self;},
  4276. source: unescape('h5%0A%20%20%20%20%5Eself%20tag%3A%20%27h5%27%0A')}),
  4277. smalltalk.HTMLCanvas);
  4278. smalltalk.addMethod(
  4279. '_h6',
  4280. smalltalk.method({
  4281. selector: 'h6',
  4282. category: 'tags',
  4283. fn: function (){
  4284. var self=this;
  4285. return self._tag_("h6");
  4286. return self;},
  4287. source: unescape('h6%0A%20%20%20%20%5Eself%20tag%3A%20%27h6%27%0A')}),
  4288. smalltalk.HTMLCanvas);
  4289. smalltalk.addMethod(
  4290. '_p',
  4291. smalltalk.method({
  4292. selector: 'p',
  4293. category: 'tags',
  4294. fn: function (){
  4295. var self=this;
  4296. return self._tag_("p");
  4297. return self;},
  4298. source: unescape('p%0A%20%20%20%20%5Eself%20tag%3A%20%27p%27%0A')}),
  4299. smalltalk.HTMLCanvas);
  4300. smalltalk.addMethod(
  4301. '_div',
  4302. smalltalk.method({
  4303. selector: 'div',
  4304. category: 'tags',
  4305. fn: function (){
  4306. var self=this;
  4307. return self._tag_("div");
  4308. return self;},
  4309. source: unescape('div%0A%20%20%20%20%5Eself%20tag%3A%20%27div%27%0A')}),
  4310. smalltalk.HTMLCanvas);
  4311. smalltalk.addMethod(
  4312. '_span',
  4313. smalltalk.method({
  4314. selector: 'span',
  4315. category: 'tags',
  4316. fn: function (){
  4317. var self=this;
  4318. return self._tag_("span");
  4319. return self;},
  4320. source: unescape('span%0A%20%20%20%20%5Eself%20tag%3A%20%27span%27%0A')}),
  4321. smalltalk.HTMLCanvas);
  4322. smalltalk.addMethod(
  4323. '_img',
  4324. smalltalk.method({
  4325. selector: 'img',
  4326. category: 'tags',
  4327. fn: function (){
  4328. var self=this;
  4329. return self._tag_("img");
  4330. return self;},
  4331. source: unescape('img%0A%20%20%20%20%5Eself%20tag%3A%20%27img%27%0A')}),
  4332. smalltalk.HTMLCanvas);
  4333. smalltalk.addMethod(
  4334. '_ul',
  4335. smalltalk.method({
  4336. selector: 'ul',
  4337. category: 'tags',
  4338. fn: function (){
  4339. var self=this;
  4340. return self._tag_("ul");
  4341. return self;},
  4342. source: unescape('ul%0A%20%20%20%20%5Eself%20tag%3A%20%27ul%27%0A')}),
  4343. smalltalk.HTMLCanvas);
  4344. smalltalk.addMethod(
  4345. '_ol',
  4346. smalltalk.method({
  4347. selector: 'ol',
  4348. category: 'tags',
  4349. fn: function (){
  4350. var self=this;
  4351. return self._tag_("ol");
  4352. return self;},
  4353. source: unescape('ol%0A%20%20%20%20%5Eself%20tag%3A%20%27ol%27%0A')}),
  4354. smalltalk.HTMLCanvas);
  4355. smalltalk.addMethod(
  4356. '_li',
  4357. smalltalk.method({
  4358. selector: 'li',
  4359. category: 'tags',
  4360. fn: function (){
  4361. var self=this;
  4362. return self._tag_("li");
  4363. return self;},
  4364. source: unescape('li%0A%20%20%20%20%5Eself%20tag%3A%20%27li%27%0A')}),
  4365. smalltalk.HTMLCanvas);
  4366. smalltalk.addMethod(
  4367. '_table',
  4368. smalltalk.method({
  4369. selector: 'table',
  4370. category: 'tags',
  4371. fn: function (){
  4372. var self=this;
  4373. return self._tag_("table");
  4374. return self;},
  4375. source: unescape('table%0A%20%20%20%20%5Eself%20tag%3A%20%27table%27%0A')}),
  4376. smalltalk.HTMLCanvas);
  4377. smalltalk.addMethod(
  4378. '_tr',
  4379. smalltalk.method({
  4380. selector: 'tr',
  4381. category: 'tags',
  4382. fn: function (){
  4383. var self=this;
  4384. return self._tag_("tr");
  4385. return self;},
  4386. source: unescape('tr%0A%20%20%20%20%5Eself%20tag%3A%20%27tr%27%0A')}),
  4387. smalltalk.HTMLCanvas);
  4388. smalltalk.addMethod(
  4389. '_td',
  4390. smalltalk.method({
  4391. selector: 'td',
  4392. category: 'tags',
  4393. fn: function (){
  4394. var self=this;
  4395. return self._tag_("td");
  4396. return self;},
  4397. source: unescape('td%20%0A%20%20%20%20%5Eself%20tag%3A%20%27td%27%0A')}),
  4398. smalltalk.HTMLCanvas);
  4399. smalltalk.addMethod(
  4400. '_th',
  4401. smalltalk.method({
  4402. selector: 'th',
  4403. category: 'tags',
  4404. fn: function (){
  4405. var self=this;
  4406. return self._tag_("th");
  4407. return self;},
  4408. source: unescape('th%0A%20%20%20%20%5Eself%20tag%3A%20%27th%27%0A')}),
  4409. smalltalk.HTMLCanvas);
  4410. smalltalk.addMethod(
  4411. '_form',
  4412. smalltalk.method({
  4413. selector: 'form',
  4414. category: 'tags',
  4415. fn: function (){
  4416. var self=this;
  4417. return self._tag_("form");
  4418. return self;},
  4419. source: unescape('form%0A%20%20%20%20%5Eself%20tag%3A%20%27form%27%0A')}),
  4420. smalltalk.HTMLCanvas);
  4421. smalltalk.addMethod(
  4422. '_input',
  4423. smalltalk.method({
  4424. selector: 'input',
  4425. category: 'tags',
  4426. fn: function (){
  4427. var self=this;
  4428. return self._tag_("input");
  4429. return self;},
  4430. source: unescape('input%0A%20%20%20%20%5Eself%20tag%3A%20%27input%27%0A')}),
  4431. smalltalk.HTMLCanvas);
  4432. smalltalk.addMethod(
  4433. '_button',
  4434. smalltalk.method({
  4435. selector: 'button',
  4436. category: 'tags',
  4437. fn: function (){
  4438. var self=this;
  4439. return self._tag_("button");
  4440. return self;},
  4441. source: unescape('button%0A%20%20%20%20%5Eself%20tag%3A%20%27button%27%0A')}),
  4442. smalltalk.HTMLCanvas);
  4443. smalltalk.addMethod(
  4444. '_select',
  4445. smalltalk.method({
  4446. selector: 'select',
  4447. category: 'tags',
  4448. fn: function (){
  4449. var self=this;
  4450. return self._tag_("select");
  4451. return self;},
  4452. source: unescape('select%0A%20%20%20%20%5Eself%20tag%3A%20%27select%27%0A')}),
  4453. smalltalk.HTMLCanvas);
  4454. smalltalk.addMethod(
  4455. '_option',
  4456. smalltalk.method({
  4457. selector: 'option',
  4458. category: 'tags',
  4459. fn: function (){
  4460. var self=this;
  4461. return self._tag_("option");
  4462. return self;},
  4463. source: unescape('option%0A%20%20%20%20%5Eself%20tag%3A%20%27option%27%0A')}),
  4464. smalltalk.HTMLCanvas);
  4465. smalltalk.addMethod(
  4466. '_textarea',
  4467. smalltalk.method({
  4468. selector: 'textarea',
  4469. category: 'tags',
  4470. fn: function (){
  4471. var self=this;
  4472. return self._tag_("textarea");
  4473. return self;},
  4474. source: unescape('textarea%0A%20%20%20%20%5Eself%20tag%3A%20%27textarea%27%0A')}),
  4475. smalltalk.HTMLCanvas);
  4476. smalltalk.addMethod(
  4477. '_a',
  4478. smalltalk.method({
  4479. selector: 'a',
  4480. category: 'tags',
  4481. fn: function (){
  4482. var self=this;
  4483. return self._tag_("a");
  4484. return self;},
  4485. source: unescape('a%0A%20%20%20%20%5Eself%20tag%3A%20%27a%27%0A')}),
  4486. smalltalk.HTMLCanvas);
  4487. smalltalk.addMethod(
  4488. '_appendToJQuery_',
  4489. smalltalk.method({
  4490. selector: 'appendToJQuery:',
  4491. category: '*JQuery',
  4492. fn: function (aJQuery){
  4493. var self=this;
  4494. aJQuery._appendElement_(self['@root']._element());
  4495. return self;},
  4496. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20root%20element%0A')}),
  4497. smalltalk.HTMLCanvas);
  4498. smalltalk.addClass('TagBrush', smalltalk.Object, ['element'], 'Canvas');
  4499. smalltalk.addMethod(
  4500. '_contents_',
  4501. smalltalk.method({
  4502. selector: 'contents:',
  4503. category: 'adding',
  4504. fn: function (anObject){
  4505. var self=this;
  4506. self._asJQuery()._empty();
  4507. self._append_(anObject);
  4508. return self;},
  4509. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20asJQuery%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  4510. smalltalk.TagBrush);
  4511. smalltalk.addMethod(
  4512. '_addBrush_',
  4513. smalltalk.method({
  4514. selector: 'addBrush:',
  4515. category: 'adding',
  4516. fn: function (aTagBrush){
  4517. var self=this;
  4518. self._appendChild_(aTagBrush._element());
  4519. return aTagBrush;
  4520. return self;},
  4521. source: unescape('addBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendChild%3A%20aTagBrush%20element.%0A%20%20%20%20%5EaTagBrush%0A')}),
  4522. smalltalk.TagBrush);
  4523. smalltalk.addMethod(
  4524. '_with_',
  4525. smalltalk.method({
  4526. selector: 'with:',
  4527. category: 'adding',
  4528. fn: function (anObject){
  4529. var self=this;
  4530. self._append_(anObject);
  4531. return self;},
  4532. source: unescape('with%3A%20anObject%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  4533. smalltalk.TagBrush);
  4534. smalltalk.addMethod(
  4535. '_append_',
  4536. smalltalk.method({
  4537. selector: 'append:',
  4538. category: 'adding',
  4539. fn: function (anObject){
  4540. var self=this;
  4541. anObject._appendToBrush_(self);
  4542. return self;},
  4543. source: unescape('append%3A%20anObject%0A%20%20%20%20anObject%20appendToBrush%3A%20self%0A')}),
  4544. smalltalk.TagBrush);
  4545. smalltalk.addMethod(
  4546. '_appendToBrush_',
  4547. smalltalk.method({
  4548. selector: 'appendToBrush:',
  4549. category: 'adding',
  4550. fn: function (aTagBrush){
  4551. var self=this;
  4552. aTagBrush._addBrush_(self);
  4553. return self;},
  4554. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20addBrush%3A%20self%0A')}),
  4555. smalltalk.TagBrush);
  4556. smalltalk.addMethod(
  4557. '_appendBlock_',
  4558. smalltalk.method({
  4559. selector: 'appendBlock:',
  4560. category: 'adding',
  4561. fn: function (aBlock){
  4562. var self=this;
  4563. var root=nil;
  4564. root=canvas._root();
  4565. canvas._root_(self);
  4566. aBlock._value_(canvas);
  4567. canvas._root_(root);
  4568. return self;},
  4569. source: unescape('appendBlock%3A%20aBlock%0A%20%20%20%20%7C%20root%20%7C%0A%20%20%20%20root%20%3A%3D%20canvas%20root.%0A%20%20%20%20canvas%20root%3A%20self.%0A%20%20%20%20aBlock%20value%3A%20canvas.%0A%20%20%20%20canvas%20root%3A%20root%0A')}),
  4570. smalltalk.TagBrush);
  4571. smalltalk.addMethod(
  4572. '_appendChild_',
  4573. smalltalk.method({
  4574. selector: 'appendChild:',
  4575. category: 'adding',
  4576. fn: function (anElement){
  4577. var self=this;
  4578. (function(){self['@element'].appendChild(anElement)})();
  4579. return self;},
  4580. source: unescape('appendChild%3A%20anElement%0A%20%20%20%20%7B%27self%5B%27%27@element%27%27%5D.appendChild%28anElement%29%27%7D%0A')}),
  4581. smalltalk.TagBrush);
  4582. smalltalk.addMethod(
  4583. '_appendString_',
  4584. smalltalk.method({
  4585. selector: 'appendString:',
  4586. category: 'adding',
  4587. fn: function (aString){
  4588. var self=this;
  4589. self._appendChild_(self._createTextNodeFor_(aString));
  4590. return self;},
  4591. source: unescape('appendString%3A%20aString%0A%20%20%20%20self%20appendChild%3A%20%28self%20createTextNodeFor%3A%20aString%29%0A')}),
  4592. smalltalk.TagBrush);
  4593. smalltalk.addMethod(
  4594. '_at_put_',
  4595. smalltalk.method({
  4596. selector: 'at:put:',
  4597. category: 'attributes',
  4598. fn: function (aString, aValue){
  4599. var self=this;
  4600. (function(){self['@element'].setAttribute(aString, aValue)})();
  4601. return self;},
  4602. source: unescape('at%3A%20aString%20put%3A%20aValue%0A%20%20%20%20%7B%27self%5B%27%27@element%27%27%5D.setAttribute%28aString%2C%20aValue%29%27%7D%0A')}),
  4603. smalltalk.TagBrush);
  4604. smalltalk.addMethod(
  4605. '_removeAt_',
  4606. smalltalk.method({
  4607. selector: 'removeAt:',
  4608. category: 'attributes',
  4609. fn: function (aString){
  4610. var self=this;
  4611. (function(){self['@element'].removeAttribute(aString)})();
  4612. return self;},
  4613. source: unescape('removeAt%3A%20aString%0A%20%20%20%20%7B%27self%5B%27%27@element%27%27%5D.removeAttribute%28aString%29%27%7D%0A')}),
  4614. smalltalk.TagBrush);
  4615. smalltalk.addMethod(
  4616. '_class_',
  4617. smalltalk.method({
  4618. selector: 'class:',
  4619. category: 'attributes',
  4620. fn: function (aString){
  4621. var self=this;
  4622. self._at_put_("class",aString);
  4623. return self;},
  4624. source: unescape('class%3A%20aString%0A%20%20%20%20self%20at%3A%20%27class%27%20put%3A%20aString%0A')}),
  4625. smalltalk.TagBrush);
  4626. smalltalk.addMethod(
  4627. '_id_',
  4628. smalltalk.method({
  4629. selector: 'id:',
  4630. category: 'attributes',
  4631. fn: function (aString){
  4632. var self=this;
  4633. self._at_put_("id",aString);
  4634. return self;},
  4635. source: unescape('id%3A%20aString%0A%20%20%20%20self%20at%3A%20%27id%27%20put%3A%20aString%0A')}),
  4636. smalltalk.TagBrush);
  4637. smalltalk.addMethod(
  4638. '_src_',
  4639. smalltalk.method({
  4640. selector: 'src:',
  4641. category: 'attributes',
  4642. fn: function (aString){
  4643. var self=this;
  4644. self._at_put_("src",aString);
  4645. return self;},
  4646. source: unescape('src%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27src%27%20put%3A%20aString%0A')}),
  4647. smalltalk.TagBrush);
  4648. smalltalk.addMethod(
  4649. '_href_',
  4650. smalltalk.method({
  4651. selector: 'href:',
  4652. category: 'attributes',
  4653. fn: function (aString){
  4654. var self=this;
  4655. self._at_put_("href",aString);
  4656. return self;},
  4657. source: unescape('href%3A%20aString%0A%20%20%20%20self%20at%3A%20%27href%27%20put%3A%20aString%0A')}),
  4658. smalltalk.TagBrush);
  4659. smalltalk.addMethod(
  4660. '_title_',
  4661. smalltalk.method({
  4662. selector: 'title:',
  4663. category: 'attributes',
  4664. fn: function (aString){
  4665. var self=this;
  4666. self._at_put_("title",aString);
  4667. return self;},
  4668. source: unescape('title%3A%20aString%0A%20%20%20%20self%20at%3A%20%27title%27%20put%3A%20aString%0A')}),
  4669. smalltalk.TagBrush);
  4670. smalltalk.addMethod(
  4671. '_style_',
  4672. smalltalk.method({
  4673. selector: 'style:',
  4674. category: 'attributes',
  4675. fn: function (aString){
  4676. var self=this;
  4677. self._at_put_("style",aString);
  4678. return self;},
  4679. source: unescape('style%3A%20aString%0A%20%20%20%20self%20at%3A%20%27style%27%20put%3A%20aString%0A')}),
  4680. smalltalk.TagBrush);
  4681. smalltalk.addMethod(
  4682. '_initializeFromString_canvas_',
  4683. smalltalk.method({
  4684. selector: 'initializeFromString:canvas:',
  4685. category: 'initialization',
  4686. fn: function (aString, aCanvas){
  4687. var self=this;
  4688. self['@element']=self._createElementFor_(aString);
  4689. canvas=aCanvas;
  4690. return self;},
  4691. source: unescape('initializeFromString%3A%20aString%20canvas%3A%20aCanvas%0A%20%20%20%20element%20%3A%3D%20self%20createElementFor%3A%20aString.%0A%20%20%20%20canvas%20%3A%3D%20aCanvas%0A')}),
  4692. smalltalk.TagBrush);
  4693. smalltalk.addMethod(
  4694. '_element',
  4695. smalltalk.method({
  4696. selector: 'element',
  4697. category: 'accessing',
  4698. fn: function (){
  4699. var self=this;
  4700. return self['@element'];
  4701. return self;},
  4702. source: unescape('element%0A%20%20%20%20%5Eelement%0A')}),
  4703. smalltalk.TagBrush);
  4704. smalltalk.addMethod(
  4705. '_asJQuery',
  4706. smalltalk.method({
  4707. selector: 'asJQuery',
  4708. category: 'converting',
  4709. fn: function (){
  4710. var self=this;
  4711. return (function(){return smalltalk.JQuery._from_(jQuery(self['@element']))})();
  4712. return self;},
  4713. source: unescape('asJQuery%0A%20%20%20%20%5E%7B%27return%20smalltalk.JQuery._from_%28jQuery%28self%5B%27%27@element%27%27%5D%29%29%27%7D%0A')}),
  4714. smalltalk.TagBrush);
  4715. smalltalk.addMethod(
  4716. '_onKeyDown_',
  4717. smalltalk.method({
  4718. selector: 'onKeyDown:',
  4719. category: 'events',
  4720. fn: function (aBlock){
  4721. var self=this;
  4722. self._asJQuery()._on_do_("keydown",aBlock);
  4723. return self;},
  4724. source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keydown%27%20do%3A%20aBlock%0A')}),
  4725. smalltalk.TagBrush);
  4726. smalltalk.addMethod(
  4727. '_onKeyPress_',
  4728. smalltalk.method({
  4729. selector: 'onKeyPress:',
  4730. category: 'events',
  4731. fn: function (aBlock){
  4732. var self=this;
  4733. self._asJQuery()._on_do_("keypress",aBlock);
  4734. return self;},
  4735. source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keypress%27%20do%3A%20aBlock%0A')}),
  4736. smalltalk.TagBrush);
  4737. smalltalk.addMethod(
  4738. '_onKeyUp_',
  4739. smalltalk.method({
  4740. selector: 'onKeyUp:',
  4741. category: 'events',
  4742. fn: function (aBlock){
  4743. var self=this;
  4744. self._asJQuery()._on_do_("keyup",aBlock);
  4745. return self;},
  4746. source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keyup%27%20do%3A%20aBlock%0A')}),
  4747. smalltalk.TagBrush);
  4748. smalltalk.addMethod(
  4749. '_onFocus_',
  4750. smalltalk.method({
  4751. selector: 'onFocus:',
  4752. category: 'events',
  4753. fn: function (aBlock){
  4754. var self=this;
  4755. self._asJQuery()._on_do_("focus",aBlock);
  4756. return self;},
  4757. source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27focus%27%20do%3A%20aBlock%0A')}),
  4758. smalltalk.TagBrush);
  4759. smalltalk.addMethod(
  4760. '_onBlur_',
  4761. smalltalk.method({
  4762. selector: 'onBlur:',
  4763. category: 'events',
  4764. fn: function (aBlock){
  4765. var self=this;
  4766. self._asJQuery()._on_do_("blur",aBlock);
  4767. return self;},
  4768. source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27blur%27%20do%3A%20aBlock%0A')}),
  4769. smalltalk.TagBrush);
  4770. smalltalk.addMethod(
  4771. '_onChange_',
  4772. smalltalk.method({
  4773. selector: 'onChange:',
  4774. category: 'events',
  4775. fn: function (aBlock){
  4776. var self=this;
  4777. self._asJQuery()._on_do_("change",aBlock);
  4778. return self;},
  4779. source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27change%27%20do%3A%20aBlock%0A')}),
  4780. smalltalk.TagBrush);
  4781. smalltalk.addMethod(
  4782. '_onClick_',
  4783. smalltalk.method({
  4784. selector: 'onClick:',
  4785. category: 'events',
  4786. fn: function (aBlock){
  4787. var self=this;
  4788. self._asJQuery()._on_do_("click",aBlock);
  4789. return self;},
  4790. source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27click%27%20do%3A%20aBlock%0A')}),
  4791. smalltalk.TagBrush);
  4792. smalltalk.addMethod(
  4793. '_createElementFor_',
  4794. smalltalk.method({
  4795. selector: 'createElementFor:',
  4796. category: 'private',
  4797. fn: function (aString){
  4798. var self=this;
  4799. return (function(){return document.createElement(String(aString))})();
  4800. return self;},
  4801. source: unescape('createElementFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createElement%28String%28aString%29%29%27%7D%0A')}),
  4802. smalltalk.TagBrush);
  4803. smalltalk.addMethod(
  4804. '_createTextNodeFor_',
  4805. smalltalk.method({
  4806. selector: 'createTextNodeFor:',
  4807. category: 'private',
  4808. fn: function (aString){
  4809. var self=this;
  4810. return (function(){return document.createTextNode(String(aString))})();
  4811. return self;},
  4812. source: unescape('createTextNodeFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createTextNode%28String%28aString%29%29%27%7D%0A')}),
  4813. smalltalk.TagBrush);
  4814. smalltalk.addMethod(
  4815. '_fromString_canvas_',
  4816. smalltalk.method({
  4817. selector: 'fromString:canvas:',
  4818. category: 'instance creation',
  4819. fn: function (aString, aCanvas){
  4820. var self=this;
  4821. return (function($rec){$rec._initializeFromString_canvas_(aString,aCanvas);return $rec._yourself();})(self._new());
  4822. return self;},
  4823. source: unescape('fromString%3A%20aString%20canvas%3A%20aCanvas%0A%20%20%20%20%5Eself%20new%0A%09initializeFromString%3A%20aString%20canvas%3A%20aCanvas%3B%0A%09yourself%0A')}),
  4824. smalltalk.TagBrush.klass);
  4825. smalltalk.addClass('Widget', smalltalk.Object, ['root'], 'Canvas');
  4826. smalltalk.addMethod(
  4827. '_root',
  4828. smalltalk.method({
  4829. selector: 'root',
  4830. category: 'accessing',
  4831. fn: function (){
  4832. var self=this;
  4833. return self['@root'];
  4834. return self;},
  4835. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  4836. smalltalk.Widget);
  4837. smalltalk.addMethod(
  4838. '_appendToBrush_',
  4839. smalltalk.method({
  4840. selector: 'appendToBrush:',
  4841. category: 'adding',
  4842. fn: function (aTagBrush){
  4843. var self=this;
  4844. self._appendToJQuery_(aTagBrush._asJQuery());
  4845. return self;},
  4846. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendToJQuery%3A%20aTagBrush%20asJQuery%0A')}),
  4847. smalltalk.Widget);
  4848. smalltalk.addMethod(
  4849. '_appendToJQuery_',
  4850. smalltalk.method({
  4851. selector: 'appendToJQuery:',
  4852. category: 'adding',
  4853. fn: function (aJQuery){
  4854. var self=this;
  4855. self._render();
  4856. aJQuery._append_(self._root()._asJQuery());
  4857. return self;},
  4858. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20self%20render.%0A%20%20%20%20aJQuery%20append%3A%20self%20root%20asJQuery%0A')}),
  4859. smalltalk.Widget);
  4860. smalltalk.addMethod(
  4861. '_alert_',
  4862. smalltalk.method({
  4863. selector: 'alert:',
  4864. category: 'actions',
  4865. fn: function (aString){
  4866. var self=this;
  4867. (function(){alert(aString)})();
  4868. return self;},
  4869. source: unescape('alert%3A%20aString%0A%20%20%20%20%7B%27alert%28aString%29%27%7D%0A')}),
  4870. smalltalk.Widget);
  4871. smalltalk.addMethod(
  4872. '_confirm_',
  4873. smalltalk.method({
  4874. selector: 'confirm:',
  4875. category: 'actions',
  4876. fn: function (aString){
  4877. var self=this;
  4878. return (function(){return window.confirm(aString)})();
  4879. return self;},
  4880. source: unescape('confirm%3A%20aString%0A%20%20%20%20%5E%7B%27return%20window.confirm%28aString%29%27%7D%0A')}),
  4881. smalltalk.Widget);
  4882. smalltalk.addMethod(
  4883. '_prompt_',
  4884. smalltalk.method({
  4885. selector: 'prompt:',
  4886. category: 'actions',
  4887. fn: function (aString){
  4888. var self=this;
  4889. return self._prompt_default_(aString,"");
  4890. return self;},
  4891. source: unescape('prompt%3A%20aString%0A%20%20%20%20%5Eself%20prompt%3A%20aString%20default%3A%20%27%27%0A')}),
  4892. smalltalk.Widget);
  4893. smalltalk.addMethod(
  4894. '_prompt_default_',
  4895. smalltalk.method({
  4896. selector: 'prompt:default:',
  4897. category: 'actions',
  4898. fn: function (aString, anotherString){
  4899. var self=this;
  4900. return (function(){return window.prompt(aString, anotherString)})();
  4901. return self;},
  4902. source: unescape('prompt%3A%20aString%20default%3A%20anotherString%0A%20%20%20%20%5E%7B%27return%20window.prompt%28aString%2C%20anotherString%29%27%7D%0A')}),
  4903. smalltalk.Widget);
  4904. smalltalk.addMethod(
  4905. '_update',
  4906. smalltalk.method({
  4907. selector: 'update',
  4908. category: 'actions',
  4909. fn: function (){
  4910. var self=this;
  4911. var canvas=nil;
  4912. canvas=smalltalk.HTMLCanvas._new();
  4913. canvas._root_(self._root());
  4914. self._root()._asJQuery()._empty();
  4915. self._renderOn_(canvas);
  4916. return self;},
  4917. source: unescape('update%0A%20%20%20%20%7C%20canvas%20%7C%0A%20%20%20%20canvas%20%3A%3D%20HTMLCanvas%20new.%0A%20%20%20%20canvas%20root%3A%20self%20root.%0A%20%20%20%20self%20root%20asJQuery%20empty.%0A%20%20%20%20self%20renderOn%3A%20canvas%0A')}),
  4918. smalltalk.Widget);
  4919. smalltalk.addMethod(
  4920. '_render',
  4921. smalltalk.method({
  4922. selector: 'render',
  4923. category: 'rendering',
  4924. fn: function (){
  4925. var self=this;
  4926. var canvas=nil;
  4927. canvas=smalltalk.HTMLCanvas._new();
  4928. self['@root']=canvas._root();
  4929. self._renderOn_(canvas);
  4930. return self;},
  4931. source: unescape('render%0A%20%20%20%20%7C%20canvas%20%7C%0A%20%20%20%20canvas%20%3A%3D%20HTMLCanvas%20new.%0A%20%20%20%20root%20%3A%3D%20canvas%20root.%0A%20%20%20%20self%20renderOn%3A%20canvas%0A')}),
  4932. smalltalk.Widget);
  4933. smalltalk.addMethod(
  4934. '_renderOn_',
  4935. smalltalk.method({
  4936. selector: 'renderOn:',
  4937. category: 'rendering',
  4938. fn: function (html){
  4939. var self=this;
  4940. self;
  4941. return self;},
  4942. source: unescape('renderOn%3A%20html%0A%20%20%20%20self%0A')}),
  4943. smalltalk.Widget);
  4944. smalltalk.addClass('Counter', smalltalk.Widget, ['count'], 'Canvas');
  4945. smalltalk.addMethod(
  4946. '_initialize',
  4947. smalltalk.method({
  4948. selector: 'initialize',
  4949. category: 'initialization',
  4950. fn: function (){
  4951. var self=this;
  4952. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  4953. self['@count']=(0);
  4954. return self;},
  4955. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20count%20%3A%3D%200%0A')}),
  4956. smalltalk.Counter);
  4957. smalltalk.addMethod(
  4958. '_renderOn_',
  4959. smalltalk.method({
  4960. selector: 'renderOn:',
  4961. category: 'rendering',
  4962. fn: function (html){
  4963. var self=this;
  4964. html._h1()._with_(self['@count']._asString());
  4965. (function($rec){$rec._with_(unescape("++"));return $rec._onClick_((function(){return self._increase();}));})(html._button());
  4966. (function($rec){$rec._with_(unescape("--"));return $rec._onClick_((function(){return self._decrease();}));})(html._button());
  4967. return self;},
  4968. source: unescape('renderOn%3A%20html%0A%20%20%20%20html%20h1%20with%3A%20count%20asString.%0A%20%20%20%20html%20button%0A%09with%3A%20%27++%27%3B%0A%09onClick%3A%20%5Bself%20increase%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27--%27%3B%0A%09onClick%3A%20%5Bself%20decrease%5D%0A')}),
  4969. smalltalk.Counter);
  4970. smalltalk.addMethod(
  4971. '_increase',
  4972. smalltalk.method({
  4973. selector: 'increase',
  4974. category: 'actions',
  4975. fn: function (){
  4976. var self=this;
  4977. self['@count']=self['@count'].__plus((1));
  4978. self._update();
  4979. return self;},
  4980. source: unescape('increase%0A%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20self%20update%0A')}),
  4981. smalltalk.Counter);
  4982. smalltalk.addMethod(
  4983. '_decrease',
  4984. smalltalk.method({
  4985. selector: 'decrease',
  4986. category: 'actions',
  4987. fn: function (){
  4988. var self=this;
  4989. self['@count']=self['@count'].__minus((1));
  4990. self._update();
  4991. return self;},
  4992. source: unescape('decrease%0A%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20self%20update%0A')}),
  4993. smalltalk.Counter);
  4994. smalltalk.init(smalltalk.Object);