Kernel-Collections.deploy.js 124 KB

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