Kernel-Collections.deploy.js 92 KB

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