2
0

Kernel-Collections.js 160 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655
  1. smalltalk.addPackage('Kernel-Collections', {});
  2. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3. smalltalk.addMethod(
  4. unescape('_collection'),
  5. smalltalk.method({
  6. selector: unescape('collection'),
  7. category: 'accessing',
  8. fn: function (){
  9. var self=this;
  10. return self['@collection'];
  11. return self;},
  12. args: [],
  13. source: unescape('collection%0A%09%5Ecollection'),
  14. messageSends: [],
  15. referencedClasses: []
  16. }),
  17. smalltalk.Stream);
  18. smalltalk.addMethod(
  19. unescape('_setCollection_'),
  20. smalltalk.method({
  21. selector: unescape('setCollection%3A'),
  22. category: 'accessing',
  23. fn: function (aCollection){
  24. var self=this;
  25. (self['@collection']=aCollection);
  26. return self;},
  27. args: ["aCollection"],
  28. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection'),
  29. messageSends: [],
  30. referencedClasses: []
  31. }),
  32. smalltalk.Stream);
  33. smalltalk.addMethod(
  34. unescape('_position'),
  35. smalltalk.method({
  36. selector: unescape('position'),
  37. category: 'accessing',
  38. fn: function (){
  39. var self=this;
  40. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return (self['@position']=(0));})() : $receiver;
  41. return self;},
  42. args: [],
  43. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D'),
  44. messageSends: ["ifNil:"],
  45. referencedClasses: []
  46. }),
  47. smalltalk.Stream);
  48. smalltalk.addMethod(
  49. unescape('_position_'),
  50. smalltalk.method({
  51. selector: unescape('position%3A'),
  52. category: 'accessing',
  53. fn: function (anInteger){
  54. var self=this;
  55. (self['@position']=anInteger);
  56. return self;},
  57. args: ["anInteger"],
  58. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger'),
  59. messageSends: [],
  60. referencedClasses: []
  61. }),
  62. smalltalk.Stream);
  63. smalltalk.addMethod(
  64. unescape('_streamSize'),
  65. smalltalk.method({
  66. selector: unescape('streamSize'),
  67. category: 'accessing',
  68. fn: function (){
  69. var self=this;
  70. return self['@streamSize'];
  71. return self;},
  72. args: [],
  73. source: unescape('streamSize%0A%09%5EstreamSize'),
  74. messageSends: [],
  75. referencedClasses: []
  76. }),
  77. smalltalk.Stream);
  78. smalltalk.addMethod(
  79. unescape('_setStreamSize_'),
  80. smalltalk.method({
  81. selector: unescape('setStreamSize%3A'),
  82. category: 'accessing',
  83. fn: function (anInteger){
  84. var self=this;
  85. (self['@streamSize']=anInteger);
  86. return self;},
  87. args: ["anInteger"],
  88. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger'),
  89. messageSends: [],
  90. referencedClasses: []
  91. }),
  92. smalltalk.Stream);
  93. smalltalk.addMethod(
  94. unescape('_contents'),
  95. smalltalk.method({
  96. selector: unescape('contents'),
  97. category: 'accessing',
  98. fn: function (){
  99. var self=this;
  100. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  101. return self;},
  102. args: [],
  103. 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'),
  104. messageSends: ["copyFrom:to:", "collection", "streamSize"],
  105. referencedClasses: []
  106. }),
  107. smalltalk.Stream);
  108. smalltalk.addMethod(
  109. unescape('_size'),
  110. smalltalk.method({
  111. selector: unescape('size'),
  112. category: 'accessing',
  113. fn: function (){
  114. var self=this;
  115. return smalltalk.send(self, "_streamSize", []);
  116. return self;},
  117. args: [],
  118. source: unescape('size%0A%09%5Eself%20streamSize'),
  119. messageSends: ["streamSize"],
  120. referencedClasses: []
  121. }),
  122. smalltalk.Stream);
  123. smalltalk.addMethod(
  124. unescape('_reset'),
  125. smalltalk.method({
  126. selector: unescape('reset'),
  127. category: 'actions',
  128. fn: function (){
  129. var self=this;
  130. smalltalk.send(self, "_position_", [(0)]);
  131. return self;},
  132. args: [],
  133. source: unescape('reset%0A%09self%20position%3A%200'),
  134. messageSends: ["position:"],
  135. referencedClasses: []
  136. }),
  137. smalltalk.Stream);
  138. smalltalk.addMethod(
  139. unescape('_close'),
  140. smalltalk.method({
  141. selector: unescape('close'),
  142. category: 'actions',
  143. fn: function (){
  144. var self=this;
  145. return self;},
  146. args: [],
  147. source: unescape('close'),
  148. messageSends: [],
  149. referencedClasses: []
  150. }),
  151. smalltalk.Stream);
  152. smalltalk.addMethod(
  153. unescape('_flush'),
  154. smalltalk.method({
  155. selector: unescape('flush'),
  156. category: 'actions',
  157. fn: function (){
  158. var self=this;
  159. return self;},
  160. args: [],
  161. source: unescape('flush'),
  162. messageSends: [],
  163. referencedClasses: []
  164. }),
  165. smalltalk.Stream);
  166. smalltalk.addMethod(
  167. unescape('_resetContents'),
  168. smalltalk.method({
  169. selector: unescape('resetContents'),
  170. category: 'actions',
  171. fn: function (){
  172. var self=this;
  173. smalltalk.send(self, "_reset", []);
  174. smalltalk.send(self, "_setStreamSize_", [(0)]);
  175. return self;},
  176. args: [],
  177. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200'),
  178. messageSends: ["reset", "setStreamSize:"],
  179. referencedClasses: []
  180. }),
  181. smalltalk.Stream);
  182. smalltalk.addMethod(
  183. unescape('_do_'),
  184. smalltalk.method({
  185. selector: unescape('do%3A'),
  186. category: 'enumerating',
  187. fn: function (aBlock){
  188. var self=this;
  189. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  190. return self;},
  191. args: ["aBlock"],
  192. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D'),
  193. messageSends: ["whileFalse:", "atEnd", "value:", "next"],
  194. referencedClasses: []
  195. }),
  196. smalltalk.Stream);
  197. smalltalk.addMethod(
  198. unescape('_setToEnd'),
  199. smalltalk.method({
  200. selector: unescape('setToEnd'),
  201. category: 'positioning',
  202. fn: function (){
  203. var self=this;
  204. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  205. return self;},
  206. args: [],
  207. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size'),
  208. messageSends: ["position:", "size"],
  209. referencedClasses: []
  210. }),
  211. smalltalk.Stream);
  212. smalltalk.addMethod(
  213. unescape('_skip_'),
  214. smalltalk.method({
  215. selector: unescape('skip%3A'),
  216. category: 'positioning',
  217. fn: function (anInteger){
  218. var self=this;
  219. smalltalk.send(self, "_position_", [smalltalk.send(((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +anInteger : smalltalk.send($receiver, "__plus", [anInteger])), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
  220. return self;},
  221. args: ["anInteger"],
  222. source: unescape('skip%3A%20anInteger%0A%09self%20position%3A%20%28%28self%20position%20+%20anInteger%29%20min%3A%20self%20size%20max%3A%200%29'),
  223. messageSends: ["position:", "min:max:", unescape("+"), "position", "size"],
  224. referencedClasses: []
  225. }),
  226. smalltalk.Stream);
  227. smalltalk.addMethod(
  228. unescape('_next'),
  229. smalltalk.method({
  230. selector: unescape('next'),
  231. category: 'reading',
  232. fn: function (){
  233. var self=this;
  234. return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return nil;})() : (function(){smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return nil;}), (function(){smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);})]));
  235. return self;},
  236. args: [],
  237. source: unescape('next%0A%09%5Eself%20atEnd%20%0A%09%09ifTrue%3A%20%5Bnil%5D%0A%09%09ifFalse%3A%20%5B%0A%09%09%09self%20position%3A%20self%20position%20+%201.%20%0A%09%09%09collection%20at%3A%20self%20position%5D'),
  238. messageSends: ["ifTrue:ifFalse:", "atEnd", "position:", unescape("+"), "position", "at:"],
  239. referencedClasses: []
  240. }),
  241. smalltalk.Stream);
  242. smalltalk.addMethod(
  243. unescape('_next_'),
  244. smalltalk.method({
  245. selector: unescape('next%3A'),
  246. category: 'reading',
  247. fn: function (anInteger){
  248. var self=this;
  249. var tempCollection=nil;
  250. (tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
  251. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]));})]);
  252. return tempCollection;
  253. return self;},
  254. args: ["anInteger"],
  255. 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'),
  256. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", "add:", "next"],
  257. referencedClasses: []
  258. }),
  259. smalltalk.Stream);
  260. smalltalk.addMethod(
  261. unescape('_nextPut_'),
  262. smalltalk.method({
  263. selector: unescape('nextPut%3A'),
  264. category: 'writing',
  265. fn: function (anObject){
  266. var self=this;
  267. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  268. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  269. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  270. return self;},
  271. args: ["anObject"],
  272. 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'),
  273. messageSends: ["position:", unescape("+"), "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"],
  274. referencedClasses: []
  275. }),
  276. smalltalk.Stream);
  277. smalltalk.addMethod(
  278. unescape('_nextPutAll_'),
  279. smalltalk.method({
  280. selector: unescape('nextPutAll%3A'),
  281. category: 'writing',
  282. fn: function (aCollection){
  283. var self=this;
  284. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  285. return self;},
  286. args: ["aCollection"],
  287. source: unescape('nextPutAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20nextPut%3A%20each%5D'),
  288. messageSends: ["do:", "nextPut:"],
  289. referencedClasses: []
  290. }),
  291. smalltalk.Stream);
  292. smalltalk.addMethod(
  293. unescape('_peek'),
  294. smalltalk.method({
  295. selector: unescape('peek'),
  296. category: 'reading',
  297. fn: function (){
  298. var self=this;
  299. return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})]));
  300. return self;},
  301. args: [],
  302. 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'),
  303. messageSends: ["ifFalse:", "atEnd", "at:", "collection", unescape("+"), "position"],
  304. referencedClasses: []
  305. }),
  306. smalltalk.Stream);
  307. smalltalk.addMethod(
  308. unescape('_atEnd'),
  309. smalltalk.method({
  310. selector: unescape('atEnd'),
  311. category: 'testing',
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  315. return self;},
  316. args: [],
  317. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size'),
  318. messageSends: [unescape("%3D"), "position", "size"],
  319. referencedClasses: []
  320. }),
  321. smalltalk.Stream);
  322. smalltalk.addMethod(
  323. unescape('_atStart'),
  324. smalltalk.method({
  325. selector: unescape('atStart'),
  326. category: 'testing',
  327. fn: function (){
  328. var self=this;
  329. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  330. return self;},
  331. args: [],
  332. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200'),
  333. messageSends: [unescape("%3D"), "position"],
  334. referencedClasses: []
  335. }),
  336. smalltalk.Stream);
  337. smalltalk.addMethod(
  338. unescape('_isEmpty'),
  339. smalltalk.method({
  340. selector: unescape('isEmpty'),
  341. category: 'testing',
  342. fn: function (){
  343. var self=this;
  344. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  345. return self;},
  346. args: [],
  347. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200'),
  348. messageSends: [unescape("%3D"), "size"],
  349. referencedClasses: []
  350. }),
  351. smalltalk.Stream);
  352. smalltalk.addMethod(
  353. unescape('_on_'),
  354. smalltalk.method({
  355. selector: unescape('on%3A'),
  356. category: 'instance creation',
  357. fn: function (aCollection){
  358. var self=this;
  359. return (function($rec){smalltalk.send($rec, "_setCollection_", [aCollection]);smalltalk.send($rec, "_setStreamSize_", [smalltalk.send(aCollection, "_size", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  360. return self;},
  361. args: ["aCollection"],
  362. 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'),
  363. messageSends: ["setCollection:", "setStreamSize:", "size", "yourself", "new"],
  364. referencedClasses: []
  365. }),
  366. smalltalk.Stream.klass);
  367. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
  368. smalltalk.addMethod(
  369. unescape('__eq'),
  370. smalltalk.method({
  371. selector: unescape('%3D'),
  372. category: 'comparing',
  373. fn: function (anAssociation){
  374. var self=this;
  375. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(anAssociation, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_key", []), "__eq", [smalltalk.send(anAssociation, "_key", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_value", []), "__eq", [smalltalk.send(anAssociation, "_value", [])]);})]);})]);
  376. return self;},
  377. args: ["anAssociation"],
  378. 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'),
  379. messageSends: ["and:", unescape("%3D"), "class", "key", "value"],
  380. referencedClasses: []
  381. }),
  382. smalltalk.Association);
  383. smalltalk.addMethod(
  384. unescape('_key_'),
  385. smalltalk.method({
  386. selector: unescape('key%3A'),
  387. category: 'accessing',
  388. fn: function (aKey){
  389. var self=this;
  390. (self['@key']=aKey);
  391. return self;},
  392. args: ["aKey"],
  393. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey'),
  394. messageSends: [],
  395. referencedClasses: []
  396. }),
  397. smalltalk.Association);
  398. smalltalk.addMethod(
  399. unescape('_key'),
  400. smalltalk.method({
  401. selector: unescape('key'),
  402. category: 'accessing',
  403. fn: function (){
  404. var self=this;
  405. return self['@key'];
  406. return self;},
  407. args: [],
  408. source: unescape('key%0A%09%5Ekey'),
  409. messageSends: [],
  410. referencedClasses: []
  411. }),
  412. smalltalk.Association);
  413. smalltalk.addMethod(
  414. unescape('_value_'),
  415. smalltalk.method({
  416. selector: unescape('value%3A'),
  417. category: 'accessing',
  418. fn: function (aValue){
  419. var self=this;
  420. (self['@value']=aValue);
  421. return self;},
  422. args: ["aValue"],
  423. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue'),
  424. messageSends: [],
  425. referencedClasses: []
  426. }),
  427. smalltalk.Association);
  428. smalltalk.addMethod(
  429. unescape('_value'),
  430. smalltalk.method({
  431. selector: unescape('value'),
  432. category: 'accessing',
  433. fn: function (){
  434. var self=this;
  435. return self['@value'];
  436. return self;},
  437. args: [],
  438. source: unescape('value%0A%09%5Evalue'),
  439. messageSends: [],
  440. referencedClasses: []
  441. }),
  442. smalltalk.Association);
  443. smalltalk.addMethod(
  444. unescape('_storeOn_'),
  445. smalltalk.method({
  446. selector: unescape('storeOn%3A'),
  447. category: 'comparing',
  448. fn: function (aStream){
  449. var self=this;
  450. smalltalk.send(self['@key'], "_storeOn_", [aStream]);
  451. smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
  452. smalltalk.send(self['@value'], "_storeOn_", [aStream]);
  453. return self;},
  454. args: ["aStream"],
  455. source: unescape('storeOn%3A%20aStream%0A%09%22Store%20in%20the%20format%20%28key-%3Evalue%29%22%0A%0A%09%22aStream%20nextPutAll%3A%20%27%28%27.%22%0A%09key%20storeOn%3A%20aStream.%0A%09aStream%20nextPutAll%3A%20%27-%3E%27.%0A%09value%20storeOn%3A%20aStream.%0A%09%22aStream%20nextPutAll%3A%20%27%29%27%22'),
  456. messageSends: ["storeOn:", "nextPutAll:"],
  457. referencedClasses: []
  458. }),
  459. smalltalk.Association);
  460. smalltalk.addMethod(
  461. unescape('_key_value_'),
  462. smalltalk.method({
  463. selector: unescape('key%3Avalue%3A'),
  464. category: 'instance creation',
  465. fn: function (aKey, aValue){
  466. var self=this;
  467. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  468. return self;},
  469. args: ["aKey", "aValue"],
  470. 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'),
  471. messageSends: ["key:", "value:", "yourself", "new"],
  472. referencedClasses: []
  473. }),
  474. smalltalk.Association.klass);
  475. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  476. smalltalk.addMethod(
  477. unescape('_compile_'),
  478. smalltalk.method({
  479. selector: unescape('compile%3A'),
  480. category: 'evaluating',
  481. fn: function (aString){
  482. var self=this;
  483. return self.compile(aString);
  484. return self;},
  485. args: ["aString"],
  486. source: unescape('compile%3A%20aString%0A%09%3Creturn%20self.compile%28aString%29%3E'),
  487. messageSends: [],
  488. referencedClasses: []
  489. }),
  490. smalltalk.RegularExpression);
  491. smalltalk.addMethod(
  492. unescape('_exec_'),
  493. smalltalk.method({
  494. selector: unescape('exec%3A'),
  495. category: 'evaluating',
  496. fn: function (aString){
  497. var self=this;
  498. return self.exec(aString) || nil;
  499. return self;},
  500. args: ["aString"],
  501. source: unescape('exec%3A%20aString%0A%09%3Creturn%20self.exec%28aString%29%20%7C%7C%20nil%3E'),
  502. messageSends: [],
  503. referencedClasses: []
  504. }),
  505. smalltalk.RegularExpression);
  506. smalltalk.addMethod(
  507. unescape('_test_'),
  508. smalltalk.method({
  509. selector: unescape('test%3A'),
  510. category: 'evaluating',
  511. fn: function (aString){
  512. var self=this;
  513. return self.test(aString);
  514. return self;},
  515. args: ["aString"],
  516. source: unescape('test%3A%20aString%0A%09%3Creturn%20self.test%28aString%29%3E'),
  517. messageSends: [],
  518. referencedClasses: []
  519. }),
  520. smalltalk.RegularExpression);
  521. smalltalk.addMethod(
  522. unescape('_fromString_flag_'),
  523. smalltalk.method({
  524. selector: unescape('fromString%3Aflag%3A'),
  525. category: 'instance creation',
  526. fn: function (aString, anotherString){
  527. var self=this;
  528. return new RegExp(aString, anotherString);
  529. return self;},
  530. args: ["aString", "anotherString"],
  531. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%3Creturn%20new%20RegExp%28aString%2C%20anotherString%29%3E'),
  532. messageSends: [],
  533. referencedClasses: []
  534. }),
  535. smalltalk.RegularExpression.klass);
  536. smalltalk.addMethod(
  537. unescape('_fromString_'),
  538. smalltalk.method({
  539. selector: unescape('fromString%3A'),
  540. category: 'instance creation',
  541. fn: function (aString){
  542. var self=this;
  543. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  544. return self;},
  545. args: ["aString"],
  546. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27'),
  547. messageSends: ["fromString:flag:"],
  548. referencedClasses: []
  549. }),
  550. smalltalk.RegularExpression.klass);
  551. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel-Collections');
  552. smalltalk.addMethod(
  553. unescape('_size'),
  554. smalltalk.method({
  555. selector: unescape('size'),
  556. category: 'accessing',
  557. fn: function (){
  558. var self=this;
  559. smalltalk.send(self, "_subclassResponsibility", []);
  560. return self;},
  561. args: [],
  562. source: unescape('size%0A%09self%20subclassResponsibility'),
  563. messageSends: ["subclassResponsibility"],
  564. referencedClasses: []
  565. }),
  566. smalltalk.Collection);
  567. smalltalk.addMethod(
  568. unescape('_readStream'),
  569. smalltalk.method({
  570. selector: unescape('readStream'),
  571. category: 'accessing',
  572. fn: function (){
  573. var self=this;
  574. return smalltalk.send(self, "_stream", []);
  575. return self;},
  576. args: [],
  577. source: unescape('readStream%0A%09%5Eself%20stream'),
  578. messageSends: ["stream"],
  579. referencedClasses: []
  580. }),
  581. smalltalk.Collection);
  582. smalltalk.addMethod(
  583. unescape('_writeStream'),
  584. smalltalk.method({
  585. selector: unescape('writeStream'),
  586. category: 'accessing',
  587. fn: function (){
  588. var self=this;
  589. return smalltalk.send(self, "_stream", []);
  590. return self;},
  591. args: [],
  592. source: unescape('writeStream%0A%09%5Eself%20stream'),
  593. messageSends: ["stream"],
  594. referencedClasses: []
  595. }),
  596. smalltalk.Collection);
  597. smalltalk.addMethod(
  598. unescape('_stream'),
  599. smalltalk.method({
  600. selector: unescape('stream'),
  601. category: 'accessing',
  602. fn: function (){
  603. var self=this;
  604. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  605. return self;},
  606. args: [],
  607. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self'),
  608. messageSends: ["on:", "streamClass"],
  609. referencedClasses: []
  610. }),
  611. smalltalk.Collection);
  612. smalltalk.addMethod(
  613. unescape('_streamClass'),
  614. smalltalk.method({
  615. selector: unescape('streamClass'),
  616. category: 'accessing',
  617. fn: function (){
  618. var self=this;
  619. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  620. return self;},
  621. args: [],
  622. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass'),
  623. messageSends: ["streamClass", "class"],
  624. referencedClasses: []
  625. }),
  626. smalltalk.Collection);
  627. smalltalk.addMethod(
  628. unescape('_add_'),
  629. smalltalk.method({
  630. selector: unescape('add%3A'),
  631. category: 'adding/removing',
  632. fn: function (anObject){
  633. var self=this;
  634. smalltalk.send(self, "_subclassResponsibility", []);
  635. return self;},
  636. args: ["anObject"],
  637. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility'),
  638. messageSends: ["subclassResponsibility"],
  639. referencedClasses: []
  640. }),
  641. smalltalk.Collection);
  642. smalltalk.addMethod(
  643. unescape('_addAll_'),
  644. smalltalk.method({
  645. selector: unescape('addAll%3A'),
  646. category: 'adding/removing',
  647. fn: function (aCollection){
  648. var self=this;
  649. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  650. return aCollection;
  651. return self;},
  652. args: ["aCollection"],
  653. 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'),
  654. messageSends: ["do:", "add:"],
  655. referencedClasses: []
  656. }),
  657. smalltalk.Collection);
  658. smalltalk.addMethod(
  659. unescape('__comma'),
  660. smalltalk.method({
  661. selector: unescape('%2C'),
  662. category: 'copying',
  663. fn: function (aCollection){
  664. var self=this;
  665. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  666. return self;},
  667. args: ["aCollection"],
  668. 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'),
  669. messageSends: ["addAll:", "yourself", "copy"],
  670. referencedClasses: []
  671. }),
  672. smalltalk.Collection);
  673. smalltalk.addMethod(
  674. unescape('_copyWith_'),
  675. smalltalk.method({
  676. selector: unescape('copyWith%3A'),
  677. category: 'copying',
  678. fn: function (anObject){
  679. var self=this;
  680. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  681. return self;},
  682. args: ["anObject"],
  683. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself'),
  684. messageSends: ["add:", "yourself", "copy"],
  685. referencedClasses: []
  686. }),
  687. smalltalk.Collection);
  688. smalltalk.addMethod(
  689. unescape('_copyWithAll_'),
  690. smalltalk.method({
  691. selector: unescape('copyWithAll%3A'),
  692. category: 'copying',
  693. fn: function (aCollection){
  694. var self=this;
  695. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  696. return self;},
  697. args: ["aCollection"],
  698. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself'),
  699. messageSends: ["addAll:", "yourself", "copy"],
  700. referencedClasses: []
  701. }),
  702. smalltalk.Collection);
  703. smalltalk.addMethod(
  704. unescape('_asArray'),
  705. smalltalk.method({
  706. selector: unescape('asArray'),
  707. category: 'converting',
  708. fn: function (){
  709. var self=this;
  710. return smalltalk.send((smalltalk.Array || Array), "_withAll_", [self]);
  711. return self;},
  712. args: [],
  713. source: unescape('asArray%0A%09%5EArray%20withAll%3A%20self'),
  714. messageSends: ["withAll:"],
  715. referencedClasses: ["Array"]
  716. }),
  717. smalltalk.Collection);
  718. smalltalk.addMethod(
  719. unescape('_do_'),
  720. smalltalk.method({
  721. selector: unescape('do%3A'),
  722. category: 'enumerating',
  723. fn: function (aBlock){
  724. var self=this;
  725. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  726. return self;},
  727. args: ["aBlock"],
  728. source: unescape('do%3A%20aBlock%0A%09%3Cfor%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%29%3B%7D%3E'),
  729. messageSends: [],
  730. referencedClasses: []
  731. }),
  732. smalltalk.Collection);
  733. smalltalk.addMethod(
  734. unescape('_collect_'),
  735. smalltalk.method({
  736. selector: unescape('collect%3A'),
  737. category: 'enumerating',
  738. fn: function (aBlock){
  739. var self=this;
  740. var newCollection=nil;
  741. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  742. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  743. return newCollection;
  744. return self;},
  745. args: ["aBlock"],
  746. source: unescape('collect%3A%20aBlock%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20newCollection%20add%3A%20%28aBlock%20value%3A%20each%29%5D.%0A%09%5EnewCollection'),
  747. messageSends: ["new", "class", "do:", "add:", "value:"],
  748. referencedClasses: []
  749. }),
  750. smalltalk.Collection);
  751. smalltalk.addMethod(
  752. unescape('_detect_'),
  753. smalltalk.method({
  754. selector: unescape('detect%3A'),
  755. category: 'enumerating',
  756. fn: function (aBlock){
  757. var self=this;
  758. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  759. return self;},
  760. args: ["aBlock"],
  761. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D'),
  762. messageSends: ["detect:ifNone:", "errorNotFound"],
  763. referencedClasses: []
  764. }),
  765. smalltalk.Collection);
  766. smalltalk.addMethod(
  767. unescape('_detect_ifNone_'),
  768. smalltalk.method({
  769. selector: unescape('detect%3AifNone%3A'),
  770. category: 'enumerating',
  771. fn: function (aBlock, anotherBlock){
  772. var self=this;
  773. for(var i = 0; i < self.length; i++)
  774. if(aBlock(self[i]))
  775. return self[i];
  776. return anotherBlock();
  777. ;
  778. return self;},
  779. args: ["aBlock", "anotherBlock"],
  780. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%3C%0A%09%09for%28var%20i%20%3D%200%3B%20i%20%3C%20self.length%3B%20i++%29%0A%09%09%09if%28aBlock%28self%5Bi%5D%29%29%0A%09%09%09%09return%20self%5Bi%5D%3B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%3E'),
  781. messageSends: [],
  782. referencedClasses: []
  783. }),
  784. smalltalk.Collection);
  785. smalltalk.addMethod(
  786. unescape('_do_separatedBy_'),
  787. smalltalk.method({
  788. selector: unescape('do%3AseparatedBy%3A'),
  789. category: 'enumerating',
  790. fn: function (aBlock, anotherBlock){
  791. var self=this;
  792. var first=nil;
  793. (first=true);
  794. smalltalk.send(self, "_do_", [(function(each){((($receiver = first).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (first=false);})() : (function(){return smalltalk.send(anotherBlock, "_value", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (first=false);}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]));return smalltalk.send(aBlock, "_value_", [each]);})]);
  795. return self;},
  796. args: ["aBlock", "anotherBlock"],
  797. source: unescape('do%3A%20aBlock%20separatedBy%3A%20anotherBlock%0A%09%7C%20first%20%7C%0A%09first%20%3A%3D%20true.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20first%0A%09%09ifTrue%3A%20%5Bfirst%20%3A%3D%20false%5D%0A%09%09ifFalse%3A%20%5BanotherBlock%20value%5D.%0A%09%20%20%20%20aBlock%20value%3A%20each%5D'),
  798. messageSends: ["do:", "ifTrue:ifFalse:", "value", "value:"],
  799. referencedClasses: []
  800. }),
  801. smalltalk.Collection);
  802. smalltalk.addMethod(
  803. unescape('_inject_into_'),
  804. smalltalk.method({
  805. selector: unescape('inject%3Ainto%3A'),
  806. category: 'enumerating',
  807. fn: function (anObject, aBlock){
  808. var self=this;
  809. var result=nil;
  810. (result=anObject);
  811. smalltalk.send(self, "_do_", [(function(each){return (result=smalltalk.send(aBlock, "_value_value_", [result, each]));})]);
  812. return result;
  813. return self;},
  814. args: ["anObject", "aBlock"],
  815. 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'),
  816. messageSends: ["do:", "value:value:"],
  817. referencedClasses: []
  818. }),
  819. smalltalk.Collection);
  820. smalltalk.addMethod(
  821. unescape('_reject_'),
  822. smalltalk.method({
  823. selector: unescape('reject%3A'),
  824. category: 'enumerating',
  825. fn: function (aBlock){
  826. var self=this;
  827. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  828. return self;},
  829. args: ["aBlock"],
  830. 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'),
  831. messageSends: ["select:", unescape("%3D"), "value:"],
  832. referencedClasses: []
  833. }),
  834. smalltalk.Collection);
  835. smalltalk.addMethod(
  836. unescape('_select_'),
  837. smalltalk.method({
  838. selector: unescape('select%3A'),
  839. category: 'enumerating',
  840. fn: function (aBlock){
  841. var self=this;
  842. var stream=nil;
  843. (stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []));
  844. smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(stream, "_nextPut_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]));})]);
  845. return smalltalk.send(stream, "_contents", []);
  846. return self;},
  847. args: ["aBlock"],
  848. 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'),
  849. messageSends: ["writeStream", "new", "class", "do:", "ifTrue:", "value:", "nextPut:", "contents"],
  850. referencedClasses: []
  851. }),
  852. smalltalk.Collection);
  853. smalltalk.addMethod(
  854. unescape('_errorNotFound'),
  855. smalltalk.method({
  856. selector: unescape('errorNotFound'),
  857. category: 'error handling',
  858. fn: function (){
  859. var self=this;
  860. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  861. return self;},
  862. args: [],
  863. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27'),
  864. messageSends: ["error:"],
  865. referencedClasses: []
  866. }),
  867. smalltalk.Collection);
  868. smalltalk.addMethod(
  869. unescape('_includes_'),
  870. smalltalk.method({
  871. selector: unescape('includes%3A'),
  872. category: 'testing',
  873. fn: function (anObject){
  874. var self=this;
  875. var i = self.length;
  876. while (i--) {
  877. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  878. }
  879. return false
  880. ;
  881. return self;},
  882. args: ["anObject"],
  883. source: unescape('includes%3A%20anObject%0A%09%3C%0A%09%09var%20i%20%3D%20self.length%3B%0A%09%09while%20%28i--%29%20%7B%0A%09%09%09if%20%28smalltalk.send%28self%5Bi%5D%2C%20%22__eq%22%2C%20%5BanObject%5D%29%29%20%7Breturn%20true%3B%7D%09%0A%09%09%7D%0A%09%09return%20false%0A%09%3E'),
  884. messageSends: [],
  885. referencedClasses: []
  886. }),
  887. smalltalk.Collection);
  888. smalltalk.addMethod(
  889. unescape('_notEmpty'),
  890. smalltalk.method({
  891. selector: unescape('notEmpty'),
  892. category: 'testing',
  893. fn: function (){
  894. var self=this;
  895. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  896. return self;},
  897. args: [],
  898. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not'),
  899. messageSends: ["not", "isEmpty"],
  900. referencedClasses: []
  901. }),
  902. smalltalk.Collection);
  903. smalltalk.addMethod(
  904. unescape('_isEmpty'),
  905. smalltalk.method({
  906. selector: unescape('isEmpty'),
  907. category: 'testing',
  908. fn: function (){
  909. var self=this;
  910. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  911. return self;},
  912. args: [],
  913. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200'),
  914. messageSends: [unescape("%3D"), "size"],
  915. referencedClasses: []
  916. }),
  917. smalltalk.Collection);
  918. smalltalk.addMethod(
  919. unescape('_remove_'),
  920. smalltalk.method({
  921. selector: unescape('remove%3A'),
  922. category: 'adding/removing',
  923. fn: function (anObject){
  924. var self=this;
  925. return smalltalk.send(self, "_remove_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  926. return self;},
  927. args: ["anObject"],
  928. source: unescape('remove%3A%20anObject%0A%20%20%20%20%5Eself%20remove%3A%20anObject%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  929. messageSends: ["remove:ifAbsent:", "errorNotFound"],
  930. referencedClasses: []
  931. }),
  932. smalltalk.Collection);
  933. smalltalk.addMethod(
  934. unescape('_asSet'),
  935. smalltalk.method({
  936. selector: unescape('asSet'),
  937. category: 'converting',
  938. fn: function (){
  939. var self=this;
  940. return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
  941. return self;},
  942. args: [],
  943. source: unescape('asSet%0A%09%5ESet%20withAll%3A%20self'),
  944. messageSends: ["withAll:"],
  945. referencedClasses: ["Set"]
  946. }),
  947. smalltalk.Collection);
  948. smalltalk.addMethod(
  949. unescape('_ifNotEmpty_'),
  950. smalltalk.method({
  951. selector: unescape('ifNotEmpty%3A'),
  952. category: 'testing',
  953. fn: function (aBlock){
  954. var self=this;
  955. smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
  956. return self;},
  957. args: ["aBlock"],
  958. source: unescape('ifNotEmpty%3A%20aBlock%0A%09self%20notEmpty%20ifTrue%3A%20aBlock.'),
  959. messageSends: ["ifTrue:", "notEmpty"],
  960. referencedClasses: []
  961. }),
  962. smalltalk.Collection);
  963. smalltalk.addMethod(
  964. unescape('_ifEmpty_'),
  965. smalltalk.method({
  966. selector: unescape('ifEmpty%3A'),
  967. category: 'testing',
  968. fn: function (aBlock){
  969. var self=this;
  970. smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_ifTrue_", [aBlock]);
  971. return self;},
  972. args: ["aBlock"],
  973. source: unescape('ifEmpty%3A%20aBlock%0A%09self%20isEmpty%20ifTrue%3A%20aBlock.'),
  974. messageSends: ["ifTrue:", "isEmpty"],
  975. referencedClasses: []
  976. }),
  977. smalltalk.Collection);
  978. smalltalk.addMethod(
  979. unescape('_copyWithoutAll_'),
  980. smalltalk.method({
  981. selector: unescape('copyWithoutAll%3A'),
  982. category: 'copying',
  983. fn: function (aCollection){
  984. var self=this;
  985. return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
  986. return self;},
  987. args: ["aCollection"],
  988. source: unescape('copyWithoutAll%3A%20aCollection%0A%09%22Answer%20a%20copy%20of%20the%20receiver%20that%20does%20not%20contain%20any%20elements%20%0A%09equal%20to%20those%20in%20aCollection.%22%0A%0A%09%5E%20self%20reject%3A%20%5B%3Aeach%20%7C%20aCollection%20includes%3A%20each%5D'),
  989. messageSends: ["reject:", "includes:"],
  990. referencedClasses: []
  991. }),
  992. smalltalk.Collection);
  993. smalltalk.addMethod(
  994. unescape('_remove_ifAbsent_'),
  995. smalltalk.method({
  996. selector: unescape('remove%3AifAbsent%3A'),
  997. category: 'adding/removing',
  998. fn: function (anObject, aBlock){
  999. var self=this;
  1000. smalltalk.send(self, "_subclassResponsibility", []);
  1001. return self;},
  1002. args: ["anObject", "aBlock"],
  1003. source: unescape('remove%3A%20anObject%20ifAbsent%3A%20aBlock%0A%20%20%20%20self%20subclassResponsibility'),
  1004. messageSends: ["subclassResponsibility"],
  1005. referencedClasses: []
  1006. }),
  1007. smalltalk.Collection);
  1008. smalltalk.addMethod(
  1009. unescape('_asJSONString'),
  1010. smalltalk.method({
  1011. selector: unescape('asJSONString'),
  1012. category: 'converting',
  1013. fn: function (){
  1014. var self=this;
  1015. return smalltalk.send((smalltalk.JSON || JSON), "_stringify_", [smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJSONString", []);})])]);
  1016. return self;},
  1017. args: [],
  1018. source: unescape('asJSONString%0A%09%5EJSON%20stringify%3A%20%28self%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJSONString%5D%29'),
  1019. messageSends: ["stringify:", "collect:", "asJSONString"],
  1020. referencedClasses: ["JSON"]
  1021. }),
  1022. smalltalk.Collection);
  1023. smalltalk.addMethod(
  1024. unescape('_asOrderedCollection'),
  1025. smalltalk.method({
  1026. selector: unescape('asOrderedCollection'),
  1027. category: 'converting',
  1028. fn: function (){
  1029. var self=this;
  1030. return smalltalk.send(self, "_asArray", []);
  1031. return self;},
  1032. args: [],
  1033. source: unescape('asOrderedCollection%0A%09%5Eself%20asArray'),
  1034. messageSends: ["asArray"],
  1035. referencedClasses: []
  1036. }),
  1037. smalltalk.Collection);
  1038. smalltalk.addMethod(
  1039. unescape('_streamClass'),
  1040. smalltalk.method({
  1041. selector: unescape('streamClass'),
  1042. category: 'accessing',
  1043. fn: function (){
  1044. var self=this;
  1045. return (smalltalk.Stream || Stream);
  1046. return self;},
  1047. args: [],
  1048. source: unescape('streamClass%0A%09%20%20%20%20%5EStream'),
  1049. messageSends: [],
  1050. referencedClasses: ["Stream"]
  1051. }),
  1052. smalltalk.Collection.klass);
  1053. smalltalk.addMethod(
  1054. unescape('_with_'),
  1055. smalltalk.method({
  1056. selector: unescape('with%3A'),
  1057. category: 'instance creation',
  1058. fn: function (anObject){
  1059. var self=this;
  1060. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  1061. return self;},
  1062. args: ["anObject"],
  1063. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself'),
  1064. messageSends: ["add:", "yourself", "new"],
  1065. referencedClasses: []
  1066. }),
  1067. smalltalk.Collection.klass);
  1068. smalltalk.addMethod(
  1069. unescape('_with_with_'),
  1070. smalltalk.method({
  1071. selector: unescape('with%3Awith%3A'),
  1072. category: 'instance creation',
  1073. fn: function (anObject, anotherObject){
  1074. var self=this;
  1075. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  1076. return self;},
  1077. args: ["anObject", "anotherObject"],
  1078. 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'),
  1079. messageSends: ["add:", "yourself", "new"],
  1080. referencedClasses: []
  1081. }),
  1082. smalltalk.Collection.klass);
  1083. smalltalk.addMethod(
  1084. unescape('_with_with_with_'),
  1085. smalltalk.method({
  1086. selector: unescape('with%3Awith%3Awith%3A'),
  1087. category: 'instance creation',
  1088. fn: function (firstObject, secondObject, thirdObject){
  1089. var self=this;
  1090. return (function($rec){smalltalk.send($rec, "_add_", [firstObject]);smalltalk.send($rec, "_add_", [secondObject]);smalltalk.send($rec, "_add_", [thirdObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  1091. return self;},
  1092. args: ["firstObject", "secondObject", "thirdObject"],
  1093. 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'),
  1094. messageSends: ["add:", "yourself", "new"],
  1095. referencedClasses: []
  1096. }),
  1097. smalltalk.Collection.klass);
  1098. smalltalk.addMethod(
  1099. unescape('_withAll_'),
  1100. smalltalk.method({
  1101. selector: unescape('withAll%3A'),
  1102. category: 'instance creation',
  1103. fn: function (aCollection){
  1104. var self=this;
  1105. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  1106. return self;},
  1107. args: ["aCollection"],
  1108. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself'),
  1109. messageSends: ["addAll:", "yourself", "new"],
  1110. referencedClasses: []
  1111. }),
  1112. smalltalk.Collection.klass);
  1113. smalltalk.addMethod(
  1114. unescape('_new_'),
  1115. smalltalk.method({
  1116. selector: unescape('new%3A'),
  1117. category: 'instance creation',
  1118. fn: function (anInteger){
  1119. var self=this;
  1120. return smalltalk.send(self, "_new", []);
  1121. return self;},
  1122. args: ["anInteger"],
  1123. source: unescape('new%3A%20anInteger%0A%09%5Eself%20new'),
  1124. messageSends: ["new"],
  1125. referencedClasses: []
  1126. }),
  1127. smalltalk.Collection.klass);
  1128. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel-Collections');
  1129. smalltalk.addMethod(
  1130. unescape('_at_'),
  1131. smalltalk.method({
  1132. selector: unescape('at%3A'),
  1133. category: 'accessing',
  1134. fn: function (anIndex){
  1135. var self=this;
  1136. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  1137. return self;},
  1138. args: ["anIndex"],
  1139. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D'),
  1140. messageSends: ["at:ifAbsent:", "errorNotFound"],
  1141. referencedClasses: []
  1142. }),
  1143. smalltalk.SequenceableCollection);
  1144. smalltalk.addMethod(
  1145. unescape('_at_ifAbsent_'),
  1146. smalltalk.method({
  1147. selector: unescape('at%3AifAbsent%3A'),
  1148. category: 'accessing',
  1149. fn: function (anIndex, aBlock){
  1150. var self=this;
  1151. smalltalk.send(self, "_subclassResponsibility", []);
  1152. return self;},
  1153. args: ["anIndex", "aBlock"],
  1154. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility'),
  1155. messageSends: ["subclassResponsibility"],
  1156. referencedClasses: []
  1157. }),
  1158. smalltalk.SequenceableCollection);
  1159. smalltalk.addMethod(
  1160. unescape('_at_put_'),
  1161. smalltalk.method({
  1162. selector: unescape('at%3Aput%3A'),
  1163. category: 'accessing',
  1164. fn: function (anIndex, anObject){
  1165. var self=this;
  1166. smalltalk.send(self, "_subclassResponsibility", []);
  1167. return self;},
  1168. args: ["anIndex", "anObject"],
  1169. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility'),
  1170. messageSends: ["subclassResponsibility"],
  1171. referencedClasses: []
  1172. }),
  1173. smalltalk.SequenceableCollection);
  1174. smalltalk.addMethod(
  1175. unescape('_copyFrom_to_'),
  1176. smalltalk.method({
  1177. selector: unescape('copyFrom%3Ato%3A'),
  1178. category: 'copying',
  1179. fn: function (anIndex, anotherIndex){
  1180. var self=this;
  1181. var range=nil;
  1182. var newCollection=nil;
  1183. (range=smalltalk.send(anIndex, "_to_", [anotherIndex]));
  1184. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(range, "_size", [])]));
  1185. smalltalk.send(range, "_withIndexDo_", [(function(each, i){return smalltalk.send(newCollection, "_at_put_", [i, smalltalk.send(self, "_at_", [each])]);})]);
  1186. return newCollection;
  1187. return self;},
  1188. args: ["anIndex", "anotherIndex"],
  1189. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7C%20range%20newCollection%20%7C%0A%09range%20%3A%3D%20anIndex%20to%3A%20anotherIndex.%0A%09newCollection%20%3A%3D%20self%20class%20new%3A%20range%20size.%0A%09range%20withIndexDo%3A%20%5B%3Aeach%20%3Ai%20%7C%0A%09%20%20%20%20newCollection%20at%3A%20i%20put%3A%20%28self%20at%3A%20each%29%5D.%0A%09%5EnewCollection'),
  1190. messageSends: ["to:", "new:", "class", "size", "withIndexDo:", "at:put:", "at:"],
  1191. referencedClasses: []
  1192. }),
  1193. smalltalk.SequenceableCollection);
  1194. smalltalk.addMethod(
  1195. unescape('_first'),
  1196. smalltalk.method({
  1197. selector: unescape('first'),
  1198. category: 'accessing',
  1199. fn: function (){
  1200. var self=this;
  1201. return smalltalk.send(self, "_at_", [(1)]);
  1202. return self;},
  1203. args: [],
  1204. source: unescape('first%0A%09%5Eself%20at%3A%201'),
  1205. messageSends: ["at:"],
  1206. referencedClasses: []
  1207. }),
  1208. smalltalk.SequenceableCollection);
  1209. smalltalk.addMethod(
  1210. unescape('_fourth'),
  1211. smalltalk.method({
  1212. selector: unescape('fourth'),
  1213. category: 'accessing',
  1214. fn: function (){
  1215. var self=this;
  1216. return smalltalk.send(self, "_at_", [(4)]);
  1217. return self;},
  1218. args: [],
  1219. source: unescape('fourth%0A%09%5Eself%20at%3A%204'),
  1220. messageSends: ["at:"],
  1221. referencedClasses: []
  1222. }),
  1223. smalltalk.SequenceableCollection);
  1224. smalltalk.addMethod(
  1225. unescape('_last'),
  1226. smalltalk.method({
  1227. selector: unescape('last'),
  1228. category: 'accessing',
  1229. fn: function (){
  1230. var self=this;
  1231. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  1232. return self;},
  1233. args: [],
  1234. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size'),
  1235. messageSends: ["at:", "size"],
  1236. referencedClasses: []
  1237. }),
  1238. smalltalk.SequenceableCollection);
  1239. smalltalk.addMethod(
  1240. unescape('_second'),
  1241. smalltalk.method({
  1242. selector: unescape('second'),
  1243. category: 'accessing',
  1244. fn: function (){
  1245. var self=this;
  1246. return smalltalk.send(self, "_at_", [(2)]);
  1247. return self;},
  1248. args: [],
  1249. source: unescape('second%0A%09%5Eself%20at%3A%202'),
  1250. messageSends: ["at:"],
  1251. referencedClasses: []
  1252. }),
  1253. smalltalk.SequenceableCollection);
  1254. smalltalk.addMethod(
  1255. unescape('_third'),
  1256. smalltalk.method({
  1257. selector: unescape('third'),
  1258. category: 'accessing',
  1259. fn: function (){
  1260. var self=this;
  1261. return smalltalk.send(self, "_at_", [(3)]);
  1262. return self;},
  1263. args: [],
  1264. source: unescape('third%0A%09%5Eself%20at%3A%203'),
  1265. messageSends: ["at:"],
  1266. referencedClasses: []
  1267. }),
  1268. smalltalk.SequenceableCollection);
  1269. smalltalk.addMethod(
  1270. unescape('_removeLast'),
  1271. smalltalk.method({
  1272. selector: unescape('removeLast'),
  1273. category: 'adding',
  1274. fn: function (){
  1275. var self=this;
  1276. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  1277. return self;},
  1278. args: [],
  1279. source: unescape('removeLast%0A%09self%20remove%3A%20self%20last'),
  1280. messageSends: ["remove:", "last"],
  1281. referencedClasses: []
  1282. }),
  1283. smalltalk.SequenceableCollection);
  1284. smalltalk.addMethod(
  1285. unescape('_addLast_'),
  1286. smalltalk.method({
  1287. selector: unescape('addLast%3A'),
  1288. category: 'adding',
  1289. fn: function (anObject){
  1290. var self=this;
  1291. smalltalk.send(self, "_add_", [anObject]);
  1292. return self;},
  1293. args: ["anObject"],
  1294. source: unescape('addLast%3A%20anObject%0A%09self%20add%3A%20anObject'),
  1295. messageSends: ["add:"],
  1296. referencedClasses: []
  1297. }),
  1298. smalltalk.SequenceableCollection);
  1299. smalltalk.addMethod(
  1300. unescape('_withIndexDo_'),
  1301. smalltalk.method({
  1302. selector: unescape('withIndexDo%3A'),
  1303. category: 'enumerating',
  1304. fn: function (aBlock){
  1305. var self=this;
  1306. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  1307. return self;},
  1308. args: ["aBlock"],
  1309. source: unescape('withIndexDo%3A%20aBlock%0A%09%3Cfor%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%2C%20i+1%29%3B%7D%3E'),
  1310. messageSends: [],
  1311. referencedClasses: []
  1312. }),
  1313. smalltalk.SequenceableCollection);
  1314. smalltalk.addMethod(
  1315. unescape('_allButFirst'),
  1316. smalltalk.method({
  1317. selector: unescape('allButFirst'),
  1318. category: 'accessing',
  1319. fn: function (){
  1320. var self=this;
  1321. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  1322. return self;},
  1323. args: [],
  1324. source: unescape('allButFirst%0A%09%5Eself%20copyFrom%3A%202%20to%3A%20self%20size'),
  1325. messageSends: ["copyFrom:to:", "size"],
  1326. referencedClasses: []
  1327. }),
  1328. smalltalk.SequenceableCollection);
  1329. smalltalk.addMethod(
  1330. unescape('_allButLast'),
  1331. smalltalk.method({
  1332. selector: unescape('allButLast'),
  1333. category: 'accessing',
  1334. fn: function (){
  1335. var self=this;
  1336. return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
  1337. return self;},
  1338. args: [],
  1339. source: unescape('allButLast%0A%09%5Eself%20copyFrom%3A%201%20to%3A%20self%20size%20-%201'),
  1340. messageSends: ["copyFrom:to:", unescape("-"), "size"],
  1341. referencedClasses: []
  1342. }),
  1343. smalltalk.SequenceableCollection);
  1344. smalltalk.addMethod(
  1345. unescape('_indexOf_'),
  1346. smalltalk.method({
  1347. selector: unescape('indexOf%3A'),
  1348. category: 'accessing',
  1349. fn: function (anObject){
  1350. var self=this;
  1351. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  1352. return self;},
  1353. args: ["anObject"],
  1354. source: unescape('indexOf%3A%20anObject%0A%09%5Eself%20indexOf%3A%20anObject%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  1355. messageSends: ["indexOf:ifAbsent:", "errorNotFound"],
  1356. referencedClasses: []
  1357. }),
  1358. smalltalk.SequenceableCollection);
  1359. smalltalk.addMethod(
  1360. unescape('_indexOf_ifAbsent_'),
  1361. smalltalk.method({
  1362. selector: unescape('indexOf%3AifAbsent%3A'),
  1363. category: 'accessing',
  1364. fn: function (anObject, aBlock){
  1365. var self=this;
  1366. for(var i=0;i<self.length;i++){
  1367. if(self[i].__eq(anObject)) {return i+1}
  1368. }
  1369. return aBlock();
  1370. ;
  1371. return self;},
  1372. args: ["anObject", "aBlock"],
  1373. source: unescape('indexOf%3A%20anObject%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7B%0A%09%09%09if%28self%5Bi%5D.__eq%28anObject%29%29%20%7Breturn%20i+1%7D%0A%09%09%7D%0A%09%09return%20aBlock%28%29%3B%0A%09%3E'),
  1374. messageSends: [],
  1375. referencedClasses: []
  1376. }),
  1377. smalltalk.SequenceableCollection);
  1378. smalltalk.addMethod(
  1379. unescape('_indexOf_startingAt_ifAbsent_'),
  1380. smalltalk.method({
  1381. selector: unescape('indexOf%3AstartingAt%3AifAbsent%3A'),
  1382. category: 'accessing',
  1383. fn: function (anObject, start, aBlock){
  1384. var self=this;
  1385. for(var i=start-1;i<self.length;i++){
  1386. if(self[i].__eq(anObject)) {return i+1}
  1387. }
  1388. return aBlock();
  1389. ;
  1390. return self;},
  1391. args: ["anObject", "start", "aBlock"],
  1392. source: unescape('indexOf%3A%20anObject%20startingAt%3A%20start%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%09for%28var%20i%3Dstart-1%3Bi%3Cself.length%3Bi++%29%7B%0A%09%09%09if%28self%5Bi%5D.__eq%28anObject%29%29%20%7Breturn%20i+1%7D%0A%09%09%7D%0A%09%09return%20aBlock%28%29%3B%0A%09%3E'),
  1393. messageSends: [],
  1394. referencedClasses: []
  1395. }),
  1396. smalltalk.SequenceableCollection);
  1397. smalltalk.addMethod(
  1398. unescape('_indexOf_startingAt_'),
  1399. smalltalk.method({
  1400. selector: unescape('indexOf%3AstartingAt%3A'),
  1401. category: 'accessing',
  1402. fn: function (anObject, start){
  1403. var self=this;
  1404. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  1405. return self;},
  1406. args: ["anObject", "start"],
  1407. source: unescape('indexOf%3A%20anObject%20startingAt%3A%20start%0A%09%22Answer%20the%20index%20of%20the%20first%20occurence%20of%20anElement%20after%20start%0A%09within%20the%20receiver.%20If%20the%20receiver%20does%20not%20contain%20anElement%2C%20%0A%09answer%200.%22%0A%09%5Eself%20indexOf%3A%20anObject%20startingAt%3A%20start%20ifAbsent%3A%20%5B0%5D'),
  1408. messageSends: ["indexOf:startingAt:ifAbsent:"],
  1409. referencedClasses: []
  1410. }),
  1411. smalltalk.SequenceableCollection);
  1412. smalltalk.addMethod(
  1413. unescape('_reversed'),
  1414. smalltalk.method({
  1415. selector: unescape('reversed'),
  1416. category: 'converting',
  1417. fn: function (){
  1418. var self=this;
  1419. smalltalk.send(self, "_subclassResponsibility", []);
  1420. return self;},
  1421. args: [],
  1422. source: unescape('reversed%0A%09self%20subclassResponsibility'),
  1423. messageSends: ["subclassResponsibility"],
  1424. referencedClasses: []
  1425. }),
  1426. smalltalk.SequenceableCollection);
  1427. smalltalk.addMethod(
  1428. unescape('_atRandom'),
  1429. smalltalk.method({
  1430. selector: unescape('atRandom'),
  1431. category: 'accessing',
  1432. fn: function (){
  1433. var self=this;
  1434. return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
  1435. return self;},
  1436. args: [],
  1437. source: unescape('atRandom%0A%09%5E%20self%20at%3A%20self%20size%20atRandom'),
  1438. messageSends: ["at:", "atRandom", "size"],
  1439. referencedClasses: []
  1440. }),
  1441. smalltalk.SequenceableCollection);
  1442. smalltalk.addMethod(
  1443. unescape('__eq'),
  1444. smalltalk.method({
  1445. selector: unescape('%3D'),
  1446. category: 'comparing',
  1447. fn: function (aCollection){
  1448. var self=this;
  1449. try{((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aCollection, "_size", [])]);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  1450. smalltalk.send(self, "_withIndexDo_", [(function(each, i){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_at_", [i]), "__eq", [each])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));})]);
  1451. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  1452. return self;
  1453. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  1454. args: ["aCollection"],
  1455. source: unescape('%3D%20aCollection%0A%09%28self%20class%20%3D%20aCollection%20class%20and%3A%20%5B%0A%09%09self%20size%20%3D%20aCollection%20size%5D%29%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20withIndexDo%3A%20%5B%3Aeach%20%3Ai%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28aCollection%20at%3A%20i%29%20%3D%20each%20ifFalse%3A%20%5B%5Efalse%5D%5D.%0A%09%5Etrue'),
  1456. messageSends: ["ifFalse:", "and:", unescape("%3D"), "class", "size", "withIndexDo:", "at:"],
  1457. referencedClasses: []
  1458. }),
  1459. smalltalk.SequenceableCollection);
  1460. smalltalk.addMethod(
  1461. unescape('_shallowCopy'),
  1462. smalltalk.method({
  1463. selector: unescape('shallowCopy'),
  1464. category: 'copying',
  1465. fn: function (){
  1466. var self=this;
  1467. var newCollection=nil;
  1468. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
  1469. smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, each]);})]);
  1470. return newCollection;
  1471. return self;},
  1472. args: [],
  1473. source: unescape('shallowCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new%3A%20self%20size.%0A%09self%20withIndexDo%3A%20%5B%20%3Aeach%20%3Aindex%20%7C%20%0A%09%09newCollection%20at%3A%20index%20put%3A%20each%5D.%0A%09%5EnewCollection'),
  1474. messageSends: ["new:", "class", "size", "withIndexDo:", "at:put:"],
  1475. referencedClasses: []
  1476. }),
  1477. smalltalk.SequenceableCollection);
  1478. smalltalk.addMethod(
  1479. unescape('_deepCopy'),
  1480. smalltalk.method({
  1481. selector: unescape('deepCopy'),
  1482. category: 'copying',
  1483. fn: function (){
  1484. var self=this;
  1485. var newCollection=nil;
  1486. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
  1487. smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, smalltalk.send(each, "_deepCopy", [])]);})]);
  1488. return newCollection;
  1489. return self;},
  1490. args: [],
  1491. source: unescape('deepCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new%3A%20self%20size.%0A%09self%20withIndexDo%3A%20%5B%3Aeach%20%3Aindex%20%7C%20%0A%09%09newCollection%20at%3A%20index%20put%3A%20each%20deepCopy%5D.%0A%09%5EnewCollection'),
  1492. messageSends: ["new:", "class", "size", "withIndexDo:", "at:put:", "deepCopy"],
  1493. referencedClasses: []
  1494. }),
  1495. smalltalk.SequenceableCollection);
  1496. smalltalk.addMethod(
  1497. unescape('_printString'),
  1498. smalltalk.method({
  1499. selector: unescape('printString'),
  1500. category: 'printing',
  1501. fn: function (){
  1502. var self=this;
  1503. var str=nil;
  1504. (str=smalltalk.send("", "_writeStream", []));
  1505. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Collection), "__comma", [unescape("%20%28")])]);
  1506. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  1507. smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
  1508. return smalltalk.send(str, "_contents", []);
  1509. return self;},
  1510. args: [],
  1511. source: unescape('printString%0A%09%7C%20str%20%7C%0A%09str%20%3A%3D%20%27%27%20writeStream.%0A%09str%20nextPutAll%3A%20super%20printString%2C%20%27%20%28%27.%0A%09self%20%0A%09%09do%3A%20%5B%3Aeach%20%7C%20str%20nextPutAll%3A%20each%20printString%5D%0A%09%09separatedBy%3A%20%5Bstr%20nextPutAll%3A%20%27%20%27%5D.%0A%09str%20nextPutAll%3A%20%27%29%27.%0A%09%5Estr%20contents'),
  1512. messageSends: ["writeStream", "nextPutAll:", unescape("%2C"), "printString", "do:separatedBy:", "contents"],
  1513. referencedClasses: []
  1514. }),
  1515. smalltalk.SequenceableCollection);
  1516. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  1517. smalltalk.addMethod(
  1518. unescape('_at_put_'),
  1519. smalltalk.method({
  1520. selector: unescape('at%3Aput%3A'),
  1521. category: 'accessing',
  1522. fn: function (anIndex, anObject){
  1523. var self=this;
  1524. smalltalk.send(self, "_errorReadOnly", []);
  1525. return self;},
  1526. args: ["anIndex", "anObject"],
  1527. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20errorReadOnly'),
  1528. messageSends: ["errorReadOnly"],
  1529. referencedClasses: []
  1530. }),
  1531. smalltalk.CharacterArray);
  1532. smalltalk.addMethod(
  1533. unescape('_add_'),
  1534. smalltalk.method({
  1535. selector: unescape('add%3A'),
  1536. category: 'adding',
  1537. fn: function (anObject){
  1538. var self=this;
  1539. smalltalk.send(self, "_errorReadOnly", []);
  1540. return self;},
  1541. args: ["anObject"],
  1542. source: unescape('add%3A%20anObject%0A%09self%20errorReadOnly'),
  1543. messageSends: ["errorReadOnly"],
  1544. referencedClasses: []
  1545. }),
  1546. smalltalk.CharacterArray);
  1547. smalltalk.addMethod(
  1548. unescape('__comma'),
  1549. smalltalk.method({
  1550. selector: unescape('%2C'),
  1551. category: 'copying',
  1552. fn: function (aString){
  1553. var self=this;
  1554. return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", [smalltalk.send(aString, "_asString", [])]);
  1555. return self;},
  1556. args: ["aString"],
  1557. source: unescape('%2C%20aString%0A%09%5Eself%20asString%2C%20aString%20asString'),
  1558. messageSends: [unescape("%2C"), "asString"],
  1559. referencedClasses: []
  1560. }),
  1561. smalltalk.CharacterArray);
  1562. smalltalk.addMethod(
  1563. unescape('_asString'),
  1564. smalltalk.method({
  1565. selector: unescape('asString'),
  1566. category: 'converting',
  1567. fn: function (){
  1568. var self=this;
  1569. return smalltalk.send(self, "_subclassResponsibility", []);
  1570. return self;},
  1571. args: [],
  1572. source: unescape('asString%0A%09%5Eself%20subclassResponsibility'),
  1573. messageSends: ["subclassResponsibility"],
  1574. referencedClasses: []
  1575. }),
  1576. smalltalk.CharacterArray);
  1577. smalltalk.addMethod(
  1578. unescape('_asNumber'),
  1579. smalltalk.method({
  1580. selector: unescape('asNumber'),
  1581. category: 'converting',
  1582. fn: function (){
  1583. var self=this;
  1584. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asNumber", []);
  1585. return self;},
  1586. args: [],
  1587. source: unescape('asNumber%0A%09%5Eself%20asString%20asNumber'),
  1588. messageSends: ["asNumber", "asString"],
  1589. referencedClasses: []
  1590. }),
  1591. smalltalk.CharacterArray);
  1592. smalltalk.addMethod(
  1593. unescape('_errorReadOnly'),
  1594. smalltalk.method({
  1595. selector: unescape('errorReadOnly'),
  1596. category: 'error handling',
  1597. fn: function (){
  1598. var self=this;
  1599. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  1600. return self;},
  1601. args: [],
  1602. source: unescape('errorReadOnly%0A%09self%20error%3A%20%27Object%20is%20read-only%27'),
  1603. messageSends: ["error:"],
  1604. referencedClasses: []
  1605. }),
  1606. smalltalk.CharacterArray);
  1607. smalltalk.addMethod(
  1608. unescape('_printString'),
  1609. smalltalk.method({
  1610. selector: unescape('printString'),
  1611. category: 'printing',
  1612. fn: function (){
  1613. var self=this;
  1614. return smalltalk.send(smalltalk.send(self, "_asString", []), "_printString", []);
  1615. return self;},
  1616. args: [],
  1617. source: unescape('printString%0A%09%5Eself%20asString%20printString'),
  1618. messageSends: ["printString", "asString"],
  1619. referencedClasses: []
  1620. }),
  1621. smalltalk.CharacterArray);
  1622. smalltalk.addMethod(
  1623. unescape('_remove_'),
  1624. smalltalk.method({
  1625. selector: unescape('remove%3A'),
  1626. category: 'adding',
  1627. fn: function (anObject){
  1628. var self=this;
  1629. smalltalk.send(self, "_errorReadOnly", []);
  1630. return self;},
  1631. args: ["anObject"],
  1632. source: unescape('remove%3A%20anObject%0A%09self%20errorReadOnly'),
  1633. messageSends: ["errorReadOnly"],
  1634. referencedClasses: []
  1635. }),
  1636. smalltalk.CharacterArray);
  1637. smalltalk.addMethod(
  1638. unescape('_asUppercase'),
  1639. smalltalk.method({
  1640. selector: unescape('asUppercase'),
  1641. category: 'converting',
  1642. fn: function (){
  1643. var self=this;
  1644. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asUppercase", [])]);
  1645. return self;},
  1646. args: [],
  1647. source: unescape('asUppercase%0A%09%5Eself%20class%20fromString%3A%20self%20asString%20asUppercase'),
  1648. messageSends: ["fromString:", "class", "asUppercase", "asString"],
  1649. referencedClasses: []
  1650. }),
  1651. smalltalk.CharacterArray);
  1652. smalltalk.addMethod(
  1653. unescape('_asSymbol'),
  1654. smalltalk.method({
  1655. selector: unescape('asSymbol'),
  1656. category: 'converting',
  1657. fn: function (){
  1658. var self=this;
  1659. return smalltalk.send(self, "_subclassResponsibility", []);
  1660. return self;},
  1661. args: [],
  1662. source: unescape('asSymbol%0A%09%5Eself%20subclassResponsibility'),
  1663. messageSends: ["subclassResponsibility"],
  1664. referencedClasses: []
  1665. }),
  1666. smalltalk.CharacterArray);
  1667. smalltalk.addMethod(
  1668. unescape('_asLowercase'),
  1669. smalltalk.method({
  1670. selector: unescape('asLowercase'),
  1671. category: 'converting',
  1672. fn: function (){
  1673. var self=this;
  1674. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asLowercase", [])]);
  1675. return self;},
  1676. args: [],
  1677. source: unescape('asLowercase%0A%09%5Eself%20class%20fromString%3A%20self%20asString%20asLowercase'),
  1678. messageSends: ["fromString:", "class", "asLowercase", "asString"],
  1679. referencedClasses: []
  1680. }),
  1681. smalltalk.CharacterArray);
  1682. smalltalk.addMethod(
  1683. unescape('_fromString_'),
  1684. smalltalk.method({
  1685. selector: unescape('fromString%3A'),
  1686. category: 'instance creation',
  1687. fn: function (aString){
  1688. var self=this;
  1689. smalltalk.send(self, "_subclassResponsibility", []);
  1690. return self;},
  1691. args: ["aString"],
  1692. source: unescape('fromString%3A%20aString%0A%09self%20subclassResponsibility'),
  1693. messageSends: ["subclassResponsibility"],
  1694. referencedClasses: []
  1695. }),
  1696. smalltalk.CharacterArray.klass);
  1697. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  1698. smalltalk.addMethod(
  1699. unescape('__eq'),
  1700. smalltalk.method({
  1701. selector: unescape('%3D'),
  1702. category: 'comparing',
  1703. fn: function (aString){
  1704. var self=this;
  1705. try{((($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  1706. return String(self) === String(aString);
  1707. return self;
  1708. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  1709. args: ["aString"],
  1710. source: unescape('%3D%20aString%0A%09aString%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20String%28self%29%20%3D%3D%3D%20String%28aString%29%3E'),
  1711. messageSends: ["ifFalse:", unescape("%3D"), "class"],
  1712. referencedClasses: []
  1713. }),
  1714. smalltalk.String);
  1715. smalltalk.addMethod(
  1716. unescape('_size'),
  1717. smalltalk.method({
  1718. selector: unescape('size'),
  1719. category: 'accessing',
  1720. fn: function (){
  1721. var self=this;
  1722. return self.length;
  1723. return self;},
  1724. args: [],
  1725. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  1726. messageSends: [],
  1727. referencedClasses: []
  1728. }),
  1729. smalltalk.String);
  1730. smalltalk.addMethod(
  1731. unescape('_at_ifAbsent_'),
  1732. smalltalk.method({
  1733. selector: unescape('at%3AifAbsent%3A'),
  1734. category: 'accessing',
  1735. fn: function (anIndex, aBlock){
  1736. var self=this;
  1737. return self[anIndex - 1] || aBlock();
  1738. return self;},
  1739. args: ["anIndex", "aBlock"],
  1740. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%7C%7C%20aBlock%28%29%3E'),
  1741. messageSends: [],
  1742. referencedClasses: []
  1743. }),
  1744. smalltalk.String);
  1745. smalltalk.addMethod(
  1746. unescape('_escaped'),
  1747. smalltalk.method({
  1748. selector: unescape('escaped'),
  1749. category: 'accessing',
  1750. fn: function (){
  1751. var self=this;
  1752. return escape(self);
  1753. return self;},
  1754. args: [],
  1755. source: unescape('escaped%0A%09%3Creturn%20escape%28self%29%3E'),
  1756. messageSends: [],
  1757. referencedClasses: []
  1758. }),
  1759. smalltalk.String);
  1760. smalltalk.addMethod(
  1761. unescape('_unescaped'),
  1762. smalltalk.method({
  1763. selector: unescape('unescaped'),
  1764. category: 'accessing',
  1765. fn: function (){
  1766. var self=this;
  1767. return unescape(self);
  1768. return self;},
  1769. args: [],
  1770. source: unescape('unescaped%0A%09%3Creturn%20unescape%28self%29%3E'),
  1771. messageSends: [],
  1772. referencedClasses: []
  1773. }),
  1774. smalltalk.String);
  1775. smalltalk.addMethod(
  1776. unescape('__comma'),
  1777. smalltalk.method({
  1778. selector: unescape('%2C'),
  1779. category: 'copying',
  1780. fn: function (aString){
  1781. var self=this;
  1782. return self + aString;
  1783. return self;},
  1784. args: ["aString"],
  1785. source: unescape('%2C%20aString%0A%09%3Creturn%20self%20+%20aString%3E'),
  1786. messageSends: [],
  1787. referencedClasses: []
  1788. }),
  1789. smalltalk.String);
  1790. smalltalk.addMethod(
  1791. unescape('_copyFrom_to_'),
  1792. smalltalk.method({
  1793. selector: unescape('copyFrom%3Ato%3A'),
  1794. category: 'copying',
  1795. fn: function (anIndex, anotherIndex){
  1796. var self=this;
  1797. return self.substring(anIndex - 1, anotherIndex);
  1798. return self;},
  1799. args: ["anIndex", "anotherIndex"],
  1800. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%3Creturn%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3E'),
  1801. messageSends: [],
  1802. referencedClasses: []
  1803. }),
  1804. smalltalk.String);
  1805. smalltalk.addMethod(
  1806. unescape('_shallowCopy'),
  1807. smalltalk.method({
  1808. selector: unescape('shallowCopy'),
  1809. category: 'copying',
  1810. fn: function (){
  1811. var self=this;
  1812. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  1813. return self;},
  1814. args: [],
  1815. source: unescape('shallowCopy%0A%09%5Eself%20class%20fromString%3A%20self'),
  1816. messageSends: ["fromString:", "class"],
  1817. referencedClasses: []
  1818. }),
  1819. smalltalk.String);
  1820. smalltalk.addMethod(
  1821. unescape('_deepCopy'),
  1822. smalltalk.method({
  1823. selector: unescape('deepCopy'),
  1824. category: 'copying',
  1825. fn: function (){
  1826. var self=this;
  1827. return smalltalk.send(self, "_shallowCopy", []);
  1828. return self;},
  1829. args: [],
  1830. source: unescape('deepCopy%0A%09%5Eself%20shallowCopy'),
  1831. messageSends: ["shallowCopy"],
  1832. referencedClasses: []
  1833. }),
  1834. smalltalk.String);
  1835. smalltalk.addMethod(
  1836. unescape('_asSelector'),
  1837. smalltalk.method({
  1838. selector: unescape('asSelector'),
  1839. category: 'converting',
  1840. fn: function (){
  1841. var self=this;
  1842. var selector=nil;
  1843. (selector=smalltalk.send("_", "__comma", [self]));
  1844. (selector=smalltalk.send(selector, "_replace_with_", [":", "_"]));
  1845. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]));
  1846. (selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]));
  1847. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]));
  1848. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]));
  1849. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]));
  1850. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]));
  1851. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]));
  1852. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]));
  1853. (selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]));
  1854. return selector;
  1855. return self;},
  1856. args: [],
  1857. source: unescape('asSelector%0A%09%22If%20you%20change%20this%20method%2C%20change%20smalltalk.convertSelector%20too%20%28see%20js/boot.js%20file%29%22%0A%0A%09%7C%20selector%20%7C%0A%09selector%20%3A%3D%20%27_%27%2C%20self.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%3A%27%20with%3A%20%27_%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B+%5D%27%20with%3A%20%27_plus%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27-%27%20with%3A%20%27_minus%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B*%5D%27%20with%3A%20%27_star%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B/%5D%27%20with%3A%20%27_slash%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%3E%27%20with%3A%20%27_gt%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%3C%27%20with%3A%20%27_lt%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%3D%27%20with%3A%20%27_eq%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%2C%27%20with%3A%20%27_comma%27.%0A%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B@%5D%27%20with%3A%20%27_at%27.%0A%09%5Eselector'),
  1858. messageSends: [unescape("%2C"), "replace:with:"],
  1859. referencedClasses: []
  1860. }),
  1861. smalltalk.String);
  1862. smalltalk.addMethod(
  1863. unescape('_asJavascript'),
  1864. smalltalk.method({
  1865. selector: unescape('asJavascript'),
  1866. category: 'converting',
  1867. fn: function (){
  1868. var self=this;
  1869. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  1870. return "unescape(\"" + escape(self) + "\")";
  1871. else
  1872. return "\"" + self + "\"";
  1873. ;
  1874. return self;},
  1875. args: [],
  1876. source: unescape('asJavascript%0A%09%3C%0A%09%09if%28self.search%28/%5E%5Ba-zA-Z0-9_%3A.%24%20%5D*%24/%29%20%3D%3D%20-1%29%0A%09%09%09return%20%22unescape%28%5C%22%22%20+%20escape%28self%29%20+%20%22%5C%22%29%22%3B%0A%09%09else%0A%09%09%09return%20%22%5C%22%22%20+%20self%20+%20%22%5C%22%22%3B%0A%09%3E'),
  1877. messageSends: [],
  1878. referencedClasses: []
  1879. }),
  1880. smalltalk.String);
  1881. smalltalk.addMethod(
  1882. unescape('_replace_with_'),
  1883. smalltalk.method({
  1884. selector: unescape('replace%3Awith%3A'),
  1885. category: 'regular expressions',
  1886. fn: function (aString, anotherString){
  1887. var self=this;
  1888. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  1889. return self;},
  1890. args: ["aString", "anotherString"],
  1891. source: unescape('replace%3A%20aString%20with%3A%20anotherString%0A%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20aString%20flag%3A%20%27g%27%29%20with%3A%20anotherString'),
  1892. messageSends: ["replaceRegexp:with:", "fromString:flag:"],
  1893. referencedClasses: ["RegularExpression"]
  1894. }),
  1895. smalltalk.String);
  1896. smalltalk.addMethod(
  1897. unescape('_replaceRegexp_with_'),
  1898. smalltalk.method({
  1899. selector: unescape('replaceRegexp%3Awith%3A'),
  1900. category: 'regular expressions',
  1901. fn: function (aRegexp, aString){
  1902. var self=this;
  1903. return self.replace(aRegexp, aString);
  1904. return self;},
  1905. args: ["aRegexp", "aString"],
  1906. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%09%3Creturn%20self.replace%28aRegexp%2C%20aString%29%3E'),
  1907. messageSends: [],
  1908. referencedClasses: []
  1909. }),
  1910. smalltalk.String);
  1911. smalltalk.addMethod(
  1912. unescape('_tokenize_'),
  1913. smalltalk.method({
  1914. selector: unescape('tokenize%3A'),
  1915. category: 'converting',
  1916. fn: function (aString){
  1917. var self=this;
  1918. return self.split(aString);
  1919. return self;},
  1920. args: ["aString"],
  1921. source: unescape('tokenize%3A%20aString%0A%09%3Creturn%20self.split%28aString%29%3E'),
  1922. messageSends: [],
  1923. referencedClasses: []
  1924. }),
  1925. smalltalk.String);
  1926. smalltalk.addMethod(
  1927. unescape('_match_'),
  1928. smalltalk.method({
  1929. selector: unescape('match%3A'),
  1930. category: 'regular expressions',
  1931. fn: function (aRegexp){
  1932. var self=this;
  1933. return self.search(aRegexp) != -1;
  1934. return self;},
  1935. args: ["aRegexp"],
  1936. source: unescape('match%3A%20aRegexp%0A%09%3Creturn%20self.search%28aRegexp%29%20%21%3D%20-1%3E'),
  1937. messageSends: [],
  1938. referencedClasses: []
  1939. }),
  1940. smalltalk.String);
  1941. smalltalk.addMethod(
  1942. unescape('_asString'),
  1943. smalltalk.method({
  1944. selector: unescape('asString'),
  1945. category: 'converting',
  1946. fn: function (){
  1947. var self=this;
  1948. return self;
  1949. return self;},
  1950. args: [],
  1951. source: unescape('asString%0A%09%5Eself'),
  1952. messageSends: [],
  1953. referencedClasses: []
  1954. }),
  1955. smalltalk.String);
  1956. smalltalk.addMethod(
  1957. unescape('_asNumber'),
  1958. smalltalk.method({
  1959. selector: unescape('asNumber'),
  1960. category: 'converting',
  1961. fn: function (){
  1962. var self=this;
  1963. return Number(self);
  1964. return self;},
  1965. args: [],
  1966. source: unescape('asNumber%0A%09%3Creturn%20Number%28self%29%3E'),
  1967. messageSends: [],
  1968. referencedClasses: []
  1969. }),
  1970. smalltalk.String);
  1971. smalltalk.addMethod(
  1972. unescape('_printString'),
  1973. smalltalk.method({
  1974. selector: unescape('printString'),
  1975. category: 'printing',
  1976. fn: function (){
  1977. var self=this;
  1978. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  1979. return self;},
  1980. args: [],
  1981. source: unescape('printString%0A%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27'),
  1982. messageSends: [unescape("%2C")],
  1983. referencedClasses: []
  1984. }),
  1985. smalltalk.String);
  1986. smalltalk.addMethod(
  1987. unescape('_printNl'),
  1988. smalltalk.method({
  1989. selector: unescape('printNl'),
  1990. category: 'printing',
  1991. fn: function (){
  1992. var self=this;
  1993. console.log(self);
  1994. return self;},
  1995. args: [],
  1996. source: unescape('printNl%0A%09%3Cconsole.log%28self%29%3E'),
  1997. messageSends: [],
  1998. referencedClasses: []
  1999. }),
  2000. smalltalk.String);
  2001. smalltalk.addMethod(
  2002. unescape('_isString'),
  2003. smalltalk.method({
  2004. selector: unescape('isString'),
  2005. category: 'testing',
  2006. fn: function (){
  2007. var self=this;
  2008. return true;
  2009. return self;},
  2010. args: [],
  2011. source: unescape('isString%0A%09%5Etrue'),
  2012. messageSends: [],
  2013. referencedClasses: []
  2014. }),
  2015. smalltalk.String);
  2016. smalltalk.addMethod(
  2017. unescape('__gt'),
  2018. smalltalk.method({
  2019. selector: unescape('%3E'),
  2020. category: 'comparing',
  2021. fn: function (aString){
  2022. var self=this;
  2023. return String(self) > aString._asString();
  2024. return self;},
  2025. args: ["aString"],
  2026. source: unescape('%3E%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%20aString._asString%28%29%3E'),
  2027. messageSends: [],
  2028. referencedClasses: []
  2029. }),
  2030. smalltalk.String);
  2031. smalltalk.addMethod(
  2032. unescape('__lt'),
  2033. smalltalk.method({
  2034. selector: unescape('%3C'),
  2035. category: 'comparing',
  2036. fn: function (aString){
  2037. var self=this;
  2038. return String(self) < aString._asString();
  2039. return self;},
  2040. args: ["aString"],
  2041. source: unescape('%3C%20aString%0A%09%3Creturn%20String%28self%29%20%3C%20aString._asString%28%29%3E'),
  2042. messageSends: [],
  2043. referencedClasses: []
  2044. }),
  2045. smalltalk.String);
  2046. smalltalk.addMethod(
  2047. unescape('__gt_eq'),
  2048. smalltalk.method({
  2049. selector: unescape('%3E%3D'),
  2050. category: 'comparing',
  2051. fn: function (aString){
  2052. var self=this;
  2053. return String(self) >= aString._asString();
  2054. return self;},
  2055. args: ["aString"],
  2056. source: unescape('%3E%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%3D%20aString._asString%28%29%3E'),
  2057. messageSends: [],
  2058. referencedClasses: []
  2059. }),
  2060. smalltalk.String);
  2061. smalltalk.addMethod(
  2062. unescape('__lt_eq'),
  2063. smalltalk.method({
  2064. selector: unescape('%3C%3D'),
  2065. category: 'comparing',
  2066. fn: function (aString){
  2067. var self=this;
  2068. return String(self) <= aString._asString();
  2069. return self;},
  2070. args: ["aString"],
  2071. source: unescape('%3C%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3C%3D%20aString._asString%28%29%3E'),
  2072. messageSends: [],
  2073. referencedClasses: []
  2074. }),
  2075. smalltalk.String);
  2076. smalltalk.addMethod(
  2077. unescape('_trimLeft_'),
  2078. smalltalk.method({
  2079. selector: unescape('trimLeft%3A'),
  2080. category: 'regular expressions',
  2081. fn: function (separators){
  2082. var self=this;
  2083. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5E%5B"), "__comma", [separators]), "__comma", [unescape("%5D+")]), "g"]), ""]);
  2084. return self;},
  2085. args: ["separators"],
  2086. source: unescape('trimLeft%3A%20separators%0A%0A%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20%27%5E%5B%27%2C%20separators%2C%20%27%5D+%27%20flag%3A%20%27g%27%29%20with%3A%20%27%27'),
  2087. messageSends: ["replaceRegexp:with:", "fromString:flag:", unescape("%2C")],
  2088. referencedClasses: ["RegularExpression"]
  2089. }),
  2090. smalltalk.String);
  2091. smalltalk.addMethod(
  2092. unescape('_trimRight_'),
  2093. smalltalk.method({
  2094. selector: unescape('trimRight%3A'),
  2095. category: 'regular expressions',
  2096. fn: function (separators){
  2097. var self=this;
  2098. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [separators]), "__comma", [unescape("%5D+%24")]), "g"]), ""]);
  2099. return self;},
  2100. args: ["separators"],
  2101. source: unescape('trimRight%3A%20separators%0A%0A%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20%27%5B%27%2C%20separators%2C%20%27%5D+%24%27%20flag%3A%20%27g%27%29%20with%3A%20%27%27'),
  2102. messageSends: ["replaceRegexp:with:", "fromString:flag:", unescape("%2C")],
  2103. referencedClasses: ["RegularExpression"]
  2104. }),
  2105. smalltalk.String);
  2106. smalltalk.addMethod(
  2107. unescape('_trimLeft'),
  2108. smalltalk.method({
  2109. selector: unescape('trimLeft'),
  2110. category: 'regular expressions',
  2111. fn: function (){
  2112. var self=this;
  2113. return smalltalk.send(self, "_trimLeft_", [unescape("%5Cs")]);
  2114. return self;},
  2115. args: [],
  2116. source: unescape('trimLeft%0A%09%5Eself%20trimLeft%3A%20%27%5Cs%27'),
  2117. messageSends: ["trimLeft:"],
  2118. referencedClasses: []
  2119. }),
  2120. smalltalk.String);
  2121. smalltalk.addMethod(
  2122. unescape('_trimRight'),
  2123. smalltalk.method({
  2124. selector: unescape('trimRight'),
  2125. category: 'regular expressions',
  2126. fn: function (){
  2127. var self=this;
  2128. return smalltalk.send(self, "_trimRight_", [unescape("%5Cs")]);
  2129. return self;},
  2130. args: [],
  2131. source: unescape('trimRight%0A%09%5Eself%20trimRight%3A%20%27%5Cs%27'),
  2132. messageSends: ["trimRight:"],
  2133. referencedClasses: []
  2134. }),
  2135. smalltalk.String);
  2136. smalltalk.addMethod(
  2137. unescape('_trimBoth'),
  2138. smalltalk.method({
  2139. selector: unescape('trimBoth'),
  2140. category: 'regular expressions',
  2141. fn: function (){
  2142. var self=this;
  2143. return smalltalk.send(self, "_trimBoth_", [unescape("%5Cs")]);
  2144. return self;},
  2145. args: [],
  2146. source: unescape('trimBoth%0A%09%5Eself%20trimBoth%3A%20%27%5Cs%27'),
  2147. messageSends: ["trimBoth:"],
  2148. referencedClasses: []
  2149. }),
  2150. smalltalk.String);
  2151. smalltalk.addMethod(
  2152. unescape('_trimBoth_'),
  2153. smalltalk.method({
  2154. selector: unescape('trimBoth%3A'),
  2155. category: 'regular expressions',
  2156. fn: function (separators){
  2157. var self=this;
  2158. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  2159. return self;},
  2160. args: ["separators"],
  2161. source: unescape('trimBoth%3A%20separators%0A%0A%09%5E%28self%20trimLeft%3A%20separators%29%20trimRight%3A%20separators'),
  2162. messageSends: ["trimRight:", "trimLeft:"],
  2163. referencedClasses: []
  2164. }),
  2165. smalltalk.String);
  2166. smalltalk.addMethod(
  2167. unescape('_asLowercase'),
  2168. smalltalk.method({
  2169. selector: unescape('asLowercase'),
  2170. category: 'converting',
  2171. fn: function (){
  2172. var self=this;
  2173. return self.toLowerCase();
  2174. return self;},
  2175. args: [],
  2176. source: unescape('asLowercase%0A%09%3Creturn%20self.toLowerCase%28%29%3E'),
  2177. messageSends: [],
  2178. referencedClasses: []
  2179. }),
  2180. smalltalk.String);
  2181. smalltalk.addMethod(
  2182. unescape('_asUppercase'),
  2183. smalltalk.method({
  2184. selector: unescape('asUppercase'),
  2185. category: 'converting',
  2186. fn: function (){
  2187. var self=this;
  2188. return self.toUpperCase();
  2189. return self;},
  2190. args: [],
  2191. source: unescape('asUppercase%0A%09%3Creturn%20self.toUpperCase%28%29%3E'),
  2192. messageSends: [],
  2193. referencedClasses: []
  2194. }),
  2195. smalltalk.String);
  2196. smalltalk.addMethod(
  2197. unescape('_join_'),
  2198. smalltalk.method({
  2199. selector: unescape('join%3A'),
  2200. category: 'split join',
  2201. fn: function (aCollection){
  2202. var self=this;
  2203. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(each, "_asString", [])]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [self]);})]);})]);
  2204. return self;},
  2205. args: ["aCollection"],
  2206. source: unescape('join%3A%20aCollection%20%0A%09%5E%20String%0A%09%09streamContents%3A%20%5B%3Astream%20%7C%20aCollection%0A%09%09%09%09do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%20asString%5D%20%0A%09%09%09%09separatedBy%3A%20%5Bstream%20nextPutAll%3A%20self%5D%5D'),
  2207. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"],
  2208. referencedClasses: ["String"]
  2209. }),
  2210. smalltalk.String);
  2211. smalltalk.addMethod(
  2212. unescape('_includesSubString_'),
  2213. smalltalk.method({
  2214. selector: unescape('includesSubString%3A'),
  2215. category: 'testing',
  2216. fn: function (subString){
  2217. var self=this;
  2218. return self.indexOf(subString) != -1 ;
  2219. return self;},
  2220. args: ["subString"],
  2221. source: unescape('includesSubString%3A%20subString%0A%09%3C%20return%20self.indexOf%28subString%29%20%21%3D%20-1%20%3E'),
  2222. messageSends: [],
  2223. referencedClasses: []
  2224. }),
  2225. smalltalk.String);
  2226. smalltalk.addMethod(
  2227. unescape('_asciiValue'),
  2228. smalltalk.method({
  2229. selector: unescape('asciiValue'),
  2230. category: 'accessing',
  2231. fn: function (){
  2232. var self=this;
  2233. return self.charCodeAt(0);;
  2234. return self;},
  2235. args: [],
  2236. source: unescape('asciiValue%0A%09%3Creturn%20self.charCodeAt%280%29%3B%3E'),
  2237. messageSends: [],
  2238. referencedClasses: []
  2239. }),
  2240. smalltalk.String);
  2241. smalltalk.addMethod(
  2242. unescape('_lineIndicesDo_'),
  2243. smalltalk.method({
  2244. selector: unescape('lineIndicesDo%3A'),
  2245. category: 'split join',
  2246. fn: function (aBlock){
  2247. var self=this;
  2248. try{var cr=nil;
  2249. var lf=nil;
  2250. var start=nil;
  2251. var sz=nil;
  2252. var nextLF=nil;
  2253. var nextCR=nil;
  2254. (start=(1));
  2255. (sz=smalltalk.send(self, "_size", []));
  2256. (cr=smalltalk.send((smalltalk.String || String), "_cr", []));
  2257. (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]));
  2258. (lf=smalltalk.send((smalltalk.String || String), "_lf", []));
  2259. (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]));
  2260. (function(){while((function(){return ((($receiver = start).klass === smalltalk.Number) ? $receiver <=sz : smalltalk.send($receiver, "__lt_eq", [sz]));})()) {(function(){((($receiver = smalltalk.send(smalltalk.send(nextLF, "__eq", [(0)]), "_and_", [(function(){return smalltalk.send(nextCR, "__eq", [(0)]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw({name: 'stReturn', selector: '_lineIndicesDo_', fn: function(){return self}})})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw({name: 'stReturn', selector: '_lineIndicesDo_', fn: function(){return self}})})();})]));return ((($receiver = smalltalk.send(smalltalk.send(nextCR, "__eq", [(0)]), "_or_", [(function(){return smalltalk.send((0) < nextLF, "_and_", [(function(){return ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver <nextCR : smalltalk.send($receiver, "__lt", [nextCR]));})]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})]));})]));})()}})();
  2261. return self;
  2262. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}},
  2263. args: ["aBlock"],
  2264. source: unescape('lineIndicesDo%3A%20aBlock%0A%09%22execute%20aBlock%20with%203%20arguments%20for%20each%20line%3A%0A%09-%20start%20index%20of%20line%0A%09-%20end%20index%20of%20line%20without%20line%20delimiter%0A%09-%20end%20index%20of%20line%20including%20line%20delimiter%28s%29%20CR%2C%20LF%20or%20CRLF%22%0A%09%0A%09%7C%20cr%20lf%20start%20sz%20nextLF%20nextCR%20%7C%0A%09start%20%3A%3D%201.%0A%09sz%20%3A%3D%20self%20size.%0A%09cr%20%3A%3D%20String%20cr.%0A%09nextCR%20%3A%3D%20self%20indexOf%3A%20cr%20startingAt%3A%201.%0A%09lf%20%3A%3D%20String%20lf.%0A%09nextLF%20%3A%3D%20self%20indexOf%3A%20lf%20startingAt%3A%201.%0A%09%5B%20start%20%3C%3D%20sz%20%5D%20whileTrue%3A%20%5B%0A%09%09%28nextLF%20%3D%200%20and%3A%20%5B%20nextCR%20%3D%200%20%5D%29%0A%09%09%09ifTrue%3A%20%5B%20%22No%20more%20CR%2C%20nor%20LF%2C%20the%20string%20is%20over%22%0A%09%09%09%09%09aBlock%20value%3A%20start%20value%3A%20sz%20value%3A%20sz.%0A%09%09%09%09%09%5Eself%20%5D.%0A%09%09%28nextCR%20%3D%200%20or%3A%20%5B%200%20%3C%20nextLF%20and%3A%20%5B%20nextLF%20%3C%20nextCR%20%5D%20%5D%29%0A%09%09%09ifTrue%3A%20%5B%20%22Found%20a%20LF%22%0A%09%09%09%09%09aBlock%20value%3A%20start%20value%3A%20nextLF%20-%201%20value%3A%20nextLF.%0A%09%09%09%09%09start%20%3A%3D%201%20+%20nextLF.%0A%09%09%09%09%09nextLF%20%3A%3D%20self%20indexOf%3A%20lf%20startingAt%3A%20start%20%5D%0A%09%09%09ifFalse%3A%20%5B%201%20+%20nextCR%20%3D%20nextLF%0A%09%09%09%09ifTrue%3A%20%5B%20%22Found%20a%20CR-LF%20pair%22%0A%09%09%09%09%09aBlock%20value%3A%20start%20value%3A%20nextCR%20-%201%20value%3A%20nextLF.%0A%09%09%09%09%09start%20%3A%3D%201%20+%20nextLF.%0A%09%09%09%09%09nextCR%20%3A%3D%20self%20indexOf%3A%20cr%20startingAt%3A%20start.%0A%09%09%09%09%09nextLF%20%3A%3D%20self%20indexOf%3A%20lf%20startingAt%3A%20start%20%5D%0A%09%09%09%09ifFalse%3A%20%5B%20%22Found%20a%20CR%22%0A%09%09%09%09%09aBlock%20value%3A%20start%20value%3A%20nextCR%20-%201%20value%3A%20nextCR.%0A%09%09%09%09%09start%20%3A%3D%201%20+%20nextCR.%0A%09%09%09%09%09nextCR%20%3A%3D%20self%20indexOf%3A%20cr%20startingAt%3A%20start%20%5D%5D%5D'),
  2265. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", unescape("%3C%3D"), "ifTrue:", "and:", unescape("%3D"), "value:value:value:", "ifTrue:ifFalse:", "or:", unescape("%3C"), unescape("-"), unescape("+")],
  2266. referencedClasses: ["String"]
  2267. }),
  2268. smalltalk.String);
  2269. smalltalk.addMethod(
  2270. unescape('_linesDo_'),
  2271. smalltalk.method({
  2272. selector: unescape('linesDo%3A'),
  2273. category: 'split join',
  2274. fn: function (aBlock){
  2275. var self=this;
  2276. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  2277. return self;},
  2278. args: ["aBlock"],
  2279. source: unescape('linesDo%3A%20aBlock%0A%09%22Execute%20aBlock%20with%20each%20line%20in%20this%20string.%20The%20terminating%20line%0A%09delimiters%20CR%2C%20LF%20or%20CRLF%20pairs%20are%20not%20included%20in%20what%20is%20passed%20to%20aBlock%22%0A%0A%09self%20lineIndicesDo%3A%20%5B%3Astart%20%3AendWithoutDelimiters%20%3Aend%20%7C%0A%09%09aBlock%20value%3A%20%28self%20copyFrom%3A%20start%20to%3A%20endWithoutDelimiters%29%5D'),
  2280. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"],
  2281. referencedClasses: []
  2282. }),
  2283. smalltalk.String);
  2284. smalltalk.addMethod(
  2285. unescape('_lines'),
  2286. smalltalk.method({
  2287. selector: unescape('lines'),
  2288. category: 'split join',
  2289. fn: function (){
  2290. var self=this;
  2291. var lines=nil;
  2292. (lines=smalltalk.send((smalltalk.Array || Array), "_new", []));
  2293. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  2294. return lines;
  2295. return self;},
  2296. args: [],
  2297. source: unescape('lines%0A%09%22Answer%20an%20array%20of%20lines%20composing%20this%20receiver%20without%20the%20line%20ending%20delimiters.%22%0A%0A%09%7C%20lines%20%7C%0A%09lines%20%3A%3D%20Array%20new.%0A%09self%20linesDo%3A%20%5B%3AaLine%20%7C%20lines%20add%3A%20aLine%5D.%0A%09%5Elines'),
  2298. messageSends: ["new", "linesDo:", "add:"],
  2299. referencedClasses: ["Array"]
  2300. }),
  2301. smalltalk.String);
  2302. smalltalk.addMethod(
  2303. unescape('_lineNumber_'),
  2304. smalltalk.method({
  2305. selector: unescape('lineNumber%3A'),
  2306. category: 'split join',
  2307. fn: function (anIndex){
  2308. var self=this;
  2309. try{var lineCount=nil;
  2310. (lineCount=(0));
  2311. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return ((($receiver = smalltalk.send((lineCount=((($receiver = lineCount).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))), "__eq", [anIndex])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})})();})]));})]);
  2312. (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
  2313. return self;
  2314. } catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}},
  2315. args: ["anIndex"],
  2316. source: unescape('lineNumber%3A%20anIndex%0A%09%22Answer%20a%20string%20containing%20the%20characters%20in%20the%20given%20line%20number.%22%0A%0A%09%7C%20lineCount%20%7C%0A%09lineCount%20%3A%3D%200.%0A%09self%20lineIndicesDo%3A%20%5B%3Astart%20%3AendWithoutDelimiters%20%3Aend%20%7C%0A%09%09%28lineCount%20%3A%3D%20lineCount%20+%201%29%20%3D%20anIndex%20ifTrue%3A%20%5B%5Eself%20copyFrom%3A%20start%20to%3A%20endWithoutDelimiters%5D%5D.%0A%09%5Enil'),
  2317. messageSends: ["lineIndicesDo:", "ifTrue:", unescape("%3D"), unescape("+"), "copyFrom:to:"],
  2318. referencedClasses: []
  2319. }),
  2320. smalltalk.String);
  2321. smalltalk.addMethod(
  2322. unescape('_reversed'),
  2323. smalltalk.method({
  2324. selector: unescape('reversed'),
  2325. category: 'converting',
  2326. fn: function (){
  2327. var self=this;
  2328. return self.split("").reverse().join("");
  2329. return self;},
  2330. args: [],
  2331. source: unescape('reversed%0A%09%3Creturn%20self.split%28%22%22%29.reverse%28%29.join%28%22%22%29%3E'),
  2332. messageSends: [],
  2333. referencedClasses: []
  2334. }),
  2335. smalltalk.String);
  2336. smalltalk.addMethod(
  2337. unescape('_asJavaScriptSelector'),
  2338. smalltalk.method({
  2339. selector: unescape('asJavaScriptSelector'),
  2340. category: 'converting',
  2341. fn: function (){
  2342. var self=this;
  2343. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", [unescape("%5E_"), ""]), "_replace_with_", [unescape("_.*"), ""]);
  2344. return self;},
  2345. args: [],
  2346. source: unescape('asJavaScriptSelector%0A%09%5E%28self%20asSelector%20replace%3A%20%27%5E_%27%20with%3A%20%27%27%29%20replace%3A%20%27_.*%27%20with%3A%20%27%27.'),
  2347. messageSends: ["replace:with:", "asSelector"],
  2348. referencedClasses: []
  2349. }),
  2350. smalltalk.String);
  2351. smalltalk.addMethod(
  2352. unescape('_asJSONString'),
  2353. smalltalk.method({
  2354. selector: unescape('asJSONString'),
  2355. category: 'converting',
  2356. fn: function (){
  2357. var self=this;
  2358. return self;
  2359. return self;},
  2360. args: [],
  2361. source: unescape('asJSONString%0A%09%5Eself'),
  2362. messageSends: [],
  2363. referencedClasses: []
  2364. }),
  2365. smalltalk.String);
  2366. smalltalk.addMethod(
  2367. unescape('_asSymbol'),
  2368. smalltalk.method({
  2369. selector: unescape('asSymbol'),
  2370. category: 'converting',
  2371. fn: function (){
  2372. var self=this;
  2373. return smalltalk.send((smalltalk.Symbol || Symbol), "_lookup_", [self]);
  2374. return self;},
  2375. args: [],
  2376. source: unescape('asSymbol%0A%09%5ESymbol%20lookup%3A%20self'),
  2377. messageSends: ["lookup:"],
  2378. referencedClasses: ["Symbol"]
  2379. }),
  2380. smalltalk.String);
  2381. smalltalk.addMethod(
  2382. unescape('_streamClass'),
  2383. smalltalk.method({
  2384. selector: unescape('streamClass'),
  2385. category: 'accessing',
  2386. fn: function (){
  2387. var self=this;
  2388. return (smalltalk.StringStream || StringStream);
  2389. return self;},
  2390. args: [],
  2391. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream'),
  2392. messageSends: [],
  2393. referencedClasses: ["StringStream"]
  2394. }),
  2395. smalltalk.String.klass);
  2396. smalltalk.addMethod(
  2397. unescape('_fromString_'),
  2398. smalltalk.method({
  2399. selector: unescape('fromString%3A'),
  2400. category: 'instance creation',
  2401. fn: function (aString){
  2402. var self=this;
  2403. return new self.fn(aString);
  2404. return self;},
  2405. args: ["aString"],
  2406. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%3Creturn%20new%20self.fn%28aString%29%3E'),
  2407. messageSends: [],
  2408. referencedClasses: []
  2409. }),
  2410. smalltalk.String.klass);
  2411. smalltalk.addMethod(
  2412. unescape('_cr'),
  2413. smalltalk.method({
  2414. selector: unescape('cr'),
  2415. category: 'accessing',
  2416. fn: function (){
  2417. var self=this;
  2418. return '\r';
  2419. return self;},
  2420. args: [],
  2421. source: unescape('cr%0A%09%3Creturn%20%27%5Cr%27%3E'),
  2422. messageSends: [],
  2423. referencedClasses: []
  2424. }),
  2425. smalltalk.String.klass);
  2426. smalltalk.addMethod(
  2427. unescape('_lf'),
  2428. smalltalk.method({
  2429. selector: unescape('lf'),
  2430. category: 'accessing',
  2431. fn: function (){
  2432. var self=this;
  2433. return '\n';
  2434. return self;},
  2435. args: [],
  2436. source: unescape('lf%0A%09%3Creturn%20%27%5Cn%27%3E'),
  2437. messageSends: [],
  2438. referencedClasses: []
  2439. }),
  2440. smalltalk.String.klass);
  2441. smalltalk.addMethod(
  2442. unescape('_space'),
  2443. smalltalk.method({
  2444. selector: unescape('space'),
  2445. category: 'accessing',
  2446. fn: function (){
  2447. var self=this;
  2448. return ' ';
  2449. return self;},
  2450. args: [],
  2451. source: unescape('space%0A%09%3Creturn%20%27%20%27%3E'),
  2452. messageSends: [],
  2453. referencedClasses: []
  2454. }),
  2455. smalltalk.String.klass);
  2456. smalltalk.addMethod(
  2457. unescape('_tab'),
  2458. smalltalk.method({
  2459. selector: unescape('tab'),
  2460. category: 'accessing',
  2461. fn: function (){
  2462. var self=this;
  2463. return '\t';
  2464. return self;},
  2465. args: [],
  2466. source: unescape('tab%0A%09%3Creturn%20%27%5Ct%27%3E'),
  2467. messageSends: [],
  2468. referencedClasses: []
  2469. }),
  2470. smalltalk.String.klass);
  2471. smalltalk.addMethod(
  2472. unescape('_crlf'),
  2473. smalltalk.method({
  2474. selector: unescape('crlf'),
  2475. category: 'accessing',
  2476. fn: function (){
  2477. var self=this;
  2478. return '\r\n';
  2479. return self;},
  2480. args: [],
  2481. source: unescape('crlf%0A%09%3Creturn%20%27%5Cr%5Cn%27%3E'),
  2482. messageSends: [],
  2483. referencedClasses: []
  2484. }),
  2485. smalltalk.String.klass);
  2486. smalltalk.addMethod(
  2487. unescape('_streamContents_'),
  2488. smalltalk.method({
  2489. selector: unescape('streamContents%3A'),
  2490. category: 'instance creation',
  2491. fn: function (blockWithArg){
  2492. var self=this;
  2493. var stream=nil;
  2494. (stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]));
  2495. smalltalk.send(blockWithArg, "_value_", [stream]);
  2496. return smalltalk.send(stream, "_contents", []);
  2497. return self;},
  2498. args: ["blockWithArg"],
  2499. source: unescape('streamContents%3A%20blockWithArg%0A%09%7Cstream%7C%0A%09stream%20%3A%3D%20%28self%20streamClass%20on%3A%20String%20new%29.%0A%09blockWithArg%20value%3A%20stream.%0A%09%5E%20stream%20contents'),
  2500. messageSends: ["on:", "streamClass", "new", "value:", "contents"],
  2501. referencedClasses: ["String"]
  2502. }),
  2503. smalltalk.String.klass);
  2504. smalltalk.addMethod(
  2505. unescape('_value_'),
  2506. smalltalk.method({
  2507. selector: unescape('value%3A'),
  2508. category: 'instance creation',
  2509. fn: function (aUTFCharCode){
  2510. var self=this;
  2511. return String.fromCharCode(aUTFCharCode);;
  2512. return self;},
  2513. args: ["aUTFCharCode"],
  2514. source: unescape('value%3A%20aUTFCharCode%0A%0A%09%3Creturn%20String.fromCharCode%28aUTFCharCode%29%3B%3E'),
  2515. messageSends: [],
  2516. referencedClasses: []
  2517. }),
  2518. smalltalk.String.klass);
  2519. smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
  2520. smalltalk.addMethod(
  2521. unescape('_at_ifAbsent_'),
  2522. smalltalk.method({
  2523. selector: unescape('at%3AifAbsent%3A'),
  2524. category: 'accessing',
  2525. fn: function (anIndex, aBlock){
  2526. var self=this;
  2527. return smalltalk.send(smalltalk.send(self, "_asString", []), "_at_ifAbsent_", [anIndex, aBlock]);
  2528. return self;},
  2529. args: ["anIndex", "aBlock"],
  2530. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%5Eself%20asString%20at%3A%20anIndex%20ifAbsent%3A%20aBlock'),
  2531. messageSends: ["at:ifAbsent:", "asString"],
  2532. referencedClasses: []
  2533. }),
  2534. smalltalk.Symbol);
  2535. smalltalk.addMethod(
  2536. unescape('_asString'),
  2537. smalltalk.method({
  2538. selector: unescape('asString'),
  2539. category: 'converting',
  2540. fn: function (){
  2541. var self=this;
  2542. return self.value;
  2543. return self;},
  2544. args: [],
  2545. source: unescape('asString%0A%09%3Creturn%20self.value%3E'),
  2546. messageSends: [],
  2547. referencedClasses: []
  2548. }),
  2549. smalltalk.Symbol);
  2550. smalltalk.addMethod(
  2551. unescape('_printString'),
  2552. smalltalk.method({
  2553. selector: unescape('printString'),
  2554. category: 'printing',
  2555. fn: function (){
  2556. var self=this;
  2557. return smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(self, "_asString", [])]);
  2558. return self;},
  2559. args: [],
  2560. source: unescape('printString%0A%09%5E%27%23%27%2C%20self%20asString'),
  2561. messageSends: [unescape("%2C"), "asString"],
  2562. referencedClasses: []
  2563. }),
  2564. smalltalk.Symbol);
  2565. smalltalk.addMethod(
  2566. unescape('_size'),
  2567. smalltalk.method({
  2568. selector: unescape('size'),
  2569. category: 'accessing',
  2570. fn: function (){
  2571. var self=this;
  2572. return smalltalk.send(smalltalk.send(self, "_asString", []), "_size", []);
  2573. return self;},
  2574. args: [],
  2575. source: unescape('size%0A%09%5Eself%20asString%20size'),
  2576. messageSends: ["size", "asString"],
  2577. referencedClasses: []
  2578. }),
  2579. smalltalk.Symbol);
  2580. smalltalk.addMethod(
  2581. unescape('_asSymbol'),
  2582. smalltalk.method({
  2583. selector: unescape('asSymbol'),
  2584. category: 'converting',
  2585. fn: function (){
  2586. var self=this;
  2587. return self;
  2588. return self;},
  2589. args: [],
  2590. source: unescape('asSymbol%0A%09%5Eself'),
  2591. messageSends: [],
  2592. referencedClasses: []
  2593. }),
  2594. smalltalk.Symbol);
  2595. smalltalk.addMethod(
  2596. unescape('_copyFrom_to_'),
  2597. smalltalk.method({
  2598. selector: unescape('copyFrom%3Ato%3A'),
  2599. category: 'copying',
  2600. fn: function (anIndex, anotherIndex){
  2601. var self=this;
  2602. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_copyFrom_to_", [anIndex, anotherIndex])]);
  2603. return self;},
  2604. args: ["anIndex", "anotherIndex"],
  2605. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%5Eself%20class%20fromString%3A%20%28self%20asString%20copyFrom%3A%20anIndex%20to%3A%20anotherIndex%29'),
  2606. messageSends: ["fromString:", "class", "copyFrom:to:", "asString"],
  2607. referencedClasses: []
  2608. }),
  2609. smalltalk.Symbol);
  2610. smalltalk.addMethod(
  2611. unescape('_deepCopy'),
  2612. smalltalk.method({
  2613. selector: unescape('deepCopy'),
  2614. category: 'copying',
  2615. fn: function (){
  2616. var self=this;
  2617. return self;
  2618. return self;},
  2619. args: [],
  2620. source: unescape('deepCopy%0A%09%5Eself'),
  2621. messageSends: [],
  2622. referencedClasses: []
  2623. }),
  2624. smalltalk.Symbol);
  2625. smalltalk.addMethod(
  2626. unescape('__lt'),
  2627. smalltalk.method({
  2628. selector: unescape('%3C'),
  2629. category: 'comparing',
  2630. fn: function (aSymbol){
  2631. var self=this;
  2632. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(aSymbol, "_asString", [])]));
  2633. return self;},
  2634. args: ["aSymbol"],
  2635. source: unescape('%3C%20aSymbol%0A%09%5Eself%20asString%20%3C%20aSymbol%20asString'),
  2636. messageSends: [unescape("%3C"), "asString"],
  2637. referencedClasses: []
  2638. }),
  2639. smalltalk.Symbol);
  2640. smalltalk.addMethod(
  2641. unescape('__lt_eq'),
  2642. smalltalk.method({
  2643. selector: unescape('%3C%3D'),
  2644. category: 'comparing',
  2645. fn: function (aSymbol){
  2646. var self=this;
  2647. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
  2648. return self;},
  2649. args: ["aSymbol"],
  2650. source: unescape('%3C%3D%20aSymbol%0A%09%5Eself%20asString%20%3C%3D%20aSymbol%20asString'),
  2651. messageSends: [unescape("%3C%3D"), "asString"],
  2652. referencedClasses: []
  2653. }),
  2654. smalltalk.Symbol);
  2655. smalltalk.addMethod(
  2656. unescape('__gt_eq'),
  2657. smalltalk.method({
  2658. selector: unescape('%3E%3D'),
  2659. category: 'comparing',
  2660. fn: function (aSymbol){
  2661. var self=this;
  2662. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
  2663. return self;},
  2664. args: ["aSymbol"],
  2665. source: unescape('%3E%3D%20aSymbol%0A%09%5Eself%20asString%20%3E%3D%20aSymbol%20asString'),
  2666. messageSends: [unescape("%3E%3D"), "asString"],
  2667. referencedClasses: []
  2668. }),
  2669. smalltalk.Symbol);
  2670. smalltalk.addMethod(
  2671. unescape('__eq'),
  2672. smalltalk.method({
  2673. selector: unescape('%3D'),
  2674. category: 'comparing',
  2675. fn: function (aSymbol){
  2676. var self=this;
  2677. try{((($receiver = smalltalk.send(smalltalk.send(aSymbol, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  2678. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])])}})})();
  2679. return self;
  2680. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  2681. args: ["aSymbol"],
  2682. source: unescape('%3D%20aSymbol%0A%09aSymbol%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%5Eself%20asString%20%3D%20aSymbol%20asString'),
  2683. messageSends: ["ifFalse:", unescape("%3D"), "class", "asString"],
  2684. referencedClasses: []
  2685. }),
  2686. smalltalk.Symbol);
  2687. smalltalk.addMethod(
  2688. unescape('_isSymbol'),
  2689. smalltalk.method({
  2690. selector: unescape('isSymbol'),
  2691. category: 'printing',
  2692. fn: function (){
  2693. var self=this;
  2694. return true;
  2695. return self;},
  2696. args: [],
  2697. source: unescape('isSymbol%0A%09%5Etrue'),
  2698. messageSends: [],
  2699. referencedClasses: []
  2700. }),
  2701. smalltalk.Symbol);
  2702. smalltalk.addMethod(
  2703. unescape('_asJavascript'),
  2704. smalltalk.method({
  2705. selector: unescape('asJavascript'),
  2706. category: 'converting',
  2707. fn: function (){
  2708. var self=this;
  2709. return smalltalk.send(smalltalk.send(unescape("smalltalk.symbolFor%28%22"), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%22%29")]);
  2710. return self;},
  2711. args: [],
  2712. source: unescape('asJavascript%0A%09%5E%27smalltalk.symbolFor%28%22%27%2C%20self%20asString%2C%20%27%22%29%27'),
  2713. messageSends: [unescape("%2C"), "asString"],
  2714. referencedClasses: []
  2715. }),
  2716. smalltalk.Symbol);
  2717. smalltalk.addMethod(
  2718. unescape('__gt'),
  2719. smalltalk.method({
  2720. selector: unescape('%3E'),
  2721. category: 'comparing',
  2722. fn: function (aSymbol){
  2723. var self=this;
  2724. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt", [smalltalk.send(aSymbol, "_asString", [])]));
  2725. return self;},
  2726. args: ["aSymbol"],
  2727. source: unescape('%3E%20aSymbol%0A%09%5Eself%20asString%20%3E%20aSymbol%20asString'),
  2728. messageSends: [unescape("%3E"), "asString"],
  2729. referencedClasses: []
  2730. }),
  2731. smalltalk.Symbol);
  2732. smalltalk.addMethod(
  2733. unescape('_shallowCopy'),
  2734. smalltalk.method({
  2735. selector: unescape('shallowCopy'),
  2736. category: 'copying',
  2737. fn: function (){
  2738. var self=this;
  2739. return self;
  2740. return self;},
  2741. args: [],
  2742. source: unescape('shallowCopy%0A%09%5Eself'),
  2743. messageSends: [],
  2744. referencedClasses: []
  2745. }),
  2746. smalltalk.Symbol);
  2747. smalltalk.addMethod(
  2748. unescape('_asSelector'),
  2749. smalltalk.method({
  2750. selector: unescape('asSelector'),
  2751. category: 'converting',
  2752. fn: function (){
  2753. var self=this;
  2754. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asSelector", []);
  2755. return self;},
  2756. args: [],
  2757. source: unescape('asSelector%0A%09%5Eself%20asString%20asSelector'),
  2758. messageSends: ["asSelector", "asString"],
  2759. referencedClasses: []
  2760. }),
  2761. smalltalk.Symbol);
  2762. smalltalk.addMethod(
  2763. unescape('_lookup_'),
  2764. smalltalk.method({
  2765. selector: unescape('lookup%3A'),
  2766. category: 'instance creation',
  2767. fn: function (aString){
  2768. var self=this;
  2769. return smalltalk.symbolFor(aString);;
  2770. return self;},
  2771. args: ["aString"],
  2772. source: unescape('lookup%3A%20aString%0A%09%3Creturn%20smalltalk.symbolFor%28aString%29%3B%3E'),
  2773. messageSends: [],
  2774. referencedClasses: []
  2775. }),
  2776. smalltalk.Symbol.klass);
  2777. smalltalk.addMethod(
  2778. unescape('_basicNew'),
  2779. smalltalk.method({
  2780. selector: unescape('basicNew'),
  2781. category: 'instance creation',
  2782. fn: function (){
  2783. var self=this;
  2784. smalltalk.send(self, "_shouldNotImplement", []);
  2785. return self;},
  2786. args: [],
  2787. source: unescape('basicNew%0A%09self%20shouldNotImplement'),
  2788. messageSends: ["shouldNotImplement"],
  2789. referencedClasses: []
  2790. }),
  2791. smalltalk.Symbol.klass);
  2792. smalltalk.addMethod(
  2793. unescape('_fromString_'),
  2794. smalltalk.method({
  2795. selector: unescape('fromString%3A'),
  2796. category: 'instance creation',
  2797. fn: function (aString){
  2798. var self=this;
  2799. return smalltalk.send(self, "_lookup_", [aString]);
  2800. return self;},
  2801. args: ["aString"],
  2802. source: unescape('fromString%3A%20aString%0A%09%5Eself%20lookup%3A%20aString'),
  2803. messageSends: ["lookup:"],
  2804. referencedClasses: []
  2805. }),
  2806. smalltalk.Symbol.klass);
  2807. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  2808. smalltalk.addMethod(
  2809. unescape('_size'),
  2810. smalltalk.method({
  2811. selector: unescape('size'),
  2812. category: 'accessing',
  2813. fn: function (){
  2814. var self=this;
  2815. return self.length;
  2816. return self;},
  2817. args: [],
  2818. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  2819. messageSends: [],
  2820. referencedClasses: []
  2821. }),
  2822. smalltalk.Array);
  2823. smalltalk.addMethod(
  2824. unescape('_at_put_'),
  2825. smalltalk.method({
  2826. selector: unescape('at%3Aput%3A'),
  2827. category: 'accessing',
  2828. fn: function (anIndex, anObject){
  2829. var self=this;
  2830. return self[anIndex - 1] = anObject;
  2831. return self;},
  2832. args: ["anIndex", "anObject"],
  2833. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%3D%20anObject%3E'),
  2834. messageSends: [],
  2835. referencedClasses: []
  2836. }),
  2837. smalltalk.Array);
  2838. smalltalk.addMethod(
  2839. unescape('_at_ifAbsent_'),
  2840. smalltalk.method({
  2841. selector: unescape('at%3AifAbsent%3A'),
  2842. category: 'accessing',
  2843. fn: function (anIndex, aBlock){
  2844. var self=this;
  2845. var value = self[anIndex - 1];
  2846. if(value === undefined) {
  2847. return aBlock();
  2848. } else {
  2849. return value;
  2850. }
  2851. ;
  2852. return self;},
  2853. args: ["anIndex", "aBlock"],
  2854. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%3C%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%3E'),
  2855. messageSends: [],
  2856. referencedClasses: []
  2857. }),
  2858. smalltalk.Array);
  2859. smalltalk.addMethod(
  2860. unescape('_add_'),
  2861. smalltalk.method({
  2862. selector: unescape('add%3A'),
  2863. category: 'adding/removing',
  2864. fn: function (anObject){
  2865. var self=this;
  2866. self.push(anObject); return anObject;;
  2867. return self;},
  2868. args: ["anObject"],
  2869. source: unescape('add%3A%20anObject%0A%09%3Cself.push%28anObject%29%3B%20return%20anObject%3B%3E'),
  2870. messageSends: [],
  2871. referencedClasses: []
  2872. }),
  2873. smalltalk.Array);
  2874. smalltalk.addMethod(
  2875. unescape('_join_'),
  2876. smalltalk.method({
  2877. selector: unescape('join%3A'),
  2878. category: 'enumerating',
  2879. fn: function (aString){
  2880. var self=this;
  2881. return self.join(aString);
  2882. return self;},
  2883. args: ["aString"],
  2884. source: unescape('join%3A%20aString%0A%09%3Creturn%20self.join%28aString%29%3E'),
  2885. messageSends: [],
  2886. referencedClasses: []
  2887. }),
  2888. smalltalk.Array);
  2889. smalltalk.addMethod(
  2890. unescape('_asJavascript'),
  2891. smalltalk.method({
  2892. selector: unescape('asJavascript'),
  2893. category: 'converting',
  2894. fn: function (){
  2895. var self=this;
  2896. return smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [smalltalk.send(smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJavascript", []);})]), "_join_", [unescape("%2C%20")])]), "__comma", [unescape("%5D")]);
  2897. return self;},
  2898. args: [],
  2899. 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'),
  2900. messageSends: [unescape("%2C"), "join:", "collect:", "asJavascript"],
  2901. referencedClasses: []
  2902. }),
  2903. smalltalk.Array);
  2904. smalltalk.addMethod(
  2905. unescape('_sort'),
  2906. smalltalk.method({
  2907. selector: unescape('sort'),
  2908. category: 'enumerating',
  2909. fn: function (){
  2910. var self=this;
  2911. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  2912. return self;},
  2913. args: [],
  2914. source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27'),
  2915. messageSends: ["basicPerform:"],
  2916. referencedClasses: []
  2917. }),
  2918. smalltalk.Array);
  2919. smalltalk.addMethod(
  2920. unescape('_sort_'),
  2921. smalltalk.method({
  2922. selector: unescape('sort%3A'),
  2923. category: 'enumerating',
  2924. fn: function (aBlock){
  2925. var self=this;
  2926. return self.sort(function(a, b) {
  2927. if(aBlock(a,b)) {return -1} else {return 1}
  2928. })
  2929. ;
  2930. return self;},
  2931. args: ["aBlock"],
  2932. source: unescape('sort%3A%20aBlock%0A%09%3C%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%20-1%7D%20else%20%7Breturn%201%7D%0A%09%09%7D%29%0A%09%3E'),
  2933. messageSends: [],
  2934. referencedClasses: []
  2935. }),
  2936. smalltalk.Array);
  2937. smalltalk.addMethod(
  2938. unescape('_remove_'),
  2939. smalltalk.method({
  2940. selector: unescape('remove%3A'),
  2941. category: 'adding/removing',
  2942. fn: function (anObject){
  2943. var self=this;
  2944. for(var i=0;i<self.length;i++) {
  2945. if(self[i] == anObject) {
  2946. self.splice(i,1);
  2947. break;
  2948. }
  2949. }
  2950. ;
  2951. return self;},
  2952. args: ["anObject"],
  2953. source: unescape('remove%3A%20anObject%0A%09%3C%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09%09%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09%09%09self.splice%28i%2C1%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%3E'),
  2954. messageSends: [],
  2955. referencedClasses: []
  2956. }),
  2957. smalltalk.Array);
  2958. smalltalk.addMethod(
  2959. unescape('_sorted'),
  2960. smalltalk.method({
  2961. selector: unescape('sorted'),
  2962. category: 'enumerating',
  2963. fn: function (){
  2964. var self=this;
  2965. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  2966. return self;},
  2967. args: [],
  2968. source: unescape('sorted%0A%09%5Eself%20copy%20sort'),
  2969. messageSends: ["sort", "copy"],
  2970. referencedClasses: []
  2971. }),
  2972. smalltalk.Array);
  2973. smalltalk.addMethod(
  2974. unescape('_sorted_'),
  2975. smalltalk.method({
  2976. selector: unescape('sorted%3A'),
  2977. category: 'enumerating',
  2978. fn: function (aBlock){
  2979. var self=this;
  2980. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  2981. return self;},
  2982. args: ["aBlock"],
  2983. source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sort%3A%20aBlock'),
  2984. messageSends: ["sort:", "copy"],
  2985. referencedClasses: []
  2986. }),
  2987. smalltalk.Array);
  2988. smalltalk.addMethod(
  2989. unescape('_removeFrom_to_'),
  2990. smalltalk.method({
  2991. selector: unescape('removeFrom%3Ato%3A'),
  2992. category: 'adding/removing',
  2993. fn: function (aNumber, anotherNumber){
  2994. var self=this;
  2995. self.splice(aNumber - 1,anotherNumber - 1);
  2996. return self;},
  2997. args: ["aNumber", "anotherNumber"],
  2998. source: unescape('removeFrom%3A%20aNumber%20to%3A%20anotherNumber%0A%09%3Cself.splice%28aNumber%20-%201%2CanotherNumber%20-%201%29%3E'),
  2999. messageSends: [],
  3000. referencedClasses: []
  3001. }),
  3002. smalltalk.Array);
  3003. smalltalk.addMethod(
  3004. unescape('_reversed'),
  3005. smalltalk.method({
  3006. selector: unescape('reversed'),
  3007. category: 'converting',
  3008. fn: function (){
  3009. var self=this;
  3010. return self._copy().reverse();
  3011. return self;},
  3012. args: [],
  3013. source: unescape('reversed%0A%09%3Creturn%20self._copy%28%29.reverse%28%29%3E'),
  3014. messageSends: [],
  3015. referencedClasses: []
  3016. }),
  3017. smalltalk.Array);
  3018. smalltalk.addMethod(
  3019. unescape('_new_'),
  3020. smalltalk.method({
  3021. selector: unescape('new%3A'),
  3022. category: 'instance creation',
  3023. fn: function (anInteger){
  3024. var self=this;
  3025. return new Array(anInteger);
  3026. return self;},
  3027. args: ["anInteger"],
  3028. source: unescape('new%3A%20anInteger%0A%09%3Creturn%20new%20Array%28anInteger%29%3E'),
  3029. messageSends: [],
  3030. referencedClasses: []
  3031. }),
  3032. smalltalk.Array.klass);
  3033. smalltalk.addMethod(
  3034. unescape('_with_'),
  3035. smalltalk.method({
  3036. selector: unescape('with%3A'),
  3037. category: 'instance creation',
  3038. fn: function (anObject){
  3039. var self=this;
  3040. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(1)]));
  3041. return self;},
  3042. args: ["anObject"],
  3043. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5E%28self%20new%3A%201%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09yourself'),
  3044. messageSends: ["at:put:", "yourself", "new:"],
  3045. referencedClasses: []
  3046. }),
  3047. smalltalk.Array.klass);
  3048. smalltalk.addMethod(
  3049. unescape('_with_with_'),
  3050. smalltalk.method({
  3051. selector: unescape('with%3Awith%3A'),
  3052. category: 'instance creation',
  3053. fn: function (anObject, anObject2){
  3054. var self=this;
  3055. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(2)]));
  3056. return self;},
  3057. args: ["anObject", "anObject2"],
  3058. source: unescape('with%3A%20anObject%20with%3A%20anObject2%0A%09%20%20%20%20%5E%28self%20new%3A%202%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09yourself'),
  3059. messageSends: ["at:put:", "yourself", "new:"],
  3060. referencedClasses: []
  3061. }),
  3062. smalltalk.Array.klass);
  3063. smalltalk.addMethod(
  3064. unescape('_with_with_with_'),
  3065. smalltalk.method({
  3066. selector: unescape('with%3Awith%3Awith%3A'),
  3067. category: 'instance creation',
  3068. fn: function (anObject, anObject2, anObject3){
  3069. var self=this;
  3070. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);smalltalk.send($rec, "_at_put_", [(3), anObject3]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(3)]));
  3071. return self;},
  3072. args: ["anObject", "anObject2", "anObject3"],
  3073. source: unescape('with%3A%20anObject%20with%3A%20anObject2%20with%3A%20anObject3%0A%09%20%20%20%20%5E%28self%20new%3A%203%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09at%3A%203%20put%3A%20anObject3%3B%0A%09%09yourself'),
  3074. messageSends: ["at:put:", "yourself", "new:"],
  3075. referencedClasses: []
  3076. }),
  3077. smalltalk.Array.klass);
  3078. smalltalk.addMethod(
  3079. unescape('_withAll_'),
  3080. smalltalk.method({
  3081. selector: unescape('withAll%3A'),
  3082. category: 'instance creation',
  3083. fn: function (aCollection){
  3084. var self=this;
  3085. var instance=nil;
  3086. (instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
  3087. smalltalk.send(aCollection, "_withIndexDo_", [(function(index, each){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
  3088. return instance;
  3089. return self;},
  3090. args: ["aCollection"],
  3091. source: unescape('withAll%3A%20aCollection%0A%09%7C%20instance%20%7C%0A%09instance%20%3A%3D%20self%20new%3A%20aCollection%20size.%0A%09aCollection%20withIndexDo%3A%20%5B%3Aindex%20%3Aeach%20%7C%0A%09%09instance%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Einstance'),
  3092. messageSends: ["new:", "size", "withIndexDo:", "at:put:"],
  3093. referencedClasses: []
  3094. }),
  3095. smalltalk.Array.klass);
  3096. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  3097. smalltalk.addMethod(
  3098. unescape('_size'),
  3099. smalltalk.method({
  3100. selector: unescape('size'),
  3101. category: 'accessing',
  3102. fn: function (){
  3103. var self=this;
  3104. return self.length;
  3105. return self;},
  3106. args: [],
  3107. source: unescape('size%0A%09%3Creturn%20self.length%3E'),
  3108. messageSends: [],
  3109. referencedClasses: []
  3110. }),
  3111. smalltalk.Array);
  3112. smalltalk.addMethod(
  3113. unescape('_at_put_'),
  3114. smalltalk.method({
  3115. selector: unescape('at%3Aput%3A'),
  3116. category: 'accessing',
  3117. fn: function (anIndex, anObject){
  3118. var self=this;
  3119. return self[anIndex - 1] = anObject;
  3120. return self;},
  3121. args: ["anIndex", "anObject"],
  3122. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%3Creturn%20self%5BanIndex%20-%201%5D%20%3D%20anObject%3E'),
  3123. messageSends: [],
  3124. referencedClasses: []
  3125. }),
  3126. smalltalk.Array);
  3127. smalltalk.addMethod(
  3128. unescape('_at_ifAbsent_'),
  3129. smalltalk.method({
  3130. selector: unescape('at%3AifAbsent%3A'),
  3131. category: 'accessing',
  3132. fn: function (anIndex, aBlock){
  3133. var self=this;
  3134. var value = self[anIndex - 1];
  3135. if(value === undefined) {
  3136. return aBlock();
  3137. } else {
  3138. return value;
  3139. }
  3140. ;
  3141. return self;},
  3142. args: ["anIndex", "aBlock"],
  3143. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%3C%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%3E'),
  3144. messageSends: [],
  3145. referencedClasses: []
  3146. }),
  3147. smalltalk.Array);
  3148. smalltalk.addMethod(
  3149. unescape('_add_'),
  3150. smalltalk.method({
  3151. selector: unescape('add%3A'),
  3152. category: 'adding/removing',
  3153. fn: function (anObject){
  3154. var self=this;
  3155. self.push(anObject); return anObject;;
  3156. return self;},
  3157. args: ["anObject"],
  3158. source: unescape('add%3A%20anObject%0A%09%3Cself.push%28anObject%29%3B%20return%20anObject%3B%3E'),
  3159. messageSends: [],
  3160. referencedClasses: []
  3161. }),
  3162. smalltalk.Array);
  3163. smalltalk.addMethod(
  3164. unescape('_join_'),
  3165. smalltalk.method({
  3166. selector: unescape('join%3A'),
  3167. category: 'enumerating',
  3168. fn: function (aString){
  3169. var self=this;
  3170. return self.join(aString);
  3171. return self;},
  3172. args: ["aString"],
  3173. source: unescape('join%3A%20aString%0A%09%3Creturn%20self.join%28aString%29%3E'),
  3174. messageSends: [],
  3175. referencedClasses: []
  3176. }),
  3177. smalltalk.Array);
  3178. smalltalk.addMethod(
  3179. unescape('_asJavascript'),
  3180. smalltalk.method({
  3181. selector: unescape('asJavascript'),
  3182. category: 'converting',
  3183. fn: function (){
  3184. var self=this;
  3185. return smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [smalltalk.send(smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJavascript", []);})]), "_join_", [unescape("%2C%20")])]), "__comma", [unescape("%5D")]);
  3186. return self;},
  3187. args: [],
  3188. 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'),
  3189. messageSends: [unescape("%2C"), "join:", "collect:", "asJavascript"],
  3190. referencedClasses: []
  3191. }),
  3192. smalltalk.Array);
  3193. smalltalk.addMethod(
  3194. unescape('_sort'),
  3195. smalltalk.method({
  3196. selector: unescape('sort'),
  3197. category: 'enumerating',
  3198. fn: function (){
  3199. var self=this;
  3200. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  3201. return self;},
  3202. args: [],
  3203. source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27'),
  3204. messageSends: ["basicPerform:"],
  3205. referencedClasses: []
  3206. }),
  3207. smalltalk.Array);
  3208. smalltalk.addMethod(
  3209. unescape('_sort_'),
  3210. smalltalk.method({
  3211. selector: unescape('sort%3A'),
  3212. category: 'enumerating',
  3213. fn: function (aBlock){
  3214. var self=this;
  3215. return self.sort(function(a, b) {
  3216. if(aBlock(a,b)) {return -1} else {return 1}
  3217. })
  3218. ;
  3219. return self;},
  3220. args: ["aBlock"],
  3221. source: unescape('sort%3A%20aBlock%0A%09%3C%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%20-1%7D%20else%20%7Breturn%201%7D%0A%09%09%7D%29%0A%09%3E'),
  3222. messageSends: [],
  3223. referencedClasses: []
  3224. }),
  3225. smalltalk.Array);
  3226. smalltalk.addMethod(
  3227. unescape('_remove_'),
  3228. smalltalk.method({
  3229. selector: unescape('remove%3A'),
  3230. category: 'adding/removing',
  3231. fn: function (anObject){
  3232. var self=this;
  3233. for(var i=0;i<self.length;i++) {
  3234. if(self[i] == anObject) {
  3235. self.splice(i,1);
  3236. break;
  3237. }
  3238. }
  3239. ;
  3240. return self;},
  3241. args: ["anObject"],
  3242. source: unescape('remove%3A%20anObject%0A%09%3C%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09%09%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09%09%09self.splice%28i%2C1%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%3E'),
  3243. messageSends: [],
  3244. referencedClasses: []
  3245. }),
  3246. smalltalk.Array);
  3247. smalltalk.addMethod(
  3248. unescape('_sorted'),
  3249. smalltalk.method({
  3250. selector: unescape('sorted'),
  3251. category: 'enumerating',
  3252. fn: function (){
  3253. var self=this;
  3254. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  3255. return self;},
  3256. args: [],
  3257. source: unescape('sorted%0A%09%5Eself%20copy%20sort'),
  3258. messageSends: ["sort", "copy"],
  3259. referencedClasses: []
  3260. }),
  3261. smalltalk.Array);
  3262. smalltalk.addMethod(
  3263. unescape('_sorted_'),
  3264. smalltalk.method({
  3265. selector: unescape('sorted%3A'),
  3266. category: 'enumerating',
  3267. fn: function (aBlock){
  3268. var self=this;
  3269. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  3270. return self;},
  3271. args: ["aBlock"],
  3272. source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sort%3A%20aBlock'),
  3273. messageSends: ["sort:", "copy"],
  3274. referencedClasses: []
  3275. }),
  3276. smalltalk.Array);
  3277. smalltalk.addMethod(
  3278. unescape('_removeFrom_to_'),
  3279. smalltalk.method({
  3280. selector: unescape('removeFrom%3Ato%3A'),
  3281. category: 'adding/removing',
  3282. fn: function (aNumber, anotherNumber){
  3283. var self=this;
  3284. self.splice(aNumber - 1,anotherNumber - 1);
  3285. return self;},
  3286. args: ["aNumber", "anotherNumber"],
  3287. source: unescape('removeFrom%3A%20aNumber%20to%3A%20anotherNumber%0A%09%3Cself.splice%28aNumber%20-%201%2CanotherNumber%20-%201%29%3E'),
  3288. messageSends: [],
  3289. referencedClasses: []
  3290. }),
  3291. smalltalk.Array);
  3292. smalltalk.addMethod(
  3293. unescape('_reversed'),
  3294. smalltalk.method({
  3295. selector: unescape('reversed'),
  3296. category: 'converting',
  3297. fn: function (){
  3298. var self=this;
  3299. return self._copy().reverse();
  3300. return self;},
  3301. args: [],
  3302. source: unescape('reversed%0A%09%3Creturn%20self._copy%28%29.reverse%28%29%3E'),
  3303. messageSends: [],
  3304. referencedClasses: []
  3305. }),
  3306. smalltalk.Array);
  3307. smalltalk.addMethod(
  3308. unescape('_new_'),
  3309. smalltalk.method({
  3310. selector: unescape('new%3A'),
  3311. category: 'instance creation',
  3312. fn: function (anInteger){
  3313. var self=this;
  3314. return new Array(anInteger);
  3315. return self;},
  3316. args: ["anInteger"],
  3317. source: unescape('new%3A%20anInteger%0A%09%3Creturn%20new%20Array%28anInteger%29%3E'),
  3318. messageSends: [],
  3319. referencedClasses: []
  3320. }),
  3321. smalltalk.Array.klass);
  3322. smalltalk.addMethod(
  3323. unescape('_with_'),
  3324. smalltalk.method({
  3325. selector: unescape('with%3A'),
  3326. category: 'instance creation',
  3327. fn: function (anObject){
  3328. var self=this;
  3329. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(1)]));
  3330. return self;},
  3331. args: ["anObject"],
  3332. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5E%28self%20new%3A%201%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09yourself'),
  3333. messageSends: ["at:put:", "yourself", "new:"],
  3334. referencedClasses: []
  3335. }),
  3336. smalltalk.Array.klass);
  3337. smalltalk.addMethod(
  3338. unescape('_with_with_'),
  3339. smalltalk.method({
  3340. selector: unescape('with%3Awith%3A'),
  3341. category: 'instance creation',
  3342. fn: function (anObject, anObject2){
  3343. var self=this;
  3344. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(2)]));
  3345. return self;},
  3346. args: ["anObject", "anObject2"],
  3347. source: unescape('with%3A%20anObject%20with%3A%20anObject2%0A%09%20%20%20%20%5E%28self%20new%3A%202%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09yourself'),
  3348. messageSends: ["at:put:", "yourself", "new:"],
  3349. referencedClasses: []
  3350. }),
  3351. smalltalk.Array.klass);
  3352. smalltalk.addMethod(
  3353. unescape('_with_with_with_'),
  3354. smalltalk.method({
  3355. selector: unescape('with%3Awith%3Awith%3A'),
  3356. category: 'instance creation',
  3357. fn: function (anObject, anObject2, anObject3){
  3358. var self=this;
  3359. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);smalltalk.send($rec, "_at_put_", [(3), anObject3]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(3)]));
  3360. return self;},
  3361. args: ["anObject", "anObject2", "anObject3"],
  3362. source: unescape('with%3A%20anObject%20with%3A%20anObject2%20with%3A%20anObject3%0A%09%20%20%20%20%5E%28self%20new%3A%203%29%0A%09%09at%3A%201%20put%3A%20anObject%3B%0A%09%09at%3A%202%20put%3A%20anObject2%3B%0A%09%09at%3A%203%20put%3A%20anObject3%3B%0A%09%09yourself'),
  3363. messageSends: ["at:put:", "yourself", "new:"],
  3364. referencedClasses: []
  3365. }),
  3366. smalltalk.Array.klass);
  3367. smalltalk.addMethod(
  3368. unescape('_withAll_'),
  3369. smalltalk.method({
  3370. selector: unescape('withAll%3A'),
  3371. category: 'instance creation',
  3372. fn: function (aCollection){
  3373. var self=this;
  3374. var instance=nil;
  3375. (instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
  3376. smalltalk.send(aCollection, "_withIndexDo_", [(function(index, each){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
  3377. return instance;
  3378. return self;},
  3379. args: ["aCollection"],
  3380. source: unescape('withAll%3A%20aCollection%0A%09%7C%20instance%20%7C%0A%09instance%20%3A%3D%20self%20new%3A%20aCollection%20size.%0A%09aCollection%20withIndexDo%3A%20%5B%3Aindex%20%3Aeach%20%7C%0A%09%09instance%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Einstance'),
  3381. messageSends: ["new:", "size", "withIndexDo:", "at:put:"],
  3382. referencedClasses: []
  3383. }),
  3384. smalltalk.Array.klass);
  3385. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3386. smalltalk.addMethod(
  3387. unescape('_next_'),
  3388. smalltalk.method({
  3389. selector: unescape('next%3A'),
  3390. category: 'reading',
  3391. fn: function (anInteger){
  3392. var self=this;
  3393. var tempCollection=nil;
  3394. (tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
  3395. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]));})]));})]);
  3396. return tempCollection;
  3397. return self;},
  3398. args: ["anInteger"],
  3399. 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'),
  3400. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", unescape("%2C"), "next"],
  3401. referencedClasses: []
  3402. }),
  3403. smalltalk.StringStream);
  3404. smalltalk.addMethod(
  3405. unescape('_nextPut_'),
  3406. smalltalk.method({
  3407. selector: unescape('nextPut%3A'),
  3408. category: 'writing',
  3409. fn: function (aString){
  3410. var self=this;
  3411. smalltalk.send(self, "_nextPutAll_", [aString]);
  3412. return self;},
  3413. args: ["aString"],
  3414. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString'),
  3415. messageSends: ["nextPutAll:"],
  3416. referencedClasses: []
  3417. }),
  3418. smalltalk.StringStream);
  3419. smalltalk.addMethod(
  3420. unescape('_nextPutAll_'),
  3421. smalltalk.method({
  3422. selector: unescape('nextPutAll%3A'),
  3423. category: 'writing',
  3424. fn: function (aString){
  3425. var self=this;
  3426. smalltalk.send(self, "_setCollection_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_position", [])]), "__comma", [aString]), "__comma", [smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [((($receiver = ((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])])), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
  3427. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])]))]);
  3428. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  3429. return self;},
  3430. args: ["aString"],
  3431. 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'),
  3432. messageSends: ["setCollection:", unescape("%2C"), "copyFrom:to:", "collection", "position", unescape("+"), "size", "position:", "setStreamSize:", "max:", "streamSize"],
  3433. referencedClasses: []
  3434. }),
  3435. smalltalk.StringStream);
  3436. smalltalk.addMethod(
  3437. unescape('_cr'),
  3438. smalltalk.method({
  3439. selector: unescape('cr'),
  3440. category: 'writing',
  3441. fn: function (){
  3442. var self=this;
  3443. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  3444. return self;},
  3445. args: [],
  3446. source: unescape('cr%0A%09%5Eself%20nextPutAll%3A%20String%20cr'),
  3447. messageSends: ["nextPutAll:", "cr"],
  3448. referencedClasses: ["String"]
  3449. }),
  3450. smalltalk.StringStream);
  3451. smalltalk.addMethod(
  3452. unescape('_crlf'),
  3453. smalltalk.method({
  3454. selector: unescape('crlf'),
  3455. category: 'writing',
  3456. fn: function (){
  3457. var self=this;
  3458. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  3459. return self;},
  3460. args: [],
  3461. source: unescape('crlf%0A%09%5Eself%20nextPutAll%3A%20String%20crlf'),
  3462. messageSends: ["nextPutAll:", "crlf"],
  3463. referencedClasses: ["String"]
  3464. }),
  3465. smalltalk.StringStream);
  3466. smalltalk.addMethod(
  3467. unescape('_lf'),
  3468. smalltalk.method({
  3469. selector: unescape('lf'),
  3470. category: 'writing',
  3471. fn: function (){
  3472. var self=this;
  3473. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  3474. return self;},
  3475. args: [],
  3476. source: unescape('lf%0A%09%5Eself%20nextPutAll%3A%20String%20lf'),
  3477. messageSends: ["nextPutAll:", "lf"],
  3478. referencedClasses: ["String"]
  3479. }),
  3480. smalltalk.StringStream);
  3481. smalltalk.addMethod(
  3482. unescape('_space'),
  3483. smalltalk.method({
  3484. selector: unescape('space'),
  3485. category: 'writing',
  3486. fn: function (){
  3487. var self=this;
  3488. smalltalk.send(self, "_nextPut_", [" "]);
  3489. return self;},
  3490. args: [],
  3491. source: unescape('space%0A%09self%20nextPut%3A%20%27%20%27'),
  3492. messageSends: ["nextPut:"],
  3493. referencedClasses: []
  3494. }),
  3495. smalltalk.StringStream);
  3496. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  3497. smalltalk.addMethod(
  3498. unescape('_add_'),
  3499. smalltalk.method({
  3500. selector: unescape('add%3A'),
  3501. category: 'adding/removing',
  3502. fn: function (anObject){
  3503. var self=this;
  3504. var found;
  3505. for(var i=0; i < self['@elements'].length; i++) {
  3506. if(anObject == self['@elements'][i]) {
  3507. found = true;
  3508. break;
  3509. }
  3510. }
  3511. if(!found) {self['@elements'].push(anObject)}
  3512. ;
  3513. return self;},
  3514. args: ["anObject"],
  3515. source: unescape('add%3A%20anObject%0A%09%3C%0A%09%09var%20found%3B%0A%09%09for%28var%20i%3D0%3B%20i%20%3C%20self%5B%27@elements%27%5D.length%3B%20i++%29%20%7B%0A%09%09%09if%28anObject%20%3D%3D%20self%5B%27@elements%27%5D%5Bi%5D%29%20%7B%0A%09%09%09%09found%20%3D%20true%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09if%28%21found%29%20%7Bself%5B%27@elements%27%5D.push%28anObject%29%7D%0A%09%3E'),
  3516. messageSends: [],
  3517. referencedClasses: []
  3518. }),
  3519. smalltalk.Set);
  3520. smalltalk.addMethod(
  3521. unescape('_remove_'),
  3522. smalltalk.method({
  3523. selector: unescape('remove%3A'),
  3524. category: 'adding/removing',
  3525. fn: function (anObject){
  3526. var self=this;
  3527. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  3528. return self;},
  3529. args: ["anObject"],
  3530. source: unescape('remove%3A%20anObject%0A%09elements%20remove%3A%20anObject'),
  3531. messageSends: ["remove:"],
  3532. referencedClasses: []
  3533. }),
  3534. smalltalk.Set);
  3535. smalltalk.addMethod(
  3536. unescape('_initialize'),
  3537. smalltalk.method({
  3538. selector: unescape('initialize'),
  3539. category: 'initialization',
  3540. fn: function (){
  3541. var self=this;
  3542. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  3543. (self['@elements']=[]);
  3544. return self;},
  3545. args: [],
  3546. source: unescape('initialize%0A%09super%20initialize.%0A%09elements%20%3A%3D%20%23%28%29'),
  3547. messageSends: ["initialize"],
  3548. referencedClasses: []
  3549. }),
  3550. smalltalk.Set);
  3551. smalltalk.addMethod(
  3552. unescape('_size'),
  3553. smalltalk.method({
  3554. selector: unescape('size'),
  3555. category: 'accessing',
  3556. fn: function (){
  3557. var self=this;
  3558. return smalltalk.send(self['@elements'], "_size", []);
  3559. return self;},
  3560. args: [],
  3561. source: unescape('size%0A%09%5Eelements%20size'),
  3562. messageSends: ["size"],
  3563. referencedClasses: []
  3564. }),
  3565. smalltalk.Set);
  3566. smalltalk.addMethod(
  3567. unescape('_asArray'),
  3568. smalltalk.method({
  3569. selector: unescape('asArray'),
  3570. category: 'converting',
  3571. fn: function (){
  3572. var self=this;
  3573. return smalltalk.send(self['@elements'], "_copy", []);
  3574. return self;},
  3575. args: [],
  3576. source: unescape('asArray%0A%09%5Eelements%20copy'),
  3577. messageSends: ["copy"],
  3578. referencedClasses: []
  3579. }),
  3580. smalltalk.Set);
  3581. smalltalk.addMethod(
  3582. unescape('_detect_ifNone_'),
  3583. smalltalk.method({
  3584. selector: unescape('detect%3AifNone%3A'),
  3585. category: 'enumerating',
  3586. fn: function (aBlock, anotherBlock){
  3587. var self=this;
  3588. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  3589. return self;},
  3590. args: ["aBlock", "anotherBlock"],
  3591. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eelements%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock'),
  3592. messageSends: ["detect:ifNone:"],
  3593. referencedClasses: []
  3594. }),
  3595. smalltalk.Set);
  3596. smalltalk.addMethod(
  3597. unescape('_do_'),
  3598. smalltalk.method({
  3599. selector: unescape('do%3A'),
  3600. category: 'enumerating',
  3601. fn: function (aBlock){
  3602. var self=this;
  3603. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  3604. return self;},
  3605. args: ["aBlock"],
  3606. source: unescape('do%3A%20aBlock%0A%09elements%20do%3A%20aBlock'),
  3607. messageSends: ["do:"],
  3608. referencedClasses: []
  3609. }),
  3610. smalltalk.Set);
  3611. smalltalk.addMethod(
  3612. unescape('_includes_'),
  3613. smalltalk.method({
  3614. selector: unescape('includes%3A'),
  3615. category: 'testing',
  3616. fn: function (anObject){
  3617. var self=this;
  3618. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  3619. return self;},
  3620. args: ["anObject"],
  3621. source: unescape('includes%3A%20anObject%0A%09%5Eelements%20includes%3A%20anObject'),
  3622. messageSends: ["includes:"],
  3623. referencedClasses: []
  3624. }),
  3625. smalltalk.Set);
  3626. smalltalk.addMethod(
  3627. unescape('__eq'),
  3628. smalltalk.method({
  3629. selector: unescape('%3D'),
  3630. category: 'comparing',
  3631. fn: function (aCollection){
  3632. var self=this;
  3633. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(self['@elements'], "__eq", [smalltalk.send(aCollection, "_asArray", [])]);})]);
  3634. return self;},
  3635. args: ["aCollection"],
  3636. source: unescape('%3D%20aCollection%0A%09%5Eself%20class%20%3D%20aCollection%20class%20and%3A%20%5B%0A%09%09elements%20%3D%20aCollection%20asArray%5D'),
  3637. messageSends: ["and:", unescape("%3D"), "class", "asArray"],
  3638. referencedClasses: []
  3639. }),
  3640. smalltalk.Set);
  3641. smalltalk.addMethod(
  3642. unescape('_select_'),
  3643. smalltalk.method({
  3644. selector: unescape('select%3A'),
  3645. category: 'enumerating',
  3646. fn: function (aBlock){
  3647. var self=this;
  3648. var collection=nil;
  3649. (collection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  3650. smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(collection, "_add_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(collection, "_add_", [each]);})]));})]);
  3651. return collection;
  3652. return self;},
  3653. args: ["aBlock"],
  3654. source: unescape('select%3A%20aBlock%0A%09%7C%20collection%20%7C%0A%09collection%20%3A%3D%20self%20class%20new.%20%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%28aBlock%20value%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09%09collection%20add%3A%20each%5D%5D.%0A%09%5Ecollection'),
  3655. messageSends: ["new", "class", "do:", "ifTrue:", "value:", "add:"],
  3656. referencedClasses: []
  3657. }),
  3658. smalltalk.Set);
  3659. smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
  3660. smalltalk.HashedCollection.comment=unescape('A%20HashedCollection%20is%20a%20traditional%20JavaScript%20object%2C%20or%20a%20Smalltalk%20Dictionary.%0A%0AUnlike%20a%20Dictionary%2C%20it%20can%20only%20have%20strings%20as%20keys.')
  3661. smalltalk.addMethod(
  3662. unescape('_size'),
  3663. smalltalk.method({
  3664. selector: unescape('size'),
  3665. category: 'accessing',
  3666. fn: function (){
  3667. var self=this;
  3668. return smalltalk.send(smalltalk.send(self, "_keys", []), "_size", []);
  3669. return self;},
  3670. args: [],
  3671. source: unescape('size%0A%09%5Eself%20keys%20size'),
  3672. messageSends: ["size", "keys"],
  3673. referencedClasses: []
  3674. }),
  3675. smalltalk.HashedCollection);
  3676. smalltalk.addMethod(
  3677. unescape('_associations'),
  3678. smalltalk.method({
  3679. selector: unescape('associations'),
  3680. category: 'accessing',
  3681. fn: function (){
  3682. var self=this;
  3683. var associations=nil;
  3684. (associations=[]);
  3685. smalltalk.send(smalltalk.send(self, "_keys", []), "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send((smalltalk.Association || Association), "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
  3686. return associations;
  3687. return self;},
  3688. args: [],
  3689. source: unescape('associations%0A%09%7C%20associations%20%7C%0A%09associations%20%3A%3D%20%23%28%29.%0A%09self%20keys%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'),
  3690. messageSends: ["do:", "keys", "add:", "key:value:", "at:"],
  3691. referencedClasses: ["Association"]
  3692. }),
  3693. smalltalk.HashedCollection);
  3694. smalltalk.addMethod(
  3695. unescape('_keys'),
  3696. smalltalk.method({
  3697. selector: unescape('keys'),
  3698. category: 'accessing',
  3699. fn: function (){
  3700. var self=this;
  3701. var keys = [];
  3702. for(var i in self) {
  3703. if(self.hasOwnProperty(i)) {
  3704. keys.push(i);
  3705. }
  3706. };
  3707. return keys;
  3708. ;
  3709. return self;},
  3710. args: [],
  3711. source: unescape('keys%0A%09%3C%0A%09%09var%20keys%20%3D%20%5B%5D%3B%0A%09%09for%28var%20i%20in%20self%29%20%7B%0A%09%09%09if%28self.hasOwnProperty%28i%29%29%20%7B%0A%09%09%09%09keys.push%28i%29%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09return%20keys%3B%0A%09%3E'),
  3712. messageSends: [],
  3713. referencedClasses: []
  3714. }),
  3715. smalltalk.HashedCollection);
  3716. smalltalk.addMethod(
  3717. unescape('_values'),
  3718. smalltalk.method({
  3719. selector: unescape('values'),
  3720. category: 'accessing',
  3721. fn: function (){
  3722. var self=this;
  3723. return smalltalk.send(smalltalk.send(self, "_keys", []), "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  3724. return self;},
  3725. args: [],
  3726. source: unescape('values%0A%09%5Eself%20keys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D'),
  3727. messageSends: ["collect:", "keys", "at:"],
  3728. referencedClasses: []
  3729. }),
  3730. smalltalk.HashedCollection);
  3731. smalltalk.addMethod(
  3732. unescape('_at_put_'),
  3733. smalltalk.method({
  3734. selector: unescape('at%3Aput%3A'),
  3735. category: 'accessing',
  3736. fn: function (aKey, aValue){
  3737. var self=this;
  3738. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  3739. return self;},
  3740. args: ["aKey", "aValue"],
  3741. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%5Eself%20basicAt%3A%20aKey%20put%3A%20aValue'),
  3742. messageSends: ["basicAt:put:"],
  3743. referencedClasses: []
  3744. }),
  3745. smalltalk.HashedCollection);
  3746. smalltalk.addMethod(
  3747. unescape('_at_ifAbsent_'),
  3748. smalltalk.method({
  3749. selector: unescape('at%3AifAbsent%3A'),
  3750. category: 'accessing',
  3751. fn: function (aKey, aBlock){
  3752. var self=this;
  3753. return smalltalk.send(smalltalk.send(self, "_includesKey_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  3754. return self;},
  3755. args: ["aKey", "aBlock"],
  3756. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20includesKey%3A%20aKey%29%0A%09%09ifTrue%3A%20%5Bself%20basicAt%3A%20aKey%5D%0A%09%09ifFalse%3A%20aBlock'),
  3757. messageSends: ["ifTrue:ifFalse:", "includesKey:", "basicAt:"],
  3758. referencedClasses: []
  3759. }),
  3760. smalltalk.HashedCollection);
  3761. smalltalk.addMethod(
  3762. unescape('_at_ifAbsentPut_'),
  3763. smalltalk.method({
  3764. selector: unescape('at%3AifAbsentPut%3A'),
  3765. category: 'accessing',
  3766. fn: function (aKey, aBlock){
  3767. var self=this;
  3768. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  3769. return self;},
  3770. args: ["aKey", "aBlock"],
  3771. source: unescape('at%3A%20aKey%20ifAbsentPut%3A%20aBlock%0A%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20at%3A%20aKey%20put%3A%20aBlock%20value%5D'),
  3772. messageSends: ["at:ifAbsent:", "at:put:", "value"],
  3773. referencedClasses: []
  3774. }),
  3775. smalltalk.HashedCollection);
  3776. smalltalk.addMethod(
  3777. unescape('_at_ifPresent_'),
  3778. smalltalk.method({
  3779. selector: unescape('at%3AifPresent%3A'),
  3780. category: 'accessing',
  3781. fn: function (aKey, aBlock){
  3782. var self=this;
  3783. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  3784. return self;},
  3785. args: ["aKey", "aBlock"],
  3786. 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'),
  3787. messageSends: ["ifNotNil:", "basicAt:", "value:", "at:"],
  3788. referencedClasses: []
  3789. }),
  3790. smalltalk.HashedCollection);
  3791. smalltalk.addMethod(
  3792. unescape('_at_ifPresent_ifAbsent_'),
  3793. smalltalk.method({
  3794. selector: unescape('at%3AifPresent%3AifAbsent%3A'),
  3795. category: 'accessing',
  3796. fn: function (aKey, aBlock, anotherBlock){
  3797. var self=this;
  3798. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  3799. return self;},
  3800. args: ["aKey", "aBlock", "anotherBlock"],
  3801. 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'),
  3802. messageSends: ["ifNil:ifNotNil:", "basicAt:", "value:", "at:"],
  3803. referencedClasses: []
  3804. }),
  3805. smalltalk.HashedCollection);
  3806. smalltalk.addMethod(
  3807. unescape('_at_'),
  3808. smalltalk.method({
  3809. selector: unescape('at%3A'),
  3810. category: 'accessing',
  3811. fn: function (aKey){
  3812. var self=this;
  3813. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  3814. return self;},
  3815. args: ["aKey"],
  3816. source: unescape('at%3A%20aKey%0A%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5Bself%20errorNotFound%5D'),
  3817. messageSends: ["at:ifAbsent:", "errorNotFound"],
  3818. referencedClasses: []
  3819. }),
  3820. smalltalk.HashedCollection);
  3821. smalltalk.addMethod(
  3822. unescape('_add_'),
  3823. smalltalk.method({
  3824. selector: unescape('add%3A'),
  3825. category: 'adding/removing',
  3826. fn: function (anAssociation){
  3827. var self=this;
  3828. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  3829. return self;},
  3830. args: ["anAssociation"],
  3831. source: unescape('add%3A%20anAssociation%0A%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value'),
  3832. messageSends: ["at:put:", "key", "value"],
  3833. referencedClasses: []
  3834. }),
  3835. smalltalk.HashedCollection);
  3836. smalltalk.addMethod(
  3837. unescape('_addAll_'),
  3838. smalltalk.method({
  3839. selector: unescape('addAll%3A'),
  3840. category: 'adding/removing',
  3841. fn: function (aHashedCollection){
  3842. var self=this;
  3843. smalltalk.send(self, "_addAll_", [smalltalk.send(aHashedCollection, "_associations", [])], smalltalk.Collection);
  3844. return aHashedCollection;
  3845. return self;},
  3846. args: ["aHashedCollection"],
  3847. source: unescape('addAll%3A%20aHashedCollection%0A%09super%20addAll%3A%20aHashedCollection%20associations.%0A%09%5EaHashedCollection'),
  3848. messageSends: ["addAll:", "associations"],
  3849. referencedClasses: []
  3850. }),
  3851. smalltalk.HashedCollection);
  3852. smalltalk.addMethod(
  3853. unescape('_removeKey_'),
  3854. smalltalk.method({
  3855. selector: unescape('removeKey%3A'),
  3856. category: 'adding/removing',
  3857. fn: function (aKey){
  3858. var self=this;
  3859. smalltalk.send(self, "_remove_", [aKey]);
  3860. return self;},
  3861. args: ["aKey"],
  3862. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20self%20remove%3A%20aKey'),
  3863. messageSends: ["remove:"],
  3864. referencedClasses: []
  3865. }),
  3866. smalltalk.HashedCollection);
  3867. smalltalk.addMethod(
  3868. unescape('_remove_ifAbsent_'),
  3869. smalltalk.method({
  3870. selector: unescape('remove%3AifAbsent%3A'),
  3871. category: 'adding/removing',
  3872. fn: function (aKey, aBlock){
  3873. var self=this;
  3874. return smalltalk.send(self, "_removeKey_ifAbsent_", [aKey, aBlock]);
  3875. return self;},
  3876. args: ["aKey", "aBlock"],
  3877. source: unescape('remove%3A%20aKey%20ifAbsent%3A%20aBlock%0A%20%20%20%20%5Eself%20removeKey%3A%20aKey%20ifAbsent%3A%20aBlock'),
  3878. messageSends: ["removeKey:ifAbsent:"],
  3879. referencedClasses: []
  3880. }),
  3881. smalltalk.HashedCollection);
  3882. smalltalk.addMethod(
  3883. unescape('_removeKey_ifAbsent_'),
  3884. smalltalk.method({
  3885. selector: unescape('removeKey%3AifAbsent%3A'),
  3886. category: 'adding/removing',
  3887. fn: function (aKey, aBlock){
  3888. var self=this;
  3889. return ((($receiver = smalltalk.send(self, "_includesKey_", [aKey])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})]));
  3890. return self;},
  3891. args: ["aKey", "aBlock"],
  3892. source: unescape('removeKey%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20includesKey%3A%20aKey%29%20%0A%09%09ifFalse%3A%20%5BaBlock%20value%5D%0A%09%09ifTrue%3A%20%5Bself%20basicDelete%3A%20aKey%5D'),
  3893. messageSends: ["ifFalse:ifTrue:", "includesKey:", "value", "basicDelete:"],
  3894. referencedClasses: []
  3895. }),
  3896. smalltalk.HashedCollection);
  3897. smalltalk.addMethod(
  3898. unescape('__eq'),
  3899. smalltalk.method({
  3900. selector: unescape('%3D'),
  3901. category: 'comparing',
  3902. fn: function (aHashedCollection){
  3903. var self=this;
  3904. try{((($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aHashedCollection, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  3905. ((($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aHashedCollection, "_size", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  3906. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aHashedCollection, "_associations", [])])}})})();
  3907. return self;
  3908. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  3909. args: ["aHashedCollection"],
  3910. source: unescape('%3D%20aHashedCollection%0A%09self%20class%20%3D%20aHashedCollection%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20size%20%3D%20aHashedCollection%20size%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%5Eself%20associations%20%3D%20aHashedCollection%20associations'),
  3911. messageSends: ["ifFalse:", unescape("%3D"), "class", "size", "associations"],
  3912. referencedClasses: []
  3913. }),
  3914. smalltalk.HashedCollection);
  3915. smalltalk.addMethod(
  3916. unescape('_shallowCopy'),
  3917. smalltalk.method({
  3918. selector: unescape('shallowCopy'),
  3919. category: 'copying',
  3920. fn: function (){
  3921. var self=this;
  3922. var copy=nil;
  3923. (copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  3924. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  3925. return copy;
  3926. return self;},
  3927. args: [],
  3928. 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'),
  3929. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "value"],
  3930. referencedClasses: []
  3931. }),
  3932. smalltalk.HashedCollection);
  3933. smalltalk.addMethod(
  3934. unescape('__comma'),
  3935. smalltalk.method({
  3936. selector: unescape('%2C'),
  3937. category: 'copying',
  3938. fn: function (aCollection){
  3939. var self=this;
  3940. smalltalk.send(self, "_shouldNotImplement", []);
  3941. return self;},
  3942. args: ["aCollection"],
  3943. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement'),
  3944. messageSends: ["shouldNotImplement"],
  3945. referencedClasses: []
  3946. }),
  3947. smalltalk.HashedCollection);
  3948. smalltalk.addMethod(
  3949. unescape('_copyFrom_to_'),
  3950. smalltalk.method({
  3951. selector: unescape('copyFrom%3Ato%3A'),
  3952. category: 'copying',
  3953. fn: function (anIndex, anotherIndex){
  3954. var self=this;
  3955. smalltalk.send(self, "_shouldNotImplement", []);
  3956. return self;},
  3957. args: ["anIndex", "anotherIndex"],
  3958. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement'),
  3959. messageSends: ["shouldNotImplement"],
  3960. referencedClasses: []
  3961. }),
  3962. smalltalk.HashedCollection);
  3963. smalltalk.addMethod(
  3964. unescape('_deepCopy'),
  3965. smalltalk.method({
  3966. selector: unescape('deepCopy'),
  3967. category: 'copying',
  3968. fn: function (){
  3969. var self=this;
  3970. var copy=nil;
  3971. (copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  3972. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(smalltalk.send(each, "_value", []), "_deepCopy", [])]);})]);
  3973. return copy;
  3974. return self;},
  3975. args: [],
  3976. source: unescape('deepCopy%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%20deepCopy%5D.%0A%09%5Ecopy'),
  3977. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "deepCopy", "value"],
  3978. referencedClasses: []
  3979. }),
  3980. smalltalk.HashedCollection);
  3981. smalltalk.addMethod(
  3982. unescape('_associationsDo_'),
  3983. smalltalk.method({
  3984. selector: unescape('associationsDo%3A'),
  3985. category: 'enumerating',
  3986. fn: function (aBlock){
  3987. var self=this;
  3988. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  3989. return self;},
  3990. args: ["aBlock"],
  3991. source: unescape('associationsDo%3A%20aBlock%0A%09self%20associations%20do%3A%20aBlock'),
  3992. messageSends: ["do:", "associations"],
  3993. referencedClasses: []
  3994. }),
  3995. smalltalk.HashedCollection);
  3996. smalltalk.addMethod(
  3997. unescape('_keysAndValuesDo_'),
  3998. smalltalk.method({
  3999. selector: unescape('keysAndValuesDo%3A'),
  4000. category: 'enumerating',
  4001. fn: function (aBlock){
  4002. var self=this;
  4003. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  4004. return self;},
  4005. args: ["aBlock"],
  4006. source: unescape('keysAndValuesDo%3A%20aBlock%0A%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20aBlock%20value%3A%20each%20key%20value%3A%20each%20value%5D'),
  4007. messageSends: ["associationsDo:", "value:value:", "key", "value"],
  4008. referencedClasses: []
  4009. }),
  4010. smalltalk.HashedCollection);
  4011. smalltalk.addMethod(
  4012. unescape('_do_'),
  4013. smalltalk.method({
  4014. selector: unescape('do%3A'),
  4015. category: 'enumerating',
  4016. fn: function (aBlock){
  4017. var self=this;
  4018. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  4019. return self;},
  4020. args: ["aBlock"],
  4021. source: unescape('do%3A%20aBlock%0A%09self%20values%20do%3A%20aBlock'),
  4022. messageSends: ["do:", "values"],
  4023. referencedClasses: []
  4024. }),
  4025. smalltalk.HashedCollection);
  4026. smalltalk.addMethod(
  4027. unescape('_select_'),
  4028. smalltalk.method({
  4029. selector: unescape('select%3A'),
  4030. category: 'enumerating',
  4031. fn: function (aBlock){
  4032. var self=this;
  4033. var newDict=nil;
  4034. (newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  4035. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return ((($receiver = smalltalk.send(aBlock, "_value_", [value])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]));})]);
  4036. return newDict;
  4037. return self;},
  4038. args: ["aBlock"],
  4039. source: unescape('select%3A%20aBlock%0A%09%7C%20newDict%20%7C%0A%09newDict%20%3A%3D%20self%20class%20new.%0A%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%09%5EnewDict'),
  4040. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "value:", "at:put:"],
  4041. referencedClasses: []
  4042. }),
  4043. smalltalk.HashedCollection);
  4044. smalltalk.addMethod(
  4045. unescape('_collect_'),
  4046. smalltalk.method({
  4047. selector: unescape('collect%3A'),
  4048. category: 'enumerating',
  4049. fn: function (aBlock){
  4050. var self=this;
  4051. var newDict=nil;
  4052. (newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  4053. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  4054. return newDict;
  4055. return self;},
  4056. args: ["aBlock"],
  4057. source: unescape('collect%3A%20aBlock%0A%09%7C%20newDict%20%7C%0A%09newDict%20%3A%3D%20self%20class%20new.%0A%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%20%20%20%20newDict%20at%3A%20key%20put%3A%20%28aBlock%20value%3A%20value%29%5D.%0A%09%5EnewDict'),
  4058. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "value:"],
  4059. referencedClasses: []
  4060. }),
  4061. smalltalk.HashedCollection);
  4062. smalltalk.addMethod(
  4063. unescape('_detect_ifNone_'),
  4064. smalltalk.method({
  4065. selector: unescape('detect%3AifNone%3A'),
  4066. category: 'enumerating',
  4067. fn: function (aBlock, anotherBlock){
  4068. var self=this;
  4069. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  4070. return self;},
  4071. args: ["aBlock", "anotherBlock"],
  4072. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock'),
  4073. messageSends: ["detect:ifNone:", "values"],
  4074. referencedClasses: []
  4075. }),
  4076. smalltalk.HashedCollection);
  4077. smalltalk.addMethod(
  4078. unescape('_includes_'),
  4079. smalltalk.method({
  4080. selector: unescape('includes%3A'),
  4081. category: 'enumerating',
  4082. fn: function (anObject){
  4083. var self=this;
  4084. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  4085. return self;},
  4086. args: ["anObject"],
  4087. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject'),
  4088. messageSends: ["includes:", "values"],
  4089. referencedClasses: []
  4090. }),
  4091. smalltalk.HashedCollection);
  4092. smalltalk.addMethod(
  4093. unescape('_printString'),
  4094. smalltalk.method({
  4095. selector: unescape('printString'),
  4096. category: 'printing',
  4097. fn: function (){
  4098. var self=this;
  4099. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Collection)]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);})(aStream);smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(anAssociation){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_key", []), "_printString", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%20-%3E%20")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_value", []), "_printString", [])]);})(aStream);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%20%2C%20")]);})]);return smalltalk.send(aStream, "_nextPutAll_", [unescape("%29")]);})]);
  4100. return self;},
  4101. args: [],
  4102. source: unescape('printString%0A%09%5EString%20streamContents%3A%20%5B%3AaStream%7C%20%20%0A%09%09aStream%20%0A%09%09%09nextPutAll%3A%20super%20printString%3B%0A%09%09%09nextPutAll%3A%20%27%28%27.%0A%09%09%09%09self%20associations%20%0A%09%09%09%09%09do%3A%20%5B%3AanAssociation%7C%20%20%0A%09%09%09%09%09%09aStream%20%0A%09%09%09%09%09%09%09nextPutAll%3A%20anAssociation%20key%20printString%3B%0A%09%09%09%09%09%09%09%09nextPutAll%3A%20%27%20-%3E%20%27%3B%0A%09%09%09%09%09%09%09%09nextPutAll%3A%20anAssociation%20value%20printString%5D%0A%09%09%09%09%09%09%09separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%20%2C%20%27%5D.%0A%09%09%09%09%09%09aStream%20nextPutAll%3A%20%27%29%27%5D'),
  4103. messageSends: ["streamContents:", "nextPutAll:", "printString", "do:separatedBy:", "associations", "key", "value"],
  4104. referencedClasses: ["String"]
  4105. }),
  4106. smalltalk.HashedCollection);
  4107. smalltalk.addMethod(
  4108. unescape('_storeOn_'),
  4109. smalltalk.method({
  4110. selector: unescape('storeOn%3A'),
  4111. category: 'printing',
  4112. fn: function (aStream){
  4113. var self=this;
  4114. smalltalk.send(aStream, "_nextPutAll_", [unescape("%23%7B")]);
  4115. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  4116. smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
  4117. return self;},
  4118. args: ["aStream"],
  4119. source: unescape('storeOn%3A%20aStream%0A%09aStream%20nextPutAll%3A%20%27%23%7B%27.%0A%09self%20associations%0A%09%09do%3A%20%5B%3Aeach%20%7C%20each%20storeOn%3A%20aStream%5D%0A%09%09separatedBy%3A%20%5B%20aStream%20nextPutAll%3A%20%27.%20%27%5D.%0A%09aStream%20nextPutAll%3A%20%27%7D%27'),
  4120. messageSends: ["nextPutAll:", "do:separatedBy:", "associations", "storeOn:"],
  4121. referencedClasses: []
  4122. }),
  4123. smalltalk.HashedCollection);
  4124. smalltalk.addMethod(
  4125. unescape('_includesKey_'),
  4126. smalltalk.method({
  4127. selector: unescape('includesKey%3A'),
  4128. category: 'testing',
  4129. fn: function (aKey){
  4130. var self=this;
  4131. return self.hasOwnProperty(aKey);
  4132. return self;},
  4133. args: ["aKey"],
  4134. source: unescape('includesKey%3A%20aKey%0A%09%3Creturn%20self.hasOwnProperty%28aKey%29%3E'),
  4135. messageSends: [],
  4136. referencedClasses: []
  4137. }),
  4138. smalltalk.HashedCollection);
  4139. smalltalk.addMethod(
  4140. unescape('_asDictionary'),
  4141. smalltalk.method({
  4142. selector: unescape('asDictionary'),
  4143. category: 'converting',
  4144. fn: function (){
  4145. var self=this;
  4146. return smalltalk.send((smalltalk.Dictionary || Dictionary), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
  4147. return self;},
  4148. args: [],
  4149. source: unescape('asDictionary%0A%09%5EDictionary%20fromPairs%3A%20self%20associations'),
  4150. messageSends: ["fromPairs:", "associations"],
  4151. referencedClasses: ["Dictionary"]
  4152. }),
  4153. smalltalk.HashedCollection);
  4154. smalltalk.addMethod(
  4155. unescape('_fromPairs_'),
  4156. smalltalk.method({
  4157. selector: unescape('fromPairs%3A'),
  4158. category: 'instance creation',
  4159. fn: function (aCollection){
  4160. var self=this;
  4161. var dict=nil;
  4162. (dict=smalltalk.send(self, "_new", []));
  4163. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  4164. return dict;
  4165. return self;},
  4166. args: ["aCollection"],
  4167. source: unescape('fromPairs%3A%20aCollection%0A%09%7C%20dict%20%7C%0A%09dict%20%3A%3D%20self%20new.%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%20dict%20add%3A%20each%5D.%0A%09%5Edict'),
  4168. messageSends: ["new", "do:", "add:"],
  4169. referencedClasses: []
  4170. }),
  4171. smalltalk.HashedCollection.klass);
  4172. smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
  4173. smalltalk.addMethod(
  4174. unescape('_at_ifAbsent_'),
  4175. smalltalk.method({
  4176. selector: unescape('at%3AifAbsent%3A'),
  4177. category: 'accessing',
  4178. fn: function (aKey, aBlock){
  4179. var self=this;
  4180. var index;
  4181. for(var i=0;i<self['@keys'].length;i++){
  4182. if(self['@keys'][i].__eq(aKey)) {index = i;}
  4183. };
  4184. if(typeof index === 'undefined') {
  4185. return aBlock();
  4186. } else {
  4187. return self['@values'][index];
  4188. }
  4189. ;
  4190. return self;},
  4191. args: ["aKey", "aBlock"],
  4192. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%09var%20index%3B%0A%09%09for%28var%20i%3D0%3Bi%3Cself%5B%27@keys%27%5D.length%3Bi++%29%7B%0A%09%09%09if%28self%5B%27@keys%27%5D%5Bi%5D.__eq%28aKey%29%29%20%7Bindex%20%3D%20i%3B%7D%0A%09%09%7D%3B%0A%09%09if%28typeof%20index%20%3D%3D%3D%20%27undefined%27%29%20%7B%0A%09%09%09return%20aBlock%28%29%3B%0A%09%09%7D%20else%20%7B%0A%09%09%09return%20self%5B%27@values%27%5D%5Bindex%5D%3B%0A%09%09%7D%0A%09%3E'),
  4193. messageSends: [],
  4194. referencedClasses: []
  4195. }),
  4196. smalltalk.Dictionary);
  4197. smalltalk.addMethod(
  4198. unescape('_keys'),
  4199. smalltalk.method({
  4200. selector: unescape('keys'),
  4201. category: 'accessing',
  4202. fn: function (){
  4203. var self=this;
  4204. return smalltalk.send(self['@keys'], "_copy", []);
  4205. return self;},
  4206. args: [],
  4207. source: unescape('keys%0A%09%5Ekeys%20copy'),
  4208. messageSends: ["copy"],
  4209. referencedClasses: []
  4210. }),
  4211. smalltalk.Dictionary);
  4212. smalltalk.addMethod(
  4213. unescape('_values'),
  4214. smalltalk.method({
  4215. selector: unescape('values'),
  4216. category: 'accessing',
  4217. fn: function (){
  4218. var self=this;
  4219. return smalltalk.send(self['@values'], "_copy", []);
  4220. return self;},
  4221. args: [],
  4222. source: unescape('values%0A%09%5Evalues%20copy'),
  4223. messageSends: ["copy"],
  4224. referencedClasses: []
  4225. }),
  4226. smalltalk.Dictionary);
  4227. smalltalk.addMethod(
  4228. unescape('_at_put_'),
  4229. smalltalk.method({
  4230. selector: unescape('at%3Aput%3A'),
  4231. category: 'accessing',
  4232. fn: function (aKey, aValue){
  4233. var self=this;
  4234. var index = self['@keys'].indexOf(aKey);
  4235. if(index === -1) {
  4236. self['@values'].push(aValue);
  4237. self['@keys'].push(aKey);
  4238. } else {
  4239. self['@values'][index] = aValue;
  4240. };
  4241. return aValue;
  4242. ;
  4243. return self;},
  4244. args: ["aKey", "aValue"],
  4245. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%3C%0A%09%09var%20index%20%3D%20self%5B%27@keys%27%5D.indexOf%28aKey%29%3B%0A%09%09if%28index%20%3D%3D%3D%20-1%29%20%7B%0A%09%09%09self%5B%27@values%27%5D.push%28aValue%29%3B%0A%09%09%09self%5B%27@keys%27%5D.push%28aKey%29%3B%0A%09%09%7D%20else%20%7B%0A%09%09%09self%5B%27@values%27%5D%5Bindex%5D%20%3D%20aValue%3B%0A%09%09%7D%3B%0A%0A%09%09return%20aValue%3B%0A%09%3E'),
  4246. messageSends: [],
  4247. referencedClasses: []
  4248. }),
  4249. smalltalk.Dictionary);
  4250. smalltalk.addMethod(
  4251. unescape('_removeKey_ifAbsent_'),
  4252. smalltalk.method({
  4253. selector: unescape('removeKey%3AifAbsent%3A'),
  4254. category: 'adding/removing',
  4255. fn: function (aKey, aBlock){
  4256. var self=this;
  4257. var index = self['@keys'].indexOf(aKey);
  4258. if(index === -1) {
  4259. return aBlock()
  4260. } else {
  4261. self['@keys'].splice(i, 1);
  4262. self['@values'].splice(i, 1);
  4263. return aKey
  4264. };
  4265. ;
  4266. return self;},
  4267. args: ["aKey", "aBlock"],
  4268. source: unescape('removeKey%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%3C%0A%09%09var%20index%20%3D%20self%5B%27@keys%27%5D.indexOf%28aKey%29%3B%0A%09%09if%28index%20%3D%3D%3D%20-1%29%20%7B%0A%09%09%09return%20aBlock%28%29%0A%09%09%7D%20else%20%7B%0A%09%09%09self%5B%27@keys%27%5D.splice%28i%2C%201%29%3B%0A%09%09%09self%5B%27@values%27%5D.splice%28i%2C%201%29%3B%0A%09%09%09return%20aKey%0A%09%09%7D%3B%0A%09%3E'),
  4269. messageSends: [],
  4270. referencedClasses: []
  4271. }),
  4272. smalltalk.Dictionary);
  4273. smalltalk.addMethod(
  4274. unescape('_initialize'),
  4275. smalltalk.method({
  4276. selector: unescape('initialize'),
  4277. category: 'initialization',
  4278. fn: function (){
  4279. var self=this;
  4280. smalltalk.send(self, "_initialize", [], smalltalk.HashedCollection);
  4281. (self['@keys']=[]);
  4282. (self['@values']=[]);
  4283. return self;},
  4284. args: [],
  4285. source: unescape('initialize%0A%09super%20initialize.%0A%09keys%20%3A%3D%20%23%28%29.%0A%09values%20%3A%3D%20%23%28%29'),
  4286. messageSends: ["initialize"],
  4287. referencedClasses: []
  4288. }),
  4289. smalltalk.Dictionary);
  4290. smalltalk.addMethod(
  4291. unescape('_includesKey_'),
  4292. smalltalk.method({
  4293. selector: unescape('includesKey%3A'),
  4294. category: 'testing',
  4295. fn: function (aKey){
  4296. var self=this;
  4297. return smalltalk.send(self['@keys'], "_includes_", [aKey]);
  4298. return self;},
  4299. args: ["aKey"],
  4300. source: unescape('includesKey%3A%20aKey%0A%09%5Ekeys%20includes%3A%20aKey'),
  4301. messageSends: ["includes:"],
  4302. referencedClasses: []
  4303. }),
  4304. smalltalk.Dictionary);
  4305. smalltalk.addMethod(
  4306. unescape('_asHashedCollection'),
  4307. smalltalk.method({
  4308. selector: unescape('asHashedCollection'),
  4309. category: 'converting',
  4310. fn: function (){
  4311. var self=this;
  4312. return smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
  4313. return self;},
  4314. args: [],
  4315. source: unescape('asHashedCollection%0A%09%5EHashedCollection%20fromPairs%3A%20self%20associations'),
  4316. messageSends: ["fromPairs:", "associations"],
  4317. referencedClasses: ["HashedCollection"]
  4318. }),
  4319. smalltalk.Dictionary);
  4320. smalltalk.addMethod(
  4321. unescape('_asJSONString'),
  4322. smalltalk.method({
  4323. selector: unescape('asJSONString'),
  4324. category: 'converting',
  4325. fn: function (){
  4326. var self=this;
  4327. return smalltalk.send(smalltalk.send(self, "_asHashedCollection", []), "_asJSONString", []);
  4328. return self;},
  4329. args: [],
  4330. source: unescape('asJSONString%0A%09%5Eself%20asHashedCollection%20asJSONString'),
  4331. messageSends: ["asJSONString", "asHashedCollection"],
  4332. referencedClasses: []
  4333. }),
  4334. smalltalk.Dictionary);