Kernel-Collections.deploy.js 124 KB

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