Kernel-Collections.deploy.js 128 KB

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