Kernel-Collections.deploy.js 128 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018
  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. "_crlfSanitized",
  2395. smalltalk.method({
  2396. selector: "crlfSanitized",
  2397. fn: function (){
  2398. var self=this;
  2399. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2400. return smalltalk.withContext(function($ctx1) {
  2401. var $1;
  2402. $1=_st(_st(self)._lines())._join_(_st($String())._lf());
  2403. return $1;
  2404. }, function($ctx1) {$ctx1.fill(self,"crlfSanitized",{},smalltalk.String)})},
  2405. messageSends: ["join:", "lf", "lines"]}),
  2406. smalltalk.String);
  2407. smalltalk.addMethod(
  2408. "_deepCopy",
  2409. smalltalk.method({
  2410. selector: "deepCopy",
  2411. fn: function (){
  2412. var self=this;
  2413. return smalltalk.withContext(function($ctx1) { var $1;
  2414. $1=_st(self)._shallowCopy();
  2415. return $1;
  2416. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.String)})},
  2417. messageSends: ["shallowCopy"]}),
  2418. smalltalk.String);
  2419. smalltalk.addMethod(
  2420. "_do_",
  2421. smalltalk.method({
  2422. selector: "do:",
  2423. fn: function (aBlock){
  2424. var self=this;
  2425. return smalltalk.withContext(function($ctx1) { for(var i=0;i<self.length;i++){aBlock(self.charAt(i));};
  2426. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.String)})},
  2427. messageSends: []}),
  2428. smalltalk.String);
  2429. smalltalk.addMethod(
  2430. "_escaped",
  2431. smalltalk.method({
  2432. selector: "escaped",
  2433. fn: function (){
  2434. var self=this;
  2435. return smalltalk.withContext(function($ctx1) { return escape(self);
  2436. return self}, function($ctx1) {$ctx1.fill(self,"escaped",{},smalltalk.String)})},
  2437. messageSends: []}),
  2438. smalltalk.String);
  2439. smalltalk.addMethod(
  2440. "_includesSubString_",
  2441. smalltalk.method({
  2442. selector: "includesSubString:",
  2443. fn: function (subString){
  2444. var self=this;
  2445. return smalltalk.withContext(function($ctx1) { return self.indexOf(subString) != -1 ;
  2446. return self}, function($ctx1) {$ctx1.fill(self,"includesSubString:",{subString:subString},smalltalk.String)})},
  2447. messageSends: []}),
  2448. smalltalk.String);
  2449. smalltalk.addMethod(
  2450. "_isImmutable",
  2451. smalltalk.method({
  2452. selector: "isImmutable",
  2453. fn: function (){
  2454. var self=this;
  2455. return smalltalk.withContext(function($ctx1) { return true;
  2456. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.String)})},
  2457. messageSends: []}),
  2458. smalltalk.String);
  2459. smalltalk.addMethod(
  2460. "_isString",
  2461. smalltalk.method({
  2462. selector: "isString",
  2463. fn: function (){
  2464. var self=this;
  2465. return smalltalk.withContext(function($ctx1) { return true;
  2466. }, function($ctx1) {$ctx1.fill(self,"isString",{},smalltalk.String)})},
  2467. messageSends: []}),
  2468. smalltalk.String);
  2469. smalltalk.addMethod(
  2470. "_isVowel",
  2471. smalltalk.method({
  2472. selector: "isVowel",
  2473. fn: function (){
  2474. var self=this;
  2475. return smalltalk.withContext(function($ctx1) { var $1;
  2476. $1=_st(_st(_st(self)._size()).__eq((1)))._and_((function(){
  2477. return smalltalk.withContext(function($ctx2) { return _st("aeiou")._includes_(_st(self)._asLowercase());
  2478. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2479. return $1;
  2480. }, function($ctx1) {$ctx1.fill(self,"isVowel",{},smalltalk.String)})},
  2481. messageSends: ["and:", "includes:", "asLowercase", "=", "size"]}),
  2482. smalltalk.String);
  2483. smalltalk.addMethod(
  2484. "_join_",
  2485. smalltalk.method({
  2486. selector: "join:",
  2487. fn: function (aCollection){
  2488. var self=this;
  2489. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2490. return smalltalk.withContext(function($ctx1) { var $1;
  2491. $1=_st($String())._streamContents_((function(stream){
  2492. return smalltalk.withContext(function($ctx2) { return _st(aCollection)._do_separatedBy_((function(each){
  2493. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(_st(each)._asString());
  2494. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  2495. return smalltalk.withContext(function($ctx3) { return _st(stream)._nextPutAll_(self);
  2496. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2497. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  2498. return $1;
  2499. }, function($ctx1) {$ctx1.fill(self,"join:",{aCollection:aCollection},smalltalk.String)})},
  2500. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"]}),
  2501. smalltalk.String);
  2502. smalltalk.addMethod(
  2503. "_lineIndicesDo_",
  2504. smalltalk.method({
  2505. selector: "lineIndicesDo:",
  2506. fn: function (aBlock){
  2507. var self=this;
  2508. var cr,lf,start,sz,nextLF,nextCR;
  2509. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2510. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2511. var $early={};
  2512. try {
  2513. start=(1);
  2514. sz=_st(self)._size();
  2515. cr=_st($String())._cr();
  2516. nextCR=_st(self)._indexOf_startingAt_(cr,(1));
  2517. lf=_st($String())._lf();
  2518. nextLF=_st(self)._indexOf_startingAt_(lf,(1));
  2519. _st((function(){
  2520. return smalltalk.withContext(function($ctx2) { return _st(start).__lt_eq(sz);
  2521. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2522. return smalltalk.withContext(function($ctx2) { $1=_st(_st(nextLF).__eq((0)))._and_((function(){
  2523. return smalltalk.withContext(function($ctx3) { return _st(nextCR).__eq((0));
  2524. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2525. if(smalltalk.assert($1)){
  2526. _st(aBlock)._value_value_value_(start,sz,sz);
  2527. $2=self;
  2528. throw $early=[$2];
  2529. };
  2530. $3=_st(_st(nextCR).__eq((0)))._or_((function(){
  2531. return smalltalk.withContext(function($ctx3) { return _st(_st((0)).__lt(nextLF))._and_((function(){
  2532. return smalltalk.withContext(function($ctx4) { return _st(nextLF).__lt(nextCR);
  2533. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  2534. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2535. if(smalltalk.assert($3)){
  2536. _st(aBlock)._value_value_value_(start,_st(nextLF).__minus((1)),nextLF);
  2537. start=_st((1)).__plus(nextLF);
  2538. start;
  2539. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  2540. return nextLF;
  2541. } else {
  2542. $4=_st(_st((1)).__plus(nextCR)).__eq(nextLF);
  2543. if(smalltalk.assert($4)){
  2544. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextLF);
  2545. start=_st((1)).__plus(nextLF);
  2546. start;
  2547. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  2548. nextCR;
  2549. nextLF=_st(self)._indexOf_startingAt_(lf,start);
  2550. return nextLF;
  2551. } else {
  2552. _st(aBlock)._value_value_value_(start,_st(nextCR).__minus((1)),nextCR);
  2553. start=_st((1)).__plus(nextCR);
  2554. start;
  2555. nextCR=_st(self)._indexOf_startingAt_(cr,start);
  2556. return nextCR;
  2557. };
  2558. };
  2559. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2560. return self}
  2561. catch(e) {if(e===$early)return e[0]; throw e}
  2562. }, function($ctx1) {$ctx1.fill(self,"lineIndicesDo:",{aBlock:aBlock,cr:cr,lf:lf,start:start,sz:sz,nextLF:nextLF,nextCR:nextCR},smalltalk.String)})},
  2563. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "ifTrue:", "value:value:value:", "and:", "=", "ifTrue:ifFalse:", "-", "+", "or:", "<", "<="]}),
  2564. smalltalk.String);
  2565. smalltalk.addMethod(
  2566. "_lineNumber_",
  2567. smalltalk.method({
  2568. selector: "lineNumber:",
  2569. fn: function (anIndex){
  2570. var self=this;
  2571. var lineCount;
  2572. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2573. var $early={};
  2574. try {
  2575. lineCount=(0);
  2576. _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2577. return smalltalk.withContext(function($ctx2) { lineCount=_st(lineCount).__plus((1));
  2578. $1=_st(lineCount).__eq(anIndex);
  2579. if(smalltalk.assert($1)){
  2580. $2=_st(self)._copyFrom_to_(start,endWithoutDelimiters);
  2581. throw $early=[$2];
  2582. };
  2583. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2584. return nil;
  2585. }
  2586. catch(e) {if(e===$early)return e[0]; throw e}
  2587. }, function($ctx1) {$ctx1.fill(self,"lineNumber:",{anIndex:anIndex,lineCount:lineCount},smalltalk.String)})},
  2588. messageSends: ["lineIndicesDo:", "ifTrue:", "copyFrom:to:", "=", "+"]}),
  2589. smalltalk.String);
  2590. smalltalk.addMethod(
  2591. "_lines",
  2592. smalltalk.method({
  2593. selector: "lines",
  2594. fn: function (){
  2595. var self=this;
  2596. var lines;
  2597. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2598. return smalltalk.withContext(function($ctx1) { var $1;
  2599. lines=_st($Array())._new();
  2600. _st(self)._linesDo_((function(aLine){
  2601. return smalltalk.withContext(function($ctx2) { return _st(lines)._add_(aLine);
  2602. }, function($ctx2) {$ctx2.fillBlock({aLine:aLine},$ctx1)})}));
  2603. $1=lines;
  2604. return $1;
  2605. }, function($ctx1) {$ctx1.fill(self,"lines",{lines:lines},smalltalk.String)})},
  2606. messageSends: ["new", "linesDo:", "add:"]}),
  2607. smalltalk.String);
  2608. smalltalk.addMethod(
  2609. "_linesDo_",
  2610. smalltalk.method({
  2611. selector: "linesDo:",
  2612. fn: function (aBlock){
  2613. var self=this;
  2614. return smalltalk.withContext(function($ctx1) { _st(self)._lineIndicesDo_((function(start,endWithoutDelimiters,end){
  2615. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_(_st(self)._copyFrom_to_(start,endWithoutDelimiters));
  2616. }, function($ctx2) {$ctx2.fillBlock({start:start,endWithoutDelimiters:endWithoutDelimiters,end:end},$ctx1)})}));
  2617. return self}, function($ctx1) {$ctx1.fill(self,"linesDo:",{aBlock:aBlock},smalltalk.String)})},
  2618. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"]}),
  2619. smalltalk.String);
  2620. smalltalk.addMethod(
  2621. "_match_",
  2622. smalltalk.method({
  2623. selector: "match:",
  2624. fn: function (aRegexp){
  2625. var self=this;
  2626. return smalltalk.withContext(function($ctx1) { return self.search(aRegexp) != -1;
  2627. return self}, function($ctx1) {$ctx1.fill(self,"match:",{aRegexp:aRegexp},smalltalk.String)})},
  2628. messageSends: []}),
  2629. smalltalk.String);
  2630. smalltalk.addMethod(
  2631. "_matchesOf_",
  2632. smalltalk.method({
  2633. selector: "matchesOf:",
  2634. fn: function (aRegularExpression){
  2635. var self=this;
  2636. return smalltalk.withContext(function($ctx1) { return self.match(aRegularExpression);
  2637. return self}, function($ctx1) {$ctx1.fill(self,"matchesOf:",{aRegularExpression:aRegularExpression},smalltalk.String)})},
  2638. messageSends: []}),
  2639. smalltalk.String);
  2640. smalltalk.addMethod(
  2641. "_printNl",
  2642. smalltalk.method({
  2643. selector: "printNl",
  2644. fn: function (){
  2645. var self=this;
  2646. return smalltalk.withContext(function($ctx1) { console.log(self);
  2647. return self}, function($ctx1) {$ctx1.fill(self,"printNl",{},smalltalk.String)})},
  2648. messageSends: []}),
  2649. smalltalk.String);
  2650. smalltalk.addMethod(
  2651. "_printOn_",
  2652. smalltalk.method({
  2653. selector: "printOn:",
  2654. fn: function (aStream){
  2655. var self=this;
  2656. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2657. $1=aStream;
  2658. _st($1)._nextPutAll_("'");
  2659. _st($1)._nextPutAll_(self);
  2660. $2=_st($1)._nextPutAll_("'");
  2661. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.String)})},
  2662. messageSends: ["nextPutAll:"]}),
  2663. smalltalk.String);
  2664. smalltalk.addMethod(
  2665. "_replace_with_",
  2666. smalltalk.method({
  2667. selector: "replace:with:",
  2668. fn: function (aString,anotherString){
  2669. var self=this;
  2670. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2671. return smalltalk.withContext(function($ctx1) { var $1;
  2672. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(aString,"g"),anotherString);
  2673. return $1;
  2674. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.String)})},
  2675. messageSends: ["replaceRegexp:with:", "fromString:flag:"]}),
  2676. smalltalk.String);
  2677. smalltalk.addMethod(
  2678. "_replaceRegexp_with_",
  2679. smalltalk.method({
  2680. selector: "replaceRegexp:with:",
  2681. fn: function (aRegexp,aString){
  2682. var self=this;
  2683. return smalltalk.withContext(function($ctx1) { return self.replace(aRegexp, aString);
  2684. return self}, function($ctx1) {$ctx1.fill(self,"replaceRegexp:with:",{aRegexp:aRegexp,aString:aString},smalltalk.String)})},
  2685. messageSends: []}),
  2686. smalltalk.String);
  2687. smalltalk.addMethod(
  2688. "_reversed",
  2689. smalltalk.method({
  2690. selector: "reversed",
  2691. fn: function (){
  2692. var self=this;
  2693. return smalltalk.withContext(function($ctx1) { return self.split("").reverse().join("");
  2694. return self}, function($ctx1) {$ctx1.fill(self,"reversed",{},smalltalk.String)})},
  2695. messageSends: []}),
  2696. smalltalk.String);
  2697. smalltalk.addMethod(
  2698. "_shallowCopy",
  2699. smalltalk.method({
  2700. selector: "shallowCopy",
  2701. fn: function (){
  2702. var self=this;
  2703. return smalltalk.withContext(function($ctx1) { var $1;
  2704. $1=_st(_st(self)._class())._fromString_(self);
  2705. return $1;
  2706. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.String)})},
  2707. messageSends: ["fromString:", "class"]}),
  2708. smalltalk.String);
  2709. smalltalk.addMethod(
  2710. "_size",
  2711. smalltalk.method({
  2712. selector: "size",
  2713. fn: function (){
  2714. var self=this;
  2715. return smalltalk.withContext(function($ctx1) { return self.length;
  2716. return self}, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.String)})},
  2717. messageSends: []}),
  2718. smalltalk.String);
  2719. smalltalk.addMethod(
  2720. "_tokenize_",
  2721. smalltalk.method({
  2722. selector: "tokenize:",
  2723. fn: function (aString){
  2724. var self=this;
  2725. return smalltalk.withContext(function($ctx1) { return self.split(aString);
  2726. return self}, function($ctx1) {$ctx1.fill(self,"tokenize:",{aString:aString},smalltalk.String)})},
  2727. messageSends: []}),
  2728. smalltalk.String);
  2729. smalltalk.addMethod(
  2730. "_trimBoth",
  2731. smalltalk.method({
  2732. selector: "trimBoth",
  2733. fn: function (){
  2734. var self=this;
  2735. return smalltalk.withContext(function($ctx1) { var $1;
  2736. $1=_st(self)._trimBoth_("\x5cs");
  2737. return $1;
  2738. }, function($ctx1) {$ctx1.fill(self,"trimBoth",{},smalltalk.String)})},
  2739. messageSends: ["trimBoth:"]}),
  2740. smalltalk.String);
  2741. smalltalk.addMethod(
  2742. "_trimBoth_",
  2743. smalltalk.method({
  2744. selector: "trimBoth:",
  2745. fn: function (separators){
  2746. var self=this;
  2747. return smalltalk.withContext(function($ctx1) { var $1;
  2748. $1=_st(_st(self)._trimLeft_(separators))._trimRight_(separators);
  2749. return $1;
  2750. }, function($ctx1) {$ctx1.fill(self,"trimBoth:",{separators:separators},smalltalk.String)})},
  2751. messageSends: ["trimRight:", "trimLeft:"]}),
  2752. smalltalk.String);
  2753. smalltalk.addMethod(
  2754. "_trimLeft",
  2755. smalltalk.method({
  2756. selector: "trimLeft",
  2757. fn: function (){
  2758. var self=this;
  2759. return smalltalk.withContext(function($ctx1) { var $1;
  2760. $1=_st(self)._trimLeft_("\x5cs");
  2761. return $1;
  2762. }, function($ctx1) {$ctx1.fill(self,"trimLeft",{},smalltalk.String)})},
  2763. messageSends: ["trimLeft:"]}),
  2764. smalltalk.String);
  2765. smalltalk.addMethod(
  2766. "_trimLeft_",
  2767. smalltalk.method({
  2768. selector: "trimLeft:",
  2769. fn: function (separators){
  2770. var self=this;
  2771. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2772. return smalltalk.withContext(function($ctx1) { var $1;
  2773. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st(_st("^[").__comma(separators)).__comma("]+"),"g"),"");
  2774. return $1;
  2775. }, function($ctx1) {$ctx1.fill(self,"trimLeft:",{separators:separators},smalltalk.String)})},
  2776. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2777. smalltalk.String);
  2778. smalltalk.addMethod(
  2779. "_trimRight",
  2780. smalltalk.method({
  2781. selector: "trimRight",
  2782. fn: function (){
  2783. var self=this;
  2784. return smalltalk.withContext(function($ctx1) { var $1;
  2785. $1=_st(self)._trimRight_("\x5cs");
  2786. return $1;
  2787. }, function($ctx1) {$ctx1.fill(self,"trimRight",{},smalltalk.String)})},
  2788. messageSends: ["trimRight:"]}),
  2789. smalltalk.String);
  2790. smalltalk.addMethod(
  2791. "_trimRight_",
  2792. smalltalk.method({
  2793. selector: "trimRight:",
  2794. fn: function (separators){
  2795. var self=this;
  2796. function $RegularExpression(){return smalltalk.RegularExpression||(typeof RegularExpression=="undefined"?nil:RegularExpression)}
  2797. return smalltalk.withContext(function($ctx1) { var $1;
  2798. $1=_st(self)._replaceRegexp_with_(_st($RegularExpression())._fromString_flag_(_st(_st("[").__comma(separators)).__comma("]+$"),"g"),"");
  2799. return $1;
  2800. }, function($ctx1) {$ctx1.fill(self,"trimRight:",{separators:separators},smalltalk.String)})},
  2801. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","]}),
  2802. smalltalk.String);
  2803. smalltalk.addMethod(
  2804. "_unescaped",
  2805. smalltalk.method({
  2806. selector: "unescaped",
  2807. fn: function (){
  2808. var self=this;
  2809. return smalltalk.withContext(function($ctx1) { return unescape(self);
  2810. return self}, function($ctx1) {$ctx1.fill(self,"unescaped",{},smalltalk.String)})},
  2811. messageSends: []}),
  2812. smalltalk.String);
  2813. smalltalk.addMethod(
  2814. "_withIndexDo_",
  2815. smalltalk.method({
  2816. selector: "withIndexDo:",
  2817. fn: function (aBlock){
  2818. var self=this;
  2819. return smalltalk.withContext(function($ctx1) { for(var i=0;i<self.length;i++){aBlock(self.charAt(i), i+1);};
  2820. return self}, function($ctx1) {$ctx1.fill(self,"withIndexDo:",{aBlock:aBlock},smalltalk.String)})},
  2821. messageSends: []}),
  2822. smalltalk.String);
  2823. smalltalk.addMethod(
  2824. "_cr",
  2825. smalltalk.method({
  2826. selector: "cr",
  2827. fn: function (){
  2828. var self=this;
  2829. return smalltalk.withContext(function($ctx1) { return '\r';
  2830. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.String.klass)})},
  2831. messageSends: []}),
  2832. smalltalk.String.klass);
  2833. smalltalk.addMethod(
  2834. "_crlf",
  2835. smalltalk.method({
  2836. selector: "crlf",
  2837. fn: function (){
  2838. var self=this;
  2839. return smalltalk.withContext(function($ctx1) { return '\r\n';
  2840. return self}, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.String.klass)})},
  2841. messageSends: []}),
  2842. smalltalk.String.klass);
  2843. smalltalk.addMethod(
  2844. "_fromCharCode_",
  2845. smalltalk.method({
  2846. selector: "fromCharCode:",
  2847. fn: function (anInteger){
  2848. var self=this;
  2849. return smalltalk.withContext(function($ctx1) { return String.fromCharCode(anInteger);
  2850. return self}, function($ctx1) {$ctx1.fill(self,"fromCharCode:",{anInteger:anInteger},smalltalk.String.klass)})},
  2851. messageSends: []}),
  2852. smalltalk.String.klass);
  2853. smalltalk.addMethod(
  2854. "_fromString_",
  2855. smalltalk.method({
  2856. selector: "fromString:",
  2857. fn: function (aString){
  2858. var self=this;
  2859. return smalltalk.withContext(function($ctx1) { return String(aString);
  2860. return self}, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.String.klass)})},
  2861. messageSends: []}),
  2862. smalltalk.String.klass);
  2863. smalltalk.addMethod(
  2864. "_lf",
  2865. smalltalk.method({
  2866. selector: "lf",
  2867. fn: function (){
  2868. var self=this;
  2869. return smalltalk.withContext(function($ctx1) { return '\n';
  2870. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.String.klass)})},
  2871. messageSends: []}),
  2872. smalltalk.String.klass);
  2873. smalltalk.addMethod(
  2874. "_random",
  2875. smalltalk.method({
  2876. selector: "random",
  2877. fn: function (){
  2878. var self=this;
  2879. return smalltalk.withContext(function($ctx1) { return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);;
  2880. return self}, function($ctx1) {$ctx1.fill(self,"random",{},smalltalk.String.klass)})},
  2881. messageSends: []}),
  2882. smalltalk.String.klass);
  2883. smalltalk.addMethod(
  2884. "_randomNotIn_",
  2885. smalltalk.method({
  2886. selector: "randomNotIn:",
  2887. fn: function (aString){
  2888. var self=this;
  2889. var result;
  2890. return smalltalk.withContext(function($ctx1) { var $1;
  2891. _st((function(){
  2892. return smalltalk.withContext(function($ctx2) { result=_st(self)._random();
  2893. result;
  2894. return _st(aString)._includesSubString_(result);
  2895. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  2896. $1=result;
  2897. return $1;
  2898. }, function($ctx1) {$ctx1.fill(self,"randomNotIn:",{aString:aString,result:result},smalltalk.String.klass)})},
  2899. messageSends: ["whileTrue", "random", "includesSubString:"]}),
  2900. smalltalk.String.klass);
  2901. smalltalk.addMethod(
  2902. "_space",
  2903. smalltalk.method({
  2904. selector: "space",
  2905. fn: function (){
  2906. var self=this;
  2907. return smalltalk.withContext(function($ctx1) { return ' ';
  2908. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.String.klass)})},
  2909. messageSends: []}),
  2910. smalltalk.String.klass);
  2911. smalltalk.addMethod(
  2912. "_streamClass",
  2913. smalltalk.method({
  2914. selector: "streamClass",
  2915. fn: function (){
  2916. var self=this;
  2917. function $StringStream(){return smalltalk.StringStream||(typeof StringStream=="undefined"?nil:StringStream)}
  2918. return smalltalk.withContext(function($ctx1) { var $1;
  2919. $1=$StringStream();
  2920. return $1;
  2921. }, function($ctx1) {$ctx1.fill(self,"streamClass",{},smalltalk.String.klass)})},
  2922. messageSends: []}),
  2923. smalltalk.String.klass);
  2924. smalltalk.addMethod(
  2925. "_tab",
  2926. smalltalk.method({
  2927. selector: "tab",
  2928. fn: function (){
  2929. var self=this;
  2930. return smalltalk.withContext(function($ctx1) { return '\t';
  2931. return self}, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.String.klass)})},
  2932. messageSends: []}),
  2933. smalltalk.String.klass);
  2934. smalltalk.addMethod(
  2935. "_value_",
  2936. smalltalk.method({
  2937. selector: "value:",
  2938. fn: function (aUTFCharCode){
  2939. var self=this;
  2940. return smalltalk.withContext(function($ctx1) { return String.fromCharCode(aUTFCharCode);;
  2941. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aUTFCharCode:aUTFCharCode},smalltalk.String.klass)})},
  2942. messageSends: []}),
  2943. smalltalk.String.klass);
  2944. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  2945. smalltalk.addMethod(
  2946. "__eq",
  2947. smalltalk.method({
  2948. selector: "=",
  2949. fn: function (aCollection){
  2950. var self=this;
  2951. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  2952. var $early={};
  2953. try {
  2954. $1=_st(_st(self)._class()).__eq(_st(aCollection)._class());
  2955. if(! smalltalk.assert($1)){
  2956. return false;
  2957. };
  2958. $2=_st(_st(self)._size()).__eq(_st(aCollection)._size());
  2959. if(! smalltalk.assert($2)){
  2960. return false;
  2961. };
  2962. _st(self)._do_((function(each){
  2963. return smalltalk.withContext(function($ctx2) { $3=_st(aCollection)._includes_(each);
  2964. if(! smalltalk.assert($3)){
  2965. throw $early=[false];
  2966. };
  2967. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2968. return true;
  2969. }
  2970. catch(e) {if(e===$early)return e[0]; throw e}
  2971. }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection},smalltalk.Set)})},
  2972. messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]}),
  2973. smalltalk.Set);
  2974. smalltalk.addMethod(
  2975. "_add_",
  2976. smalltalk.method({
  2977. selector: "add:",
  2978. fn: function (anObject){
  2979. var self=this;
  2980. return smalltalk.withContext(function($ctx1) {
  2981. var found;
  2982. for(var i=0; i < self['@elements'].length; i++) {
  2983. if(anObject == self['@elements'][i]) {
  2984. found = true;
  2985. break;
  2986. }
  2987. }
  2988. if(!found) {self['@elements'].push(anObject)}
  2989. ;
  2990. return self}, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.Set)})},
  2991. messageSends: []}),
  2992. smalltalk.Set);
  2993. smalltalk.addMethod(
  2994. "_asArray",
  2995. smalltalk.method({
  2996. selector: "asArray",
  2997. fn: function (){
  2998. var self=this;
  2999. return smalltalk.withContext(function($ctx1) { var $1;
  3000. $1=_st(self["@elements"])._copy();
  3001. return $1;
  3002. }, function($ctx1) {$ctx1.fill(self,"asArray",{},smalltalk.Set)})},
  3003. messageSends: ["copy"]}),
  3004. smalltalk.Set);
  3005. smalltalk.addMethod(
  3006. "_collect_",
  3007. smalltalk.method({
  3008. selector: "collect:",
  3009. fn: function (aBlock){
  3010. var self=this;
  3011. return smalltalk.withContext(function($ctx1) { var $1;
  3012. $1=_st(_st(self)._class())._withAll_(_st(self["@elements"])._collect_(aBlock));
  3013. return $1;
  3014. }, function($ctx1) {$ctx1.fill(self,"collect:",{aBlock:aBlock},smalltalk.Set)})},
  3015. messageSends: ["withAll:", "collect:", "class"]}),
  3016. smalltalk.Set);
  3017. smalltalk.addMethod(
  3018. "_detect_ifNone_",
  3019. smalltalk.method({
  3020. selector: "detect:ifNone:",
  3021. fn: function (aBlock,anotherBlock){
  3022. var self=this;
  3023. return smalltalk.withContext(function($ctx1) { var $1;
  3024. $1=_st(self["@elements"])._detect_ifNone_(aBlock,anotherBlock);
  3025. return $1;
  3026. }, function($ctx1) {$ctx1.fill(self,"detect:ifNone:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.Set)})},
  3027. messageSends: ["detect:ifNone:"]}),
  3028. smalltalk.Set);
  3029. smalltalk.addMethod(
  3030. "_do_",
  3031. smalltalk.method({
  3032. selector: "do:",
  3033. fn: function (aBlock){
  3034. var self=this;
  3035. return smalltalk.withContext(function($ctx1) { _st(self["@elements"])._do_(aBlock);
  3036. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Set)})},
  3037. messageSends: ["do:"]}),
  3038. smalltalk.Set);
  3039. smalltalk.addMethod(
  3040. "_includes_",
  3041. smalltalk.method({
  3042. selector: "includes:",
  3043. fn: function (anObject){
  3044. var self=this;
  3045. return smalltalk.withContext(function($ctx1) { var $1;
  3046. $1=_st(self["@elements"])._includes_(anObject);
  3047. return $1;
  3048. }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},smalltalk.Set)})},
  3049. messageSends: ["includes:"]}),
  3050. smalltalk.Set);
  3051. smalltalk.addMethod(
  3052. "_initialize",
  3053. smalltalk.method({
  3054. selector: "initialize",
  3055. fn: function (){
  3056. var self=this;
  3057. return smalltalk.withContext(function($ctx1) { smalltalk.Collection.fn.prototype._initialize.apply(_st(self), []);
  3058. self["@elements"]=[];
  3059. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Set)})},
  3060. messageSends: ["initialize"]}),
  3061. smalltalk.Set);
  3062. smalltalk.addMethod(
  3063. "_printOn_",
  3064. smalltalk.method({
  3065. selector: "printOn:",
  3066. fn: function (aStream){
  3067. var self=this;
  3068. return smalltalk.withContext(function($ctx1) { smalltalk.Collection.fn.prototype._printOn_.apply(_st(self), [aStream]);
  3069. _st(aStream)._nextPutAll_(" (");
  3070. _st(self)._do_separatedBy_((function(each){
  3071. return smalltalk.withContext(function($ctx2) { return _st(each)._printOn_(aStream);
  3072. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3073. return smalltalk.withContext(function($ctx2) { return _st(aStream)._nextPutAll_(" ");
  3074. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3075. _st(aStream)._nextPutAll_(")");
  3076. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Set)})},
  3077. messageSends: ["printOn:", "nextPutAll:", "do:separatedBy:"]}),
  3078. smalltalk.Set);
  3079. smalltalk.addMethod(
  3080. "_remove_",
  3081. smalltalk.method({
  3082. selector: "remove:",
  3083. fn: function (anObject){
  3084. var self=this;
  3085. return smalltalk.withContext(function($ctx1) { _st(self["@elements"])._remove_(anObject);
  3086. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anObject:anObject},smalltalk.Set)})},
  3087. messageSends: ["remove:"]}),
  3088. smalltalk.Set);
  3089. smalltalk.addMethod(
  3090. "_select_",
  3091. smalltalk.method({
  3092. selector: "select:",
  3093. fn: function (aBlock){
  3094. var self=this;
  3095. var collection;
  3096. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3097. collection=_st(_st(self)._class())._new();
  3098. _st(self)._do_((function(each){
  3099. return smalltalk.withContext(function($ctx2) { $1=_st(aBlock)._value_(each);
  3100. if(smalltalk.assert($1)){
  3101. return _st(collection)._add_(each);
  3102. };
  3103. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3104. $2=collection;
  3105. return $2;
  3106. }, function($ctx1) {$ctx1.fill(self,"select:",{aBlock:aBlock,collection:collection},smalltalk.Set)})},
  3107. messageSends: ["new", "class", "do:", "ifTrue:", "add:", "value:"]}),
  3108. smalltalk.Set);
  3109. smalltalk.addMethod(
  3110. "_size",
  3111. smalltalk.method({
  3112. selector: "size",
  3113. fn: function (){
  3114. var self=this;
  3115. return smalltalk.withContext(function($ctx1) { var $1;
  3116. $1=_st(self["@elements"])._size();
  3117. return $1;
  3118. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Set)})},
  3119. messageSends: ["size"]}),
  3120. smalltalk.Set);
  3121. smalltalk.addClass('Queue', smalltalk.Object, ['read', 'readIndex', 'write'], 'Kernel-Collections');
  3122. smalltalk.addMethod(
  3123. "_back_",
  3124. smalltalk.method({
  3125. selector: "back:",
  3126. fn: function (anObject){
  3127. var self=this;
  3128. return smalltalk.withContext(function($ctx1) { _st(self["@write"])._add_(anObject);
  3129. return self}, function($ctx1) {$ctx1.fill(self,"back:",{anObject:anObject},smalltalk.Queue)})},
  3130. messageSends: ["add:"]}),
  3131. smalltalk.Queue);
  3132. smalltalk.addMethod(
  3133. "_front",
  3134. smalltalk.method({
  3135. selector: "front",
  3136. fn: function (){
  3137. var self=this;
  3138. return smalltalk.withContext(function($ctx1) { var $1;
  3139. $1=_st(self)._frontIfAbsent_((function(){
  3140. return smalltalk.withContext(function($ctx2) { return _st(self)._error_("Cannot read from empty Queue.");
  3141. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3142. return $1;
  3143. }, function($ctx1) {$ctx1.fill(self,"front",{},smalltalk.Queue)})},
  3144. messageSends: ["frontIfAbsent:", "error:"]}),
  3145. smalltalk.Queue);
  3146. smalltalk.addMethod(
  3147. "_frontIfAbsent_",
  3148. smalltalk.method({
  3149. selector: "frontIfAbsent:",
  3150. fn: function (aBlock){
  3151. var self=this;
  3152. var result;
  3153. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3154. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3155. var $early={};
  3156. try {
  3157. result=_st(self["@read"])._at_ifAbsent_(self["@readIndex"],(function(){
  3158. return smalltalk.withContext(function($ctx2) { $1=_st(self["@write"])._isEmpty();
  3159. if(smalltalk.assert($1)){
  3160. $2=_st(self["@readIndex"]).__gt((1));
  3161. if(smalltalk.assert($2)){
  3162. self["@read"]=[];
  3163. self["@read"];
  3164. self["@readIndex"]=(1);
  3165. self["@readIndex"];
  3166. };
  3167. $3=_st(aBlock)._value();
  3168. throw $early=[$3];
  3169. };
  3170. self["@read"]=self["@write"];
  3171. self["@read"];
  3172. self["@readIndex"]=(1);
  3173. self["@readIndex"];
  3174. self["@write"]=_st($OrderedCollection())._new();
  3175. self["@write"];
  3176. return _st(self["@read"])._first();
  3177. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3178. _st(self["@read"])._at_put_(self["@readIndex"],nil);
  3179. self["@readIndex"]=_st(self["@readIndex"]).__plus((1));
  3180. $4=result;
  3181. return $4;
  3182. }
  3183. catch(e) {if(e===$early)return e[0]; throw e}
  3184. }, function($ctx1) {$ctx1.fill(self,"frontIfAbsent:",{aBlock:aBlock,result:result},smalltalk.Queue)})},
  3185. messageSends: ["at:ifAbsent:", "ifTrue:", ">", "value", "isEmpty", "new", "first", "at:put:", "+"]}),
  3186. smalltalk.Queue);
  3187. smalltalk.addMethod(
  3188. "_initialize",
  3189. smalltalk.method({
  3190. selector: "initialize",
  3191. fn: function (){
  3192. var self=this;
  3193. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3194. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  3195. self["@read"]=_st($OrderedCollection())._new();
  3196. self["@write"]=_st($OrderedCollection())._new();
  3197. self["@readIndex"]=(1);
  3198. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Queue)})},
  3199. messageSends: ["initialize", "new"]}),
  3200. smalltalk.Queue);
  3201. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  3202. smalltalk.addMethod(
  3203. "_compile_",
  3204. smalltalk.method({
  3205. selector: "compile:",
  3206. fn: function (aString){
  3207. var self=this;
  3208. return smalltalk.withContext(function($ctx1) { return self.compile(aString);
  3209. return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.RegularExpression)})},
  3210. messageSends: []}),
  3211. smalltalk.RegularExpression);
  3212. smalltalk.addMethod(
  3213. "_exec_",
  3214. smalltalk.method({
  3215. selector: "exec:",
  3216. fn: function (aString){
  3217. var self=this;
  3218. return smalltalk.withContext(function($ctx1) { return self.exec(aString) || nil;
  3219. return self}, function($ctx1) {$ctx1.fill(self,"exec:",{aString:aString},smalltalk.RegularExpression)})},
  3220. messageSends: []}),
  3221. smalltalk.RegularExpression);
  3222. smalltalk.addMethod(
  3223. "_test_",
  3224. smalltalk.method({
  3225. selector: "test:",
  3226. fn: function (aString){
  3227. var self=this;
  3228. return smalltalk.withContext(function($ctx1) { return self.test(aString);
  3229. return self}, function($ctx1) {$ctx1.fill(self,"test:",{aString:aString},smalltalk.RegularExpression)})},
  3230. messageSends: []}),
  3231. smalltalk.RegularExpression);
  3232. smalltalk.addMethod(
  3233. "_fromString_",
  3234. smalltalk.method({
  3235. selector: "fromString:",
  3236. fn: function (aString){
  3237. var self=this;
  3238. return smalltalk.withContext(function($ctx1) { var $1;
  3239. $1=_st(self)._fromString_flag_(aString,"");
  3240. return $1;
  3241. }, function($ctx1) {$ctx1.fill(self,"fromString:",{aString:aString},smalltalk.RegularExpression.klass)})},
  3242. messageSends: ["fromString:flag:"]}),
  3243. smalltalk.RegularExpression.klass);
  3244. smalltalk.addMethod(
  3245. "_fromString_flag_",
  3246. smalltalk.method({
  3247. selector: "fromString:flag:",
  3248. fn: function (aString,anotherString){
  3249. var self=this;
  3250. return smalltalk.withContext(function($ctx1) { return new RegExp(aString, anotherString);
  3251. return self}, function($ctx1) {$ctx1.fill(self,"fromString:flag:",{aString:aString,anotherString:anotherString},smalltalk.RegularExpression.klass)})},
  3252. messageSends: []}),
  3253. smalltalk.RegularExpression.klass);
  3254. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  3255. smalltalk.addMethod(
  3256. "__lt_lt",
  3257. smalltalk.method({
  3258. selector: "<<",
  3259. fn: function (anObject){
  3260. var self=this;
  3261. return smalltalk.withContext(function($ctx1) { _st(self)._write_(anObject);
  3262. return self}, function($ctx1) {$ctx1.fill(self,"<<",{anObject:anObject},smalltalk.Stream)})},
  3263. messageSends: ["write:"]}),
  3264. smalltalk.Stream);
  3265. smalltalk.addMethod(
  3266. "_atEnd",
  3267. smalltalk.method({
  3268. selector: "atEnd",
  3269. fn: function (){
  3270. var self=this;
  3271. return smalltalk.withContext(function($ctx1) { var $1;
  3272. $1=_st(_st(self)._position()).__eq(_st(self)._size());
  3273. return $1;
  3274. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Stream)})},
  3275. messageSends: ["=", "size", "position"]}),
  3276. smalltalk.Stream);
  3277. smalltalk.addMethod(
  3278. "_atStart",
  3279. smalltalk.method({
  3280. selector: "atStart",
  3281. fn: function (){
  3282. var self=this;
  3283. return smalltalk.withContext(function($ctx1) { var $1;
  3284. $1=_st(_st(self)._position()).__eq((0));
  3285. return $1;
  3286. }, function($ctx1) {$ctx1.fill(self,"atStart",{},smalltalk.Stream)})},
  3287. messageSends: ["=", "position"]}),
  3288. smalltalk.Stream);
  3289. smalltalk.addMethod(
  3290. "_close",
  3291. smalltalk.method({
  3292. selector: "close",
  3293. fn: function (){
  3294. var self=this;
  3295. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.Stream)})},
  3296. messageSends: []}),
  3297. smalltalk.Stream);
  3298. smalltalk.addMethod(
  3299. "_collection",
  3300. smalltalk.method({
  3301. selector: "collection",
  3302. fn: function (){
  3303. var self=this;
  3304. return smalltalk.withContext(function($ctx1) { var $1;
  3305. $1=self["@collection"];
  3306. return $1;
  3307. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.Stream)})},
  3308. messageSends: []}),
  3309. smalltalk.Stream);
  3310. smalltalk.addMethod(
  3311. "_contents",
  3312. smalltalk.method({
  3313. selector: "contents",
  3314. fn: function (){
  3315. var self=this;
  3316. return smalltalk.withContext(function($ctx1) { var $1;
  3317. $1=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._streamSize());
  3318. return $1;
  3319. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.Stream)})},
  3320. messageSends: ["copyFrom:to:", "streamSize", "collection"]}),
  3321. smalltalk.Stream);
  3322. smalltalk.addMethod(
  3323. "_do_",
  3324. smalltalk.method({
  3325. selector: "do:",
  3326. fn: function (aBlock){
  3327. var self=this;
  3328. return smalltalk.withContext(function($ctx1) { _st((function(){
  3329. return smalltalk.withContext(function($ctx2) { return _st(self)._atEnd();
  3330. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  3331. return smalltalk.withContext(function($ctx2) { return _st(aBlock)._value_(_st(self)._next());
  3332. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3333. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.Stream)})},
  3334. messageSends: ["whileFalse:", "value:", "next", "atEnd"]}),
  3335. smalltalk.Stream);
  3336. smalltalk.addMethod(
  3337. "_flush",
  3338. smalltalk.method({
  3339. selector: "flush",
  3340. fn: function (){
  3341. var self=this;
  3342. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.Stream)})},
  3343. messageSends: []}),
  3344. smalltalk.Stream);
  3345. smalltalk.addMethod(
  3346. "_isEmpty",
  3347. smalltalk.method({
  3348. selector: "isEmpty",
  3349. fn: function (){
  3350. var self=this;
  3351. return smalltalk.withContext(function($ctx1) { var $1;
  3352. $1=_st(_st(self)._size()).__eq((0));
  3353. return $1;
  3354. }, function($ctx1) {$ctx1.fill(self,"isEmpty",{},smalltalk.Stream)})},
  3355. messageSends: ["=", "size"]}),
  3356. smalltalk.Stream);
  3357. smalltalk.addMethod(
  3358. "_next",
  3359. smalltalk.method({
  3360. selector: "next",
  3361. fn: function (){
  3362. var self=this;
  3363. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3364. $2=_st(self)._atEnd();
  3365. if(smalltalk.assert($2)){
  3366. $1=nil;
  3367. } else {
  3368. _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3369. $1=_st(self["@collection"])._at_(_st(self)._position());
  3370. };
  3371. return $1;
  3372. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Stream)})},
  3373. messageSends: ["ifTrue:ifFalse:", "position:", "+", "position", "at:", "atEnd"]}),
  3374. smalltalk.Stream);
  3375. smalltalk.addMethod(
  3376. "_next_",
  3377. smalltalk.method({
  3378. selector: "next:",
  3379. fn: function (anInteger){
  3380. var self=this;
  3381. var tempCollection;
  3382. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3383. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3384. _st(anInteger)._timesRepeat_((function(){
  3385. return smalltalk.withContext(function($ctx2) { $1=_st(self)._atEnd();
  3386. if(! smalltalk.assert($1)){
  3387. return _st(tempCollection)._add_(_st(self)._next());
  3388. };
  3389. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3390. $2=tempCollection;
  3391. return $2;
  3392. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.Stream)})},
  3393. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "add:", "next", "atEnd"]}),
  3394. smalltalk.Stream);
  3395. smalltalk.addMethod(
  3396. "_nextPut_",
  3397. smalltalk.method({
  3398. selector: "nextPut:",
  3399. fn: function (anObject){
  3400. var self=this;
  3401. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(_st(self)._position()).__plus((1)));
  3402. _st(_st(self)._collection())._at_put_(_st(self)._position(),anObject);
  3403. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3404. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{anObject:anObject},smalltalk.Stream)})},
  3405. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"]}),
  3406. smalltalk.Stream);
  3407. smalltalk.addMethod(
  3408. "_nextPutAll_",
  3409. smalltalk.method({
  3410. selector: "nextPutAll:",
  3411. fn: function (aCollection){
  3412. var self=this;
  3413. return smalltalk.withContext(function($ctx1) { _st(aCollection)._do_((function(each){
  3414. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPut_(each);
  3415. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3416. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aCollection:aCollection},smalltalk.Stream)})},
  3417. messageSends: ["do:", "nextPut:"]}),
  3418. smalltalk.Stream);
  3419. smalltalk.addMethod(
  3420. "_nextPutString_",
  3421. smalltalk.method({
  3422. selector: "nextPutString:",
  3423. fn: function (aString){
  3424. var self=this;
  3425. return smalltalk.withContext(function($ctx1) { _st(self)._nextPut_(aString);
  3426. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.Stream)})},
  3427. messageSends: ["nextPut:"]}),
  3428. smalltalk.Stream);
  3429. smalltalk.addMethod(
  3430. "_peek",
  3431. smalltalk.method({
  3432. selector: "peek",
  3433. fn: function (){
  3434. var self=this;
  3435. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3436. $2=_st(self)._atEnd();
  3437. if(! smalltalk.assert($2)){
  3438. $1=_st(_st(self)._collection())._at_(_st(_st(self)._position()).__plus((1)));
  3439. };
  3440. return $1;
  3441. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Stream)})},
  3442. messageSends: ["ifFalse:", "at:", "+", "position", "collection", "atEnd"]}),
  3443. smalltalk.Stream);
  3444. smalltalk.addMethod(
  3445. "_position",
  3446. smalltalk.method({
  3447. selector: "position",
  3448. fn: function (){
  3449. var self=this;
  3450. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3451. $2=self["@position"];
  3452. if(($receiver = $2) == nil || $receiver == undefined){
  3453. self["@position"]=(0);
  3454. $1=self["@position"];
  3455. } else {
  3456. $1=$2;
  3457. };
  3458. return $1;
  3459. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Stream)})},
  3460. messageSends: ["ifNil:"]}),
  3461. smalltalk.Stream);
  3462. smalltalk.addMethod(
  3463. "_position_",
  3464. smalltalk.method({
  3465. selector: "position:",
  3466. fn: function (anInteger){
  3467. var self=this;
  3468. return smalltalk.withContext(function($ctx1) { self["@position"]=anInteger;
  3469. return self}, function($ctx1) {$ctx1.fill(self,"position:",{anInteger:anInteger},smalltalk.Stream)})},
  3470. messageSends: []}),
  3471. smalltalk.Stream);
  3472. smalltalk.addMethod(
  3473. "_reset",
  3474. smalltalk.method({
  3475. selector: "reset",
  3476. fn: function (){
  3477. var self=this;
  3478. return smalltalk.withContext(function($ctx1) { _st(self)._position_((0));
  3479. return self}, function($ctx1) {$ctx1.fill(self,"reset",{},smalltalk.Stream)})},
  3480. messageSends: ["position:"]}),
  3481. smalltalk.Stream);
  3482. smalltalk.addMethod(
  3483. "_resetContents",
  3484. smalltalk.method({
  3485. selector: "resetContents",
  3486. fn: function (){
  3487. var self=this;
  3488. return smalltalk.withContext(function($ctx1) { _st(self)._reset();
  3489. _st(self)._setStreamSize_((0));
  3490. return self}, function($ctx1) {$ctx1.fill(self,"resetContents",{},smalltalk.Stream)})},
  3491. messageSends: ["reset", "setStreamSize:"]}),
  3492. smalltalk.Stream);
  3493. smalltalk.addMethod(
  3494. "_setCollection_",
  3495. smalltalk.method({
  3496. selector: "setCollection:",
  3497. fn: function (aCollection){
  3498. var self=this;
  3499. return smalltalk.withContext(function($ctx1) { self["@collection"]=aCollection;
  3500. return self}, function($ctx1) {$ctx1.fill(self,"setCollection:",{aCollection:aCollection},smalltalk.Stream)})},
  3501. messageSends: []}),
  3502. smalltalk.Stream);
  3503. smalltalk.addMethod(
  3504. "_setStreamSize_",
  3505. smalltalk.method({
  3506. selector: "setStreamSize:",
  3507. fn: function (anInteger){
  3508. var self=this;
  3509. return smalltalk.withContext(function($ctx1) { self["@streamSize"]=anInteger;
  3510. return self}, function($ctx1) {$ctx1.fill(self,"setStreamSize:",{anInteger:anInteger},smalltalk.Stream)})},
  3511. messageSends: []}),
  3512. smalltalk.Stream);
  3513. smalltalk.addMethod(
  3514. "_setToEnd",
  3515. smalltalk.method({
  3516. selector: "setToEnd",
  3517. fn: function (){
  3518. var self=this;
  3519. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(self)._size());
  3520. return self}, function($ctx1) {$ctx1.fill(self,"setToEnd",{},smalltalk.Stream)})},
  3521. messageSends: ["position:", "size"]}),
  3522. smalltalk.Stream);
  3523. smalltalk.addMethod(
  3524. "_size",
  3525. smalltalk.method({
  3526. selector: "size",
  3527. fn: function (){
  3528. var self=this;
  3529. return smalltalk.withContext(function($ctx1) { var $1;
  3530. $1=_st(self)._streamSize();
  3531. return $1;
  3532. }, function($ctx1) {$ctx1.fill(self,"size",{},smalltalk.Stream)})},
  3533. messageSends: ["streamSize"]}),
  3534. smalltalk.Stream);
  3535. smalltalk.addMethod(
  3536. "_skip_",
  3537. smalltalk.method({
  3538. selector: "skip:",
  3539. fn: function (anInteger){
  3540. var self=this;
  3541. return smalltalk.withContext(function($ctx1) { _st(self)._position_(_st(_st(_st(self)._position()).__plus(anInteger))._min_max_(_st(self)._size(),(0)));
  3542. return self}, function($ctx1) {$ctx1.fill(self,"skip:",{anInteger:anInteger},smalltalk.Stream)})},
  3543. messageSends: ["position:", "min:max:", "size", "+", "position"]}),
  3544. smalltalk.Stream);
  3545. smalltalk.addMethod(
  3546. "_streamSize",
  3547. smalltalk.method({
  3548. selector: "streamSize",
  3549. fn: function (){
  3550. var self=this;
  3551. return smalltalk.withContext(function($ctx1) { var $1;
  3552. $1=self["@streamSize"];
  3553. return $1;
  3554. }, function($ctx1) {$ctx1.fill(self,"streamSize",{},smalltalk.Stream)})},
  3555. messageSends: []}),
  3556. smalltalk.Stream);
  3557. smalltalk.addMethod(
  3558. "_write_",
  3559. smalltalk.method({
  3560. selector: "write:",
  3561. fn: function (anObject){
  3562. var self=this;
  3563. return smalltalk.withContext(function($ctx1) { _st(anObject)._putOn_(self);
  3564. return self}, function($ctx1) {$ctx1.fill(self,"write:",{anObject:anObject},smalltalk.Stream)})},
  3565. messageSends: ["putOn:"]}),
  3566. smalltalk.Stream);
  3567. smalltalk.addMethod(
  3568. "_on_",
  3569. smalltalk.method({
  3570. selector: "on:",
  3571. fn: function (aCollection){
  3572. var self=this;
  3573. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  3574. $2=_st(self)._new();
  3575. _st($2)._setCollection_(aCollection);
  3576. _st($2)._setStreamSize_(_st(aCollection)._size());
  3577. $3=_st($2)._yourself();
  3578. $1=$3;
  3579. return $1;
  3580. }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection},smalltalk.Stream.klass)})},
  3581. messageSends: ["setCollection:", "new", "setStreamSize:", "size", "yourself"]}),
  3582. smalltalk.Stream.klass);
  3583. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  3584. smalltalk.addMethod(
  3585. "_cr",
  3586. smalltalk.method({
  3587. selector: "cr",
  3588. fn: function (){
  3589. var self=this;
  3590. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3591. return smalltalk.withContext(function($ctx1) { var $1;
  3592. $1=_st(self)._nextPutAll_(_st($String())._cr());
  3593. return $1;
  3594. }, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.StringStream)})},
  3595. messageSends: ["nextPutAll:", "cr"]}),
  3596. smalltalk.StringStream);
  3597. smalltalk.addMethod(
  3598. "_crlf",
  3599. smalltalk.method({
  3600. selector: "crlf",
  3601. fn: function (){
  3602. var self=this;
  3603. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3604. return smalltalk.withContext(function($ctx1) { var $1;
  3605. $1=_st(self)._nextPutAll_(_st($String())._crlf());
  3606. return $1;
  3607. }, function($ctx1) {$ctx1.fill(self,"crlf",{},smalltalk.StringStream)})},
  3608. messageSends: ["nextPutAll:", "crlf"]}),
  3609. smalltalk.StringStream);
  3610. smalltalk.addMethod(
  3611. "_lf",
  3612. smalltalk.method({
  3613. selector: "lf",
  3614. fn: function (){
  3615. var self=this;
  3616. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3617. return smalltalk.withContext(function($ctx1) { var $1;
  3618. $1=_st(self)._nextPutAll_(_st($String())._lf());
  3619. return $1;
  3620. }, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.StringStream)})},
  3621. messageSends: ["nextPutAll:", "lf"]}),
  3622. smalltalk.StringStream);
  3623. smalltalk.addMethod(
  3624. "_next_",
  3625. smalltalk.method({
  3626. selector: "next:",
  3627. fn: function (anInteger){
  3628. var self=this;
  3629. var tempCollection;
  3630. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3631. tempCollection=_st(_st(_st(self)._collection())._class())._new();
  3632. _st(anInteger)._timesRepeat_((function(){
  3633. return smalltalk.withContext(function($ctx2) { $1=_st(self)._atEnd();
  3634. if(! smalltalk.assert($1)){
  3635. tempCollection=_st(tempCollection).__comma(_st(self)._next());
  3636. return tempCollection;
  3637. };
  3638. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3639. $2=tempCollection;
  3640. return $2;
  3641. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger,tempCollection:tempCollection},smalltalk.StringStream)})},
  3642. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", ",", "next", "atEnd"]}),
  3643. smalltalk.StringStream);
  3644. smalltalk.addMethod(
  3645. "_nextPut_",
  3646. smalltalk.method({
  3647. selector: "nextPut:",
  3648. fn: function (aString){
  3649. var self=this;
  3650. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutAll_(aString);
  3651. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.StringStream)})},
  3652. messageSends: ["nextPutAll:"]}),
  3653. smalltalk.StringStream);
  3654. smalltalk.addMethod(
  3655. "_nextPutAll_",
  3656. smalltalk.method({
  3657. selector: "nextPutAll:",
  3658. fn: function (aString){
  3659. var self=this;
  3660. var pre,post;
  3661. return smalltalk.withContext(function($ctx1) { var $1;
  3662. $1=_st(self)._atEnd();
  3663. if(smalltalk.assert($1)){
  3664. _st(self)._setCollection_(_st(_st(self)._collection()).__comma(aString));
  3665. } else {
  3666. pre=_st(_st(self)._collection())._copyFrom_to_((1),_st(self)._position());
  3667. pre;
  3668. post=_st(_st(self)._collection())._copyFrom_to_(_st(_st(_st(self)._position()).__plus((1))).__plus(_st(aString)._size()),_st(_st(self)._collection())._size());
  3669. post;
  3670. _st(self)._setCollection_(_st(_st(pre).__comma(aString)).__comma(post));
  3671. };
  3672. _st(self)._position_(_st(_st(self)._position()).__plus(_st(aString)._size()));
  3673. _st(self)._setStreamSize_(_st(_st(self)._streamSize())._max_(_st(self)._position()));
  3674. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString,pre:pre,post:post},smalltalk.StringStream)})},
  3675. messageSends: ["ifTrue:ifFalse:", "setCollection:", ",", "collection", "copyFrom:to:", "position", "+", "size", "atEnd", "position:", "setStreamSize:", "max:", "streamSize"]}),
  3676. smalltalk.StringStream);
  3677. smalltalk.addMethod(
  3678. "_nextPutString_",
  3679. smalltalk.method({
  3680. selector: "nextPutString:",
  3681. fn: function (aString){
  3682. var self=this;
  3683. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutAll_(aString);
  3684. return self}, function($ctx1) {$ctx1.fill(self,"nextPutString:",{aString:aString},smalltalk.StringStream)})},
  3685. messageSends: ["nextPutAll:"]}),
  3686. smalltalk.StringStream);
  3687. smalltalk.addMethod(
  3688. "_space",
  3689. smalltalk.method({
  3690. selector: "space",
  3691. fn: function (){
  3692. var self=this;
  3693. return smalltalk.withContext(function($ctx1) { _st(self)._nextPut_(" ");
  3694. return self}, function($ctx1) {$ctx1.fill(self,"space",{},smalltalk.StringStream)})},
  3695. messageSends: ["nextPut:"]}),
  3696. smalltalk.StringStream);
  3697. smalltalk.addMethod(
  3698. "_tab",
  3699. smalltalk.method({
  3700. selector: "tab",
  3701. fn: function (){
  3702. var self=this;
  3703. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3704. return smalltalk.withContext(function($ctx1) { var $1;
  3705. $1=_st(self)._nextPutAll_(_st($String())._tab());
  3706. return $1;
  3707. }, function($ctx1) {$ctx1.fill(self,"tab",{},smalltalk.StringStream)})},
  3708. messageSends: ["nextPutAll:", "tab"]}),
  3709. smalltalk.StringStream);