Kernel-Objects.js 122 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787
  1. smalltalk.addPackage('Kernel-Objects', {});
  2. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
  3. smalltalk.addMethod(
  4. unescape('__eq'),
  5. smalltalk.method({
  6. selector: unescape('%3D'),
  7. category: 'comparing',
  8. fn: function (anObject){
  9. var self=this;
  10. return smalltalk.send(self, "__eq_eq", [anObject]);
  11. return self;},
  12. args: ["anObject"],
  13. source: unescape('%3D%20anObject%0A%09%5Eself%20%3D%3D%20anObject'),
  14. messageSends: [unescape("%3D%3D")],
  15. referencedClasses: []
  16. }),
  17. smalltalk.Object);
  18. smalltalk.addMethod(
  19. unescape('_%7E_eq'),
  20. smalltalk.method({
  21. selector: unescape('%7E%3D'),
  22. category: 'comparing',
  23. fn: function (anObject){
  24. var self=this;
  25. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq", [false]);
  26. return self;},
  27. args: ["anObject"],
  28. source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%20false'),
  29. messageSends: [unescape("%3D")],
  30. referencedClasses: []
  31. }),
  32. smalltalk.Object);
  33. smalltalk.addMethod(
  34. unescape('_initialize'),
  35. smalltalk.method({
  36. selector: unescape('initialize'),
  37. category: 'initialization',
  38. fn: function (){
  39. var self=this;
  40. return self;},
  41. args: [],
  42. source: unescape('initialize'),
  43. messageSends: [],
  44. referencedClasses: []
  45. }),
  46. smalltalk.Object);
  47. smalltalk.addMethod(
  48. unescape('_yourself'),
  49. smalltalk.method({
  50. selector: unescape('yourself'),
  51. category: 'accessing',
  52. fn: function (){
  53. var self=this;
  54. return self;
  55. return self;},
  56. args: [],
  57. source: unescape('yourself%0A%09%5Eself'),
  58. messageSends: [],
  59. referencedClasses: []
  60. }),
  61. smalltalk.Object);
  62. smalltalk.addMethod(
  63. unescape('_class'),
  64. smalltalk.method({
  65. selector: unescape('class'),
  66. category: 'accessing',
  67. fn: function (){
  68. var self=this;
  69. return self.klass;
  70. return self;},
  71. args: [],
  72. source: unescape('class%0A%09%3Creturn%20self.klass%3E'),
  73. messageSends: [],
  74. referencedClasses: []
  75. }),
  76. smalltalk.Object);
  77. smalltalk.addMethod(
  78. unescape('_size'),
  79. smalltalk.method({
  80. selector: unescape('size'),
  81. category: 'accessing',
  82. fn: function (){
  83. var self=this;
  84. smalltalk.send(self, "_error_", ["Object not indexable"]);
  85. return self;},
  86. args: [],
  87. source: unescape('size%0A%09self%20error%3A%20%27Object%20not%20indexable%27'),
  88. messageSends: ["error:"],
  89. referencedClasses: []
  90. }),
  91. smalltalk.Object);
  92. smalltalk.addMethod(
  93. unescape('_copy'),
  94. smalltalk.method({
  95. selector: unescape('copy'),
  96. category: 'copying',
  97. fn: function (){
  98. var self=this;
  99. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  100. return self;},
  101. args: [],
  102. source: unescape('copy%0A%09%5Eself%20shallowCopy%20postCopy'),
  103. messageSends: ["postCopy", "shallowCopy"],
  104. referencedClasses: []
  105. }),
  106. smalltalk.Object);
  107. smalltalk.addMethod(
  108. unescape('_shallowCopy'),
  109. smalltalk.method({
  110. selector: unescape('shallowCopy'),
  111. category: 'copying',
  112. fn: function (){
  113. var self=this;
  114. var copy = self.klass._new();
  115. for(var i in self) {
  116. if(/^@.+/.test(i)) {
  117. copy[i] = self[i];
  118. }
  119. }
  120. return copy;
  121. ;
  122. return self;},
  123. args: [],
  124. source: unescape('shallowCopy%0A%09%3C%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%3E'),
  125. messageSends: [],
  126. referencedClasses: []
  127. }),
  128. smalltalk.Object);
  129. smalltalk.addMethod(
  130. unescape('_deepCopy'),
  131. smalltalk.method({
  132. selector: unescape('deepCopy'),
  133. category: 'copying',
  134. fn: function (){
  135. var self=this;
  136. var copy = self.klass._new();
  137. for(var i in self) {
  138. if(/^@.+/.test(i)) {
  139. copy[i] = self[i]._deepCopy();
  140. }
  141. }
  142. return copy;
  143. ;
  144. return self;},
  145. args: [],
  146. source: unescape('deepCopy%0A%09%3C%20%20%20%20%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D._deepCopy%28%29%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%3E'),
  147. messageSends: [],
  148. referencedClasses: []
  149. }),
  150. smalltalk.Object);
  151. smalltalk.addMethod(
  152. unescape('_postCopy'),
  153. smalltalk.method({
  154. selector: unescape('postCopy'),
  155. category: 'copying',
  156. fn: function (){
  157. var self=this;
  158. return self;},
  159. args: [],
  160. source: unescape('postCopy'),
  161. messageSends: [],
  162. referencedClasses: []
  163. }),
  164. smalltalk.Object);
  165. smalltalk.addMethod(
  166. unescape('__minus_gt'),
  167. smalltalk.method({
  168. selector: unescape('-%3E'),
  169. category: 'converting',
  170. fn: function (anObject){
  171. var self=this;
  172. return smalltalk.send((smalltalk.Association || Association), "_key_value_", [self, anObject]);
  173. return self;},
  174. args: ["anObject"],
  175. source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject'),
  176. messageSends: ["key:value:"],
  177. referencedClasses: ["Association"]
  178. }),
  179. smalltalk.Object);
  180. smalltalk.addMethod(
  181. unescape('_asString'),
  182. smalltalk.method({
  183. selector: unescape('asString'),
  184. category: 'converting',
  185. fn: function (){
  186. var self=this;
  187. return smalltalk.send(self, "_printString", []);
  188. return self;},
  189. args: [],
  190. source: unescape('asString%0A%09%5Eself%20printString'),
  191. messageSends: ["printString"],
  192. referencedClasses: []
  193. }),
  194. smalltalk.Object);
  195. smalltalk.addMethod(
  196. unescape('_asJavascript'),
  197. smalltalk.method({
  198. selector: unescape('asJavascript'),
  199. category: 'converting',
  200. fn: function (){
  201. var self=this;
  202. return smalltalk.send(self, "_asString", []);
  203. return self;},
  204. args: [],
  205. source: unescape('asJavascript%0A%09%5Eself%20asString'),
  206. messageSends: ["asString"],
  207. referencedClasses: []
  208. }),
  209. smalltalk.Object);
  210. smalltalk.addMethod(
  211. unescape('_perform_'),
  212. smalltalk.method({
  213. selector: unescape('perform%3A'),
  214. category: 'message handling',
  215. fn: function (aSymbol){
  216. var self=this;
  217. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  218. return self;},
  219. args: ["aSymbol"],
  220. source: unescape('perform%3A%20aSymbol%0A%09%5Eself%20perform%3A%20aSymbol%20withArguments%3A%20%23%28%29'),
  221. messageSends: ["perform:withArguments:"],
  222. referencedClasses: []
  223. }),
  224. smalltalk.Object);
  225. smalltalk.addMethod(
  226. unescape('_perform_withArguments_'),
  227. smalltalk.method({
  228. selector: unescape('perform%3AwithArguments%3A'),
  229. category: 'message handling',
  230. fn: function (aSymbol, aCollection){
  231. var self=this;
  232. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  233. return self;},
  234. args: ["aSymbol", "aCollection"],
  235. source: unescape('perform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5Eself%20basicPerform%3A%20aSymbol%20asSelector%20withArguments%3A%20aCollection'),
  236. messageSends: ["basicPerform:withArguments:", "asSelector"],
  237. referencedClasses: []
  238. }),
  239. smalltalk.Object);
  240. smalltalk.addMethod(
  241. unescape('_instVarAt_'),
  242. smalltalk.method({
  243. selector: unescape('instVarAt%3A'),
  244. category: 'accessing',
  245. fn: function (aSymbol){
  246. var self=this;
  247. var varname=nil;
  248. varname=smalltalk.send(aSymbol, "_asString", []);
  249. return self['@'+varname];
  250. return self;},
  251. args: ["aSymbol"],
  252. source: unescape('instVarAt%3A%20aSymbol%0A%09%7C%20varname%20%7C%0A%09varname%20%3A%3D%20aSymbol%20asString.%0A%09%3Creturn%20self%5B%27@%27+varname%5D%3E'),
  253. messageSends: ["asString"],
  254. referencedClasses: []
  255. }),
  256. smalltalk.Object);
  257. smalltalk.addMethod(
  258. unescape('_instVarAt_put_'),
  259. smalltalk.method({
  260. selector: unescape('instVarAt%3Aput%3A'),
  261. category: 'accessing',
  262. fn: function (aSymbol, anObject){
  263. var self=this;
  264. var varname=nil;
  265. varname=smalltalk.send(aSymbol, "_asString", []);
  266. self['@' + varname] = anObject;
  267. return self;},
  268. args: ["aSymbol", "anObject"],
  269. source: unescape('instVarAt%3A%20aSymbol%20put%3A%20anObject%0A%09%7C%20varname%20%7C%0A%09varname%20%3A%3D%20aSymbol%20asString.%0A%09%3Cself%5B%27@%27%20+%20varname%5D%20%3D%20anObject%3E'),
  270. messageSends: ["asString"],
  271. referencedClasses: []
  272. }),
  273. smalltalk.Object);
  274. smalltalk.addMethod(
  275. unescape('_basicAt_'),
  276. smalltalk.method({
  277. selector: unescape('basicAt%3A'),
  278. category: 'accessing',
  279. fn: function (aString){
  280. var self=this;
  281. return self[aString];
  282. return self;},
  283. args: ["aString"],
  284. source: unescape('basicAt%3A%20aString%0A%09%3Creturn%20self%5BaString%5D%3E'),
  285. messageSends: [],
  286. referencedClasses: []
  287. }),
  288. smalltalk.Object);
  289. smalltalk.addMethod(
  290. unescape('_basicAt_put_'),
  291. smalltalk.method({
  292. selector: unescape('basicAt%3Aput%3A'),
  293. category: 'accessing',
  294. fn: function (aString, anObject){
  295. var self=this;
  296. return self[aString] = anObject;
  297. return self;},
  298. args: ["aString", "anObject"],
  299. source: unescape('basicAt%3A%20aString%20put%3A%20anObject%0A%09%3Creturn%20self%5BaString%5D%20%3D%20anObject%3E'),
  300. messageSends: [],
  301. referencedClasses: []
  302. }),
  303. smalltalk.Object);
  304. smalltalk.addMethod(
  305. unescape('_error_'),
  306. smalltalk.method({
  307. selector: unescape('error%3A'),
  308. category: 'error handling',
  309. fn: function (aString){
  310. var self=this;
  311. smalltalk.send((smalltalk.Error || Error), "_signal_", [aString]);
  312. return self;},
  313. args: ["aString"],
  314. source: unescape('error%3A%20aString%0A%09Error%20signal%3A%20aString'),
  315. messageSends: ["signal:"],
  316. referencedClasses: ["Error"]
  317. }),
  318. smalltalk.Object);
  319. smalltalk.addMethod(
  320. unescape('_subclassResponsibility'),
  321. smalltalk.method({
  322. selector: unescape('subclassResponsibility'),
  323. category: 'error handling',
  324. fn: function (){
  325. var self=this;
  326. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  327. return self;},
  328. args: [],
  329. source: unescape('subclassResponsibility%0A%09self%20error%3A%20%27This%20method%20is%20a%20responsibility%20of%20a%20subclass%27'),
  330. messageSends: ["error:"],
  331. referencedClasses: []
  332. }),
  333. smalltalk.Object);
  334. smalltalk.addMethod(
  335. unescape('_shouldNotImplement'),
  336. smalltalk.method({
  337. selector: unescape('shouldNotImplement'),
  338. category: 'error handling',
  339. fn: function (){
  340. var self=this;
  341. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  342. return self;},
  343. args: [],
  344. source: unescape('shouldNotImplement%0A%09self%20error%3A%20%27This%20method%20should%20not%20be%20implemented%20in%20%27%2C%20self%20class%20name'),
  345. messageSends: ["error:", unescape("%2C"), "name", "class"],
  346. referencedClasses: []
  347. }),
  348. smalltalk.Object);
  349. smalltalk.addMethod(
  350. unescape('_try_catch_'),
  351. smalltalk.method({
  352. selector: unescape('try%3Acatch%3A'),
  353. category: 'error handling',
  354. fn: function (aBlock, anotherBlock){
  355. var self=this;
  356. try{result = aBlock()} catch(e) {result = anotherBlock(e)};
  357. return result;;
  358. return self;},
  359. args: ["aBlock", "anotherBlock"],
  360. source: unescape('try%3A%20aBlock%20catch%3A%20anotherBlock%0A%09%3Ctry%7Bresult%20%3D%20aBlock%28%29%7D%20catch%28e%29%20%7Bresult%20%3D%20anotherBlock%28e%29%7D%3B%0A%09return%20result%3B%3E'),
  361. messageSends: [],
  362. referencedClasses: []
  363. }),
  364. smalltalk.Object);
  365. smalltalk.addMethod(
  366. unescape('_printString'),
  367. smalltalk.method({
  368. selector: unescape('printString'),
  369. category: 'printing',
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  373. return self;},
  374. args: [],
  375. source: unescape('printString%0A%09%5E%27a%20%27%2C%20self%20class%20name'),
  376. messageSends: [unescape("%2C"), "name", "class"],
  377. referencedClasses: []
  378. }),
  379. smalltalk.Object);
  380. smalltalk.addMethod(
  381. unescape('_printNl'),
  382. smalltalk.method({
  383. selector: unescape('printNl'),
  384. category: 'printing',
  385. fn: function (){
  386. var self=this;
  387. console.log(self);
  388. return self;},
  389. args: [],
  390. source: unescape('printNl%0A%09%3Cconsole.log%28self%29%3E'),
  391. messageSends: [],
  392. referencedClasses: []
  393. }),
  394. smalltalk.Object);
  395. smalltalk.addMethod(
  396. unescape('_isKindOf_'),
  397. smalltalk.method({
  398. selector: unescape('isKindOf%3A'),
  399. category: 'testing',
  400. fn: function (aClass){
  401. var self=this;
  402. return ((($receiver = smalltalk.send(self, "_isMemberOf_", [aClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return true;})() : (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return true;}), (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);})]));
  403. return self;},
  404. args: ["aClass"],
  405. source: unescape('isKindOf%3A%20aClass%0A%09%5E%28self%20isMemberOf%3A%20aClass%29%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20class%20inheritsFrom%3A%20aClass%5D'),
  406. messageSends: ["ifTrue:ifFalse:", "isMemberOf:", "inheritsFrom:", "class"],
  407. referencedClasses: []
  408. }),
  409. smalltalk.Object);
  410. smalltalk.addMethod(
  411. unescape('_isMemberOf_'),
  412. smalltalk.method({
  413. selector: unescape('isMemberOf%3A'),
  414. category: 'testing',
  415. fn: function (aClass){
  416. var self=this;
  417. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  418. return self;},
  419. args: ["aClass"],
  420. source: unescape('isMemberOf%3A%20aClass%0A%09%5Eself%20class%20%3D%20aClass'),
  421. messageSends: [unescape("%3D"), "class"],
  422. referencedClasses: []
  423. }),
  424. smalltalk.Object);
  425. smalltalk.addMethod(
  426. unescape('_ifNil_'),
  427. smalltalk.method({
  428. selector: unescape('ifNil%3A'),
  429. category: 'testing',
  430. fn: function (aBlock){
  431. var self=this;
  432. return self;
  433. return self;},
  434. args: ["aBlock"],
  435. source: unescape('ifNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself'),
  436. messageSends: [],
  437. referencedClasses: []
  438. }),
  439. smalltalk.Object);
  440. smalltalk.addMethod(
  441. unescape('_ifNil_ifNotNil_'),
  442. smalltalk.method({
  443. selector: unescape('ifNil%3AifNotNil%3A'),
  444. category: 'testing',
  445. fn: function (aBlock, anotherBlock){
  446. var self=this;
  447. return smalltalk.send(anotherBlock, "_value", []);
  448. return self;},
  449. args: ["aBlock", "anotherBlock"],
  450. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EanotherBlock%20value'),
  451. messageSends: ["value"],
  452. referencedClasses: []
  453. }),
  454. smalltalk.Object);
  455. smalltalk.addMethod(
  456. unescape('_ifNotNil_'),
  457. smalltalk.method({
  458. selector: unescape('ifNotNil%3A'),
  459. category: 'testing',
  460. fn: function (aBlock){
  461. var self=this;
  462. return smalltalk.send(aBlock, "_value", []);
  463. return self;},
  464. args: ["aBlock"],
  465. source: unescape('ifNotNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  466. messageSends: ["value"],
  467. referencedClasses: []
  468. }),
  469. smalltalk.Object);
  470. smalltalk.addMethod(
  471. unescape('_ifNotNil_ifNil_'),
  472. smalltalk.method({
  473. selector: unescape('ifNotNil%3AifNil%3A'),
  474. category: 'testing',
  475. fn: function (aBlock, anotherBlock){
  476. var self=this;
  477. return smalltalk.send(aBlock, "_value", []);
  478. return self;},
  479. args: ["aBlock", "anotherBlock"],
  480. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  481. messageSends: ["value"],
  482. referencedClasses: []
  483. }),
  484. smalltalk.Object);
  485. smalltalk.addMethod(
  486. unescape('_isNil'),
  487. smalltalk.method({
  488. selector: unescape('isNil'),
  489. category: 'testing',
  490. fn: function (){
  491. var self=this;
  492. return false;
  493. return self;},
  494. args: [],
  495. source: unescape('isNil%0A%09%5Efalse'),
  496. messageSends: [],
  497. referencedClasses: []
  498. }),
  499. smalltalk.Object);
  500. smalltalk.addMethod(
  501. unescape('_notNil'),
  502. smalltalk.method({
  503. selector: unescape('notNil'),
  504. category: 'testing',
  505. fn: function (){
  506. var self=this;
  507. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  508. return self;},
  509. args: [],
  510. source: unescape('notNil%0A%09%5Eself%20isNil%20not'),
  511. messageSends: ["not", "isNil"],
  512. referencedClasses: []
  513. }),
  514. smalltalk.Object);
  515. smalltalk.addMethod(
  516. unescape('_isClass'),
  517. smalltalk.method({
  518. selector: unescape('isClass'),
  519. category: 'testing',
  520. fn: function (){
  521. var self=this;
  522. return false;
  523. return self;},
  524. args: [],
  525. source: unescape('isClass%0A%09%5Efalse'),
  526. messageSends: [],
  527. referencedClasses: []
  528. }),
  529. smalltalk.Object);
  530. smalltalk.addMethod(
  531. unescape('_isMetaclass'),
  532. smalltalk.method({
  533. selector: unescape('isMetaclass'),
  534. category: 'testing',
  535. fn: function (){
  536. var self=this;
  537. return false;
  538. return self;},
  539. args: [],
  540. source: unescape('isMetaclass%0A%09%5Efalse'),
  541. messageSends: [],
  542. referencedClasses: []
  543. }),
  544. smalltalk.Object);
  545. smalltalk.addMethod(
  546. unescape('_isNumber'),
  547. smalltalk.method({
  548. selector: unescape('isNumber'),
  549. category: 'testing',
  550. fn: function (){
  551. var self=this;
  552. return false;
  553. return self;},
  554. args: [],
  555. source: unescape('isNumber%0A%09%5Efalse'),
  556. messageSends: [],
  557. referencedClasses: []
  558. }),
  559. smalltalk.Object);
  560. smalltalk.addMethod(
  561. unescape('_isString'),
  562. smalltalk.method({
  563. selector: unescape('isString'),
  564. category: 'testing',
  565. fn: function (){
  566. var self=this;
  567. return false;
  568. return self;},
  569. args: [],
  570. source: unescape('isString%0A%09%5Efalse'),
  571. messageSends: [],
  572. referencedClasses: []
  573. }),
  574. smalltalk.Object);
  575. smalltalk.addMethod(
  576. unescape('_isParseFailure'),
  577. smalltalk.method({
  578. selector: unescape('isParseFailure'),
  579. category: 'testing',
  580. fn: function (){
  581. var self=this;
  582. return false;
  583. return self;},
  584. args: [],
  585. source: unescape('isParseFailure%0A%09%5Efalse'),
  586. messageSends: [],
  587. referencedClasses: []
  588. }),
  589. smalltalk.Object);
  590. smalltalk.addMethod(
  591. unescape('_basicPerform_'),
  592. smalltalk.method({
  593. selector: unescape('basicPerform%3A'),
  594. category: 'message handling',
  595. fn: function (aSymbol){
  596. var self=this;
  597. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  598. return self;},
  599. args: ["aSymbol"],
  600. source: unescape('basicPerform%3A%20aSymbol%20%0A%09%5Eself%20basicPerform%3A%20aSymbol%20withArguments%3A%20%23%28%29'),
  601. messageSends: ["basicPerform:withArguments:"],
  602. referencedClasses: []
  603. }),
  604. smalltalk.Object);
  605. smalltalk.addMethod(
  606. unescape('_basicPerform_withArguments_'),
  607. smalltalk.method({
  608. selector: unescape('basicPerform%3AwithArguments%3A'),
  609. category: 'message handling',
  610. fn: function (aSymbol, aCollection){
  611. var self=this;
  612. return self[aSymbol].apply(self, aCollection);;
  613. return self;},
  614. args: ["aSymbol", "aCollection"],
  615. source: unescape('basicPerform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%3Creturn%20self%5BaSymbol%5D.apply%28self%2C%20aCollection%29%3B%3E'),
  616. messageSends: [],
  617. referencedClasses: []
  618. }),
  619. smalltalk.Object);
  620. smalltalk.addMethod(
  621. unescape('_basicDelete_'),
  622. smalltalk.method({
  623. selector: unescape('basicDelete%3A'),
  624. category: 'accessing',
  625. fn: function (aString){
  626. var self=this;
  627. delete self[aString]; return aString;
  628. return self;},
  629. args: ["aString"],
  630. source: unescape('basicDelete%3A%20aString%0A%20%20%20%20%3Cdelete%20self%5BaString%5D%3B%20return%20aString%3E'),
  631. messageSends: [],
  632. referencedClasses: []
  633. }),
  634. smalltalk.Object);
  635. smalltalk.addMethod(
  636. unescape('_doesNotUnderstand_'),
  637. smalltalk.method({
  638. selector: unescape('doesNotUnderstand%3A'),
  639. category: 'error handling',
  640. fn: function (aMessage){
  641. var self=this;
  642. (function($rec){smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.MessageNotUnderstood || MessageNotUnderstood), "_new", []));
  643. return self;},
  644. args: ["aMessage"],
  645. source: unescape('doesNotUnderstand%3A%20aMessage%0A%09MessageNotUnderstood%20new%0A%09%09receiver%3A%20self%3B%0A%09%09message%3A%20aMessage%3B%0A%09%09signal'),
  646. messageSends: ["receiver:", "message:", "signal", "new"],
  647. referencedClasses: ["MessageNotUnderstood"]
  648. }),
  649. smalltalk.Object);
  650. smalltalk.addMethod(
  651. unescape('_asJSON'),
  652. smalltalk.method({
  653. selector: unescape('asJSON'),
  654. category: 'converting',
  655. fn: function (){
  656. var self=this;
  657. return smalltalk.send((smalltalk.JSON || JSON), "_parse_", [smalltalk.send(self, "_asJSONString", [])]);
  658. return self;},
  659. args: [],
  660. source: unescape('asJSON%0A%09%5EJSON%20parse%3A%20self%20asJSONString'),
  661. messageSends: ["parse:", "asJSONString"],
  662. referencedClasses: ["JSON"]
  663. }),
  664. smalltalk.Object);
  665. smalltalk.addMethod(
  666. unescape('_halt'),
  667. smalltalk.method({
  668. selector: unescape('halt'),
  669. category: 'error handling',
  670. fn: function (){
  671. var self=this;
  672. smalltalk.send(self, "_error_", ["Halt encountered"]);
  673. return self;},
  674. args: [],
  675. source: unescape('halt%0A%09self%20error%3A%20%27Halt%20encountered%27'),
  676. messageSends: ["error:"],
  677. referencedClasses: []
  678. }),
  679. smalltalk.Object);
  680. smalltalk.addMethod(
  681. unescape('_log_block_'),
  682. smalltalk.method({
  683. selector: unescape('log%3Ablock%3A'),
  684. category: 'printing',
  685. fn: function (aString, aBlock){
  686. var self=this;
  687. var result=nil;
  688. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(smalltalk.send(aString, "__comma", [" time: "]), "__comma", [smalltalk.send(smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return result=smalltalk.send(aBlock, "_value", []);})]), "_printString", [])])]);
  689. return result;
  690. return self;},
  691. args: ["aString", "aBlock"],
  692. source: unescape('log%3A%20aString%20block%3A%20aBlock%0A%0A%09%7C%20result%20%7C%0A%09console%20log%3A%20%20aString%2C%20%20%27%20time%3A%20%27%2C%20%28Date%20millisecondsToRun%3A%20%5Bresult%20%3A%3D%20aBlock%20value%5D%29%20printString.%0A%09%5Eresult'),
  693. messageSends: ["log:", unescape("%2C"), "printString", "millisecondsToRun:", "value"],
  694. referencedClasses: ["Date"]
  695. }),
  696. smalltalk.Object);
  697. smalltalk.addMethod(
  698. unescape('__eq_eq'),
  699. smalltalk.method({
  700. selector: unescape('%3D%3D'),
  701. category: 'comparing',
  702. fn: function (anObject){
  703. var self=this;
  704. return smalltalk.send(smalltalk.send(self, "_identityHash", []), "__eq", [smalltalk.send(anObject, "_identityHash", [])]);
  705. return self;},
  706. args: ["anObject"],
  707. source: unescape('%3D%3D%20anObject%0A%09%5Eself%20identityHash%20%3D%20anObject%20identityHash'),
  708. messageSends: [unescape("%3D"), "identityHash"],
  709. referencedClasses: []
  710. }),
  711. smalltalk.Object);
  712. smalltalk.addMethod(
  713. unescape('_%7E%7E'),
  714. smalltalk.method({
  715. selector: unescape('%7E%7E'),
  716. category: 'comparing',
  717. fn: function (anObject){
  718. var self=this;
  719. return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
  720. return self;},
  721. args: ["anObject"],
  722. source: unescape('%7E%7E%20anObject%0A%09%5E%28self%20%3D%3D%20anObject%29%20%3D%20false'),
  723. messageSends: [unescape("%3D"), unescape("%3D%3D")],
  724. referencedClasses: []
  725. }),
  726. smalltalk.Object);
  727. smalltalk.addMethod(
  728. unescape('_deprecatedAPI'),
  729. smalltalk.method({
  730. selector: unescape('deprecatedAPI'),
  731. category: 'error handling',
  732. fn: function (){
  733. var self=this;
  734. smalltalk.send((typeof console == 'undefined' ? nil : console), "_warn_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.getThisContext()), "_home", []), "_asString", []), "__comma", [unescape("%20is%20deprecated%21%20%28in%20")]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.getThisContext()), "_home", []), "_home", []), "_asString", [])]), "__comma", [unescape("%29")])]);
  735. return self;},
  736. args: [],
  737. source: unescape('deprecatedAPI%0A%09%22Just%20a%20simple%20way%20to%20deprecate%20methods.%0A%09%23deprecatedAPI%20is%20in%20the%20%27error%20handling%27%20protocol%20even%20if%20it%20doesn%27t%20throw%20an%20error%2C%0A%09but%20it%20could%20in%20the%20future.%22%0A%09console%20warn%3A%20thisContext%20home%20asString%2C%20%27%20is%20deprecated%21%20%28in%20%27%2C%20thisContext%20home%20home%20asString%2C%20%27%29%27'),
  738. messageSends: ["warn:", unescape("%2C"), "asString", "home"],
  739. referencedClasses: []
  740. }),
  741. smalltalk.Object);
  742. smalltalk.addMethod(
  743. unescape('_storeString'),
  744. smalltalk.method({
  745. selector: unescape('storeString'),
  746. category: 'printing',
  747. fn: function (){
  748. var self=this;
  749. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(s){return smalltalk.send(self, "_storeOn_", [s]);})]);
  750. return self;},
  751. args: [],
  752. source: unescape('storeString%0A%09%22Answer%20a%20String%20representation%20of%20the%20receiver%20from%20which%20the%20receiver%20%0A%09can%20be%20reconstructed.%22%0A%0A%09%5E%20String%20streamContents%3A%20%5B%3As%20%7C%20self%20storeOn%3A%20s%5D'),
  753. messageSends: ["streamContents:", "storeOn:"],
  754. referencedClasses: ["String"]
  755. }),
  756. smalltalk.Object);
  757. smalltalk.addMethod(
  758. unescape('_storeOn_'),
  759. smalltalk.method({
  760. selector: unescape('storeOn%3A'),
  761. category: 'printing',
  762. fn: function (aStream){
  763. var self=this;
  764. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(self, "_printString", [])]);
  765. return self;},
  766. args: ["aStream"],
  767. source: unescape('storeOn%3A%20aStream%0A%09aStream%20nextPutAll%3A%20self%20printString'),
  768. messageSends: ["nextPutAll:", "printString"],
  769. referencedClasses: []
  770. }),
  771. smalltalk.Object);
  772. smalltalk.addMethod(
  773. unescape('_asJSONString'),
  774. smalltalk.method({
  775. selector: unescape('asJSONString'),
  776. category: 'converting',
  777. fn: function (){
  778. var self=this;
  779. return smalltalk.send((smalltalk.JSON || JSON), "_stringify_", [self]);
  780. return self;},
  781. args: [],
  782. source: unescape('asJSONString%0A%09%5EJSON%20stringify%3A%20self'),
  783. messageSends: ["stringify:"],
  784. referencedClasses: ["JSON"]
  785. }),
  786. smalltalk.Object);
  787. smalltalk.addMethod(
  788. unescape('_identityHash'),
  789. smalltalk.method({
  790. selector: unescape('identityHash'),
  791. category: 'accessing',
  792. fn: function (){
  793. var self=this;
  794. return self.identityHash || (self.identityHash = smalltalk.nextId());;
  795. return self;},
  796. args: [],
  797. source: unescape('identityHash%0A%09%3Creturn%20self.identityHash%20%7C%7C%20%28self.identityHash%20%3D%20smalltalk.nextId%28%29%29%3B%3E'),
  798. messageSends: [],
  799. referencedClasses: []
  800. }),
  801. smalltalk.Object);
  802. smalltalk.addMethod(
  803. unescape('_isSymbol'),
  804. smalltalk.method({
  805. selector: unescape('isSymbol'),
  806. category: 'testing',
  807. fn: function (){
  808. var self=this;
  809. return false;
  810. return self;},
  811. args: [],
  812. source: unescape('isSymbol%0A%09%5Efalse'),
  813. messageSends: [],
  814. referencedClasses: []
  815. }),
  816. smalltalk.Object);
  817. smalltalk.addMethod(
  818. unescape('_initialize'),
  819. smalltalk.method({
  820. selector: unescape('initialize'),
  821. category: 'initialization',
  822. fn: function (){
  823. var self=this;
  824. return self;},
  825. args: [],
  826. source: unescape('initialize%0A%09%22no%20op%22'),
  827. messageSends: [],
  828. referencedClasses: []
  829. }),
  830. smalltalk.Object.klass);
  831. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  832. smalltalk.addMethod(
  833. unescape('_classes'),
  834. smalltalk.method({
  835. selector: unescape('classes'),
  836. category: 'accessing',
  837. fn: function (){
  838. var self=this;
  839. return self.classes();
  840. return self;},
  841. args: [],
  842. source: unescape('classes%0A%09%3Creturn%20self.classes%28%29%3E'),
  843. messageSends: [],
  844. referencedClasses: []
  845. }),
  846. smalltalk.Smalltalk);
  847. smalltalk.addMethod(
  848. unescape('_at_'),
  849. smalltalk.method({
  850. selector: unescape('at%3A'),
  851. category: 'accessing',
  852. fn: function (aString){
  853. var self=this;
  854. return self[aString];
  855. return self;},
  856. args: ["aString"],
  857. source: unescape('at%3A%20aString%0A%09%3Creturn%20self%5BaString%5D%3E'),
  858. messageSends: [],
  859. referencedClasses: []
  860. }),
  861. smalltalk.Smalltalk);
  862. smalltalk.addMethod(
  863. unescape('_removeClass_'),
  864. smalltalk.method({
  865. selector: unescape('removeClass%3A'),
  866. category: 'classes',
  867. fn: function (aClass){
  868. var self=this;
  869. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);})]));
  870. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  871. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  872. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  873. return self;},
  874. args: ["aClass"],
  875. source: unescape('removeClass%3A%20aClass%0A%09aClass%20isMetaclass%20ifTrue%3A%20%5Bself%20error%3A%20aClass%20asString%2C%20%27%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21%27%5D.%0A%09aClass%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09aClass%20removeCompiledMethod%3A%20each%5D.%0A%09aClass%20class%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09aClass%20class%20removeCompiledMethod%3A%20each%5D.%0A%09self%20basicDelete%3A%20aClass%20name'),
  876. messageSends: ["ifTrue:", "isMetaclass", "error:", unescape("%2C"), "asString", "do:", "values", "methodDictionary", "removeCompiledMethod:", "class", "basicDelete:", "name"],
  877. referencedClasses: []
  878. }),
  879. smalltalk.Smalltalk);
  880. smalltalk.addMethod(
  881. unescape('_basicParse_'),
  882. smalltalk.method({
  883. selector: unescape('basicParse%3A'),
  884. category: 'accessing',
  885. fn: function (aString){
  886. var self=this;
  887. return smalltalk.parser.parse(aString);
  888. return self;},
  889. args: ["aString"],
  890. source: unescape('basicParse%3A%20aString%0A%09%3Creturn%20smalltalk.parser.parse%28aString%29%3E'),
  891. messageSends: [],
  892. referencedClasses: []
  893. }),
  894. smalltalk.Smalltalk);
  895. smalltalk.addMethod(
  896. unescape('_parse_'),
  897. smalltalk.method({
  898. selector: unescape('parse%3A'),
  899. category: 'accessing',
  900. fn: function (aString){
  901. var self=this;
  902. var result=nil;
  903. smalltalk.send(self, "_try_catch_", [(function(){return result=smalltalk.send(self, "_basicParse_", [aString]);}), (function(ex){return smalltalk.send(smalltalk.send(self, "_parseError_parsing_", [ex, aString]), "_signal", []);})]);
  904. return result;
  905. return self;},
  906. args: ["aString"],
  907. source: unescape('parse%3A%20aString%0A%09%7C%20result%20%7C%20%0A%09self%20try%3A%20%5Bresult%20%3A%3D%20self%20basicParse%3A%20aString%5D%20catch%3A%20%5B%3Aex%20%7C%20%28self%20parseError%3A%20ex%20parsing%3A%20aString%29%20signal%5D.%0A%09%5Eresult'),
  908. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:"],
  909. referencedClasses: []
  910. }),
  911. smalltalk.Smalltalk);
  912. smalltalk.addMethod(
  913. unescape('_parseError_parsing_'),
  914. smalltalk.method({
  915. selector: unescape('parseError%3Aparsing%3A'),
  916. category: 'accessing',
  917. fn: function (anException, aString){
  918. var self=this;
  919. var row=nil;
  920. var col=nil;
  921. var message=nil;
  922. var lines=nil;
  923. var badLine=nil;
  924. var code=nil;
  925. row = anException.line;
  926. col = anException.column;
  927. message = anException.message;;
  928. lines=smalltalk.send(aString, "_lines", []);
  929. badLine=smalltalk.send(lines, "_at_", [row]);
  930. badLine=smalltalk.send(smalltalk.send(smalltalk.send(badLine, "_copyFrom_to_", [(1), ((($receiver = col).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]), "__comma", [unescape("%20%3D%3D%3D%3E")]), "__comma", [smalltalk.send(badLine, "_copyFrom_to_", [col, smalltalk.send(badLine, "_size", [])])]);
  931. smalltalk.send(lines, "_at_put_", [row, badLine]);
  932. code=smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(s){return smalltalk.send(lines, "_withIndexDo_", [(function(l, i){return smalltalk.send(s, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(i, "_asString", []), "__comma", [": "]), "__comma", [l]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})]);})]);
  933. return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_messageText_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Parse error on line ", "__comma", [row]), "__comma", [" column "]), "__comma", [col]), "__comma", [" : "]), "__comma", [message]), "__comma", [unescape("%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A")]), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", [code])]);
  934. return self;},
  935. args: ["anException", "aString"],
  936. source: unescape('parseError%3A%20anException%20parsing%3A%20aString%0A%09%7C%20row%20col%20message%20lines%20badLine%20code%20%7C%0A%09%3Crow%20%3D%20anException.line%3B%0A%09col%20%3D%20anException.column%3B%0A%09message%20%3D%20anException.message%3B%3E.%0A%09lines%20%3A%3D%20aString%20lines.%0A%09badLine%20%3A%3D%20lines%20at%3A%20row.%0A%09badLine%20%3A%3D%20%28badLine%20copyFrom%3A%201%20to%3A%20col%20-%201%29%2C%20%27%20%3D%3D%3D%3E%27%2C%20%28badLine%20copyFrom%3A%20%20col%20to%3A%20badLine%20size%29.%0A%09lines%20at%3A%20row%20put%3A%20badLine.%0A%09code%20%3A%3D%20String%20streamContents%3A%20%5B%3As%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20lines%20withIndexDo%3A%20%5B%3Al%20%3Ai%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20nextPutAll%3A%20i%20asString%2C%20%27%3A%20%27%2C%20l%2C%20String%20lf%5D%5D.%0A%09%5E%20Error%20new%20messageText%3A%20%28%27Parse%20error%20on%20line%20%27%20%2C%20row%20%2C%20%27%20column%20%27%20%2C%20col%20%2C%20%27%20%3A%20%27%20%2C%20message%20%2C%20%27%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A%27%20%2C%20String%20lf%2C%20code%29'),
  937. messageSends: ["lines", "at:", unescape("%2C"), "copyFrom:to:", unescape("-"), "size", "at:put:", "streamContents:", "withIndexDo:", "nextPutAll:", "asString", "lf", "messageText:", "new"],
  938. referencedClasses: ["String", "Error"]
  939. }),
  940. smalltalk.Smalltalk);
  941. smalltalk.addMethod(
  942. unescape('_packages'),
  943. smalltalk.method({
  944. selector: unescape('packages'),
  945. category: 'packages',
  946. fn: function (){
  947. var self=this;
  948. return self.packages.all();
  949. return self;},
  950. args: [],
  951. source: unescape('packages%0A%09%22Return%20all%20Package%20instances%20in%20the%20system.%22%0A%0A%09%3Creturn%20self.packages.all%28%29%3E'),
  952. messageSends: [],
  953. referencedClasses: []
  954. }),
  955. smalltalk.Smalltalk);
  956. smalltalk.addMethod(
  957. unescape('_packageAt_'),
  958. smalltalk.method({
  959. selector: unescape('packageAt%3A'),
  960. category: 'packages',
  961. fn: function (packageName){
  962. var self=this;
  963. return self.packages[packageName];
  964. return self;},
  965. args: ["packageName"],
  966. source: unescape('packageAt%3A%20packageName%0A%20%20%20%20%20%20%20%3Creturn%20self.packages%5BpackageName%5D%3E'),
  967. messageSends: [],
  968. referencedClasses: []
  969. }),
  970. smalltalk.Smalltalk);
  971. smalltalk.addMethod(
  972. unescape('_packageAt_ifAbsent_'),
  973. smalltalk.method({
  974. selector: unescape('packageAt%3AifAbsent%3A'),
  975. category: 'packages',
  976. fn: function (packageName, aBlock){
  977. var self=this;
  978. return smalltalk.send(smalltalk.send(self, "_packageAt_", [packageName]), "_ifNil_", [aBlock]);
  979. return self;},
  980. args: ["packageName", "aBlock"],
  981. source: unescape('packageAt%3A%20packageName%20ifAbsent%3A%20aBlock%0A%20%20%20%20%20%20%20%5E%28self%20packageAt%3A%20packageName%29%20ifNil%3A%20aBlock'),
  982. messageSends: ["ifNil:", "packageAt:"],
  983. referencedClasses: []
  984. }),
  985. smalltalk.Smalltalk);
  986. smalltalk.addMethod(
  987. unescape('_createPackage_'),
  988. smalltalk.method({
  989. selector: unescape('createPackage%3A'),
  990. category: 'private',
  991. fn: function (packageName){
  992. var self=this;
  993. return smalltalk.addPackage(packageName, nil);
  994. return self;},
  995. args: ["packageName"],
  996. source: unescape('createPackage%3A%20packageName%0A%09%22Create%20and%20bind%20a%20new%20package%20with%20given%20name%20and%20return%20it.%22%0A%0A%20%20%20%20%20%20%3Creturn%20smalltalk.addPackage%28packageName%2C%20nil%29%3E'),
  997. messageSends: [],
  998. referencedClasses: []
  999. }),
  1000. smalltalk.Smalltalk);
  1001. smalltalk.addMethod(
  1002. unescape('_deletePackage_'),
  1003. smalltalk.method({
  1004. selector: unescape('deletePackage%3A'),
  1005. category: 'private',
  1006. fn: function (packageName){
  1007. var self=this;
  1008. delete smalltalk.packages[packageName];
  1009. return self;},
  1010. args: ["packageName"],
  1011. source: unescape('deletePackage%3A%20packageName%0A%09%22Deletes%20a%20package%20by%20deleting%20its%20binding%2C%20but%20does%20not%20check%20if%20it%20contains%20classes%20etc.%0A%09To%20remove%20a%20package%2C%20use%20%23removePackage%20instead.%22%0A%0A%20%20%20%20%20%20%20%3Cdelete%20smalltalk.packages%5BpackageName%5D%3E'),
  1012. messageSends: [],
  1013. referencedClasses: []
  1014. }),
  1015. smalltalk.Smalltalk);
  1016. smalltalk.addMethod(
  1017. unescape('_removePackage_'),
  1018. smalltalk.method({
  1019. selector: unescape('removePackage%3A'),
  1020. category: 'packages',
  1021. fn: function (packageName){
  1022. var self=this;
  1023. var pkg=nil;
  1024. pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  1025. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
  1026. smalltalk.send(self, "_deletePackage_", [packageName]);
  1027. return self;},
  1028. args: ["packageName"],
  1029. source: unescape('removePackage%3A%20packageName%0A%09%22Removes%20a%20package%20and%20all%20its%20classes.%22%0A%0A%09%7C%20pkg%20%7C%0A%09pkg%20%3A%3D%20self%20packageAt%3A%20packageName%20ifAbsent%3A%20%5Bself%20error%3A%20%27Missing%20package%3A%20%27%2C%20packageName%5D.%0A%09pkg%20classes%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%20%20%20%20%09self%20removeClass%3A%20each%5D.%0A%09self%20deletePackage%3A%20packageName'),
  1030. messageSends: ["packageAt:ifAbsent:", "error:", unescape("%2C"), "do:", "classes", "removeClass:", "deletePackage:"],
  1031. referencedClasses: []
  1032. }),
  1033. smalltalk.Smalltalk);
  1034. smalltalk.addMethod(
  1035. unescape('_renamePackage_to_'),
  1036. smalltalk.method({
  1037. selector: unescape('renamePackage%3Ato%3A'),
  1038. category: 'packages',
  1039. fn: function (packageName, newName){
  1040. var self=this;
  1041. var pkg=nil;
  1042. pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  1043. (($receiver = smalltalk.send(self, "_packageAt_", [newName])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);})() : nil;
  1044. smalltalk.packages[newName] = smalltalk.packages[packageName];
  1045. smalltalk.send(pkg, "_name_", [newName]);
  1046. smalltalk.send(self, "_deletePackage_", [packageName]);
  1047. return self;},
  1048. args: ["packageName", "newName"],
  1049. source: unescape('renamePackage%3A%20packageName%20to%3A%20newName%0A%09%22Rename%20a%20package.%22%0A%0A%09%7C%20pkg%20%7C%0A%09pkg%20%3A%3D%20self%20packageAt%3A%20packageName%20ifAbsent%3A%20%5Bself%20error%3A%20%27Missing%20package%3A%20%27%2C%20packageName%5D.%0A%09%28self%20packageAt%3A%20newName%29%20ifNotNil%3A%20%5Bself%20error%3A%20%27Already%20exists%20a%20package%20called%3A%20%27%2C%20newName%5D.%0A%09%3Csmalltalk.packages%5BnewName%5D%20%3D%20smalltalk.packages%5BpackageName%5D%3E.%0A%09pkg%20name%3A%20newName.%0A%09self%20deletePackage%3A%20packageName.'),
  1050. messageSends: ["packageAt:ifAbsent:", "error:", unescape("%2C"), "ifNotNil:", "packageAt:", "name:", "deletePackage:"],
  1051. referencedClasses: []
  1052. }),
  1053. smalltalk.Smalltalk);
  1054. smalltalk.addMethod(
  1055. unescape('_reservedWords'),
  1056. smalltalk.method({
  1057. selector: unescape('reservedWords'),
  1058. category: 'accessing',
  1059. fn: function (){
  1060. var self=this;
  1061. return self.reservedWords;
  1062. return self;},
  1063. args: [],
  1064. source: unescape('reservedWords%0A%09%22JavaScript%20reserved%20words%22%0A%09%3Creturn%20self.reservedWords%3E'),
  1065. messageSends: [],
  1066. referencedClasses: []
  1067. }),
  1068. smalltalk.Smalltalk);
  1069. smalltalk.addMethod(
  1070. unescape('_createPackage_properties_'),
  1071. smalltalk.method({
  1072. selector: unescape('createPackage%3Aproperties%3A'),
  1073. category: 'private',
  1074. fn: function (packageName, aDict){
  1075. var self=this;
  1076. var object=nil;
  1077. object = {};;
  1078. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  1079. return smalltalk.addPackage(packageName, object);
  1080. return self;},
  1081. args: ["packageName", "aDict"],
  1082. source: unescape('createPackage%3A%20packageName%20properties%3A%20aDict%0A%09%22Create%20and%20bind%20a%20new%20package%20with%20given%20name%20and%20return%20it.%22%0A%0A%09%7C%20object%20%7C%0A%09%3Cobject%20%3D%20%7B%7D%3B%3E.%0A%09aDict%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%09%3Cobject%5Bkey%5D%20%3D%20value%3E.%0A%09%5D.%0A%20%20%20%20%20%20%20%3Creturn%20smalltalk.addPackage%28packageName%2C%20object%29%3E'),
  1083. messageSends: ["keysAndValuesDo:"],
  1084. referencedClasses: []
  1085. }),
  1086. smalltalk.Smalltalk);
  1087. smalltalk.addMethod(
  1088. unescape('_readJSObject_'),
  1089. smalltalk.method({
  1090. selector: unescape('readJSObject%3A'),
  1091. category: 'accessing',
  1092. fn: function (anObject){
  1093. var self=this;
  1094. return self.readJSObject(anObject);
  1095. return self;},
  1096. args: ["anObject"],
  1097. source: unescape('readJSObject%3A%20anObject%0A%09%3Creturn%20self.readJSObject%28anObject%29%3E'),
  1098. messageSends: [],
  1099. referencedClasses: []
  1100. }),
  1101. smalltalk.Smalltalk);
  1102. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  1103. smalltalk.addMethod(
  1104. unescape('_current'),
  1105. smalltalk.method({
  1106. selector: unescape('current'),
  1107. category: 'accessing',
  1108. fn: function (){
  1109. var self=this;
  1110. return smalltalk;
  1111. return self;},
  1112. args: [],
  1113. source: unescape('current%0A%09%3Creturn%20smalltalk%3E'),
  1114. messageSends: [],
  1115. referencedClasses: []
  1116. }),
  1117. smalltalk.Smalltalk.klass);
  1118. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  1119. smalltalk.Package.comment=unescape('A%20Package%20is%20similar%20to%20a%20%22class%20category%22%20typically%20found%20in%20other%20Smalltalks%20like%20Pharo%20or%20Squeak.%20Amber%20does%20not%20have%20class%20categories%20anymore%2C%20it%20had%20in%20the%20beginning%20but%20now%20each%20class%20in%20the%20system%20knows%20which%20package%20it%20belongs%20to.%0A%0AA%20Package%20has%20a%20name%2C%20an%20Array%20of%20%22requires%22%2C%20a%20comment%20and%20a%20Dictionary%20with%20other%20optional%20key%20value%20attributes.%20A%20Package%20can%20also%20be%20queried%20for%20its%20classes%2C%20but%20it%20will%20then%20resort%20to%20a%20reverse%20scan%20of%20all%20classes%20to%20find%20them.%0APackages%20are%20manipulated%20through%20%22Smalltalk%20current%22%2C%20like%20for%20example%20finding%20one%20based%20on%20a%20name%3A%0A%0A%09Smalltalk%20current%20packageAt%3A%20%27Kernel%27%0A%0A...but%20you%20can%20also%20use%3A%0A%0A%09Package%20named%3A%20%27Kernel%27%0A%0AA%20Package%20differs%20slightly%20from%20a%20Monticello%20package%20which%20can%20span%20multiple%20class%20categories%20using%20a%20naming%20convention%20based%20on%20hyphenation.%20But%20just%20as%20in%20Monticello%20a%20Package%20supports%20%22class%20extensions%22%20so%20a%20Package%0Acan%20define%20behaviors%20in%20foreign%20classes%20using%20a%20naming%20convention%20for%20method%20categories%20where%20the%20category%20starts%20with%20an%20asterisk%20and%20then%20the%20name%20of%20the%20owning%20package%20follows.%20This%20can%20easily%20be%20seen%20in%20for%20example%20class%0AString%20where%20the%20method%20category%20%22*IDE%22%20defines%20%23inspectOn%3A%20which%20thus%20is%20a%20method%20belonging%20to%20the%20IDE%20package.%0A%0AYou%20can%20fetch%20a%20package%20from%20the%20server%3A%0A%0A%09Package%20fetch%3A%20%27Additional-Examples%27')
  1120. smalltalk.addMethod(
  1121. unescape('_name'),
  1122. smalltalk.method({
  1123. selector: unescape('name'),
  1124. category: 'accessing',
  1125. fn: function (){
  1126. var self=this;
  1127. return self.pkgName;
  1128. return self;},
  1129. args: [],
  1130. source: unescape('name%0A%09%3Creturn%20self.pkgName%3E'),
  1131. messageSends: [],
  1132. referencedClasses: []
  1133. }),
  1134. smalltalk.Package);
  1135. smalltalk.addMethod(
  1136. unescape('_name_'),
  1137. smalltalk.method({
  1138. selector: unescape('name%3A'),
  1139. category: 'accessing',
  1140. fn: function (aString){
  1141. var self=this;
  1142. self.pkgName = aString;
  1143. return self;},
  1144. args: ["aString"],
  1145. source: unescape('name%3A%20aString%0A%09%3Cself.pkgName%20%3D%20aString%3E'),
  1146. messageSends: [],
  1147. referencedClasses: []
  1148. }),
  1149. smalltalk.Package);
  1150. smalltalk.addMethod(
  1151. unescape('_classes'),
  1152. smalltalk.method({
  1153. selector: unescape('classes'),
  1154. category: 'classes',
  1155. fn: function (){
  1156. var self=this;
  1157. return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_select_", [(function(c){return smalltalk.send(smalltalk.send(c, "_package", []), "__eq_eq", [self]);})]);
  1158. return self;},
  1159. args: [],
  1160. source: unescape('classes%0A%09%22We%20need%20to%20do%20a%20reverse%20scan.%22%0A%09%5ESmalltalk%20current%20classes%20select%3A%20%5B%3Ac%20%7C%20c%20package%20%3D%3D%20self%5D'),
  1161. messageSends: ["select:", "classes", "current", unescape("%3D%3D"), "package"],
  1162. referencedClasses: ["Smalltalk"]
  1163. }),
  1164. smalltalk.Package);
  1165. smalltalk.addMethod(
  1166. unescape('_printString'),
  1167. smalltalk.method({
  1168. selector: unescape('printString'),
  1169. category: 'printing',
  1170. fn: function (){
  1171. var self=this;
  1172. return smalltalk.send(self, "_name", []);
  1173. return self;},
  1174. args: [],
  1175. source: unescape('printString%0A%09%5Eself%20name'),
  1176. messageSends: ["name"],
  1177. referencedClasses: []
  1178. }),
  1179. smalltalk.Package);
  1180. smalltalk.addMethod(
  1181. unescape('_dependencies'),
  1182. smalltalk.method({
  1183. selector: unescape('dependencies'),
  1184. category: 'accessing',
  1185. fn: function (){
  1186. var self=this;
  1187. return smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", (function(){return [];})]);
  1188. return self;},
  1189. args: [],
  1190. source: unescape('dependencies%0A%09%5Eself%20propertyAt%3A%20%27dependencies%27%20ifAbsent%3A%20%5B%23%28%29%5D'),
  1191. messageSends: ["propertyAt:ifAbsent:"],
  1192. referencedClasses: []
  1193. }),
  1194. smalltalk.Package);
  1195. smalltalk.addMethod(
  1196. unescape('_dependencies_'),
  1197. smalltalk.method({
  1198. selector: unescape('dependencies%3A'),
  1199. category: 'accessing',
  1200. fn: function (anArray){
  1201. var self=this;
  1202. return smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  1203. return self;},
  1204. args: ["anArray"],
  1205. source: unescape('dependencies%3A%20anArray%0A%09%5Eself%20propertyAt%3A%20%27dependencies%27%20put%3A%20anArray'),
  1206. messageSends: ["propertyAt:put:"],
  1207. referencedClasses: []
  1208. }),
  1209. smalltalk.Package);
  1210. smalltalk.addMethod(
  1211. unescape('_properties'),
  1212. smalltalk.method({
  1213. selector: unescape('properties'),
  1214. category: 'accessing',
  1215. fn: function (){
  1216. var self=this;
  1217. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  1218. return self;},
  1219. args: [],
  1220. source: unescape('properties%0A%09%5ESmalltalk%20current%20readJSObject%3A%20%28self%20basicAt%3A%20%27properties%27%29'),
  1221. messageSends: ["readJSObject:", "current", "basicAt:"],
  1222. referencedClasses: ["Smalltalk"]
  1223. }),
  1224. smalltalk.Package);
  1225. smalltalk.addMethod(
  1226. unescape('_propertiesAsJSON'),
  1227. smalltalk.method({
  1228. selector: unescape('propertiesAsJSON'),
  1229. category: 'private',
  1230. fn: function (){
  1231. var self=this;
  1232. return JSON.stringify(self.properties);
  1233. return self;},
  1234. args: [],
  1235. source: unescape('propertiesAsJSON%0A%09%3Creturn%20JSON.stringify%28self.properties%29%3E'),
  1236. messageSends: [],
  1237. referencedClasses: []
  1238. }),
  1239. smalltalk.Package);
  1240. smalltalk.addMethod(
  1241. unescape('_properties_'),
  1242. smalltalk.method({
  1243. selector: unescape('properties%3A'),
  1244. category: 'accessing',
  1245. fn: function (aDict){
  1246. var self=this;
  1247. var object=nil;
  1248. object = {};;
  1249. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  1250. return self.properties = object;
  1251. return self;},
  1252. args: ["aDict"],
  1253. source: unescape('properties%3A%20aDict%0A%09%22We%20store%20it%20as%20a%20javascript%20object.%22%0A%09%0A%09%7C%20object%20%7C%0A%09%3Cobject%20%3D%20%7B%7D%3B%3E.%0A%09aDict%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%09%3Cobject%5Bkey%5D%20%3D%20value%3E.%0A%09%5D.%0A%09%3Creturn%20self.properties%20%3D%20object%3E'),
  1254. messageSends: ["keysAndValuesDo:"],
  1255. referencedClasses: []
  1256. }),
  1257. smalltalk.Package);
  1258. smalltalk.addMethod(
  1259. unescape('_jsProperties'),
  1260. smalltalk.method({
  1261. selector: unescape('jsProperties'),
  1262. category: 'private',
  1263. fn: function (){
  1264. var self=this;
  1265. return self.properties;
  1266. return self;},
  1267. args: [],
  1268. source: unescape('jsProperties%0A%09%3Creturn%20self.properties%3E'),
  1269. messageSends: [],
  1270. referencedClasses: []
  1271. }),
  1272. smalltalk.Package);
  1273. smalltalk.addMethod(
  1274. unescape('_jsProperties_'),
  1275. smalltalk.method({
  1276. selector: unescape('jsProperties%3A'),
  1277. category: 'private',
  1278. fn: function (aJSObject){
  1279. var self=this;
  1280. return self.properties = aJSObject;
  1281. return self;},
  1282. args: ["aJSObject"],
  1283. source: unescape('jsProperties%3A%20aJSObject%0A%09%3Creturn%20self.properties%20%3D%20aJSObject%3E'),
  1284. messageSends: [],
  1285. referencedClasses: []
  1286. }),
  1287. smalltalk.Package);
  1288. smalltalk.addMethod(
  1289. unescape('_propertyAt_'),
  1290. smalltalk.method({
  1291. selector: unescape('propertyAt%3A'),
  1292. category: 'properties',
  1293. fn: function (key){
  1294. var self=this;
  1295. return self.properties[key];
  1296. return self;},
  1297. args: ["key"],
  1298. source: unescape('propertyAt%3A%20key%0A%0A%09%3Creturn%20self.properties%5Bkey%5D%3E'),
  1299. messageSends: [],
  1300. referencedClasses: []
  1301. }),
  1302. smalltalk.Package);
  1303. smalltalk.addMethod(
  1304. unescape('_propertyAt_put_'),
  1305. smalltalk.method({
  1306. selector: unescape('propertyAt%3Aput%3A'),
  1307. category: 'properties',
  1308. fn: function (key, value){
  1309. var self=this;
  1310. return self.properties[key] = value;
  1311. return self;},
  1312. args: ["key", "value"],
  1313. source: unescape('propertyAt%3A%20key%20put%3A%20value%0A%0A%09%3Creturn%20self.properties%5Bkey%5D%20%3D%20value%3E'),
  1314. messageSends: [],
  1315. referencedClasses: []
  1316. }),
  1317. smalltalk.Package);
  1318. smalltalk.addMethod(
  1319. unescape('_propertyAt_ifAbsent_'),
  1320. smalltalk.method({
  1321. selector: unescape('propertyAt%3AifAbsent%3A'),
  1322. category: 'properties',
  1323. fn: function (key, block){
  1324. var self=this;
  1325. return (($receiver = smalltalk.send(self, "_propertyAt_", [key])) == nil || $receiver == undefined) ? (function(){return smalltalk.send(block, "_value", []);})() : $receiver;
  1326. return self;},
  1327. args: ["key", "block"],
  1328. source: unescape('propertyAt%3A%20key%20ifAbsent%3A%20block%0A%0A%09%5E%28self%20propertyAt%3A%20key%29%20ifNil%3A%20%5Bblock%20value%5D'),
  1329. messageSends: ["ifNil:", "propertyAt:", "value"],
  1330. referencedClasses: []
  1331. }),
  1332. smalltalk.Package);
  1333. smalltalk.addMethod(
  1334. unescape('_commitPathJs'),
  1335. smalltalk.method({
  1336. selector: unescape('commitPathJs'),
  1337. category: 'accessing',
  1338. fn: function (){
  1339. var self=this;
  1340. return (($receiver = self['@commitPathJs']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);})() : $receiver;
  1341. return self;},
  1342. args: [],
  1343. source: unescape('commitPathJs%0A%09%5E%20commitPathJs%20ifNil%3A%20%5Bself%20class%20defaultCommitPathJs%5D'),
  1344. messageSends: ["ifNil:", "defaultCommitPathJs", "class"],
  1345. referencedClasses: []
  1346. }),
  1347. smalltalk.Package);
  1348. smalltalk.addMethod(
  1349. unescape('_commitPathJs_'),
  1350. smalltalk.method({
  1351. selector: unescape('commitPathJs%3A'),
  1352. category: 'accessing',
  1353. fn: function (aString){
  1354. var self=this;
  1355. self['@commitPathJs']=aString;
  1356. return self;},
  1357. args: ["aString"],
  1358. source: unescape('commitPathJs%3A%20aString%0A%09commitPathJs%A0%3A%3D%20aString'),
  1359. messageSends: [],
  1360. referencedClasses: []
  1361. }),
  1362. smalltalk.Package);
  1363. smalltalk.addMethod(
  1364. unescape('_commitPathSt'),
  1365. smalltalk.method({
  1366. selector: unescape('commitPathSt'),
  1367. category: 'accessing',
  1368. fn: function (){
  1369. var self=this;
  1370. return (($receiver = self['@commitPathSt']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);})() : $receiver;
  1371. return self;},
  1372. args: [],
  1373. source: unescape('commitPathSt%0A%09%5E%20commitPathSt%20ifNil%3A%20%5Bself%20class%20defaultCommitPathSt%5D'),
  1374. messageSends: ["ifNil:", "defaultCommitPathSt", "class"],
  1375. referencedClasses: []
  1376. }),
  1377. smalltalk.Package);
  1378. smalltalk.addMethod(
  1379. unescape('_commitPathSt_'),
  1380. smalltalk.method({
  1381. selector: unescape('commitPathSt%3A'),
  1382. category: 'accessing',
  1383. fn: function (aString){
  1384. var self=this;
  1385. self['@commitPathSt']=aString;
  1386. return self;},
  1387. args: ["aString"],
  1388. source: unescape('commitPathSt%3A%20aString%0A%09commitPathSt%A0%3A%3D%20aString'),
  1389. messageSends: [],
  1390. referencedClasses: []
  1391. }),
  1392. smalltalk.Package);
  1393. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  1394. smalltalk.addMethod(
  1395. unescape('_named_'),
  1396. smalltalk.method({
  1397. selector: unescape('named%3A'),
  1398. category: 'not yet classified',
  1399. fn: function (aPackageName){
  1400. var self=this;
  1401. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [aPackageName]);
  1402. return self;},
  1403. args: ["aPackageName"],
  1404. source: unescape('named%3A%20aPackageName%0A%0A%09%5ESmalltalk%20current%20packageAt%3A%20aPackageName'),
  1405. messageSends: ["packageAt:", "current"],
  1406. referencedClasses: ["Smalltalk"]
  1407. }),
  1408. smalltalk.Package.klass);
  1409. smalltalk.addMethod(
  1410. unescape('_named_ifAbsent_'),
  1411. smalltalk.method({
  1412. selector: unescape('named%3AifAbsent%3A'),
  1413. category: 'not yet classified',
  1414. fn: function (aPackageName, aBlock){
  1415. var self=this;
  1416. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  1417. return self;},
  1418. args: ["aPackageName", "aBlock"],
  1419. source: unescape('named%3A%20aPackageName%20ifAbsent%3A%20aBlock%0A%0A%09%5ESmalltalk%20current%20packageAt%3A%20aPackageName%20ifAbsent%3A%20aBlock'),
  1420. messageSends: ["packageAt:ifAbsent:", "current"],
  1421. referencedClasses: ["Smalltalk"]
  1422. }),
  1423. smalltalk.Package.klass);
  1424. smalltalk.addMethod(
  1425. unescape('_defaultCommitPathJs'),
  1426. smalltalk.method({
  1427. selector: unescape('defaultCommitPathJs'),
  1428. category: 'commit paths',
  1429. fn: function (){
  1430. var self=this;
  1431. return (($receiver = self['@defaultCommitPathJs']) == nil || $receiver == undefined) ? (function(){return self['@defaultCommitPathJs']="js";})() : $receiver;
  1432. return self;},
  1433. args: [],
  1434. source: unescape('defaultCommitPathJs%0A%09%5E%20defaultCommitPathJs%20ifNil%3A%20%5B%20defaultCommitPathJs%20%3A%3D%20%27js%27%5D'),
  1435. messageSends: ["ifNil:"],
  1436. referencedClasses: []
  1437. }),
  1438. smalltalk.Package.klass);
  1439. smalltalk.addMethod(
  1440. unescape('_defaultCommitPathJs_'),
  1441. smalltalk.method({
  1442. selector: unescape('defaultCommitPathJs%3A'),
  1443. category: 'commit paths',
  1444. fn: function (aString){
  1445. var self=this;
  1446. self['@defaultCommitPathJs']=aString;
  1447. return self;},
  1448. args: ["aString"],
  1449. source: unescape('defaultCommitPathJs%3A%20aString%0A%09defaultCommitPathJs%20%3A%3D%20aString'),
  1450. messageSends: [],
  1451. referencedClasses: []
  1452. }),
  1453. smalltalk.Package.klass);
  1454. smalltalk.addMethod(
  1455. unescape('_defaultCommitPathSt'),
  1456. smalltalk.method({
  1457. selector: unescape('defaultCommitPathSt'),
  1458. category: 'commit paths',
  1459. fn: function (){
  1460. var self=this;
  1461. return (($receiver = self['@defaultCommitPathSt']) == nil || $receiver == undefined) ? (function(){return self['@defaultCommitPathSt']="st";})() : $receiver;
  1462. return self;},
  1463. args: [],
  1464. source: unescape('defaultCommitPathSt%0A%09%5E%20defaultCommitPathSt%20ifNil%3A%20%5B%20defaultCommitPathSt%20%3A%3D%20%27st%27%5D'),
  1465. messageSends: ["ifNil:"],
  1466. referencedClasses: []
  1467. }),
  1468. smalltalk.Package.klass);
  1469. smalltalk.addMethod(
  1470. unescape('_defaultCommitPathSt_'),
  1471. smalltalk.method({
  1472. selector: unescape('defaultCommitPathSt%3A'),
  1473. category: 'commit paths',
  1474. fn: function (aString){
  1475. var self=this;
  1476. self['@defaultCommitPathSt']=aString;
  1477. return self;},
  1478. args: ["aString"],
  1479. source: unescape('defaultCommitPathSt%3A%20aString%0A%09defaultCommitPathSt%20%3A%3D%20aString'),
  1480. messageSends: [],
  1481. referencedClasses: []
  1482. }),
  1483. smalltalk.Package.klass);
  1484. smalltalk.addMethod(
  1485. unescape('_resetCommitPaths'),
  1486. smalltalk.method({
  1487. selector: unescape('resetCommitPaths'),
  1488. category: 'commit paths',
  1489. fn: function (){
  1490. var self=this;
  1491. self['@defaultCommitPathJs']=nil;
  1492. self['@defaultCommitPathSt']=nil;
  1493. return self;},
  1494. args: [],
  1495. source: unescape('resetCommitPaths%0A%20%20%20%20%20%20%20%20defaultCommitPathJs%20%3A%3D%20nil.%0A%20%20%20%20%20%20%20%20defaultCommitPathSt%20%3A%3D%20nil.'),
  1496. messageSends: [],
  1497. referencedClasses: []
  1498. }),
  1499. smalltalk.Package.klass);
  1500. smalltalk.addMethod(
  1501. unescape('_fetch_prefix_'),
  1502. smalltalk.method({
  1503. selector: unescape('fetch%3Aprefix%3A'),
  1504. category: 'loading-storing',
  1505. fn: function (aPackageName, aPrefix){
  1506. var self=this;
  1507. smalltalk.send((typeof jQuery == 'undefined' ? nil : jQuery), "_getScript_onSuccess_", [smalltalk.send(smalltalk.send(aPrefix, "__comma", [aPackageName]), "__comma", [".js"]), (function(){return smalltalk.send((smalltalk.Package || Package), "_init_", [aPackageName]);})]);
  1508. return self;},
  1509. args: ["aPackageName", "aPrefix"],
  1510. source: unescape('fetch%3A%20aPackageName%20prefix%3A%20aPrefix%0A%09jQuery%20getScript%3A%20%28aPrefix%20%2C%20aPackageName%20%2C%20%27.js%27%29%20onSuccess%3A%20%5B%20Package%20init%3A%20aPackageName%20%5D'),
  1511. messageSends: ["getScript:onSuccess:", unescape("%2C"), "init:"],
  1512. referencedClasses: ["Package"]
  1513. }),
  1514. smalltalk.Package.klass);
  1515. smalltalk.addMethod(
  1516. unescape('_fetch_'),
  1517. smalltalk.method({
  1518. selector: unescape('fetch%3A'),
  1519. category: 'loading-storing',
  1520. fn: function (aPackageName){
  1521. var self=this;
  1522. smalltalk.send(self, "_fetch_prefix_", [aPackageName, smalltalk.send(smalltalk.send(self, "_defaultCommitPathJs", []), "__comma", [unescape("/")])]);
  1523. return self;},
  1524. args: ["aPackageName"],
  1525. source: unescape('fetch%3A%20aPackageName%0A%09self%20fetch%3A%20aPackageName%20prefix%3A%20self%20defaultCommitPathJs%2C%20%27/%27'),
  1526. messageSends: ["fetch:prefix:", unescape("%2C"), "defaultCommitPathJs"],
  1527. referencedClasses: []
  1528. }),
  1529. smalltalk.Package.klass);
  1530. smalltalk.addMethod(
  1531. unescape('_commitToLocalStorage_'),
  1532. smalltalk.method({
  1533. selector: unescape('commitToLocalStorage%3A'),
  1534. category: 'loading-storing',
  1535. fn: function (aPackageName){
  1536. var self=this;
  1537. var key=nil;
  1538. var sourceCode=nil;
  1539. key=smalltalk.send("smalltalk.packages.", "__comma", [aPackageName]);
  1540. sourceCode=smalltalk.send(smalltalk.send((smalltalk.Exporter || Exporter), "_new", []), "_exportPackage_", [aPackageName]);
  1541. localStorage[key] = escape(sourceCode);
  1542. return self;},
  1543. args: ["aPackageName"],
  1544. source: unescape('commitToLocalStorage%3A%20aPackageName%0A%09%7C%20key%20sourceCode%20%7C%0A%09key%20%3A%3D%20%27smalltalk.packages.%27%20%2C%20aPackageName.%0A%09sourceCode%20%3A%3D%20Exporter%20new%20exportPackage%3A%20aPackageName.%0A%09%3ClocalStorage%5Bkey%5D%20%3D%20escape%28sourceCode%29%3E'),
  1545. messageSends: [unescape("%2C"), "exportPackage:", "new"],
  1546. referencedClasses: ["Exporter"]
  1547. }),
  1548. smalltalk.Package.klass);
  1549. smalltalk.addMethod(
  1550. unescape('_init_'),
  1551. smalltalk.method({
  1552. selector: unescape('init%3A'),
  1553. category: 'loading-storing',
  1554. fn: function (aPackageName){
  1555. var self=this;
  1556. (function($rec){smalltalk.send($rec, "_do_", [(function(each){return smalltalk.init(each);})]);return smalltalk.send($rec, "_do_", [(function(each){return smalltalk.send(each, "_initialize", []);})]);})(smalltalk.send(smalltalk.send((typeof smalltalk == 'undefined' ? nil : smalltalk), "_classes", []), "_select_", [(function(each){return each.pkg.pkgName == aPackageName;})]));
  1557. return self;},
  1558. args: ["aPackageName"],
  1559. source: unescape('init%3A%20aPackageName%0A%09%28smalltalk%20classes%20select%3A%20%5B%20%3Aeach%20%7C%20%3Ceach.pkg.pkgName%20%3D%3D%20aPackageName%3E%20%5D%29%0A%09%09do%3A%20%5B%20%3Aeach%20%7C%20%3Csmalltalk.init%28each%29%3E%20%5D%3B%0A%09%09do%3A%20%5B%20%3Aeach%20%7C%20each%20initialize%20%5D'),
  1560. messageSends: ["do:", "initialize", "select:", "classes"],
  1561. referencedClasses: []
  1562. }),
  1563. smalltalk.Package.klass);
  1564. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  1565. smalltalk.addMethod(
  1566. unescape('__eq'),
  1567. smalltalk.method({
  1568. selector: unescape('%3D'),
  1569. category: 'comparing',
  1570. fn: function (aNumber){
  1571. var self=this;
  1572. try{((($receiver = smalltalk.send(aNumber, "_isNumber", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  1573. return Number(self) == aNumber;
  1574. return self;
  1575. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  1576. args: ["aNumber"],
  1577. source: unescape('%3D%20aNumber%0A%09aNumber%20isNumber%20ifFalse%3A%20%5B%5Efalse%5D.%20%0A%09%3Creturn%20Number%28self%29%20%3D%3D%20aNumber%3E'),
  1578. messageSends: ["ifFalse:", "isNumber"],
  1579. referencedClasses: []
  1580. }),
  1581. smalltalk.Number);
  1582. smalltalk.addMethod(
  1583. unescape('__gt'),
  1584. smalltalk.method({
  1585. selector: unescape('%3E'),
  1586. category: 'comparing',
  1587. fn: function (aNumber){
  1588. var self=this;
  1589. return self > aNumber;
  1590. return self;},
  1591. args: ["aNumber"],
  1592. source: unescape('%3E%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3E%3E%20aNumber%3E'),
  1593. messageSends: [],
  1594. referencedClasses: []
  1595. }),
  1596. smalltalk.Number);
  1597. smalltalk.addMethod(
  1598. unescape('__lt'),
  1599. smalltalk.method({
  1600. selector: unescape('%3C'),
  1601. category: 'comparing',
  1602. fn: function (aNumber){
  1603. var self=this;
  1604. return self < aNumber;
  1605. return self;},
  1606. args: ["aNumber"],
  1607. source: unescape('%3C%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3C%20aNumber%3E'),
  1608. messageSends: [],
  1609. referencedClasses: []
  1610. }),
  1611. smalltalk.Number);
  1612. smalltalk.addMethod(
  1613. unescape('__gt_eq'),
  1614. smalltalk.method({
  1615. selector: unescape('%3E%3D'),
  1616. category: 'comparing',
  1617. fn: function (aNumber){
  1618. var self=this;
  1619. return self >= aNumber;
  1620. return self;},
  1621. args: ["aNumber"],
  1622. source: unescape('%3E%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3E%3E%3D%20aNumber%3E'),
  1623. messageSends: [],
  1624. referencedClasses: []
  1625. }),
  1626. smalltalk.Number);
  1627. smalltalk.addMethod(
  1628. unescape('__lt_eq'),
  1629. smalltalk.method({
  1630. selector: unescape('%3C%3D'),
  1631. category: 'comparing',
  1632. fn: function (aNumber){
  1633. var self=this;
  1634. return self <= aNumber;
  1635. return self;},
  1636. args: ["aNumber"],
  1637. source: unescape('%3C%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3C%3D%20aNumber%3E'),
  1638. messageSends: [],
  1639. referencedClasses: []
  1640. }),
  1641. smalltalk.Number);
  1642. smalltalk.addMethod(
  1643. unescape('__plus'),
  1644. smalltalk.method({
  1645. selector: unescape('+'),
  1646. category: 'arithmetic',
  1647. fn: function (aNumber){
  1648. var self=this;
  1649. return self + aNumber;
  1650. return self;},
  1651. args: ["aNumber"],
  1652. source: unescape('+%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20+%20aNumber%3E'),
  1653. messageSends: [],
  1654. referencedClasses: []
  1655. }),
  1656. smalltalk.Number);
  1657. smalltalk.addMethod(
  1658. unescape('__minus'),
  1659. smalltalk.method({
  1660. selector: unescape('-'),
  1661. category: 'arithmetic',
  1662. fn: function (aNumber){
  1663. var self=this;
  1664. return self - aNumber;
  1665. return self;},
  1666. args: ["aNumber"],
  1667. source: unescape('-%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20-%20aNumber%3E'),
  1668. messageSends: [],
  1669. referencedClasses: []
  1670. }),
  1671. smalltalk.Number);
  1672. smalltalk.addMethod(
  1673. unescape('__star'),
  1674. smalltalk.method({
  1675. selector: unescape('*'),
  1676. category: 'arithmetic',
  1677. fn: function (aNumber){
  1678. var self=this;
  1679. return self * aNumber;
  1680. return self;},
  1681. args: ["aNumber"],
  1682. source: unescape('*%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20*%20aNumber%3E'),
  1683. messageSends: [],
  1684. referencedClasses: []
  1685. }),
  1686. smalltalk.Number);
  1687. smalltalk.addMethod(
  1688. unescape('__slash'),
  1689. smalltalk.method({
  1690. selector: unescape('/'),
  1691. category: 'arithmetic',
  1692. fn: function (aNumber){
  1693. var self=this;
  1694. return self / aNumber;
  1695. return self;},
  1696. args: ["aNumber"],
  1697. source: unescape('/%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20/%20aNumber%3E'),
  1698. messageSends: [],
  1699. referencedClasses: []
  1700. }),
  1701. smalltalk.Number);
  1702. smalltalk.addMethod(
  1703. unescape('_max_'),
  1704. smalltalk.method({
  1705. selector: unescape('max%3A'),
  1706. category: 'arithmetic',
  1707. fn: function (aNumber){
  1708. var self=this;
  1709. return Math.max(self, aNumber);;
  1710. return self;},
  1711. args: ["aNumber"],
  1712. source: unescape('max%3A%20aNumber%0A%09%3Creturn%20Math.max%28self%2C%20aNumber%29%3B%3E'),
  1713. messageSends: [],
  1714. referencedClasses: []
  1715. }),
  1716. smalltalk.Number);
  1717. smalltalk.addMethod(
  1718. unescape('_min_'),
  1719. smalltalk.method({
  1720. selector: unescape('min%3A'),
  1721. category: 'arithmetic',
  1722. fn: function (aNumber){
  1723. var self=this;
  1724. return Math.min(self, aNumber);;
  1725. return self;},
  1726. args: ["aNumber"],
  1727. source: unescape('min%3A%20aNumber%0A%09%3Creturn%20Math.min%28self%2C%20aNumber%29%3B%3E'),
  1728. messageSends: [],
  1729. referencedClasses: []
  1730. }),
  1731. smalltalk.Number);
  1732. smalltalk.addMethod(
  1733. unescape('_rounded'),
  1734. smalltalk.method({
  1735. selector: unescape('rounded'),
  1736. category: 'converting',
  1737. fn: function (){
  1738. var self=this;
  1739. return Math.round(self);;
  1740. return self;},
  1741. args: [],
  1742. source: unescape('rounded%0A%09%3Creturn%20Math.round%28self%29%3B%3E'),
  1743. messageSends: [],
  1744. referencedClasses: []
  1745. }),
  1746. smalltalk.Number);
  1747. smalltalk.addMethod(
  1748. unescape('_truncated'),
  1749. smalltalk.method({
  1750. selector: unescape('truncated'),
  1751. category: 'converting',
  1752. fn: function (){
  1753. var self=this;
  1754. var result=nil;
  1755. ((($receiver = self >= (0)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return result = Math.floor(self);;})() : (function(){return result = (Math.floor(self * (-1)) * (-1));;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return result = Math.floor(self);;}), (function(){return result = (Math.floor(self * (-1)) * (-1));;})]));
  1756. return result;
  1757. return self;},
  1758. args: [],
  1759. source: unescape('truncated%0A%7Cresult%7C%0A%0A%20%20%20%20self%20%3E%3D%200%20%0A%20%20%20%20%20%20%20%20ifTrue%3A%20%5B%3Cresult%20%3D%20Math.floor%28self%29%3B%3E%5D%0A%20%20%20%20%20%20%20%20ifFalse%3A%20%5B%3Cresult%20%3D%20%28Math.floor%28self%20*%20%28-1%29%29%20*%20%28-1%29%29%3B%3E%5D.%0A%0A%20%20%20%20%5E%20result'),
  1760. messageSends: ["ifTrue:ifFalse:", unescape("%3E%3D")],
  1761. referencedClasses: []
  1762. }),
  1763. smalltalk.Number);
  1764. smalltalk.addMethod(
  1765. unescape('_to_'),
  1766. smalltalk.method({
  1767. selector: unescape('to%3A'),
  1768. category: 'converting',
  1769. fn: function (aNumber){
  1770. var self=this;
  1771. var array=nil;
  1772. var first=nil;
  1773. var last=nil;
  1774. var count=nil;
  1775. first=smalltalk.send(self, "_truncated", []);
  1776. last=((($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
  1777. count=(1);
  1778. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1779. smalltalk.send(((($receiver = last).klass === smalltalk.Number) ? $receiver -first : smalltalk.send($receiver, "__minus", [first])), "_timesRepeat_", [(function(){smalltalk.send(array, "_at_put_", [count, first]);count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return first=((($receiver = first).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
  1780. return array;
  1781. return self;},
  1782. args: ["aNumber"],
  1783. source: unescape('to%3A%20aNumber%0A%09%7C%20array%20first%20last%20count%20%7C%0A%09first%20%3A%3D%20self%20truncated.%0A%09last%20%3A%3D%20aNumber%20truncated%20+%201.%0A%09count%20%3A%3D%201.%0A%09array%20%3A%3D%20Array%20new.%0A%09%28last%20-%20first%29%20timesRepeat%3A%20%5B%0A%09%20%20%20%20array%20at%3A%20count%20put%3A%20first.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%09%20%20%20%20first%20%3A%3D%20first%20+%201%5D.%0A%09%5Earray'),
  1784. messageSends: ["truncated", unescape("+"), "new", "timesRepeat:", unescape("-"), "at:put:"],
  1785. referencedClasses: ["Array"]
  1786. }),
  1787. smalltalk.Number);
  1788. smalltalk.addMethod(
  1789. unescape('_timesRepeat_'),
  1790. smalltalk.method({
  1791. selector: unescape('timesRepeat%3A'),
  1792. category: 'enumerating',
  1793. fn: function (aBlock){
  1794. var self=this;
  1795. var integer=nil;
  1796. var count=nil;
  1797. integer=smalltalk.send(self, "_truncated", []);
  1798. count=(1);
  1799. (function(){while(!(function(){return ((($receiver = count).klass === smalltalk.Number) ? $receiver >self : smalltalk.send($receiver, "__gt", [self]));})()) {(function(){smalltalk.send(aBlock, "_value", []);return count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
  1800. return self;},
  1801. args: ["aBlock"],
  1802. source: unescape('timesRepeat%3A%20aBlock%0A%09%7C%20integer%20count%20%7C%0A%09integer%20%3A%3D%20self%20truncated.%0A%09count%20%3A%3D%201.%0A%09%5Bcount%20%3E%20self%5D%20whileFalse%3A%20%5B%0A%09%20%20%20%20aBlock%20value.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201%5D'),
  1803. messageSends: ["truncated", "whileFalse:", unescape("%3E"), "value", unescape("+")],
  1804. referencedClasses: []
  1805. }),
  1806. smalltalk.Number);
  1807. smalltalk.addMethod(
  1808. unescape('_to_do_'),
  1809. smalltalk.method({
  1810. selector: unescape('to%3Ado%3A'),
  1811. category: 'enumerating',
  1812. fn: function (stop, aBlock){
  1813. var self=this;
  1814. var nextValue=nil;
  1815. nextValue=self;
  1816. (function(){while((function(){return ((($receiver = nextValue).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [nextValue]);return nextValue=((($receiver = nextValue).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
  1817. return self;},
  1818. args: ["stop", "aBlock"],
  1819. source: unescape('to%3A%20stop%20do%3A%20aBlock%0A%09%22Evaluate%20aBlock%20for%20each%20number%20from%20self%20to%20aNumber.%22%0A%09%7C%20nextValue%20%7C%0A%09nextValue%20%3A%3D%20self.%0A%09%5BnextValue%20%3C%3D%20stop%5D%0A%09%09whileTrue%3A%20%0A%09%09%09%5BaBlock%20value%3A%20nextValue.%0A%09%09%09nextValue%20%3A%3D%20nextValue%20+%201%5D'),
  1820. messageSends: ["whileTrue:", unescape("%3C%3D"), "value:", unescape("+")],
  1821. referencedClasses: []
  1822. }),
  1823. smalltalk.Number);
  1824. smalltalk.addMethod(
  1825. unescape('_asString'),
  1826. smalltalk.method({
  1827. selector: unescape('asString'),
  1828. category: 'converting',
  1829. fn: function (){
  1830. var self=this;
  1831. return smalltalk.send(self, "_printString", []);
  1832. return self;},
  1833. args: [],
  1834. source: unescape('asString%0A%09%5Eself%20printString'),
  1835. messageSends: ["printString"],
  1836. referencedClasses: []
  1837. }),
  1838. smalltalk.Number);
  1839. smalltalk.addMethod(
  1840. unescape('_asJavascript'),
  1841. smalltalk.method({
  1842. selector: unescape('asJavascript'),
  1843. category: 'converting',
  1844. fn: function (){
  1845. var self=this;
  1846. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1847. return self;},
  1848. args: [],
  1849. source: unescape('asJavascript%0A%09%5E%27%28%27%2C%20self%20printString%2C%20%27%29%27'),
  1850. messageSends: [unescape("%2C"), "printString"],
  1851. referencedClasses: []
  1852. }),
  1853. smalltalk.Number);
  1854. smalltalk.addMethod(
  1855. unescape('_printString'),
  1856. smalltalk.method({
  1857. selector: unescape('printString'),
  1858. category: 'printing',
  1859. fn: function (){
  1860. var self=this;
  1861. return String(self);
  1862. return self;},
  1863. args: [],
  1864. source: unescape('printString%0A%09%3Creturn%20String%28self%29%3E'),
  1865. messageSends: [],
  1866. referencedClasses: []
  1867. }),
  1868. smalltalk.Number);
  1869. smalltalk.addMethod(
  1870. unescape('_isNumber'),
  1871. smalltalk.method({
  1872. selector: unescape('isNumber'),
  1873. category: 'testing',
  1874. fn: function (){
  1875. var self=this;
  1876. return true;
  1877. return self;},
  1878. args: [],
  1879. source: unescape('isNumber%0A%09%5Etrue'),
  1880. messageSends: [],
  1881. referencedClasses: []
  1882. }),
  1883. smalltalk.Number);
  1884. smalltalk.addMethod(
  1885. unescape('_atRandom'),
  1886. smalltalk.method({
  1887. selector: unescape('atRandom'),
  1888. category: 'converting',
  1889. fn: function (){
  1890. var self=this;
  1891. return ((($receiver = smalltalk.send(((($receiver = smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", [])).klass === smalltalk.Number) ? $receiver *self : smalltalk.send($receiver, "__star", [self])), "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
  1892. return self;},
  1893. args: [],
  1894. source: unescape('atRandom%0A%20%20%20%20%5E%28Random%20new%20next%20*%20self%29%20truncated%20+%201'),
  1895. messageSends: [unescape("+"), "truncated", unescape("*"), "next", "new"],
  1896. referencedClasses: ["Random"]
  1897. }),
  1898. smalltalk.Number);
  1899. smalltalk.addMethod(
  1900. unescape('__at'),
  1901. smalltalk.method({
  1902. selector: unescape('@'),
  1903. category: 'converting',
  1904. fn: function (aNumber){
  1905. var self=this;
  1906. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, aNumber]);
  1907. return self;},
  1908. args: ["aNumber"],
  1909. source: unescape('@%20aNumber%0A%09%5EPoint%20x%3A%20self%20y%3A%20aNumber'),
  1910. messageSends: ["x:y:"],
  1911. referencedClasses: ["Point"]
  1912. }),
  1913. smalltalk.Number);
  1914. smalltalk.addMethod(
  1915. unescape('_asPoint'),
  1916. smalltalk.method({
  1917. selector: unescape('asPoint'),
  1918. category: 'converting',
  1919. fn: function (){
  1920. var self=this;
  1921. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, self]);
  1922. return self;},
  1923. args: [],
  1924. source: unescape('asPoint%0A%09%5EPoint%20x%3A%20self%20y%3A%20self'),
  1925. messageSends: ["x:y:"],
  1926. referencedClasses: ["Point"]
  1927. }),
  1928. smalltalk.Number);
  1929. smalltalk.addMethod(
  1930. unescape('_clearInterval'),
  1931. smalltalk.method({
  1932. selector: unescape('clearInterval'),
  1933. category: 'timeouts/intervals',
  1934. fn: function (){
  1935. var self=this;
  1936. clearInterval(Number(self));
  1937. return self;},
  1938. args: [],
  1939. source: unescape('clearInterval%0A%09%3CclearInterval%28Number%28self%29%29%3E'),
  1940. messageSends: [],
  1941. referencedClasses: []
  1942. }),
  1943. smalltalk.Number);
  1944. smalltalk.addMethod(
  1945. unescape('_clearTimeout'),
  1946. smalltalk.method({
  1947. selector: unescape('clearTimeout'),
  1948. category: 'timeouts/intervals',
  1949. fn: function (){
  1950. var self=this;
  1951. clearTimeout(Number(self));
  1952. return self;},
  1953. args: [],
  1954. source: unescape('clearTimeout%0A%09%3CclearTimeout%28Number%28self%29%29%3E'),
  1955. messageSends: [],
  1956. referencedClasses: []
  1957. }),
  1958. smalltalk.Number);
  1959. smalltalk.addMethod(
  1960. unescape('_even'),
  1961. smalltalk.method({
  1962. selector: unescape('even'),
  1963. category: 'testing',
  1964. fn: function (){
  1965. var self=this;
  1966. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_\\\\", [(2)])]);
  1967. return self;},
  1968. args: [],
  1969. source: unescape('even%0A%09%5E%200%20%3D%20%28self%20%5C%5C%202%29'),
  1970. messageSends: [unescape("%3D"), unescape("%5C%5C%5C%5C")],
  1971. referencedClasses: []
  1972. }),
  1973. smalltalk.Number);
  1974. smalltalk.addMethod(
  1975. unescape('_odd'),
  1976. smalltalk.method({
  1977. selector: unescape('odd'),
  1978. category: 'testing',
  1979. fn: function (){
  1980. var self=this;
  1981. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1982. return self;},
  1983. args: [],
  1984. source: unescape('odd%0A%09%5E%20self%20even%20not'),
  1985. messageSends: ["not", "even"],
  1986. referencedClasses: []
  1987. }),
  1988. smalltalk.Number);
  1989. smalltalk.addMethod(
  1990. unescape('_negated'),
  1991. smalltalk.method({
  1992. selector: unescape('negated'),
  1993. category: 'arithmetic',
  1994. fn: function (){
  1995. var self=this;
  1996. return (0) - self;
  1997. return self;},
  1998. args: [],
  1999. source: unescape('negated%0A%09%5E0%20-%20self'),
  2000. messageSends: [unescape("-")],
  2001. referencedClasses: []
  2002. }),
  2003. smalltalk.Number);
  2004. smalltalk.addMethod(
  2005. unescape('_printShowingDecimalPlaces_'),
  2006. smalltalk.method({
  2007. selector: unescape('printShowingDecimalPlaces%3A'),
  2008. category: 'printing',
  2009. fn: function (placesDesired){
  2010. var self=this;
  2011. return self.toFixed(placesDesired);
  2012. return self;},
  2013. args: ["placesDesired"],
  2014. source: unescape('printShowingDecimalPlaces%3A%20placesDesired%0A%09%3Creturn%20self.toFixed%28placesDesired%29%3E'),
  2015. messageSends: [],
  2016. referencedClasses: []
  2017. }),
  2018. smalltalk.Number);
  2019. smalltalk.addMethod(
  2020. unescape('_%5C'),
  2021. smalltalk.method({
  2022. selector: unescape('%5C'),
  2023. category: '',
  2024. fn: function (aNumber){
  2025. var self=this;
  2026. return self % aNumber;
  2027. return self;},
  2028. args: ["aNumber"],
  2029. source: unescape(''),
  2030. messageSends: [],
  2031. referencedClasses: []
  2032. }),
  2033. smalltalk.Number);
  2034. smalltalk.addMethod(
  2035. unescape('_to_by_'),
  2036. smalltalk.method({
  2037. selector: unescape('to%3Aby%3A'),
  2038. category: 'converting',
  2039. fn: function (stop, step){
  2040. var self=this;
  2041. var array=nil;
  2042. var value=nil;
  2043. var pos=nil;
  2044. value=self;
  2045. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  2046. pos=(1);
  2047. ((($receiver = smalltalk.send(step, "__eq", [(0)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})]));
  2048. ((($receiver = ((($receiver = step).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})() : (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();}), (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(array, "_at_put_", [pos, value]);pos=((($receiver = pos).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})]));
  2049. return array;
  2050. return self;},
  2051. args: ["stop", "step"],
  2052. source: unescape('to%3A%20stop%20by%3A%20step%0A%09%7C%20array%20value%20pos%20%7C%0A%09value%20%3A%3D%20self.%0A%09array%20%3A%3D%20Array%20new.%0A%09pos%20%3A%3D%201.%0A%09step%20%3D%200%20ifTrue%3A%20%5Bself%20error%3A%20%27step%20must%20be%20non-zero%27%5D.%0A%09step%20%3C%200%0A%09%09ifTrue%3A%20%5B%5B%20value%20%3E%3D%20stop%20%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20%09%09%09array%20at%3A%20pos%20put%3A%20value.%0A%09%20%20%20%20%09%09%09pos%20%3A%3D%20pos%20+%201.%0A%09%20%20%20%20%09%09%09value%20%3A%3D%20value%20+%20step%5D%5D%0A%09%09ifFalse%3A%20%5B%5B%20value%20%3C%3D%20stop%20%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20%09%09%09array%20at%3A%20pos%20put%3A%20value.%0A%09%20%20%09%09%09pos%20%3A%3D%20pos%20+%201.%0A%09%20%20%20%20%09%09%09value%20%3A%3D%20value%20+%20step%5D%5D.%0A%09%5Earray'),
  2053. messageSends: ["new", "ifTrue:", unescape("%3D"), "error:", "ifTrue:ifFalse:", unescape("%3C"), "whileTrue:", unescape("%3E%3D"), "at:put:", unescape("+"), unescape("%3C%3D")],
  2054. referencedClasses: ["Array"]
  2055. }),
  2056. smalltalk.Number);
  2057. smalltalk.addMethod(
  2058. unescape('_to_by_do_'),
  2059. smalltalk.method({
  2060. selector: unescape('to%3Aby%3Ado%3A'),
  2061. category: 'enumerating',
  2062. fn: function (stop, step, aBlock){
  2063. var self=this;
  2064. var value=nil;
  2065. value=self;
  2066. ((($receiver = smalltalk.send(step, "__eq", [(0)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);})]));
  2067. ((($receiver = ((($receiver = step).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})() : (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver >=stop : smalltalk.send($receiver, "__gt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();}), (function(){return (function(){while((function(){return ((($receiver = value).klass === smalltalk.Number) ? $receiver <=stop : smalltalk.send($receiver, "__lt_eq", [stop]));})()) {(function(){smalltalk.send(aBlock, "_value_", [value]);return value=((($receiver = value).klass === smalltalk.Number) ? $receiver +step : smalltalk.send($receiver, "__plus", [step]));})()}})();})]));
  2068. return self;},
  2069. args: ["stop", "step", "aBlock"],
  2070. source: unescape('to%3A%20stop%20by%3A%20step%20do%3A%20aBlock%0A%09%7C%20value%20%7C%0A%09value%20%3A%3D%20self.%0A%09step%20%3D%200%20ifTrue%3A%20%5Bself%20error%3A%20%27step%20must%20be%20non-zero%27%5D.%0A%09step%20%3C%200%0A%09%09ifTrue%3A%20%5B%5B%20value%20%3E%3D%20stop%20%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20%09%09%09aBlock%20value%3A%20value.%0A%09%20%20%20%20%09%09%09value%20%3A%3D%20value%20+%20step%5D%5D%0A%09%09ifFalse%3A%20%5B%5B%20value%20%3C%3D%20stop%20%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20%09%09%09aBlock%20value%3A%20value.%0A%09%20%20%20%20%09%09%09value%20%3A%3D%20value%20+%20step%5D%5D'),
  2071. messageSends: ["ifTrue:", unescape("%3D"), "error:", "ifTrue:ifFalse:", unescape("%3C"), "whileTrue:", unescape("%3E%3D"), "value:", unescape("+"), unescape("%3C%3D")],
  2072. referencedClasses: []
  2073. }),
  2074. smalltalk.Number);
  2075. smalltalk.addMethod(
  2076. unescape('_deepCopy'),
  2077. smalltalk.method({
  2078. selector: unescape('deepCopy'),
  2079. category: 'copying',
  2080. fn: function (){
  2081. var self=this;
  2082. return smalltalk.send(self, "_copy", []);
  2083. return self;},
  2084. args: [],
  2085. source: unescape('deepCopy%0A%09%5Eself%20copy'),
  2086. messageSends: ["copy"],
  2087. referencedClasses: []
  2088. }),
  2089. smalltalk.Number);
  2090. smalltalk.addMethod(
  2091. unescape('_copy'),
  2092. smalltalk.method({
  2093. selector: unescape('copy'),
  2094. category: 'copying',
  2095. fn: function (){
  2096. var self=this;
  2097. return self;
  2098. return self;},
  2099. args: [],
  2100. source: unescape('copy%0A%09%5Eself'),
  2101. messageSends: [],
  2102. referencedClasses: []
  2103. }),
  2104. smalltalk.Number);
  2105. smalltalk.addMethod(
  2106. unescape('_%5C%5C'),
  2107. smalltalk.method({
  2108. selector: unescape('%5C%5C'),
  2109. category: 'arithmetic',
  2110. fn: function (aNumber){
  2111. var self=this;
  2112. return self % aNumber;
  2113. return self;},
  2114. args: ["aNumber"],
  2115. source: unescape('%5C%5C%20aNumber%0A%09%3Creturn%20self%20%25%20aNumber%3E'),
  2116. messageSends: [],
  2117. referencedClasses: []
  2118. }),
  2119. smalltalk.Number);
  2120. smalltalk.addMethod(
  2121. unescape('_sqrt'),
  2122. smalltalk.method({
  2123. selector: unescape('sqrt'),
  2124. category: 'arithmetic',
  2125. fn: function (){
  2126. var self=this;
  2127. return Math.sqrt(self);
  2128. return self;},
  2129. args: [],
  2130. source: unescape('sqrt%0A%09%3Creturn%20Math.sqrt%28self%29%3E'),
  2131. messageSends: [],
  2132. referencedClasses: []
  2133. }),
  2134. smalltalk.Number);
  2135. smalltalk.addMethod(
  2136. unescape('_squared'),
  2137. smalltalk.method({
  2138. selector: unescape('squared'),
  2139. category: 'arithmetic',
  2140. fn: function (){
  2141. var self=this;
  2142. return self * self;
  2143. return self;},
  2144. args: [],
  2145. source: unescape('squared%0A%09%5Eself%20*%20self'),
  2146. messageSends: [unescape("*")],
  2147. referencedClasses: []
  2148. }),
  2149. smalltalk.Number);
  2150. smalltalk.addMethod(
  2151. unescape('_identityHash'),
  2152. smalltalk.method({
  2153. selector: unescape('identityHash'),
  2154. category: 'accessing',
  2155. fn: function (){
  2156. var self=this;
  2157. return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", ["n"]);
  2158. return self;},
  2159. args: [],
  2160. source: unescape('identityHash%0A%09%5Eself%20asString%2C%20%27n%27'),
  2161. messageSends: [unescape("%2C"), "asString"],
  2162. referencedClasses: []
  2163. }),
  2164. smalltalk.Number);
  2165. smalltalk.addMethod(
  2166. unescape('_pi'),
  2167. smalltalk.method({
  2168. selector: unescape('pi'),
  2169. category: 'instance creation',
  2170. fn: function (){
  2171. var self=this;
  2172. return Math.PI;
  2173. return self;},
  2174. args: [],
  2175. source: unescape('pi%0A%09%3Creturn%20Math.PI%3E'),
  2176. messageSends: [],
  2177. referencedClasses: []
  2178. }),
  2179. smalltalk.Number.klass);
  2180. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  2181. smalltalk.addMethod(
  2182. unescape('__eq'),
  2183. smalltalk.method({
  2184. selector: unescape('%3D'),
  2185. category: 'comparing',
  2186. fn: function (aBoolean){
  2187. var self=this;
  2188. try{((($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
  2189. return Boolean(self == true) == aBoolean;
  2190. return self;
  2191. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  2192. args: ["aBoolean"],
  2193. source: unescape('%3D%20aBoolean%0A%09aBoolean%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%3Creturn%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%3E'),
  2194. messageSends: ["ifFalse:", unescape("%3D"), "class"],
  2195. referencedClasses: []
  2196. }),
  2197. smalltalk.Boolean);
  2198. smalltalk.addMethod(
  2199. unescape('_shallowCopy'),
  2200. smalltalk.method({
  2201. selector: unescape('shallowCopy'),
  2202. category: 'copying',
  2203. fn: function (){
  2204. var self=this;
  2205. return self;
  2206. return self;},
  2207. args: [],
  2208. source: unescape('shallowCopy%0A%09%5Eself'),
  2209. messageSends: [],
  2210. referencedClasses: []
  2211. }),
  2212. smalltalk.Boolean);
  2213. smalltalk.addMethod(
  2214. unescape('_deepCopy'),
  2215. smalltalk.method({
  2216. selector: unescape('deepCopy'),
  2217. category: 'copying',
  2218. fn: function (){
  2219. var self=this;
  2220. return self;
  2221. return self;},
  2222. args: [],
  2223. source: unescape('deepCopy%0A%09%5Eself'),
  2224. messageSends: [],
  2225. referencedClasses: []
  2226. }),
  2227. smalltalk.Boolean);
  2228. smalltalk.addMethod(
  2229. unescape('_ifTrue_'),
  2230. smalltalk.method({
  2231. selector: unescape('ifTrue%3A'),
  2232. category: 'controlling',
  2233. fn: function (aBlock){
  2234. var self=this;
  2235. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  2236. return self;},
  2237. args: ["aBlock"],
  2238. source: unescape('ifTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D'),
  2239. messageSends: ["ifTrue:ifFalse:"],
  2240. referencedClasses: []
  2241. }),
  2242. smalltalk.Boolean);
  2243. smalltalk.addMethod(
  2244. unescape('_ifFalse_'),
  2245. smalltalk.method({
  2246. selector: unescape('ifFalse%3A'),
  2247. category: 'controlling',
  2248. fn: function (aBlock){
  2249. var self=this;
  2250. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  2251. return self;},
  2252. args: ["aBlock"],
  2253. source: unescape('ifFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock'),
  2254. messageSends: ["ifTrue:ifFalse:"],
  2255. referencedClasses: []
  2256. }),
  2257. smalltalk.Boolean);
  2258. smalltalk.addMethod(
  2259. unescape('_ifFalse_ifTrue_'),
  2260. smalltalk.method({
  2261. selector: unescape('ifFalse%3AifTrue%3A'),
  2262. category: 'controlling',
  2263. fn: function (aBlock, anotherBlock){
  2264. var self=this;
  2265. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  2266. return self;},
  2267. args: ["aBlock", "anotherBlock"],
  2268. source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock'),
  2269. messageSends: ["ifTrue:ifFalse:"],
  2270. referencedClasses: []
  2271. }),
  2272. smalltalk.Boolean);
  2273. smalltalk.addMethod(
  2274. unescape('_ifTrue_ifFalse_'),
  2275. smalltalk.method({
  2276. selector: unescape('ifTrue%3AifFalse%3A'),
  2277. category: 'controlling',
  2278. fn: function (aBlock, anotherBlock){
  2279. var self=this;
  2280. if(self == true) {
  2281. return aBlock();
  2282. } else {
  2283. return anotherBlock();
  2284. }
  2285. ;
  2286. return self;},
  2287. args: ["aBlock", "anotherBlock"],
  2288. source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  2289. messageSends: [],
  2290. referencedClasses: []
  2291. }),
  2292. smalltalk.Boolean);
  2293. smalltalk.addMethod(
  2294. unescape('_and_'),
  2295. smalltalk.method({
  2296. selector: unescape('and%3A'),
  2297. category: 'controlling',
  2298. fn: function (aBlock){
  2299. var self=this;
  2300. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  2301. return self;},
  2302. args: ["aBlock"],
  2303. source: unescape('and%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20aBlock%0A%09%20%20%20%20ifFalse%3A%20%5Bfalse%5D'),
  2304. messageSends: ["ifTrue:ifFalse:", unescape("%3D")],
  2305. referencedClasses: []
  2306. }),
  2307. smalltalk.Boolean);
  2308. smalltalk.addMethod(
  2309. unescape('_or_'),
  2310. smalltalk.method({
  2311. selector: unescape('or%3A'),
  2312. category: 'controlling',
  2313. fn: function (aBlock){
  2314. var self=this;
  2315. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  2316. return self;},
  2317. args: ["aBlock"],
  2318. source: unescape('or%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20aBlock'),
  2319. messageSends: ["ifTrue:ifFalse:", unescape("%3D")],
  2320. referencedClasses: []
  2321. }),
  2322. smalltalk.Boolean);
  2323. smalltalk.addMethod(
  2324. unescape('_not'),
  2325. smalltalk.method({
  2326. selector: unescape('not'),
  2327. category: 'controlling',
  2328. fn: function (){
  2329. var self=this;
  2330. return smalltalk.send(self, "__eq", [false]);
  2331. return self;},
  2332. args: [],
  2333. source: unescape('not%0A%09%5Eself%20%3D%20false'),
  2334. messageSends: [unescape("%3D")],
  2335. referencedClasses: []
  2336. }),
  2337. smalltalk.Boolean);
  2338. smalltalk.addMethod(
  2339. unescape('_printString'),
  2340. smalltalk.method({
  2341. selector: unescape('printString'),
  2342. category: 'printing',
  2343. fn: function (){
  2344. var self=this;
  2345. return self.toString();
  2346. return self;},
  2347. args: [],
  2348. source: unescape('printString%0A%09%3Creturn%20self.toString%28%29%3E'),
  2349. messageSends: [],
  2350. referencedClasses: []
  2351. }),
  2352. smalltalk.Boolean);
  2353. smalltalk.addMethod(
  2354. unescape('_%26'),
  2355. smalltalk.method({
  2356. selector: unescape('%26'),
  2357. category: 'controlling',
  2358. fn: function (aBoolean){
  2359. var self=this;
  2360. if(self == true) {
  2361. return aBoolean;
  2362. } else {
  2363. return false;
  2364. }
  2365. ;
  2366. return self;},
  2367. args: ["aBoolean"],
  2368. source: unescape('%26%20aBoolean%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBoolean%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20false%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  2369. messageSends: [],
  2370. referencedClasses: []
  2371. }),
  2372. smalltalk.Boolean);
  2373. smalltalk.addMethod(
  2374. unescape('_%7C'),
  2375. smalltalk.method({
  2376. selector: unescape('%7C'),
  2377. category: 'controlling',
  2378. fn: function (aBoolean){
  2379. var self=this;
  2380. if(self == true) {
  2381. return true;
  2382. } else {
  2383. return aBoolean;
  2384. }
  2385. ;
  2386. return self;},
  2387. args: ["aBoolean"],
  2388. source: unescape('%7C%20aBoolean%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20true%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20aBoolean%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
  2389. messageSends: [],
  2390. referencedClasses: []
  2391. }),
  2392. smalltalk.Boolean);
  2393. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  2394. smalltalk.Date.comment=unescape('The%20Date%20class%20is%20used%20to%20work%20with%20dates%20and%20times.')
  2395. smalltalk.addMethod(
  2396. unescape('_year'),
  2397. smalltalk.method({
  2398. selector: unescape('year'),
  2399. category: 'accessing',
  2400. fn: function (){
  2401. var self=this;
  2402. return self.getFullYear();
  2403. return self;},
  2404. args: [],
  2405. source: unescape('year%0A%09%3Creturn%20self.getFullYear%28%29%3E'),
  2406. messageSends: [],
  2407. referencedClasses: []
  2408. }),
  2409. smalltalk.Date);
  2410. smalltalk.addMethod(
  2411. unescape('_month'),
  2412. smalltalk.method({
  2413. selector: unescape('month'),
  2414. category: 'accessing',
  2415. fn: function (){
  2416. var self=this;
  2417. return self.getMonth() + 1;
  2418. return self;},
  2419. args: [],
  2420. source: unescape('month%0A%09%3Creturn%20self.getMonth%28%29%20+%201%3E'),
  2421. messageSends: [],
  2422. referencedClasses: []
  2423. }),
  2424. smalltalk.Date);
  2425. smalltalk.addMethod(
  2426. unescape('_month_'),
  2427. smalltalk.method({
  2428. selector: unescape('month%3A'),
  2429. category: 'accessing',
  2430. fn: function (aNumber){
  2431. var self=this;
  2432. self.setMonth(aNumber - 1);
  2433. return self;},
  2434. args: ["aNumber"],
  2435. source: unescape('month%3A%20aNumber%0A%09%3Cself.setMonth%28aNumber%20-%201%29%3E'),
  2436. messageSends: [],
  2437. referencedClasses: []
  2438. }),
  2439. smalltalk.Date);
  2440. smalltalk.addMethod(
  2441. unescape('_day'),
  2442. smalltalk.method({
  2443. selector: unescape('day'),
  2444. category: 'accessing',
  2445. fn: function (){
  2446. var self=this;
  2447. return smalltalk.send(self, "_dayOfWeek", []);
  2448. return self;},
  2449. args: [],
  2450. source: unescape('day%0A%09%5Eself%20dayOfWeek'),
  2451. messageSends: ["dayOfWeek"],
  2452. referencedClasses: []
  2453. }),
  2454. smalltalk.Date);
  2455. smalltalk.addMethod(
  2456. unescape('_dayOfWeek'),
  2457. smalltalk.method({
  2458. selector: unescape('dayOfWeek'),
  2459. category: 'accessing',
  2460. fn: function (){
  2461. var self=this;
  2462. return self.getDay() + 1;
  2463. return self;},
  2464. args: [],
  2465. source: unescape('dayOfWeek%0A%09%3Creturn%20self.getDay%28%29%20+%201%3E'),
  2466. messageSends: [],
  2467. referencedClasses: []
  2468. }),
  2469. smalltalk.Date);
  2470. smalltalk.addMethod(
  2471. unescape('_dayOfWeek_'),
  2472. smalltalk.method({
  2473. selector: unescape('dayOfWeek%3A'),
  2474. category: 'accessing',
  2475. fn: function (aNumber){
  2476. var self=this;
  2477. return self.setDay(aNumber - 1);
  2478. return self;},
  2479. args: ["aNumber"],
  2480. source: unescape('dayOfWeek%3A%20aNumber%0A%09%3Creturn%20self.setDay%28aNumber%20-%201%29%3E'),
  2481. messageSends: [],
  2482. referencedClasses: []
  2483. }),
  2484. smalltalk.Date);
  2485. smalltalk.addMethod(
  2486. unescape('_day_'),
  2487. smalltalk.method({
  2488. selector: unescape('day%3A'),
  2489. category: 'accessing',
  2490. fn: function (aNumber){
  2491. var self=this;
  2492. smalltalk.send(self, "_day_", [aNumber]);
  2493. return self;},
  2494. args: ["aNumber"],
  2495. source: unescape('day%3A%20aNumber%0A%09self%20day%3A%20aNumber'),
  2496. messageSends: ["day:"],
  2497. referencedClasses: []
  2498. }),
  2499. smalltalk.Date);
  2500. smalltalk.addMethod(
  2501. unescape('_year_'),
  2502. smalltalk.method({
  2503. selector: unescape('year%3A'),
  2504. category: 'accessing',
  2505. fn: function (aNumber){
  2506. var self=this;
  2507. self.setFullYear(aNumber);
  2508. return self;},
  2509. args: ["aNumber"],
  2510. source: unescape('year%3A%20aNumber%0A%09%3Cself.setFullYear%28aNumber%29%3E'),
  2511. messageSends: [],
  2512. referencedClasses: []
  2513. }),
  2514. smalltalk.Date);
  2515. smalltalk.addMethod(
  2516. unescape('_dayOfMonth'),
  2517. smalltalk.method({
  2518. selector: unescape('dayOfMonth'),
  2519. category: 'accessing',
  2520. fn: function (){
  2521. var self=this;
  2522. return self.getDate();
  2523. return self;},
  2524. args: [],
  2525. source: unescape('dayOfMonth%0A%09%3Creturn%20self.getDate%28%29%3E'),
  2526. messageSends: [],
  2527. referencedClasses: []
  2528. }),
  2529. smalltalk.Date);
  2530. smalltalk.addMethod(
  2531. unescape('_dayOfMonth_'),
  2532. smalltalk.method({
  2533. selector: unescape('dayOfMonth%3A'),
  2534. category: 'accessing',
  2535. fn: function (aNumber){
  2536. var self=this;
  2537. self.setDate(aNumber);
  2538. return self;},
  2539. args: ["aNumber"],
  2540. source: unescape('dayOfMonth%3A%20aNumber%0A%09%3Cself.setDate%28aNumber%29%3E'),
  2541. messageSends: [],
  2542. referencedClasses: []
  2543. }),
  2544. smalltalk.Date);
  2545. smalltalk.addMethod(
  2546. unescape('_asString'),
  2547. smalltalk.method({
  2548. selector: unescape('asString'),
  2549. category: 'converting',
  2550. fn: function (){
  2551. var self=this;
  2552. return self.toString();
  2553. return self;},
  2554. args: [],
  2555. source: unescape('asString%0A%09%3Creturn%20self.toString%28%29%3E'),
  2556. messageSends: [],
  2557. referencedClasses: []
  2558. }),
  2559. smalltalk.Date);
  2560. smalltalk.addMethod(
  2561. unescape('_printString'),
  2562. smalltalk.method({
  2563. selector: unescape('printString'),
  2564. category: 'printing',
  2565. fn: function (){
  2566. var self=this;
  2567. return smalltalk.send(self, "_asString", []);
  2568. return self;},
  2569. args: [],
  2570. source: unescape('printString%0A%09%5Eself%20asString'),
  2571. messageSends: ["asString"],
  2572. referencedClasses: []
  2573. }),
  2574. smalltalk.Date);
  2575. smalltalk.addMethod(
  2576. unescape('_asMilliseconds'),
  2577. smalltalk.method({
  2578. selector: unescape('asMilliseconds'),
  2579. category: 'converting',
  2580. fn: function (){
  2581. var self=this;
  2582. return smalltalk.send(self, "_time", []);
  2583. return self;},
  2584. args: [],
  2585. source: unescape('asMilliseconds%0A%09%5Eself%20time'),
  2586. messageSends: ["time"],
  2587. referencedClasses: []
  2588. }),
  2589. smalltalk.Date);
  2590. smalltalk.addMethod(
  2591. unescape('_time'),
  2592. smalltalk.method({
  2593. selector: unescape('time'),
  2594. category: 'accessing',
  2595. fn: function (){
  2596. var self=this;
  2597. return self.getTime();
  2598. return self;},
  2599. args: [],
  2600. source: unescape('time%0A%09%3Creturn%20self.getTime%28%29%3E'),
  2601. messageSends: [],
  2602. referencedClasses: []
  2603. }),
  2604. smalltalk.Date);
  2605. smalltalk.addMethod(
  2606. unescape('_time_'),
  2607. smalltalk.method({
  2608. selector: unescape('time%3A'),
  2609. category: 'accessing',
  2610. fn: function (aNumber){
  2611. var self=this;
  2612. self.setTime(aNumber);
  2613. return self;},
  2614. args: ["aNumber"],
  2615. source: unescape('time%3A%20aNumber%0A%09%3Cself.setTime%28aNumber%29%3E'),
  2616. messageSends: [],
  2617. referencedClasses: []
  2618. }),
  2619. smalltalk.Date);
  2620. smalltalk.addMethod(
  2621. unescape('_asDateString'),
  2622. smalltalk.method({
  2623. selector: unescape('asDateString'),
  2624. category: 'converting',
  2625. fn: function (){
  2626. var self=this;
  2627. return self.toDateString();
  2628. return self;},
  2629. args: [],
  2630. source: unescape('asDateString%0A%09%3Creturn%20self.toDateString%28%29%3E'),
  2631. messageSends: [],
  2632. referencedClasses: []
  2633. }),
  2634. smalltalk.Date);
  2635. smalltalk.addMethod(
  2636. unescape('_asTimeString'),
  2637. smalltalk.method({
  2638. selector: unescape('asTimeString'),
  2639. category: 'converting',
  2640. fn: function (){
  2641. var self=this;
  2642. return self.toTimeString();
  2643. return self;},
  2644. args: [],
  2645. source: unescape('asTimeString%0A%09%3Creturn%20self.toTimeString%28%29%3E'),
  2646. messageSends: [],
  2647. referencedClasses: []
  2648. }),
  2649. smalltalk.Date);
  2650. smalltalk.addMethod(
  2651. unescape('_asLocaleString'),
  2652. smalltalk.method({
  2653. selector: unescape('asLocaleString'),
  2654. category: 'converting',
  2655. fn: function (){
  2656. var self=this;
  2657. return self.toLocaleString();
  2658. return self;},
  2659. args: [],
  2660. source: unescape('asLocaleString%0A%09%3Creturn%20self.toLocaleString%28%29%3E'),
  2661. messageSends: [],
  2662. referencedClasses: []
  2663. }),
  2664. smalltalk.Date);
  2665. smalltalk.addMethod(
  2666. unescape('_asNumber'),
  2667. smalltalk.method({
  2668. selector: unescape('asNumber'),
  2669. category: 'converting',
  2670. fn: function (){
  2671. var self=this;
  2672. return smalltalk.send(self, "_asMilliseconds", []);
  2673. return self;},
  2674. args: [],
  2675. source: unescape('asNumber%0A%09%5Eself%20asMilliseconds'),
  2676. messageSends: ["asMilliseconds"],
  2677. referencedClasses: []
  2678. }),
  2679. smalltalk.Date);
  2680. smalltalk.addMethod(
  2681. unescape('_hours_'),
  2682. smalltalk.method({
  2683. selector: unescape('hours%3A'),
  2684. category: 'accessing',
  2685. fn: function (aNumber){
  2686. var self=this;
  2687. self.setHours(aNumber);
  2688. return self;},
  2689. args: ["aNumber"],
  2690. source: unescape('hours%3A%20aNumber%0A%09%3Cself.setHours%28aNumber%29%3E'),
  2691. messageSends: [],
  2692. referencedClasses: []
  2693. }),
  2694. smalltalk.Date);
  2695. smalltalk.addMethod(
  2696. unescape('_minutes_'),
  2697. smalltalk.method({
  2698. selector: unescape('minutes%3A'),
  2699. category: 'accessing',
  2700. fn: function (aNumber){
  2701. var self=this;
  2702. self.setMinutes(aNumber);
  2703. return self;},
  2704. args: ["aNumber"],
  2705. source: unescape('minutes%3A%20aNumber%0A%09%3Cself.setMinutes%28aNumber%29%3E'),
  2706. messageSends: [],
  2707. referencedClasses: []
  2708. }),
  2709. smalltalk.Date);
  2710. smalltalk.addMethod(
  2711. unescape('_seconds_'),
  2712. smalltalk.method({
  2713. selector: unescape('seconds%3A'),
  2714. category: 'accessing',
  2715. fn: function (aNumber){
  2716. var self=this;
  2717. self.setSeconds(aNumber);
  2718. return self;},
  2719. args: ["aNumber"],
  2720. source: unescape('seconds%3A%20aNumber%0A%09%3Cself.setSeconds%28aNumber%29%3E'),
  2721. messageSends: [],
  2722. referencedClasses: []
  2723. }),
  2724. smalltalk.Date);
  2725. smalltalk.addMethod(
  2726. unescape('_milliseconds_'),
  2727. smalltalk.method({
  2728. selector: unescape('milliseconds%3A'),
  2729. category: 'accessing',
  2730. fn: function (aNumber){
  2731. var self=this;
  2732. self.setMilliseconds(aNumber);
  2733. return self;},
  2734. args: ["aNumber"],
  2735. source: unescape('milliseconds%3A%20aNumber%0A%09%3Cself.setMilliseconds%28aNumber%29%3E'),
  2736. messageSends: [],
  2737. referencedClasses: []
  2738. }),
  2739. smalltalk.Date);
  2740. smalltalk.addMethod(
  2741. unescape('_hours'),
  2742. smalltalk.method({
  2743. selector: unescape('hours'),
  2744. category: 'accessing',
  2745. fn: function (){
  2746. var self=this;
  2747. return self.getHours();
  2748. return self;},
  2749. args: [],
  2750. source: unescape('hours%0A%09%3Creturn%20self.getHours%28%29%3E'),
  2751. messageSends: [],
  2752. referencedClasses: []
  2753. }),
  2754. smalltalk.Date);
  2755. smalltalk.addMethod(
  2756. unescape('_minutes'),
  2757. smalltalk.method({
  2758. selector: unescape('minutes'),
  2759. category: 'accessing',
  2760. fn: function (){
  2761. var self=this;
  2762. return self.getMinutes();
  2763. return self;},
  2764. args: [],
  2765. source: unescape('minutes%0A%09%3Creturn%20self.getMinutes%28%29%3E'),
  2766. messageSends: [],
  2767. referencedClasses: []
  2768. }),
  2769. smalltalk.Date);
  2770. smalltalk.addMethod(
  2771. unescape('_seconds'),
  2772. smalltalk.method({
  2773. selector: unescape('seconds'),
  2774. category: 'accessing',
  2775. fn: function (){
  2776. var self=this;
  2777. return self.getSeconds();
  2778. return self;},
  2779. args: [],
  2780. source: unescape('seconds%0A%09%3Creturn%20self.getSeconds%28%29%3E'),
  2781. messageSends: [],
  2782. referencedClasses: []
  2783. }),
  2784. smalltalk.Date);
  2785. smalltalk.addMethod(
  2786. unescape('_milliseconds'),
  2787. smalltalk.method({
  2788. selector: unescape('milliseconds'),
  2789. category: 'accessing',
  2790. fn: function (){
  2791. var self=this;
  2792. return self.getMilliseconds();
  2793. return self;},
  2794. args: [],
  2795. source: unescape('milliseconds%0A%09%3Creturn%20self.getMilliseconds%28%29%3E'),
  2796. messageSends: [],
  2797. referencedClasses: []
  2798. }),
  2799. smalltalk.Date);
  2800. smalltalk.addMethod(
  2801. unescape('__lt'),
  2802. smalltalk.method({
  2803. selector: unescape('%3C'),
  2804. category: 'comparing',
  2805. fn: function (aDate){
  2806. var self=this;
  2807. return self < aDate;
  2808. return self;},
  2809. args: ["aDate"],
  2810. source: unescape('%3C%20aDate%0A%09%3Creturn%20self%20%3C%20aDate%3E'),
  2811. messageSends: [],
  2812. referencedClasses: []
  2813. }),
  2814. smalltalk.Date);
  2815. smalltalk.addMethod(
  2816. unescape('__gt'),
  2817. smalltalk.method({
  2818. selector: unescape('%3E'),
  2819. category: 'comparing',
  2820. fn: function (aDate){
  2821. var self=this;
  2822. return self > aDate;
  2823. return self;},
  2824. args: ["aDate"],
  2825. source: unescape('%3E%20aDate%0A%09%3Creturn%20self%20%3E%3E%20aDate%3E'),
  2826. messageSends: [],
  2827. referencedClasses: []
  2828. }),
  2829. smalltalk.Date);
  2830. smalltalk.addMethod(
  2831. unescape('__lt_eq'),
  2832. smalltalk.method({
  2833. selector: unescape('%3C%3D'),
  2834. category: 'comparing',
  2835. fn: function (aDate){
  2836. var self=this;
  2837. return self <= aDate;
  2838. return self;},
  2839. args: ["aDate"],
  2840. source: unescape('%3C%3D%20aDate%0A%09%3Creturn%20self%20%3C%3D%20aDate%3E'),
  2841. messageSends: [],
  2842. referencedClasses: []
  2843. }),
  2844. smalltalk.Date);
  2845. smalltalk.addMethod(
  2846. unescape('__gt_eq'),
  2847. smalltalk.method({
  2848. selector: unescape('%3E%3D'),
  2849. category: 'comparing',
  2850. fn: function (aDate){
  2851. var self=this;
  2852. return self >= aDate;
  2853. return self;},
  2854. args: ["aDate"],
  2855. source: unescape('%3E%3D%20aDate%0A%09%3Creturn%20self%20%3E%3E%3D%20aDate%3E'),
  2856. messageSends: [],
  2857. referencedClasses: []
  2858. }),
  2859. smalltalk.Date);
  2860. smalltalk.addMethod(
  2861. unescape('__minus'),
  2862. smalltalk.method({
  2863. selector: unescape('-'),
  2864. category: 'arithmetic',
  2865. fn: function (aDate){
  2866. var self=this;
  2867. return self - aDate;
  2868. return self;},
  2869. args: ["aDate"],
  2870. source: unescape('-%20aDate%0A%09%3Creturn%20self%20-%20aDate%3E'),
  2871. messageSends: [],
  2872. referencedClasses: []
  2873. }),
  2874. smalltalk.Date);
  2875. smalltalk.addMethod(
  2876. unescape('__plus'),
  2877. smalltalk.method({
  2878. selector: unescape('+'),
  2879. category: 'arithmetic',
  2880. fn: function (aDate){
  2881. var self=this;
  2882. return self + aDate;
  2883. return self;},
  2884. args: ["aDate"],
  2885. source: unescape('+%20aDate%0A%09%3Creturn%20self%20+%20aDate%3E'),
  2886. messageSends: [],
  2887. referencedClasses: []
  2888. }),
  2889. smalltalk.Date);
  2890. smalltalk.addMethod(
  2891. unescape('_new_'),
  2892. smalltalk.method({
  2893. selector: unescape('new%3A'),
  2894. category: 'instance creation',
  2895. fn: function (anObject){
  2896. var self=this;
  2897. return new Date(anObject);
  2898. return self;},
  2899. args: ["anObject"],
  2900. source: unescape('new%3A%20anObject%0A%09%3Creturn%20new%20Date%28anObject%29%3E'),
  2901. messageSends: [],
  2902. referencedClasses: []
  2903. }),
  2904. smalltalk.Date.klass);
  2905. smalltalk.addMethod(
  2906. unescape('_fromString_'),
  2907. smalltalk.method({
  2908. selector: unescape('fromString%3A'),
  2909. category: 'instance creation',
  2910. fn: function (aString){
  2911. var self=this;
  2912. return smalltalk.send(self, "_new_", [aString]);
  2913. return self;},
  2914. args: ["aString"],
  2915. source: unescape('fromString%3A%20aString%0A%09%22Example%3A%20Date%20fromString%28%272011/04/15%2000%3A00%3A00%27%29%22%0A%09%5Eself%20new%3A%20aString'),
  2916. messageSends: ["new:"],
  2917. referencedClasses: []
  2918. }),
  2919. smalltalk.Date.klass);
  2920. smalltalk.addMethod(
  2921. unescape('_fromSeconds_'),
  2922. smalltalk.method({
  2923. selector: unescape('fromSeconds%3A'),
  2924. category: 'instance creation',
  2925. fn: function (aNumber){
  2926. var self=this;
  2927. return smalltalk.send(self, "_fromMilliseconds_", [((($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))]);
  2928. return self;},
  2929. args: ["aNumber"],
  2930. source: unescape('fromSeconds%3A%20aNumber%0A%09%5Eself%20fromMilliseconds%3A%20aNumber%20*%201000'),
  2931. messageSends: ["fromMilliseconds:", unescape("*")],
  2932. referencedClasses: []
  2933. }),
  2934. smalltalk.Date.klass);
  2935. smalltalk.addMethod(
  2936. unescape('_fromMilliseconds_'),
  2937. smalltalk.method({
  2938. selector: unescape('fromMilliseconds%3A'),
  2939. category: 'instance creation',
  2940. fn: function (aNumber){
  2941. var self=this;
  2942. return smalltalk.send(self, "_new_", [aNumber]);
  2943. return self;},
  2944. args: ["aNumber"],
  2945. source: unescape('fromMilliseconds%3A%20aNumber%0A%09%5Eself%20new%3A%20aNumber'),
  2946. messageSends: ["new:"],
  2947. referencedClasses: []
  2948. }),
  2949. smalltalk.Date.klass);
  2950. smalltalk.addMethod(
  2951. unescape('_today'),
  2952. smalltalk.method({
  2953. selector: unescape('today'),
  2954. category: 'instance creation',
  2955. fn: function (){
  2956. var self=this;
  2957. return smalltalk.send(self, "_new", []);
  2958. return self;},
  2959. args: [],
  2960. source: unescape('today%0A%09%5Eself%20new'),
  2961. messageSends: ["new"],
  2962. referencedClasses: []
  2963. }),
  2964. smalltalk.Date.klass);
  2965. smalltalk.addMethod(
  2966. unescape('_now'),
  2967. smalltalk.method({
  2968. selector: unescape('now'),
  2969. category: 'instance creation',
  2970. fn: function (){
  2971. var self=this;
  2972. return smalltalk.send(self, "_today", []);
  2973. return self;},
  2974. args: [],
  2975. source: unescape('now%0A%09%5Eself%20today'),
  2976. messageSends: ["today"],
  2977. referencedClasses: []
  2978. }),
  2979. smalltalk.Date.klass);
  2980. smalltalk.addMethod(
  2981. unescape('_millisecondsToRun_'),
  2982. smalltalk.method({
  2983. selector: unescape('millisecondsToRun%3A'),
  2984. category: 'instance creation',
  2985. fn: function (aBlock){
  2986. var self=this;
  2987. var t=nil;
  2988. t=smalltalk.send((smalltalk.Date || Date), "_now", []);
  2989. smalltalk.send(aBlock, "_value", []);
  2990. return ((($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]));
  2991. return self;},
  2992. args: ["aBlock"],
  2993. source: unescape('millisecondsToRun%3A%20aBlock%0A%09%7C%20t%20%7C%0A%09t%20%3A%3D%20Date%20now.%0A%09aBlock%20value.%0A%09%5EDate%20now%20-%20t'),
  2994. messageSends: ["now", "value", unescape("-")],
  2995. referencedClasses: ["Date"]
  2996. }),
  2997. smalltalk.Date.klass);
  2998. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  2999. smalltalk.addMethod(
  3000. unescape('_subclass_instanceVariableNames_'),
  3001. smalltalk.method({
  3002. selector: unescape('subclass%3AinstanceVariableNames%3A'),
  3003. category: 'class creation',
  3004. fn: function (aString, anotherString){
  3005. var self=this;
  3006. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  3007. return self;},
  3008. args: ["aString", "anotherString"],
  3009. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20package%3A%20nil'),
  3010. messageSends: ["subclass:instanceVariableNames:package:"],
  3011. referencedClasses: []
  3012. }),
  3013. smalltalk.UndefinedObject);
  3014. smalltalk.addMethod(
  3015. unescape('_subclass_instanceVariableNames_category_'),
  3016. smalltalk.method({
  3017. selector: unescape('subclass%3AinstanceVariableNames%3Acategory%3A'),
  3018. category: 'class creation',
  3019. fn: function (aString, aString2, aString3){
  3020. var self=this;
  3021. smalltalk.send(self, "_deprecatedAPI", []);
  3022. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  3023. return self;},
  3024. args: ["aString", "aString2", "aString3"],
  3025. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%22Kept%20for%20compatibility.%22%0A%09self%20deprecatedAPI.%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3'),
  3026. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  3027. referencedClasses: []
  3028. }),
  3029. smalltalk.UndefinedObject);
  3030. smalltalk.addMethod(
  3031. unescape('_shallowCopy'),
  3032. smalltalk.method({
  3033. selector: unescape('shallowCopy'),
  3034. category: 'copying',
  3035. fn: function (){
  3036. var self=this;
  3037. return self;
  3038. return self;},
  3039. args: [],
  3040. source: unescape('shallowCopy%0A%09%5Eself'),
  3041. messageSends: [],
  3042. referencedClasses: []
  3043. }),
  3044. smalltalk.UndefinedObject);
  3045. smalltalk.addMethod(
  3046. unescape('_deepCopy'),
  3047. smalltalk.method({
  3048. selector: unescape('deepCopy'),
  3049. category: 'copying',
  3050. fn: function (){
  3051. var self=this;
  3052. return self;
  3053. return self;},
  3054. args: [],
  3055. source: unescape('deepCopy%0A%09%5Eself'),
  3056. messageSends: [],
  3057. referencedClasses: []
  3058. }),
  3059. smalltalk.UndefinedObject);
  3060. smalltalk.addMethod(
  3061. unescape('_ifNil_'),
  3062. smalltalk.method({
  3063. selector: unescape('ifNil%3A'),
  3064. category: 'testing',
  3065. fn: function (aBlock){
  3066. var self=this;
  3067. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  3068. return self;},
  3069. args: ["aBlock"],
  3070. source: unescape('ifNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D'),
  3071. messageSends: ["ifNil:ifNotNil:"],
  3072. referencedClasses: []
  3073. }),
  3074. smalltalk.UndefinedObject);
  3075. smalltalk.addMethod(
  3076. unescape('_ifNotNil_'),
  3077. smalltalk.method({
  3078. selector: unescape('ifNotNil%3A'),
  3079. category: 'testing',
  3080. fn: function (aBlock){
  3081. var self=this;
  3082. return self;
  3083. return self;},
  3084. args: ["aBlock"],
  3085. source: unescape('ifNotNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself'),
  3086. messageSends: [],
  3087. referencedClasses: []
  3088. }),
  3089. smalltalk.UndefinedObject);
  3090. smalltalk.addMethod(
  3091. unescape('_ifNil_ifNotNil_'),
  3092. smalltalk.method({
  3093. selector: unescape('ifNil%3AifNotNil%3A'),
  3094. category: 'testing',
  3095. fn: function (aBlock, anotherBlock){
  3096. var self=this;
  3097. return smalltalk.send(aBlock, "_value", []);
  3098. return self;},
  3099. args: ["aBlock", "anotherBlock"],
  3100. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
  3101. messageSends: ["value"],
  3102. referencedClasses: []
  3103. }),
  3104. smalltalk.UndefinedObject);
  3105. smalltalk.addMethod(
  3106. unescape('_ifNotNil_ifNil_'),
  3107. smalltalk.method({
  3108. selector: unescape('ifNotNil%3AifNil%3A'),
  3109. category: 'testing',
  3110. fn: function (aBlock, anotherBlock){
  3111. var self=this;
  3112. return smalltalk.send(anotherBlock, "_value", []);
  3113. return self;},
  3114. args: ["aBlock", "anotherBlock"],
  3115. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EanotherBlock%20value'),
  3116. messageSends: ["value"],
  3117. referencedClasses: []
  3118. }),
  3119. smalltalk.UndefinedObject);
  3120. smalltalk.addMethod(
  3121. unescape('_isNil'),
  3122. smalltalk.method({
  3123. selector: unescape('isNil'),
  3124. category: 'testing',
  3125. fn: function (){
  3126. var self=this;
  3127. return true;
  3128. return self;},
  3129. args: [],
  3130. source: unescape('isNil%0A%09%5Etrue'),
  3131. messageSends: [],
  3132. referencedClasses: []
  3133. }),
  3134. smalltalk.UndefinedObject);
  3135. smalltalk.addMethod(
  3136. unescape('_notNil'),
  3137. smalltalk.method({
  3138. selector: unescape('notNil'),
  3139. category: 'testing',
  3140. fn: function (){
  3141. var self=this;
  3142. return false;
  3143. return self;},
  3144. args: [],
  3145. source: unescape('notNil%0A%09%5Efalse'),
  3146. messageSends: [],
  3147. referencedClasses: []
  3148. }),
  3149. smalltalk.UndefinedObject);
  3150. smalltalk.addMethod(
  3151. unescape('_printString'),
  3152. smalltalk.method({
  3153. selector: unescape('printString'),
  3154. category: 'printing',
  3155. fn: function (){
  3156. var self=this;
  3157. return "nil";
  3158. return self;},
  3159. args: [],
  3160. source: unescape('printString%0A%20%20%20%20%5E%27nil%27'),
  3161. messageSends: [],
  3162. referencedClasses: []
  3163. }),
  3164. smalltalk.UndefinedObject);
  3165. smalltalk.addMethod(
  3166. unescape('_subclass_instanceVariableNames_package_'),
  3167. smalltalk.method({
  3168. selector: unescape('subclass%3AinstanceVariableNames%3Apackage%3A'),
  3169. category: 'class creation',
  3170. fn: function (aString, aString2, aString3){
  3171. var self=this;
  3172. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  3173. return self;},
  3174. args: ["aString", "aString2", "aString3"],
  3175. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3'),
  3176. messageSends: ["superclass:subclass:instanceVariableNames:package:", "new"],
  3177. referencedClasses: ["ClassBuilder"]
  3178. }),
  3179. smalltalk.UndefinedObject);
  3180. smalltalk.addMethod(
  3181. unescape('_new'),
  3182. smalltalk.method({
  3183. selector: unescape('new'),
  3184. category: 'instance creation',
  3185. fn: function (){
  3186. var self=this;
  3187. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  3188. return self;},
  3189. args: [],
  3190. source: unescape('new%0A%09%20%20%20%20self%20error%3A%20%27You%20cannot%20create%20new%20instances%20of%20UndefinedObject.%20Use%20nil%27'),
  3191. messageSends: ["error:"],
  3192. referencedClasses: []
  3193. }),
  3194. smalltalk.UndefinedObject.klass);
  3195. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  3196. smalltalk.Random.comment=unescape('Random%20is%20just%20a%20wrapper%20around%20javascript%20Math.random%28%29%20and%20is%20trivially%20used%20like%20this%3A%0A%0A%09Random%20new%20next%0A%0AThis%20will%20return%20a%20float%20x%20where%20x%20%3C%201%20and%20x%20%3E%200.%20If%20you%20want%20a%20random%20integer%20between%201%20and%2010%20you%20can%20use%20%23atRandom%0A%0A%0910%20atRandom%0A%0A...which%20is%20also%20implemented%20in%20SequencableCollection%20so%20you%20can%20easy%20pick%20an%20element%20at%20random%3A%0A%0A%09%23%28%27a%27%20%27b%27%20%27c%27%29%20atRandom')
  3197. smalltalk.addMethod(
  3198. unescape('_next'),
  3199. smalltalk.method({
  3200. selector: unescape('next'),
  3201. category: 'accessing',
  3202. fn: function (){
  3203. var self=this;
  3204. return Math.random();
  3205. return self;},
  3206. args: [],
  3207. source: unescape('next%0A%09%3Creturn%20Math.random%28%29%3E'),
  3208. messageSends: [],
  3209. referencedClasses: []
  3210. }),
  3211. smalltalk.Random);
  3212. smalltalk.addMethod(
  3213. unescape('_next_'),
  3214. smalltalk.method({
  3215. selector: unescape('next%3A'),
  3216. category: 'accessing',
  3217. fn: function (anInteger){
  3218. var self=this;
  3219. return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
  3220. return self;},
  3221. args: ["anInteger"],
  3222. source: unescape('next%3A%20anInteger%0A%20%20%20%20%5E%281%20to%3A%20anInteger%29%20collect%3A%20%5B%3Aeach%20%7C%20self%20next%5D'),
  3223. messageSends: ["collect:", "to:", "next"],
  3224. referencedClasses: []
  3225. }),
  3226. smalltalk.Random);
  3227. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  3228. smalltalk.addMethod(
  3229. unescape('_x'),
  3230. smalltalk.method({
  3231. selector: unescape('x'),
  3232. category: 'accessing',
  3233. fn: function (){
  3234. var self=this;
  3235. return self['@x'];
  3236. return self;},
  3237. args: [],
  3238. source: unescape('x%0A%09%5Ex'),
  3239. messageSends: [],
  3240. referencedClasses: []
  3241. }),
  3242. smalltalk.Point);
  3243. smalltalk.addMethod(
  3244. unescape('_y'),
  3245. smalltalk.method({
  3246. selector: unescape('y'),
  3247. category: 'accessing',
  3248. fn: function (){
  3249. var self=this;
  3250. return self['@y'];
  3251. return self;},
  3252. args: [],
  3253. source: unescape('y%0A%09%5Ey'),
  3254. messageSends: [],
  3255. referencedClasses: []
  3256. }),
  3257. smalltalk.Point);
  3258. smalltalk.addMethod(
  3259. unescape('_y_'),
  3260. smalltalk.method({
  3261. selector: unescape('y%3A'),
  3262. category: 'accessing',
  3263. fn: function (aNumber){
  3264. var self=this;
  3265. self['@y']=aNumber;
  3266. return self;},
  3267. args: ["aNumber"],
  3268. source: unescape('y%3A%20aNumber%0A%09y%20%3A%3D%20aNumber'),
  3269. messageSends: [],
  3270. referencedClasses: []
  3271. }),
  3272. smalltalk.Point);
  3273. smalltalk.addMethod(
  3274. unescape('_x_'),
  3275. smalltalk.method({
  3276. selector: unescape('x%3A'),
  3277. category: 'accessing',
  3278. fn: function (aNumber){
  3279. var self=this;
  3280. self['@x']=aNumber;
  3281. return self;},
  3282. args: ["aNumber"],
  3283. source: unescape('x%3A%20aNumber%0A%09x%20%3A%3D%20aNumber'),
  3284. messageSends: [],
  3285. referencedClasses: []
  3286. }),
  3287. smalltalk.Point);
  3288. smalltalk.addMethod(
  3289. unescape('__star'),
  3290. smalltalk.method({
  3291. selector: unescape('*'),
  3292. category: 'arithmetic',
  3293. fn: function (aPoint){
  3294. var self=this;
  3295. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  3296. return self;},
  3297. args: ["aPoint"],
  3298. source: unescape('*%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20*%20aPoint%20asPoint%20x%20y%3A%20self%20y%20*%20aPoint%20asPoint%20y'),
  3299. messageSends: ["x:y:", unescape("*"), "x", "asPoint", "y"],
  3300. referencedClasses: ["Point"]
  3301. }),
  3302. smalltalk.Point);
  3303. smalltalk.addMethod(
  3304. unescape('__plus'),
  3305. smalltalk.method({
  3306. selector: unescape('+'),
  3307. category: 'arithmetic',
  3308. fn: function (aPoint){
  3309. var self=this;
  3310. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  3311. return self;},
  3312. args: ["aPoint"],
  3313. source: unescape('+%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20+%20aPoint%20asPoint%20x%20y%3A%20self%20y%20+%20aPoint%20asPoint%20y'),
  3314. messageSends: ["x:y:", unescape("+"), "x", "asPoint", "y"],
  3315. referencedClasses: ["Point"]
  3316. }),
  3317. smalltalk.Point);
  3318. smalltalk.addMethod(
  3319. unescape('__minus'),
  3320. smalltalk.method({
  3321. selector: unescape('-'),
  3322. category: 'arithmetic',
  3323. fn: function (aPoint){
  3324. var self=this;
  3325. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  3326. return self;},
  3327. args: ["aPoint"],
  3328. source: unescape('-%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20-%20aPoint%20asPoint%20x%20y%3A%20self%20y%20-%20aPoint%20asPoint%20y'),
  3329. messageSends: ["x:y:", unescape("-"), "x", "asPoint", "y"],
  3330. referencedClasses: ["Point"]
  3331. }),
  3332. smalltalk.Point);
  3333. smalltalk.addMethod(
  3334. unescape('__slash'),
  3335. smalltalk.method({
  3336. selector: unescape('/'),
  3337. category: 'arithmetic',
  3338. fn: function (aPoint){
  3339. var self=this;
  3340. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [((($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number) ? $receiver /smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])])), ((($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number) ? $receiver /smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])]))]);
  3341. return self;},
  3342. args: ["aPoint"],
  3343. source: unescape('/%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20/%20aPoint%20asPoint%20x%20y%3A%20self%20y%20/%20aPoint%20asPoint%20y'),
  3344. messageSends: ["x:y:", unescape("/"), "x", "asPoint", "y"],
  3345. referencedClasses: ["Point"]
  3346. }),
  3347. smalltalk.Point);
  3348. smalltalk.addMethod(
  3349. unescape('_asPoint'),
  3350. smalltalk.method({
  3351. selector: unescape('asPoint'),
  3352. category: 'converting',
  3353. fn: function (){
  3354. var self=this;
  3355. return self;
  3356. return self;},
  3357. args: [],
  3358. source: unescape('asPoint%0A%09%5Eself'),
  3359. messageSends: [],
  3360. referencedClasses: []
  3361. }),
  3362. smalltalk.Point);
  3363. smalltalk.addMethod(
  3364. unescape('__eq'),
  3365. smalltalk.method({
  3366. selector: unescape('%3D'),
  3367. category: 'arithmetic',
  3368. fn: function (aPoint){
  3369. var self=this;
  3370. return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);})]);
  3371. return self;},
  3372. args: ["aPoint"],
  3373. source: unescape('%3D%20aPoint%0A%09%5EaPoint%20class%20%3D%20self%20class%20and%3A%20%5B%0A%09%09%28aPoint%20x%20%3D%20self%20x%29%20%26%20%28aPoint%20y%20%3D%20self%20y%29%5D'),
  3374. messageSends: ["and:", unescape("%3D"), "class", unescape("%26"), "x", "y"],
  3375. referencedClasses: []
  3376. }),
  3377. smalltalk.Point);
  3378. smalltalk.addMethod(
  3379. unescape('_x_y_'),
  3380. smalltalk.method({
  3381. selector: unescape('x%3Ay%3A'),
  3382. category: 'instance creation',
  3383. fn: function (aNumber, anotherNumber){
  3384. var self=this;
  3385. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3386. return self;},
  3387. args: ["aNumber", "anotherNumber"],
  3388. source: unescape('x%3A%20aNumber%20y%3A%20anotherNumber%0A%09%5Eself%20new%0A%09%09x%3A%20aNumber%3B%0A%09%09y%3A%20anotherNumber%3B%0A%09%09yourself'),
  3389. messageSends: ["x:", "y:", "yourself", "new"],
  3390. referencedClasses: []
  3391. }),
  3392. smalltalk.Point.klass);
  3393. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  3394. smalltalk.addMethod(
  3395. unescape('_jsObject_'),
  3396. smalltalk.method({
  3397. selector: unescape('jsObject%3A'),
  3398. category: 'accessing',
  3399. fn: function (aJSObject){
  3400. var self=this;
  3401. self['@jsObject']=aJSObject;
  3402. return self;},
  3403. args: ["aJSObject"],
  3404. source: unescape('jsObject%3A%20aJSObject%0A%09jsObject%20%3A%3D%20aJSObject'),
  3405. messageSends: [],
  3406. referencedClasses: []
  3407. }),
  3408. smalltalk.JSObjectProxy);
  3409. smalltalk.addMethod(
  3410. unescape('_jsObject'),
  3411. smalltalk.method({
  3412. selector: unescape('jsObject'),
  3413. category: 'accessing',
  3414. fn: function (){
  3415. var self=this;
  3416. return self['@jsObject'];
  3417. return self;},
  3418. args: [],
  3419. source: unescape('jsObject%0A%09%5EjsObject'),
  3420. messageSends: [],
  3421. referencedClasses: []
  3422. }),
  3423. smalltalk.JSObjectProxy);
  3424. smalltalk.addMethod(
  3425. unescape('_printString'),
  3426. smalltalk.method({
  3427. selector: unescape('printString'),
  3428. category: 'proxy',
  3429. fn: function (){
  3430. var self=this;
  3431. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  3432. return self;},
  3433. args: [],
  3434. source: unescape('printString%0A%09%5Eself%20jsObject%20toString'),
  3435. messageSends: ["toString", "jsObject"],
  3436. referencedClasses: []
  3437. }),
  3438. smalltalk.JSObjectProxy);
  3439. smalltalk.addMethod(
  3440. unescape('_inspectOn_'),
  3441. smalltalk.method({
  3442. selector: unescape('inspectOn%3A'),
  3443. category: 'proxy',
  3444. fn: function (anInspector){
  3445. var self=this;
  3446. var variables=nil;
  3447. variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  3448. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  3449. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  3450. for(var i in self['@jsObject']) {
  3451. variables._at_put_(i, self['@jsObject'][i]);
  3452. };
  3453. smalltalk.send(anInspector, "_setVariables_", [variables]);
  3454. return self;},
  3455. args: ["anInspector"],
  3456. source: unescape('inspectOn%3A%20anInspector%0A%09%7C%20variables%20%7C%0A%09variables%20%3A%3D%20Dictionary%20new.%0A%09variables%20at%3A%20%27%23self%27%20put%3A%20self%20jsObject.%0A%09anInspector%20setLabel%3A%20self%20printString.%0A%09%3Cfor%28var%20i%20in%20self%5B%27@jsObject%27%5D%29%20%7B%0A%09%09variables._at_put_%28i%2C%20self%5B%27@jsObject%27%5D%5Bi%5D%29%3B%0A%09%7D%3E.%0A%09anInspector%20setVariables%3A%20variables'),
  3457. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "setVariables:"],
  3458. referencedClasses: ["Dictionary"]
  3459. }),
  3460. smalltalk.JSObjectProxy);
  3461. smalltalk.addMethod(
  3462. unescape('_doesNotUnderstand_'),
  3463. smalltalk.method({
  3464. selector: unescape('doesNotUnderstand%3A'),
  3465. category: 'proxy',
  3466. fn: function (aMessage){
  3467. var self=this;
  3468. var obj=nil;
  3469. var selector=nil;
  3470. var jsSelector=nil;
  3471. var arguments=nil;
  3472. obj=smalltalk.send(self, "_jsObject", []);
  3473. selector=smalltalk.send(aMessage, "_selector", []);
  3474. jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []);
  3475. arguments=smalltalk.send(aMessage, "_arguments", []);
  3476. if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
  3477. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  3478. return self;},
  3479. args: ["aMessage"],
  3480. source: unescape('doesNotUnderstand%3A%20aMessage%0A%09%7C%20obj%20selector%20jsSelector%20arguments%20%7C%0A%09obj%20%3A%3D%20self%20jsObject.%0A%09selector%20%3A%3D%20aMessage%20selector.%0A%09jsSelector%20%3A%3D%20selector%20asJavaScriptSelector.%0A%09arguments%20%3A%3D%20aMessage%20arguments.%0A%09%3Cif%28obj%5BjsSelector%5D%20%21%3D%20undefined%29%20%7Breturn%20smalltalk.send%28obj%2C%20jsSelector%2C%20arguments%29%7D%3E.%0A%09super%20doesNotUnderstand%3A%20aMessage'),
  3481. messageSends: ["jsObject", "selector", "asJavaScriptSelector", "arguments", "doesNotUnderstand:"],
  3482. referencedClasses: []
  3483. }),
  3484. smalltalk.JSObjectProxy);
  3485. smalltalk.addMethod(
  3486. unescape('_at_'),
  3487. smalltalk.method({
  3488. selector: unescape('at%3A'),
  3489. category: 'accessing',
  3490. fn: function (aSymbol){
  3491. var self=this;
  3492. var attr=nil;
  3493. attr=smalltalk.send(aSymbol, "_asString", []);
  3494. return self['@jsObject'][attr];
  3495. return self;},
  3496. args: ["aSymbol"],
  3497. source: unescape('at%3A%20aSymbol%0A%09%7C%20attr%20%7C%0A%09attr%20%3A%3D%20aSymbol%20asString.%0A%09%3Creturn%20self%5B%27@jsObject%27%5D%5Battr%5D%3E'),
  3498. messageSends: ["asString"],
  3499. referencedClasses: []
  3500. }),
  3501. smalltalk.JSObjectProxy);
  3502. smalltalk.addMethod(
  3503. unescape('_at_put_'),
  3504. smalltalk.method({
  3505. selector: unescape('at%3Aput%3A'),
  3506. category: 'accessing',
  3507. fn: function (aSymbol, anObject){
  3508. var self=this;
  3509. var attr=nil;
  3510. attr=smalltalk.send(aSymbol, "_asString", []);
  3511. self['@jsObject'][attr] = anObject;
  3512. return self;},
  3513. args: ["aSymbol", "anObject"],
  3514. source: unescape('at%3A%20aSymbol%20put%3A%20anObject%0A%09%7C%20attr%20%7C%0A%09attr%20%3A%3D%20aSymbol%20asString.%0A%09%3Cself%5B%27@jsObject%27%5D%5Battr%5D%20%3D%20anObject%3E'),
  3515. messageSends: ["asString"],
  3516. referencedClasses: []
  3517. }),
  3518. smalltalk.JSObjectProxy);
  3519. smalltalk.addMethod(
  3520. unescape('_on_'),
  3521. smalltalk.method({
  3522. selector: unescape('on%3A'),
  3523. category: 'instance creation',
  3524. fn: function (aJSObject){
  3525. var self=this;
  3526. return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  3527. return self;},
  3528. args: ["aJSObject"],
  3529. source: unescape('on%3A%20aJSObject%0A%09%5Eself%20new%0A%09%09jsObject%3A%20aJSObject%3B%0A%09%09yourself'),
  3530. messageSends: ["jsObject:", "yourself", "new"],
  3531. referencedClasses: []
  3532. }),
  3533. smalltalk.JSObjectProxy.klass);