jtalk.deploy.js 164 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596
  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, function(e){aBlock(self)})})();
  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%20function%28e%29%7BaBlock%28self%29%7D%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('Ajax', smalltalk.Object, ['settings'], 'JQuery');
  4156. smalltalk.Ajax.comment=unescape('instance%20variable%20names%3A%0A-%20settings%20%20A%20set%20of%20key/value%20pairs%20that%20configure%20the%20Ajax%20request.%20All%20settings%20are%20optional.%0A%0AFull%20list%20of%20settings%20options%20at%20http%3A//api.jquery.com/jQuery.ajax/%0A')
  4157. smalltalk.addMethod(
  4158. '_initialize',
  4159. smalltalk.method({
  4160. selector: 'initialize',
  4161. category: 'initialization',
  4162. fn: function (){
  4163. var self=this;
  4164. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  4165. self['@settings']=smalltalk.Dictionary._new();
  4166. return self;},
  4167. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20settings%20%3A%3D%20Dictionary%20new%0A')}),
  4168. smalltalk.Ajax);
  4169. smalltalk.addMethod(
  4170. '_at_',
  4171. smalltalk.method({
  4172. selector: 'at:',
  4173. category: 'accessing',
  4174. fn: function (aKey){
  4175. var self=this;
  4176. return self['@settings']._at_ifAbsent_(aKey,(function(){return nil;}));
  4177. return self;},
  4178. source: unescape('at%3A%20aKey%0A%20%20%20%20%5Esettings%20at%3A%20aKey%20ifAbsent%3A%20%5Bnil%5D%0A')}),
  4179. smalltalk.Ajax);
  4180. smalltalk.addMethod(
  4181. '_at_put_',
  4182. smalltalk.method({
  4183. selector: 'at:put:',
  4184. category: 'accessing',
  4185. fn: function (aKey, aValue){
  4186. var self=this;
  4187. self['@settings']._at_put_(aKey,aValue);
  4188. return self;},
  4189. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%20%20%20%20settings%20at%3A%20aKey%20put%3A%20aValue%0A')}),
  4190. smalltalk.Ajax);
  4191. smalltalk.addMethod(
  4192. '_url',
  4193. smalltalk.method({
  4194. selector: 'url',
  4195. category: 'accessing',
  4196. fn: function (){
  4197. var self=this;
  4198. return self._at_("url");
  4199. return self;},
  4200. source: unescape('url%0A%20%20%20%20%5Eself%20at%3A%20%27url%27%0A')}),
  4201. smalltalk.Ajax);
  4202. smalltalk.addMethod(
  4203. '_url_',
  4204. smalltalk.method({
  4205. selector: 'url:',
  4206. category: 'accessing',
  4207. fn: function (aString){
  4208. var self=this;
  4209. self._at_put_("url",aString);
  4210. return self;},
  4211. source: unescape('url%3A%20aString%0A%20%20%20%20self%20at%3A%20%27url%27%20put%3A%20aString%0A')}),
  4212. smalltalk.Ajax);
  4213. smalltalk.addMethod(
  4214. '_send',
  4215. smalltalk.method({
  4216. selector: 'send',
  4217. category: 'actions',
  4218. fn: function (){
  4219. var self=this;
  4220. (function(){jQuery.ajax(self['@settings'])})();
  4221. return self;},
  4222. source: unescape('send%0A%20%20%20%20%7B%27jQuery.ajax%28self%5B%27%27@settings%27%27%5D%29%27%7D%0A')}),
  4223. smalltalk.Ajax);
  4224. smalltalk.addMethod(
  4225. '_url_',
  4226. smalltalk.method({
  4227. selector: 'url:',
  4228. category: 'instance creation',
  4229. fn: function (aString){
  4230. var self=this;
  4231. return (function($rec){$rec._url_(aString);return $rec._yourself();})(self._new());
  4232. return self;},
  4233. source: unescape('url%3A%20aString%0A%20%20%20%20%5Eself%20new%0A%09url%3A%20aString%3B%0A%09yourself%0A')}),
  4234. smalltalk.Ajax.klass);
  4235. smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
  4236. smalltalk.addMethod(
  4237. '_root_',
  4238. smalltalk.method({
  4239. selector: 'root:',
  4240. category: 'accessing',
  4241. fn: function (aTagBrush){
  4242. var self=this;
  4243. self['@root']=aTagBrush;
  4244. return self;},
  4245. source: unescape('root%3A%20aTagBrush%0A%20%20%20%20root%20%3A%3D%20aTagBrush%0A')}),
  4246. smalltalk.HTMLCanvas);
  4247. smalltalk.addMethod(
  4248. '_root',
  4249. smalltalk.method({
  4250. selector: 'root',
  4251. category: 'accessing',
  4252. fn: function (){
  4253. var self=this;
  4254. return self['@root'];
  4255. return self;},
  4256. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  4257. smalltalk.HTMLCanvas);
  4258. smalltalk.addMethod(
  4259. '_initialize',
  4260. smalltalk.method({
  4261. selector: 'initialize',
  4262. category: 'initialization',
  4263. fn: function (){
  4264. var self=this;
  4265. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  4266. self['@root']=smalltalk.TagBrush._fromString_canvas_("div",self);
  4267. return self;},
  4268. 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')}),
  4269. smalltalk.HTMLCanvas);
  4270. smalltalk.addMethod(
  4271. '_with_',
  4272. smalltalk.method({
  4273. selector: 'with:',
  4274. category: 'adding',
  4275. fn: function (anObject){
  4276. var self=this;
  4277. return self._root()._with_(anObject);
  4278. return self;},
  4279. source: unescape('with%3A%20anObject%0A%20%20%20%20%5Eself%20root%20with%3A%20anObject%0A')}),
  4280. smalltalk.HTMLCanvas);
  4281. smalltalk.addMethod(
  4282. '_newTag_',
  4283. smalltalk.method({
  4284. selector: 'newTag:',
  4285. category: 'tags',
  4286. fn: function (aString){
  4287. var self=this;
  4288. return smalltalk.TagBrush._fromString_canvas_(aString,self);
  4289. return self;},
  4290. source: unescape('newTag%3A%20aString%0A%20%20%20%20%5ETagBrush%20fromString%3A%20aString%20canvas%3A%20self%0A')}),
  4291. smalltalk.HTMLCanvas);
  4292. smalltalk.addMethod(
  4293. '_tag_',
  4294. smalltalk.method({
  4295. selector: 'tag:',
  4296. category: 'tags',
  4297. fn: function (aString){
  4298. var self=this;
  4299. return self['@root']._addBrush_(self._newTag_(aString));
  4300. return self;},
  4301. source: unescape('tag%3A%20aString%0A%20%20%20%20%5Eroot%20addBrush%3A%20%28self%20newTag%3A%20aString%29%0A')}),
  4302. smalltalk.HTMLCanvas);
  4303. smalltalk.addMethod(
  4304. '_h1',
  4305. smalltalk.method({
  4306. selector: 'h1',
  4307. category: 'tags',
  4308. fn: function (){
  4309. var self=this;
  4310. return self._tag_("h1");
  4311. return self;},
  4312. source: unescape('h1%0A%20%20%20%20%5Eself%20tag%3A%20%27h1%27%0A')}),
  4313. smalltalk.HTMLCanvas);
  4314. smalltalk.addMethod(
  4315. '_h2',
  4316. smalltalk.method({
  4317. selector: 'h2',
  4318. category: 'tags',
  4319. fn: function (){
  4320. var self=this;
  4321. return self._tag_("h2");
  4322. return self;},
  4323. source: unescape('h2%0A%20%20%20%20%5Eself%20tag%3A%20%27h2%27%0A')}),
  4324. smalltalk.HTMLCanvas);
  4325. smalltalk.addMethod(
  4326. '_h3',
  4327. smalltalk.method({
  4328. selector: 'h3',
  4329. category: 'tags',
  4330. fn: function (){
  4331. var self=this;
  4332. return self._tag_("h3");
  4333. return self;},
  4334. source: unescape('h3%0A%20%20%20%20%5Eself%20tag%3A%20%27h3%27%0A')}),
  4335. smalltalk.HTMLCanvas);
  4336. smalltalk.addMethod(
  4337. '_h4',
  4338. smalltalk.method({
  4339. selector: 'h4',
  4340. category: 'tags',
  4341. fn: function (){
  4342. var self=this;
  4343. return self._tag_("h4");
  4344. return self;},
  4345. source: unescape('h4%0A%20%20%20%20%5Eself%20tag%3A%20%27h4%27%0A')}),
  4346. smalltalk.HTMLCanvas);
  4347. smalltalk.addMethod(
  4348. '_h5',
  4349. smalltalk.method({
  4350. selector: 'h5',
  4351. category: 'tags',
  4352. fn: function (){
  4353. var self=this;
  4354. return self._tag_("h5");
  4355. return self;},
  4356. source: unescape('h5%0A%20%20%20%20%5Eself%20tag%3A%20%27h5%27%0A')}),
  4357. smalltalk.HTMLCanvas);
  4358. smalltalk.addMethod(
  4359. '_h6',
  4360. smalltalk.method({
  4361. selector: 'h6',
  4362. category: 'tags',
  4363. fn: function (){
  4364. var self=this;
  4365. return self._tag_("h6");
  4366. return self;},
  4367. source: unescape('h6%0A%20%20%20%20%5Eself%20tag%3A%20%27h6%27%0A')}),
  4368. smalltalk.HTMLCanvas);
  4369. smalltalk.addMethod(
  4370. '_p',
  4371. smalltalk.method({
  4372. selector: 'p',
  4373. category: 'tags',
  4374. fn: function (){
  4375. var self=this;
  4376. return self._tag_("p");
  4377. return self;},
  4378. source: unescape('p%0A%20%20%20%20%5Eself%20tag%3A%20%27p%27%0A')}),
  4379. smalltalk.HTMLCanvas);
  4380. smalltalk.addMethod(
  4381. '_div',
  4382. smalltalk.method({
  4383. selector: 'div',
  4384. category: 'tags',
  4385. fn: function (){
  4386. var self=this;
  4387. return self._tag_("div");
  4388. return self;},
  4389. source: unescape('div%0A%20%20%20%20%5Eself%20tag%3A%20%27div%27%0A')}),
  4390. smalltalk.HTMLCanvas);
  4391. smalltalk.addMethod(
  4392. '_span',
  4393. smalltalk.method({
  4394. selector: 'span',
  4395. category: 'tags',
  4396. fn: function (){
  4397. var self=this;
  4398. return self._tag_("span");
  4399. return self;},
  4400. source: unescape('span%0A%20%20%20%20%5Eself%20tag%3A%20%27span%27%0A')}),
  4401. smalltalk.HTMLCanvas);
  4402. smalltalk.addMethod(
  4403. '_img',
  4404. smalltalk.method({
  4405. selector: 'img',
  4406. category: 'tags',
  4407. fn: function (){
  4408. var self=this;
  4409. return self._tag_("img");
  4410. return self;},
  4411. source: unescape('img%0A%20%20%20%20%5Eself%20tag%3A%20%27img%27%0A')}),
  4412. smalltalk.HTMLCanvas);
  4413. smalltalk.addMethod(
  4414. '_ul',
  4415. smalltalk.method({
  4416. selector: 'ul',
  4417. category: 'tags',
  4418. fn: function (){
  4419. var self=this;
  4420. return self._tag_("ul");
  4421. return self;},
  4422. source: unescape('ul%0A%20%20%20%20%5Eself%20tag%3A%20%27ul%27%0A')}),
  4423. smalltalk.HTMLCanvas);
  4424. smalltalk.addMethod(
  4425. '_ol',
  4426. smalltalk.method({
  4427. selector: 'ol',
  4428. category: 'tags',
  4429. fn: function (){
  4430. var self=this;
  4431. return self._tag_("ol");
  4432. return self;},
  4433. source: unescape('ol%0A%20%20%20%20%5Eself%20tag%3A%20%27ol%27%0A')}),
  4434. smalltalk.HTMLCanvas);
  4435. smalltalk.addMethod(
  4436. '_li',
  4437. smalltalk.method({
  4438. selector: 'li',
  4439. category: 'tags',
  4440. fn: function (){
  4441. var self=this;
  4442. return self._tag_("li");
  4443. return self;},
  4444. source: unescape('li%0A%20%20%20%20%5Eself%20tag%3A%20%27li%27%0A')}),
  4445. smalltalk.HTMLCanvas);
  4446. smalltalk.addMethod(
  4447. '_table',
  4448. smalltalk.method({
  4449. selector: 'table',
  4450. category: 'tags',
  4451. fn: function (){
  4452. var self=this;
  4453. return self._tag_("table");
  4454. return self;},
  4455. source: unescape('table%0A%20%20%20%20%5Eself%20tag%3A%20%27table%27%0A')}),
  4456. smalltalk.HTMLCanvas);
  4457. smalltalk.addMethod(
  4458. '_tr',
  4459. smalltalk.method({
  4460. selector: 'tr',
  4461. category: 'tags',
  4462. fn: function (){
  4463. var self=this;
  4464. return self._tag_("tr");
  4465. return self;},
  4466. source: unescape('tr%0A%20%20%20%20%5Eself%20tag%3A%20%27tr%27%0A')}),
  4467. smalltalk.HTMLCanvas);
  4468. smalltalk.addMethod(
  4469. '_td',
  4470. smalltalk.method({
  4471. selector: 'td',
  4472. category: 'tags',
  4473. fn: function (){
  4474. var self=this;
  4475. return self._tag_("td");
  4476. return self;},
  4477. source: unescape('td%20%0A%20%20%20%20%5Eself%20tag%3A%20%27td%27%0A')}),
  4478. smalltalk.HTMLCanvas);
  4479. smalltalk.addMethod(
  4480. '_th',
  4481. smalltalk.method({
  4482. selector: 'th',
  4483. category: 'tags',
  4484. fn: function (){
  4485. var self=this;
  4486. return self._tag_("th");
  4487. return self;},
  4488. source: unescape('th%0A%20%20%20%20%5Eself%20tag%3A%20%27th%27%0A')}),
  4489. smalltalk.HTMLCanvas);
  4490. smalltalk.addMethod(
  4491. '_form',
  4492. smalltalk.method({
  4493. selector: 'form',
  4494. category: 'tags',
  4495. fn: function (){
  4496. var self=this;
  4497. return self._tag_("form");
  4498. return self;},
  4499. source: unescape('form%0A%20%20%20%20%5Eself%20tag%3A%20%27form%27%0A')}),
  4500. smalltalk.HTMLCanvas);
  4501. smalltalk.addMethod(
  4502. '_input',
  4503. smalltalk.method({
  4504. selector: 'input',
  4505. category: 'tags',
  4506. fn: function (){
  4507. var self=this;
  4508. return self._tag_("input");
  4509. return self;},
  4510. source: unescape('input%0A%20%20%20%20%5Eself%20tag%3A%20%27input%27%0A')}),
  4511. smalltalk.HTMLCanvas);
  4512. smalltalk.addMethod(
  4513. '_button',
  4514. smalltalk.method({
  4515. selector: 'button',
  4516. category: 'tags',
  4517. fn: function (){
  4518. var self=this;
  4519. return self._tag_("button");
  4520. return self;},
  4521. source: unescape('button%0A%20%20%20%20%5Eself%20tag%3A%20%27button%27%0A')}),
  4522. smalltalk.HTMLCanvas);
  4523. smalltalk.addMethod(
  4524. '_select',
  4525. smalltalk.method({
  4526. selector: 'select',
  4527. category: 'tags',
  4528. fn: function (){
  4529. var self=this;
  4530. return self._tag_("select");
  4531. return self;},
  4532. source: unescape('select%0A%20%20%20%20%5Eself%20tag%3A%20%27select%27%0A')}),
  4533. smalltalk.HTMLCanvas);
  4534. smalltalk.addMethod(
  4535. '_option',
  4536. smalltalk.method({
  4537. selector: 'option',
  4538. category: 'tags',
  4539. fn: function (){
  4540. var self=this;
  4541. return self._tag_("option");
  4542. return self;},
  4543. source: unescape('option%0A%20%20%20%20%5Eself%20tag%3A%20%27option%27%0A')}),
  4544. smalltalk.HTMLCanvas);
  4545. smalltalk.addMethod(
  4546. '_textarea',
  4547. smalltalk.method({
  4548. selector: 'textarea',
  4549. category: 'tags',
  4550. fn: function (){
  4551. var self=this;
  4552. return self._tag_("textarea");
  4553. return self;},
  4554. source: unescape('textarea%0A%20%20%20%20%5Eself%20tag%3A%20%27textarea%27%0A')}),
  4555. smalltalk.HTMLCanvas);
  4556. smalltalk.addMethod(
  4557. '_a',
  4558. smalltalk.method({
  4559. selector: 'a',
  4560. category: 'tags',
  4561. fn: function (){
  4562. var self=this;
  4563. return self._tag_("a");
  4564. return self;},
  4565. source: unescape('a%0A%20%20%20%20%5Eself%20tag%3A%20%27a%27%0A')}),
  4566. smalltalk.HTMLCanvas);
  4567. smalltalk.addMethod(
  4568. '_appendToJQuery_',
  4569. smalltalk.method({
  4570. selector: 'appendToJQuery:',
  4571. category: '*JQuery',
  4572. fn: function (aJQuery){
  4573. var self=this;
  4574. aJQuery._appendElement_(self['@root']._element());
  4575. return self;},
  4576. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20root%20element%0A')}),
  4577. smalltalk.HTMLCanvas);
  4578. smalltalk.addClass('TagBrush', smalltalk.Object, ['element'], 'Canvas');
  4579. smalltalk.addMethod(
  4580. '_contents_',
  4581. smalltalk.method({
  4582. selector: 'contents:',
  4583. category: 'adding',
  4584. fn: function (anObject){
  4585. var self=this;
  4586. self._asJQuery()._empty();
  4587. self._append_(anObject);
  4588. return self;},
  4589. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20asJQuery%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  4590. smalltalk.TagBrush);
  4591. smalltalk.addMethod(
  4592. '_addBrush_',
  4593. smalltalk.method({
  4594. selector: 'addBrush:',
  4595. category: 'adding',
  4596. fn: function (aTagBrush){
  4597. var self=this;
  4598. self._appendChild_(aTagBrush._element());
  4599. return aTagBrush;
  4600. return self;},
  4601. source: unescape('addBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendChild%3A%20aTagBrush%20element.%0A%20%20%20%20%5EaTagBrush%0A')}),
  4602. smalltalk.TagBrush);
  4603. smalltalk.addMethod(
  4604. '_with_',
  4605. smalltalk.method({
  4606. selector: 'with:',
  4607. category: 'adding',
  4608. fn: function (anObject){
  4609. var self=this;
  4610. self._append_(anObject);
  4611. return self;},
  4612. source: unescape('with%3A%20anObject%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  4613. smalltalk.TagBrush);
  4614. smalltalk.addMethod(
  4615. '_append_',
  4616. smalltalk.method({
  4617. selector: 'append:',
  4618. category: 'adding',
  4619. fn: function (anObject){
  4620. var self=this;
  4621. anObject._appendToBrush_(self);
  4622. return self;},
  4623. source: unescape('append%3A%20anObject%0A%20%20%20%20anObject%20appendToBrush%3A%20self%0A')}),
  4624. smalltalk.TagBrush);
  4625. smalltalk.addMethod(
  4626. '_appendToBrush_',
  4627. smalltalk.method({
  4628. selector: 'appendToBrush:',
  4629. category: 'adding',
  4630. fn: function (aTagBrush){
  4631. var self=this;
  4632. aTagBrush._addBrush_(self);
  4633. return self;},
  4634. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20addBrush%3A%20self%0A')}),
  4635. smalltalk.TagBrush);
  4636. smalltalk.addMethod(
  4637. '_appendBlock_',
  4638. smalltalk.method({
  4639. selector: 'appendBlock:',
  4640. category: 'adding',
  4641. fn: function (aBlock){
  4642. var self=this;
  4643. var root=nil;
  4644. root=canvas._root();
  4645. canvas._root_(self);
  4646. aBlock._value_(canvas);
  4647. canvas._root_(root);
  4648. return self;},
  4649. 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')}),
  4650. smalltalk.TagBrush);
  4651. smalltalk.addMethod(
  4652. '_appendChild_',
  4653. smalltalk.method({
  4654. selector: 'appendChild:',
  4655. category: 'adding',
  4656. fn: function (anElement){
  4657. var self=this;
  4658. (function(){self['@element'].appendChild(anElement)})();
  4659. return self;},
  4660. 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')}),
  4661. smalltalk.TagBrush);
  4662. smalltalk.addMethod(
  4663. '_appendString_',
  4664. smalltalk.method({
  4665. selector: 'appendString:',
  4666. category: 'adding',
  4667. fn: function (aString){
  4668. var self=this;
  4669. self._appendChild_(self._createTextNodeFor_(aString));
  4670. return self;},
  4671. source: unescape('appendString%3A%20aString%0A%20%20%20%20self%20appendChild%3A%20%28self%20createTextNodeFor%3A%20aString%29%0A')}),
  4672. smalltalk.TagBrush);
  4673. smalltalk.addMethod(
  4674. '_at_put_',
  4675. smalltalk.method({
  4676. selector: 'at:put:',
  4677. category: 'attributes',
  4678. fn: function (aString, aValue){
  4679. var self=this;
  4680. (function(){self['@element'].setAttribute(aString, aValue)})();
  4681. return self;},
  4682. 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')}),
  4683. smalltalk.TagBrush);
  4684. smalltalk.addMethod(
  4685. '_removeAt_',
  4686. smalltalk.method({
  4687. selector: 'removeAt:',
  4688. category: 'attributes',
  4689. fn: function (aString){
  4690. var self=this;
  4691. (function(){self['@element'].removeAttribute(aString)})();
  4692. return self;},
  4693. 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')}),
  4694. smalltalk.TagBrush);
  4695. smalltalk.addMethod(
  4696. '_class_',
  4697. smalltalk.method({
  4698. selector: 'class:',
  4699. category: 'attributes',
  4700. fn: function (aString){
  4701. var self=this;
  4702. self._at_put_("class",aString);
  4703. return self;},
  4704. source: unescape('class%3A%20aString%0A%20%20%20%20self%20at%3A%20%27class%27%20put%3A%20aString%0A')}),
  4705. smalltalk.TagBrush);
  4706. smalltalk.addMethod(
  4707. '_id_',
  4708. smalltalk.method({
  4709. selector: 'id:',
  4710. category: 'attributes',
  4711. fn: function (aString){
  4712. var self=this;
  4713. self._at_put_("id",aString);
  4714. return self;},
  4715. source: unescape('id%3A%20aString%0A%20%20%20%20self%20at%3A%20%27id%27%20put%3A%20aString%0A')}),
  4716. smalltalk.TagBrush);
  4717. smalltalk.addMethod(
  4718. '_src_',
  4719. smalltalk.method({
  4720. selector: 'src:',
  4721. category: 'attributes',
  4722. fn: function (aString){
  4723. var self=this;
  4724. self._at_put_("src",aString);
  4725. return self;},
  4726. source: unescape('src%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27src%27%20put%3A%20aString%0A')}),
  4727. smalltalk.TagBrush);
  4728. smalltalk.addMethod(
  4729. '_href_',
  4730. smalltalk.method({
  4731. selector: 'href:',
  4732. category: 'attributes',
  4733. fn: function (aString){
  4734. var self=this;
  4735. self._at_put_("href",aString);
  4736. return self;},
  4737. source: unescape('href%3A%20aString%0A%20%20%20%20self%20at%3A%20%27href%27%20put%3A%20aString%0A')}),
  4738. smalltalk.TagBrush);
  4739. smalltalk.addMethod(
  4740. '_title_',
  4741. smalltalk.method({
  4742. selector: 'title:',
  4743. category: 'attributes',
  4744. fn: function (aString){
  4745. var self=this;
  4746. self._at_put_("title",aString);
  4747. return self;},
  4748. source: unescape('title%3A%20aString%0A%20%20%20%20self%20at%3A%20%27title%27%20put%3A%20aString%0A')}),
  4749. smalltalk.TagBrush);
  4750. smalltalk.addMethod(
  4751. '_style_',
  4752. smalltalk.method({
  4753. selector: 'style:',
  4754. category: 'attributes',
  4755. fn: function (aString){
  4756. var self=this;
  4757. self._at_put_("style",aString);
  4758. return self;},
  4759. source: unescape('style%3A%20aString%0A%20%20%20%20self%20at%3A%20%27style%27%20put%3A%20aString%0A')}),
  4760. smalltalk.TagBrush);
  4761. smalltalk.addMethod(
  4762. '_initializeFromString_canvas_',
  4763. smalltalk.method({
  4764. selector: 'initializeFromString:canvas:',
  4765. category: 'initialization',
  4766. fn: function (aString, aCanvas){
  4767. var self=this;
  4768. self['@element']=self._createElementFor_(aString);
  4769. canvas=aCanvas;
  4770. return self;},
  4771. 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')}),
  4772. smalltalk.TagBrush);
  4773. smalltalk.addMethod(
  4774. '_element',
  4775. smalltalk.method({
  4776. selector: 'element',
  4777. category: 'accessing',
  4778. fn: function (){
  4779. var self=this;
  4780. return self['@element'];
  4781. return self;},
  4782. source: unescape('element%0A%20%20%20%20%5Eelement%0A')}),
  4783. smalltalk.TagBrush);
  4784. smalltalk.addMethod(
  4785. '_asJQuery',
  4786. smalltalk.method({
  4787. selector: 'asJQuery',
  4788. category: 'converting',
  4789. fn: function (){
  4790. var self=this;
  4791. return (function(){return smalltalk.JQuery._from_(jQuery(self['@element']))})();
  4792. return self;},
  4793. 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')}),
  4794. smalltalk.TagBrush);
  4795. smalltalk.addMethod(
  4796. '_asJQueryDo_',
  4797. smalltalk.method({
  4798. selector: 'asJQueryDo:',
  4799. category: 'converting',
  4800. fn: function (aBlock){
  4801. var self=this;
  4802. aBlock._value_(self._asJQuery());
  4803. return self;},
  4804. source: unescape('asJQueryDo%3A%20aBlock%0A%20%20%20%20aBlock%20value%3A%20self%20asJQuery%0A')}),
  4805. smalltalk.TagBrush);
  4806. smalltalk.addMethod(
  4807. '_onKeyDown_',
  4808. smalltalk.method({
  4809. selector: 'onKeyDown:',
  4810. category: 'events',
  4811. fn: function (aBlock){
  4812. var self=this;
  4813. self._asJQuery()._on_do_("keydown",aBlock);
  4814. return self;},
  4815. source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keydown%27%20do%3A%20aBlock%0A')}),
  4816. smalltalk.TagBrush);
  4817. smalltalk.addMethod(
  4818. '_onKeyPress_',
  4819. smalltalk.method({
  4820. selector: 'onKeyPress:',
  4821. category: 'events',
  4822. fn: function (aBlock){
  4823. var self=this;
  4824. self._asJQuery()._on_do_("keypress",aBlock);
  4825. return self;},
  4826. source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keypress%27%20do%3A%20aBlock%0A')}),
  4827. smalltalk.TagBrush);
  4828. smalltalk.addMethod(
  4829. '_onKeyUp_',
  4830. smalltalk.method({
  4831. selector: 'onKeyUp:',
  4832. category: 'events',
  4833. fn: function (aBlock){
  4834. var self=this;
  4835. self._asJQuery()._on_do_("keyup",aBlock);
  4836. return self;},
  4837. source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keyup%27%20do%3A%20aBlock%0A')}),
  4838. smalltalk.TagBrush);
  4839. smalltalk.addMethod(
  4840. '_onFocus_',
  4841. smalltalk.method({
  4842. selector: 'onFocus:',
  4843. category: 'events',
  4844. fn: function (aBlock){
  4845. var self=this;
  4846. self._asJQuery()._on_do_("focus",aBlock);
  4847. return self;},
  4848. source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27focus%27%20do%3A%20aBlock%0A')}),
  4849. smalltalk.TagBrush);
  4850. smalltalk.addMethod(
  4851. '_onBlur_',
  4852. smalltalk.method({
  4853. selector: 'onBlur:',
  4854. category: 'events',
  4855. fn: function (aBlock){
  4856. var self=this;
  4857. self._asJQuery()._on_do_("blur",aBlock);
  4858. return self;},
  4859. source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27blur%27%20do%3A%20aBlock%0A')}),
  4860. smalltalk.TagBrush);
  4861. smalltalk.addMethod(
  4862. '_onChange_',
  4863. smalltalk.method({
  4864. selector: 'onChange:',
  4865. category: 'events',
  4866. fn: function (aBlock){
  4867. var self=this;
  4868. self._asJQuery()._on_do_("change",aBlock);
  4869. return self;},
  4870. source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27change%27%20do%3A%20aBlock%0A')}),
  4871. smalltalk.TagBrush);
  4872. smalltalk.addMethod(
  4873. '_onClick_',
  4874. smalltalk.method({
  4875. selector: 'onClick:',
  4876. category: 'events',
  4877. fn: function (aBlock){
  4878. var self=this;
  4879. self._asJQuery()._on_do_("click",aBlock);
  4880. return self;},
  4881. source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27click%27%20do%3A%20aBlock%0A')}),
  4882. smalltalk.TagBrush);
  4883. smalltalk.addMethod(
  4884. '_createElementFor_',
  4885. smalltalk.method({
  4886. selector: 'createElementFor:',
  4887. category: 'private',
  4888. fn: function (aString){
  4889. var self=this;
  4890. return (function(){return document.createElement(String(aString))})();
  4891. return self;},
  4892. source: unescape('createElementFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createElement%28String%28aString%29%29%27%7D%0A')}),
  4893. smalltalk.TagBrush);
  4894. smalltalk.addMethod(
  4895. '_createTextNodeFor_',
  4896. smalltalk.method({
  4897. selector: 'createTextNodeFor:',
  4898. category: 'private',
  4899. fn: function (aString){
  4900. var self=this;
  4901. return (function(){return document.createTextNode(String(aString))})();
  4902. return self;},
  4903. source: unescape('createTextNodeFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createTextNode%28String%28aString%29%29%27%7D%0A')}),
  4904. smalltalk.TagBrush);
  4905. smalltalk.addMethod(
  4906. '_fromString_canvas_',
  4907. smalltalk.method({
  4908. selector: 'fromString:canvas:',
  4909. category: 'instance creation',
  4910. fn: function (aString, aCanvas){
  4911. var self=this;
  4912. return (function($rec){$rec._initializeFromString_canvas_(aString,aCanvas);return $rec._yourself();})(self._new());
  4913. return self;},
  4914. 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')}),
  4915. smalltalk.TagBrush.klass);
  4916. smalltalk.addClass('Widget', smalltalk.Object, ['root'], 'Canvas');
  4917. smalltalk.addMethod(
  4918. '_root',
  4919. smalltalk.method({
  4920. selector: 'root',
  4921. category: 'accessing',
  4922. fn: function (){
  4923. var self=this;
  4924. return self['@root'];
  4925. return self;},
  4926. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  4927. smalltalk.Widget);
  4928. smalltalk.addMethod(
  4929. '_appendToBrush_',
  4930. smalltalk.method({
  4931. selector: 'appendToBrush:',
  4932. category: 'adding',
  4933. fn: function (aTagBrush){
  4934. var self=this;
  4935. self._appendToJQuery_(aTagBrush._asJQuery());
  4936. return self;},
  4937. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendToJQuery%3A%20aTagBrush%20asJQuery%0A')}),
  4938. smalltalk.Widget);
  4939. smalltalk.addMethod(
  4940. '_appendToJQuery_',
  4941. smalltalk.method({
  4942. selector: 'appendToJQuery:',
  4943. category: 'adding',
  4944. fn: function (aJQuery){
  4945. var self=this;
  4946. self._render();
  4947. aJQuery._append_(self._root()._asJQuery());
  4948. return self;},
  4949. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20self%20render.%0A%20%20%20%20aJQuery%20append%3A%20self%20root%20asJQuery%0A')}),
  4950. smalltalk.Widget);
  4951. smalltalk.addMethod(
  4952. '_alert_',
  4953. smalltalk.method({
  4954. selector: 'alert:',
  4955. category: 'actions',
  4956. fn: function (aString){
  4957. var self=this;
  4958. (function(){alert(aString)})();
  4959. return self;},
  4960. source: unescape('alert%3A%20aString%0A%20%20%20%20%7B%27alert%28aString%29%27%7D%0A')}),
  4961. smalltalk.Widget);
  4962. smalltalk.addMethod(
  4963. '_confirm_',
  4964. smalltalk.method({
  4965. selector: 'confirm:',
  4966. category: 'actions',
  4967. fn: function (aString){
  4968. var self=this;
  4969. return (function(){return window.confirm(aString)})();
  4970. return self;},
  4971. source: unescape('confirm%3A%20aString%0A%20%20%20%20%5E%7B%27return%20window.confirm%28aString%29%27%7D%0A')}),
  4972. smalltalk.Widget);
  4973. smalltalk.addMethod(
  4974. '_prompt_',
  4975. smalltalk.method({
  4976. selector: 'prompt:',
  4977. category: 'actions',
  4978. fn: function (aString){
  4979. var self=this;
  4980. return self._prompt_default_(aString,"");
  4981. return self;},
  4982. source: unescape('prompt%3A%20aString%0A%20%20%20%20%5Eself%20prompt%3A%20aString%20default%3A%20%27%27%0A')}),
  4983. smalltalk.Widget);
  4984. smalltalk.addMethod(
  4985. '_prompt_default_',
  4986. smalltalk.method({
  4987. selector: 'prompt:default:',
  4988. category: 'actions',
  4989. fn: function (aString, anotherString){
  4990. var self=this;
  4991. return (function(){return window.prompt(aString, anotherString)})();
  4992. return self;},
  4993. 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')}),
  4994. smalltalk.Widget);
  4995. smalltalk.addMethod(
  4996. '_update',
  4997. smalltalk.method({
  4998. selector: 'update',
  4999. category: 'actions',
  5000. fn: function (){
  5001. var self=this;
  5002. var canvas=nil;
  5003. canvas=smalltalk.HTMLCanvas._new();
  5004. canvas._root_(self._root());
  5005. self._root()._asJQuery()._empty();
  5006. self._renderOn_(canvas);
  5007. return self;},
  5008. 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')}),
  5009. smalltalk.Widget);
  5010. smalltalk.addMethod(
  5011. '_render',
  5012. smalltalk.method({
  5013. selector: 'render',
  5014. category: 'rendering',
  5015. fn: function (){
  5016. var self=this;
  5017. var canvas=nil;
  5018. canvas=smalltalk.HTMLCanvas._new();
  5019. self['@root']=canvas._root();
  5020. self._renderOn_(canvas);
  5021. return self;},
  5022. 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')}),
  5023. smalltalk.Widget);
  5024. smalltalk.addMethod(
  5025. '_renderOn_',
  5026. smalltalk.method({
  5027. selector: 'renderOn:',
  5028. category: 'rendering',
  5029. fn: function (html){
  5030. var self=this;
  5031. self;
  5032. return self;},
  5033. source: unescape('renderOn%3A%20html%0A%20%20%20%20self%0A')}),
  5034. smalltalk.Widget);
  5035. smalltalk.addClass('Counter', smalltalk.Widget, ['count'], 'Canvas');
  5036. smalltalk.addMethod(
  5037. '_initialize',
  5038. smalltalk.method({
  5039. selector: 'initialize',
  5040. category: 'initialization',
  5041. fn: function (){
  5042. var self=this;
  5043. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  5044. self['@count']=(0);
  5045. return self;},
  5046. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20count%20%3A%3D%200%0A')}),
  5047. smalltalk.Counter);
  5048. smalltalk.addMethod(
  5049. '_renderOn_',
  5050. smalltalk.method({
  5051. selector: 'renderOn:',
  5052. category: 'rendering',
  5053. fn: function (html){
  5054. var self=this;
  5055. html._h1()._with_(self['@count']._asString());
  5056. (function($rec){$rec._with_(unescape("++"));return $rec._onClick_((function(){return self._increase();}));})(html._button());
  5057. (function($rec){$rec._with_(unescape("--"));return $rec._onClick_((function(){return self._decrease();}));})(html._button());
  5058. return self;},
  5059. 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')}),
  5060. smalltalk.Counter);
  5061. smalltalk.addMethod(
  5062. '_increase',
  5063. smalltalk.method({
  5064. selector: 'increase',
  5065. category: 'actions',
  5066. fn: function (){
  5067. var self=this;
  5068. self['@count']=self['@count'].__plus((1));
  5069. self._update();
  5070. return self;},
  5071. source: unescape('increase%0A%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20self%20update%0A')}),
  5072. smalltalk.Counter);
  5073. smalltalk.addMethod(
  5074. '_decrease',
  5075. smalltalk.method({
  5076. selector: 'decrease',
  5077. category: 'actions',
  5078. fn: function (){
  5079. var self=this;
  5080. self['@count']=self['@count'].__minus((1));
  5081. self._update();
  5082. return self;},
  5083. source: unescape('decrease%0A%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20self%20update%0A')}),
  5084. smalltalk.Counter);
  5085. smalltalk.init(smalltalk.Object);