Kernel-Collections.deploy.js 94 KB

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