1
0

Kernel-Collections.js 133 KB

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