1
0

Kernel-Collections.deploy.js 127 KB

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