Kernel-Objects.deploy.js 87 KB

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