Kernel-Objects.deploy.js 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544
  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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { $ctx1.variables=nil;
  46. $ctx1.locals.variables=_st((smalltalk.HashedCollection || HashedCollection))._new();
  47. _st(_st(_st(self)._class())._allInstanceVariableNames())._do_((function(each){
  48. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.variables)._at_put_(each,_st(_st(self)._instVarAt_(each))._asJSON());
  49. })}));
  50. return $ctx1.locals.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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) {
  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($ctx1) { _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($ctx1) { 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($ctx1) { _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($ctx1) { _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($ctx1) {
  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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { $ctx1.result=nil;
  432. _st(console)._log_(_st(_st(aString).__comma(" time: ")).__comma(_st(_st((smalltalk.Date || Date))._millisecondsToRun_((function(){
  433. return smalltalk.withContext(function($ctx2) { $ctx1.locals.result=_st(aBlock)._value();
  434. return $ctx1.locals.result;
  435. })})))._printString()));
  436. return $ctx1.locals.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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) { 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($ctx1) {
  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($ctx1) { _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($ctx1) { _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($ctx1) { _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($ctx1) { var $1;
  575. $1=_st((smalltalk.String || String))._streamContents_((function(s){
  576. return smalltalk.withContext(function($ctx2) { 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($ctx1) { _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($ctx1) { 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($ctx1) { try{return aBlock()} catch(e) {return anotherBlock(e)};
  610. ;
  611. return self}, self, "try:catch:", [aBlock,anotherBlock], smalltalk.Object)}
  612. }),
  613. smalltalk.Object);
  614. smalltalk.addMethod(
  615. "_value",
  616. smalltalk.method({
  617. selector: "value",
  618. fn: function (){
  619. var self=this;
  620. return smalltalk.withContext(function($ctx1) { return self;
  621. }, self, "value", [], smalltalk.Object)}
  622. }),
  623. smalltalk.Object);
  624. smalltalk.addMethod(
  625. "_yourself",
  626. smalltalk.method({
  627. selector: "yourself",
  628. fn: function (){
  629. var self=this;
  630. return smalltalk.withContext(function($ctx1) { return self;
  631. }, self, "yourself", [], smalltalk.Object)}
  632. }),
  633. smalltalk.Object);
  634. smalltalk.addMethod(
  635. "__tild_eq",
  636. smalltalk.method({
  637. selector: "~=",
  638. fn: function (anObject){
  639. var self=this;
  640. return smalltalk.withContext(function($ctx1) { var $1;
  641. $1=_st(_st(self).__eq(anObject)).__eq(false);
  642. return $1;
  643. }, self, "~=", [anObject], smalltalk.Object)}
  644. }),
  645. smalltalk.Object);
  646. smalltalk.addMethod(
  647. "__tild_tild",
  648. smalltalk.method({
  649. selector: "~~",
  650. fn: function (anObject){
  651. var self=this;
  652. return smalltalk.withContext(function($ctx1) { var $1;
  653. $1=_st(_st(self).__eq_eq(anObject)).__eq(false);
  654. return $1;
  655. }, self, "~~", [anObject], smalltalk.Object)}
  656. }),
  657. smalltalk.Object);
  658. smalltalk.addMethod(
  659. "_initialize",
  660. smalltalk.method({
  661. selector: "initialize",
  662. fn: function (){
  663. var self=this;
  664. return smalltalk.withContext(function($ctx1) { return self}, self, "initialize", [], smalltalk.Object.klass)}
  665. }),
  666. smalltalk.Object.klass);
  667. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  668. smalltalk.addMethod(
  669. "__and",
  670. smalltalk.method({
  671. selector: "&",
  672. fn: function (aBoolean){
  673. var self=this;
  674. return smalltalk.withContext(function($ctx1) {
  675. if(self == true) {
  676. return aBoolean;
  677. } else {
  678. return false;
  679. }
  680. ;
  681. ;
  682. return self}, self, "&", [aBoolean], smalltalk.Boolean)}
  683. }),
  684. smalltalk.Boolean);
  685. smalltalk.addMethod(
  686. "__eq",
  687. smalltalk.method({
  688. selector: "=",
  689. fn: function (aBoolean){
  690. var self=this;
  691. return smalltalk.withContext(function($ctx1) { var $1;
  692. $1=_st(_st(aBoolean)._class()).__eq(_st(self)._class());
  693. if(! smalltalk.assert($1)){
  694. return false;
  695. };
  696. return Boolean(self == true) == aBoolean;
  697. ;
  698. return self}, self, "=", [aBoolean], smalltalk.Boolean)}
  699. }),
  700. smalltalk.Boolean);
  701. smalltalk.addMethod(
  702. "__eq_eq",
  703. smalltalk.method({
  704. selector: "==",
  705. fn: function (aBoolean){
  706. var self=this;
  707. return smalltalk.withContext(function($ctx1) { var $1;
  708. $1=_st(self).__eq(aBoolean);
  709. return $1;
  710. }, self, "==", [aBoolean], smalltalk.Boolean)}
  711. }),
  712. smalltalk.Boolean);
  713. smalltalk.addMethod(
  714. "_and_",
  715. smalltalk.method({
  716. selector: "and:",
  717. fn: function (aBlock){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) { var $2,$1;
  720. $2=_st(self).__eq(true);
  721. $1=_st($2)._ifTrue_ifFalse_(aBlock,(function(){
  722. return smalltalk.withContext(function($ctx2) { return false;
  723. })}));
  724. return $1;
  725. }, self, "and:", [aBlock], smalltalk.Boolean)}
  726. }),
  727. smalltalk.Boolean);
  728. smalltalk.addMethod(
  729. "_asJSON",
  730. smalltalk.method({
  731. selector: "asJSON",
  732. fn: function (){
  733. var self=this;
  734. return smalltalk.withContext(function($ctx1) { return self;
  735. }, self, "asJSON", [], smalltalk.Boolean)}
  736. }),
  737. smalltalk.Boolean);
  738. smalltalk.addMethod(
  739. "_deepCopy",
  740. smalltalk.method({
  741. selector: "deepCopy",
  742. fn: function (){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) { return self;
  745. }, self, "deepCopy", [], smalltalk.Boolean)}
  746. }),
  747. smalltalk.Boolean);
  748. smalltalk.addMethod(
  749. "_ifFalse_",
  750. smalltalk.method({
  751. selector: "ifFalse:",
  752. fn: function (aBlock){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) { var $1;
  755. $1=_st(self)._ifTrue_ifFalse_((function(){
  756. return smalltalk.withContext(function($ctx2) { })}),aBlock);
  757. return $1;
  758. }, self, "ifFalse:", [aBlock], smalltalk.Boolean)}
  759. }),
  760. smalltalk.Boolean);
  761. smalltalk.addMethod(
  762. "_ifFalse_ifTrue_",
  763. smalltalk.method({
  764. selector: "ifFalse:ifTrue:",
  765. fn: function (aBlock,anotherBlock){
  766. var self=this;
  767. return smalltalk.withContext(function($ctx1) { var $1;
  768. $1=_st(self)._ifTrue_ifFalse_(anotherBlock,aBlock);
  769. return $1;
  770. }, self, "ifFalse:ifTrue:", [aBlock,anotherBlock], smalltalk.Boolean)}
  771. }),
  772. smalltalk.Boolean);
  773. smalltalk.addMethod(
  774. "_ifTrue_",
  775. smalltalk.method({
  776. selector: "ifTrue:",
  777. fn: function (aBlock){
  778. var self=this;
  779. return smalltalk.withContext(function($ctx1) { var $1;
  780. $1=_st(self)._ifTrue_ifFalse_(aBlock,(function(){
  781. return smalltalk.withContext(function($ctx2) { })}));
  782. return $1;
  783. }, self, "ifTrue:", [aBlock], smalltalk.Boolean)}
  784. }),
  785. smalltalk.Boolean);
  786. smalltalk.addMethod(
  787. "_ifTrue_ifFalse_",
  788. smalltalk.method({
  789. selector: "ifTrue:ifFalse:",
  790. fn: function (aBlock,anotherBlock){
  791. var self=this;
  792. return smalltalk.withContext(function($ctx1) {
  793. if(self == true) {
  794. return aBlock();
  795. } else {
  796. return anotherBlock();
  797. }
  798. ;
  799. ;
  800. return self}, self, "ifTrue:ifFalse:", [aBlock,anotherBlock], smalltalk.Boolean)}
  801. }),
  802. smalltalk.Boolean);
  803. smalltalk.addMethod(
  804. "_not",
  805. smalltalk.method({
  806. selector: "not",
  807. fn: function (){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) { var $1;
  810. $1=_st(self).__eq(false);
  811. return $1;
  812. }, self, "not", [], smalltalk.Boolean)}
  813. }),
  814. smalltalk.Boolean);
  815. smalltalk.addMethod(
  816. "_or_",
  817. smalltalk.method({
  818. selector: "or:",
  819. fn: function (aBlock){
  820. var self=this;
  821. return smalltalk.withContext(function($ctx1) { var $2,$1;
  822. $2=_st(self).__eq(true);
  823. $1=_st($2)._ifTrue_ifFalse_((function(){
  824. return smalltalk.withContext(function($ctx2) { return true;
  825. })}),aBlock);
  826. return $1;
  827. }, self, "or:", [aBlock], smalltalk.Boolean)}
  828. }),
  829. smalltalk.Boolean);
  830. smalltalk.addMethod(
  831. "_printString",
  832. smalltalk.method({
  833. selector: "printString",
  834. fn: function (){
  835. var self=this;
  836. return smalltalk.withContext(function($ctx1) { return self.toString();
  837. ;
  838. return self}, self, "printString", [], smalltalk.Boolean)}
  839. }),
  840. smalltalk.Boolean);
  841. smalltalk.addMethod(
  842. "_shallowCopy",
  843. smalltalk.method({
  844. selector: "shallowCopy",
  845. fn: function (){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx1) { return self;
  848. }, self, "shallowCopy", [], smalltalk.Boolean)}
  849. }),
  850. smalltalk.Boolean);
  851. smalltalk.addMethod(
  852. "__or",
  853. smalltalk.method({
  854. selector: "|",
  855. fn: function (aBoolean){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) {
  858. if(self == true) {
  859. return true;
  860. } else {
  861. return aBoolean;
  862. }
  863. ;
  864. ;
  865. return self}, self, "|", [aBoolean], smalltalk.Boolean)}
  866. }),
  867. smalltalk.Boolean);
  868. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  869. smalltalk.addMethod(
  870. "_arguments",
  871. smalltalk.method({
  872. selector: "arguments",
  873. fn: function (){
  874. var self=this;
  875. return smalltalk.withContext(function($ctx1) { return self.args || [];
  876. ;
  877. return self}, self, "arguments", [], smalltalk.CompiledMethod)}
  878. }),
  879. smalltalk.CompiledMethod);
  880. smalltalk.addMethod(
  881. "_category",
  882. smalltalk.method({
  883. selector: "category",
  884. fn: function (){
  885. var self=this;
  886. return smalltalk.withContext(function($ctx1) { var $2,$1;
  887. $2=_st(self)._basicAt_("category");
  888. if(($receiver = $2) == nil || $receiver == undefined){
  889. $1="";
  890. } else {
  891. $1=$2;
  892. };
  893. return $1;
  894. }, self, "category", [], smalltalk.CompiledMethod)}
  895. }),
  896. smalltalk.CompiledMethod);
  897. smalltalk.addMethod(
  898. "_category_",
  899. smalltalk.method({
  900. selector: "category:",
  901. fn: function (aString){
  902. var self=this;
  903. return smalltalk.withContext(function($ctx1) { var $1;
  904. $ctx1.locals.oldCategory=nil;
  905. $ctx1.locals.oldCategory=_st(self)._category();
  906. _st(self)._basicAt_put_("category",aString);
  907. $1=_st(self)._methodClass();
  908. if(($receiver = $1) == nil || $receiver == undefined){
  909. $1;
  910. } else {
  911. _st(_st(_st(self)._methodClass())._organization())._addElement_(aString);
  912. _st(_st(_st(_st(self)._methodClass())._methods())._select_((function(each){
  913. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._category()).__eq($ctx1.locals.oldCategory);
  914. })})))._ifEmpty_((function(){
  915. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._methodClass())._organization())._removeElement_($ctx1.locals.oldCategory);
  916. })}));
  917. };
  918. return self}, self, "category:", [aString], smalltalk.CompiledMethod)}
  919. }),
  920. smalltalk.CompiledMethod);
  921. smalltalk.addMethod(
  922. "_fn",
  923. smalltalk.method({
  924. selector: "fn",
  925. fn: function (){
  926. var self=this;
  927. return smalltalk.withContext(function($ctx1) { var $1;
  928. $1=_st(self)._basicAt_("fn");
  929. return $1;
  930. }, self, "fn", [], smalltalk.CompiledMethod)}
  931. }),
  932. smalltalk.CompiledMethod);
  933. smalltalk.addMethod(
  934. "_fn_",
  935. smalltalk.method({
  936. selector: "fn:",
  937. fn: function (aBlock){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("fn",aBlock);
  940. return self}, self, "fn:", [aBlock], smalltalk.CompiledMethod)}
  941. }),
  942. smalltalk.CompiledMethod);
  943. smalltalk.addMethod(
  944. "_messageSends",
  945. smalltalk.method({
  946. selector: "messageSends",
  947. fn: function (){
  948. var self=this;
  949. return smalltalk.withContext(function($ctx1) { var $1;
  950. $1=_st(self)._basicAt_("messageSends");
  951. return $1;
  952. }, self, "messageSends", [], smalltalk.CompiledMethod)}
  953. }),
  954. smalltalk.CompiledMethod);
  955. smalltalk.addMethod(
  956. "_methodClass",
  957. smalltalk.method({
  958. selector: "methodClass",
  959. fn: function (){
  960. var self=this;
  961. return smalltalk.withContext(function($ctx1) { var $1;
  962. $1=_st(self)._basicAt_("methodClass");
  963. return $1;
  964. }, self, "methodClass", [], smalltalk.CompiledMethod)}
  965. }),
  966. smalltalk.CompiledMethod);
  967. smalltalk.addMethod(
  968. "_protocol",
  969. smalltalk.method({
  970. selector: "protocol",
  971. fn: function (){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx1) { var $1;
  974. $1=_st(self)._category();
  975. return $1;
  976. }, self, "protocol", [], smalltalk.CompiledMethod)}
  977. }),
  978. smalltalk.CompiledMethod);
  979. smalltalk.addMethod(
  980. "_referencedClasses",
  981. smalltalk.method({
  982. selector: "referencedClasses",
  983. fn: function (){
  984. var self=this;
  985. return smalltalk.withContext(function($ctx1) { var $1;
  986. $1=_st(self)._basicAt_("referencedClasses");
  987. return $1;
  988. }, self, "referencedClasses", [], smalltalk.CompiledMethod)}
  989. }),
  990. smalltalk.CompiledMethod);
  991. smalltalk.addMethod(
  992. "_selector",
  993. smalltalk.method({
  994. selector: "selector",
  995. fn: function (){
  996. var self=this;
  997. return smalltalk.withContext(function($ctx1) { var $1;
  998. $1=_st(self)._basicAt_("selector");
  999. return $1;
  1000. }, self, "selector", [], smalltalk.CompiledMethod)}
  1001. }),
  1002. smalltalk.CompiledMethod);
  1003. smalltalk.addMethod(
  1004. "_selector_",
  1005. smalltalk.method({
  1006. selector: "selector:",
  1007. fn: function (aString){
  1008. var self=this;
  1009. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("selector",aString);
  1010. return self}, self, "selector:", [aString], smalltalk.CompiledMethod)}
  1011. }),
  1012. smalltalk.CompiledMethod);
  1013. smalltalk.addMethod(
  1014. "_source",
  1015. smalltalk.method({
  1016. selector: "source",
  1017. fn: function (){
  1018. var self=this;
  1019. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1020. $2=_st(self)._basicAt_("source");
  1021. if(($receiver = $2) == nil || $receiver == undefined){
  1022. $1="";
  1023. } else {
  1024. $1=$2;
  1025. };
  1026. return $1;
  1027. }, self, "source", [], smalltalk.CompiledMethod)}
  1028. }),
  1029. smalltalk.CompiledMethod);
  1030. smalltalk.addMethod(
  1031. "_source_",
  1032. smalltalk.method({
  1033. selector: "source:",
  1034. fn: function (aString){
  1035. var self=this;
  1036. return smalltalk.withContext(function($ctx1) { _st(self)._basicAt_put_("source",aString);
  1037. return self}, self, "source:", [aString], smalltalk.CompiledMethod)}
  1038. }),
  1039. smalltalk.CompiledMethod);
  1040. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  1041. smalltalk.addMethod(
  1042. "__plus",
  1043. smalltalk.method({
  1044. selector: "+",
  1045. fn: function (aDate){
  1046. var self=this;
  1047. return smalltalk.withContext(function($ctx1) { return self + aDate;
  1048. ;
  1049. return self}, self, "+", [aDate], smalltalk.Date)}
  1050. }),
  1051. smalltalk.Date);
  1052. smalltalk.addMethod(
  1053. "__minus",
  1054. smalltalk.method({
  1055. selector: "-",
  1056. fn: function (aDate){
  1057. var self=this;
  1058. return smalltalk.withContext(function($ctx1) { return self - aDate;
  1059. ;
  1060. return self}, self, "-", [aDate], smalltalk.Date)}
  1061. }),
  1062. smalltalk.Date);
  1063. smalltalk.addMethod(
  1064. "__lt",
  1065. smalltalk.method({
  1066. selector: "<",
  1067. fn: function (aDate){
  1068. var self=this;
  1069. return smalltalk.withContext(function($ctx1) { return self < aDate;
  1070. ;
  1071. return self}, self, "<", [aDate], smalltalk.Date)}
  1072. }),
  1073. smalltalk.Date);
  1074. smalltalk.addMethod(
  1075. "__lt_eq",
  1076. smalltalk.method({
  1077. selector: "<=",
  1078. fn: function (aDate){
  1079. var self=this;
  1080. return smalltalk.withContext(function($ctx1) { return self <= aDate;
  1081. ;
  1082. return self}, self, "<=", [aDate], smalltalk.Date)}
  1083. }),
  1084. smalltalk.Date);
  1085. smalltalk.addMethod(
  1086. "__gt",
  1087. smalltalk.method({
  1088. selector: ">",
  1089. fn: function (aDate){
  1090. var self=this;
  1091. return smalltalk.withContext(function($ctx1) { return self > aDate;
  1092. ;
  1093. return self}, self, ">", [aDate], smalltalk.Date)}
  1094. }),
  1095. smalltalk.Date);
  1096. smalltalk.addMethod(
  1097. "__gt_eq",
  1098. smalltalk.method({
  1099. selector: ">=",
  1100. fn: function (aDate){
  1101. var self=this;
  1102. return smalltalk.withContext(function($ctx1) { return self >= aDate;
  1103. ;
  1104. return self}, self, ">=", [aDate], smalltalk.Date)}
  1105. }),
  1106. smalltalk.Date);
  1107. smalltalk.addMethod(
  1108. "_asDateString",
  1109. smalltalk.method({
  1110. selector: "asDateString",
  1111. fn: function (){
  1112. var self=this;
  1113. return smalltalk.withContext(function($ctx1) { return self.toDateString();
  1114. ;
  1115. return self}, self, "asDateString", [], smalltalk.Date)}
  1116. }),
  1117. smalltalk.Date);
  1118. smalltalk.addMethod(
  1119. "_asLocaleString",
  1120. smalltalk.method({
  1121. selector: "asLocaleString",
  1122. fn: function (){
  1123. var self=this;
  1124. return smalltalk.withContext(function($ctx1) { return self.toLocaleString();
  1125. ;
  1126. return self}, self, "asLocaleString", [], smalltalk.Date)}
  1127. }),
  1128. smalltalk.Date);
  1129. smalltalk.addMethod(
  1130. "_asMilliseconds",
  1131. smalltalk.method({
  1132. selector: "asMilliseconds",
  1133. fn: function (){
  1134. var self=this;
  1135. return smalltalk.withContext(function($ctx1) { var $1;
  1136. $1=_st(self)._time();
  1137. return $1;
  1138. }, self, "asMilliseconds", [], smalltalk.Date)}
  1139. }),
  1140. smalltalk.Date);
  1141. smalltalk.addMethod(
  1142. "_asNumber",
  1143. smalltalk.method({
  1144. selector: "asNumber",
  1145. fn: function (){
  1146. var self=this;
  1147. return smalltalk.withContext(function($ctx1) { var $1;
  1148. $1=_st(self)._asMilliseconds();
  1149. return $1;
  1150. }, self, "asNumber", [], smalltalk.Date)}
  1151. }),
  1152. smalltalk.Date);
  1153. smalltalk.addMethod(
  1154. "_asString",
  1155. smalltalk.method({
  1156. selector: "asString",
  1157. fn: function (){
  1158. var self=this;
  1159. return smalltalk.withContext(function($ctx1) { return self.toString();
  1160. ;
  1161. return self}, self, "asString", [], smalltalk.Date)}
  1162. }),
  1163. smalltalk.Date);
  1164. smalltalk.addMethod(
  1165. "_asTimeString",
  1166. smalltalk.method({
  1167. selector: "asTimeString",
  1168. fn: function (){
  1169. var self=this;
  1170. return smalltalk.withContext(function($ctx1) { return self.toTimeString();
  1171. ;
  1172. return self}, self, "asTimeString", [], smalltalk.Date)}
  1173. }),
  1174. smalltalk.Date);
  1175. smalltalk.addMethod(
  1176. "_day",
  1177. smalltalk.method({
  1178. selector: "day",
  1179. fn: function (){
  1180. var self=this;
  1181. return smalltalk.withContext(function($ctx1) { var $1;
  1182. $1=_st(self)._dayOfWeek();
  1183. return $1;
  1184. }, self, "day", [], smalltalk.Date)}
  1185. }),
  1186. smalltalk.Date);
  1187. smalltalk.addMethod(
  1188. "_day_",
  1189. smalltalk.method({
  1190. selector: "day:",
  1191. fn: function (aNumber){
  1192. var self=this;
  1193. return smalltalk.withContext(function($ctx1) { _st(self)._dayOfWeek_(aNumber);
  1194. return self}, self, "day:", [aNumber], smalltalk.Date)}
  1195. }),
  1196. smalltalk.Date);
  1197. smalltalk.addMethod(
  1198. "_dayOfMonth",
  1199. smalltalk.method({
  1200. selector: "dayOfMonth",
  1201. fn: function (){
  1202. var self=this;
  1203. return smalltalk.withContext(function($ctx1) { return self.getDate();
  1204. ;
  1205. return self}, self, "dayOfMonth", [], smalltalk.Date)}
  1206. }),
  1207. smalltalk.Date);
  1208. smalltalk.addMethod(
  1209. "_dayOfMonth_",
  1210. smalltalk.method({
  1211. selector: "dayOfMonth:",
  1212. fn: function (aNumber){
  1213. var self=this;
  1214. return smalltalk.withContext(function($ctx1) { self.setDate(aNumber);
  1215. ;
  1216. return self}, self, "dayOfMonth:", [aNumber], smalltalk.Date)}
  1217. }),
  1218. smalltalk.Date);
  1219. smalltalk.addMethod(
  1220. "_dayOfWeek",
  1221. smalltalk.method({
  1222. selector: "dayOfWeek",
  1223. fn: function (){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx1) { return self.getDay() + 1;
  1226. ;
  1227. return self}, self, "dayOfWeek", [], smalltalk.Date)}
  1228. }),
  1229. smalltalk.Date);
  1230. smalltalk.addMethod(
  1231. "_dayOfWeek_",
  1232. smalltalk.method({
  1233. selector: "dayOfWeek:",
  1234. fn: function (aNumber){
  1235. var self=this;
  1236. return smalltalk.withContext(function($ctx1) { return self.setDay(aNumber - 1);
  1237. ;
  1238. return self}, self, "dayOfWeek:", [aNumber], smalltalk.Date)}
  1239. }),
  1240. smalltalk.Date);
  1241. smalltalk.addMethod(
  1242. "_hours",
  1243. smalltalk.method({
  1244. selector: "hours",
  1245. fn: function (){
  1246. var self=this;
  1247. return smalltalk.withContext(function($ctx1) { return self.getHours();
  1248. ;
  1249. return self}, self, "hours", [], smalltalk.Date)}
  1250. }),
  1251. smalltalk.Date);
  1252. smalltalk.addMethod(
  1253. "_hours_",
  1254. smalltalk.method({
  1255. selector: "hours:",
  1256. fn: function (aNumber){
  1257. var self=this;
  1258. return smalltalk.withContext(function($ctx1) { self.setHours(aNumber);
  1259. ;
  1260. return self}, self, "hours:", [aNumber], smalltalk.Date)}
  1261. }),
  1262. smalltalk.Date);
  1263. smalltalk.addMethod(
  1264. "_milliseconds",
  1265. smalltalk.method({
  1266. selector: "milliseconds",
  1267. fn: function (){
  1268. var self=this;
  1269. return smalltalk.withContext(function($ctx1) { return self.getMilliseconds();
  1270. ;
  1271. return self}, self, "milliseconds", [], smalltalk.Date)}
  1272. }),
  1273. smalltalk.Date);
  1274. smalltalk.addMethod(
  1275. "_milliseconds_",
  1276. smalltalk.method({
  1277. selector: "milliseconds:",
  1278. fn: function (aNumber){
  1279. var self=this;
  1280. return smalltalk.withContext(function($ctx1) { self.setMilliseconds(aNumber);
  1281. ;
  1282. return self}, self, "milliseconds:", [aNumber], smalltalk.Date)}
  1283. }),
  1284. smalltalk.Date);
  1285. smalltalk.addMethod(
  1286. "_minutes",
  1287. smalltalk.method({
  1288. selector: "minutes",
  1289. fn: function (){
  1290. var self=this;
  1291. return smalltalk.withContext(function($ctx1) { return self.getMinutes();
  1292. ;
  1293. return self}, self, "minutes", [], smalltalk.Date)}
  1294. }),
  1295. smalltalk.Date);
  1296. smalltalk.addMethod(
  1297. "_minutes_",
  1298. smalltalk.method({
  1299. selector: "minutes:",
  1300. fn: function (aNumber){
  1301. var self=this;
  1302. return smalltalk.withContext(function($ctx1) { self.setMinutes(aNumber);
  1303. ;
  1304. return self}, self, "minutes:", [aNumber], smalltalk.Date)}
  1305. }),
  1306. smalltalk.Date);
  1307. smalltalk.addMethod(
  1308. "_month",
  1309. smalltalk.method({
  1310. selector: "month",
  1311. fn: function (){
  1312. var self=this;
  1313. return smalltalk.withContext(function($ctx1) { return self.getMonth() + 1;
  1314. ;
  1315. return self}, self, "month", [], smalltalk.Date)}
  1316. }),
  1317. smalltalk.Date);
  1318. smalltalk.addMethod(
  1319. "_month_",
  1320. smalltalk.method({
  1321. selector: "month:",
  1322. fn: function (aNumber){
  1323. var self=this;
  1324. return smalltalk.withContext(function($ctx1) { self.setMonth(aNumber - 1);
  1325. ;
  1326. return self}, self, "month:", [aNumber], smalltalk.Date)}
  1327. }),
  1328. smalltalk.Date);
  1329. smalltalk.addMethod(
  1330. "_printString",
  1331. smalltalk.method({
  1332. selector: "printString",
  1333. fn: function (){
  1334. var self=this;
  1335. return smalltalk.withContext(function($ctx1) { var $1;
  1336. $1=_st(self)._asString();
  1337. return $1;
  1338. }, self, "printString", [], smalltalk.Date)}
  1339. }),
  1340. smalltalk.Date);
  1341. smalltalk.addMethod(
  1342. "_seconds",
  1343. smalltalk.method({
  1344. selector: "seconds",
  1345. fn: function (){
  1346. var self=this;
  1347. return smalltalk.withContext(function($ctx1) { return self.getSeconds();
  1348. ;
  1349. return self}, self, "seconds", [], smalltalk.Date)}
  1350. }),
  1351. smalltalk.Date);
  1352. smalltalk.addMethod(
  1353. "_seconds_",
  1354. smalltalk.method({
  1355. selector: "seconds:",
  1356. fn: function (aNumber){
  1357. var self=this;
  1358. return smalltalk.withContext(function($ctx1) { self.setSeconds(aNumber);
  1359. ;
  1360. return self}, self, "seconds:", [aNumber], smalltalk.Date)}
  1361. }),
  1362. smalltalk.Date);
  1363. smalltalk.addMethod(
  1364. "_time",
  1365. smalltalk.method({
  1366. selector: "time",
  1367. fn: function (){
  1368. var self=this;
  1369. return smalltalk.withContext(function($ctx1) { return self.getTime();
  1370. ;
  1371. return self}, self, "time", [], smalltalk.Date)}
  1372. }),
  1373. smalltalk.Date);
  1374. smalltalk.addMethod(
  1375. "_time_",
  1376. smalltalk.method({
  1377. selector: "time:",
  1378. fn: function (aNumber){
  1379. var self=this;
  1380. return smalltalk.withContext(function($ctx1) { self.setTime(aNumber);
  1381. ;
  1382. return self}, self, "time:", [aNumber], smalltalk.Date)}
  1383. }),
  1384. smalltalk.Date);
  1385. smalltalk.addMethod(
  1386. "_year",
  1387. smalltalk.method({
  1388. selector: "year",
  1389. fn: function (){
  1390. var self=this;
  1391. return smalltalk.withContext(function($ctx1) { return self.getFullYear();
  1392. ;
  1393. return self}, self, "year", [], smalltalk.Date)}
  1394. }),
  1395. smalltalk.Date);
  1396. smalltalk.addMethod(
  1397. "_year_",
  1398. smalltalk.method({
  1399. selector: "year:",
  1400. fn: function (aNumber){
  1401. var self=this;
  1402. return smalltalk.withContext(function($ctx1) { self.setFullYear(aNumber);
  1403. ;
  1404. return self}, self, "year:", [aNumber], smalltalk.Date)}
  1405. }),
  1406. smalltalk.Date);
  1407. smalltalk.addMethod(
  1408. "_fromMilliseconds_",
  1409. smalltalk.method({
  1410. selector: "fromMilliseconds:",
  1411. fn: function (aNumber){
  1412. var self=this;
  1413. return smalltalk.withContext(function($ctx1) { var $1;
  1414. $1=_st(self)._new_(aNumber);
  1415. return $1;
  1416. }, self, "fromMilliseconds:", [aNumber], smalltalk.Date.klass)}
  1417. }),
  1418. smalltalk.Date.klass);
  1419. smalltalk.addMethod(
  1420. "_fromSeconds_",
  1421. smalltalk.method({
  1422. selector: "fromSeconds:",
  1423. fn: function (aNumber){
  1424. var self=this;
  1425. return smalltalk.withContext(function($ctx1) { var $1;
  1426. $1=_st(self)._fromMilliseconds_(_st(aNumber).__star((1000)));
  1427. return $1;
  1428. }, self, "fromSeconds:", [aNumber], smalltalk.Date.klass)}
  1429. }),
  1430. smalltalk.Date.klass);
  1431. smalltalk.addMethod(
  1432. "_fromString_",
  1433. smalltalk.method({
  1434. selector: "fromString:",
  1435. fn: function (aString){
  1436. var self=this;
  1437. return smalltalk.withContext(function($ctx1) { var $1;
  1438. $1=_st(self)._new_(aString);
  1439. return $1;
  1440. }, self, "fromString:", [aString], smalltalk.Date.klass)}
  1441. }),
  1442. smalltalk.Date.klass);
  1443. smalltalk.addMethod(
  1444. "_millisecondsToRun_",
  1445. smalltalk.method({
  1446. selector: "millisecondsToRun:",
  1447. fn: function (aBlock){
  1448. var self=this;
  1449. return smalltalk.withContext(function($ctx1) { var $1;
  1450. $ctx1.t=nil;
  1451. $ctx1.locals.t=_st((smalltalk.Date || Date))._now();
  1452. _st(aBlock)._value();
  1453. $1=_st(_st((smalltalk.Date || Date))._now()).__minus($ctx1.locals.t);
  1454. return $1;
  1455. }, self, "millisecondsToRun:", [aBlock], smalltalk.Date.klass)}
  1456. }),
  1457. smalltalk.Date.klass);
  1458. smalltalk.addMethod(
  1459. "_new_",
  1460. smalltalk.method({
  1461. selector: "new:",
  1462. fn: function (anObject){
  1463. var self=this;
  1464. return smalltalk.withContext(function($ctx1) { return new Date(anObject);
  1465. ;
  1466. return self}, self, "new:", [anObject], smalltalk.Date.klass)}
  1467. }),
  1468. smalltalk.Date.klass);
  1469. smalltalk.addMethod(
  1470. "_now",
  1471. smalltalk.method({
  1472. selector: "now",
  1473. fn: function (){
  1474. var self=this;
  1475. return smalltalk.withContext(function($ctx1) { var $1;
  1476. $1=_st(self)._today();
  1477. return $1;
  1478. }, self, "now", [], smalltalk.Date.klass)}
  1479. }),
  1480. smalltalk.Date.klass);
  1481. smalltalk.addMethod(
  1482. "_today",
  1483. smalltalk.method({
  1484. selector: "today",
  1485. fn: function (){
  1486. var self=this;
  1487. return smalltalk.withContext(function($ctx1) { var $1;
  1488. $1=_st(self)._new();
  1489. return $1;
  1490. }, self, "today", [], smalltalk.Date.klass)}
  1491. }),
  1492. smalltalk.Date.klass);
  1493. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  1494. smalltalk.addMethod(
  1495. "_addObjectVariablesTo_",
  1496. smalltalk.method({
  1497. selector: "addObjectVariablesTo:",
  1498. fn: function (aDictionary){
  1499. var self=this;
  1500. return smalltalk.withContext(function($ctx1) { for(var i in self['@jsObject']) {
  1501. aDictionary._at_put_(i, self['@jsObject'][i]);
  1502. };
  1503. ;
  1504. return self}, self, "addObjectVariablesTo:", [aDictionary], smalltalk.JSObjectProxy)}
  1505. }),
  1506. smalltalk.JSObjectProxy);
  1507. smalltalk.addMethod(
  1508. "_at_",
  1509. smalltalk.method({
  1510. selector: "at:",
  1511. fn: function (aSymbol){
  1512. var self=this;
  1513. return smalltalk.withContext(function($ctx1) { 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($ctx1) { self['@jsObject'][aSymbol._asString()] = anObject;
  1525. ;
  1526. return self}, self, "at:put:", [aSymbol,anObject], smalltalk.JSObjectProxy)}
  1527. }),
  1528. smalltalk.JSObjectProxy);
  1529. smalltalk.addMethod(
  1530. "_doesNotUnderstand_",
  1531. smalltalk.method({
  1532. selector: "doesNotUnderstand:",
  1533. fn: function (aMessage){
  1534. var self=this;
  1535. return smalltalk.withContext(function($ctx1) {
  1536. var jsSelector = aMessage._selector()._asJavaScriptSelector();
  1537. var object = self._jsObject();
  1538. if(jsSelector in object) {
  1539. return smalltalk.send(object, jsSelector, aMessage._arguments());
  1540. }
  1541. ;
  1542. ;
  1543. smalltalk.Object.fn.prototype._doesNotUnderstand_.apply(_st(self), [aMessage]);
  1544. return self}, self, "doesNotUnderstand:", [aMessage], smalltalk.JSObjectProxy)}
  1545. }),
  1546. smalltalk.JSObjectProxy);
  1547. smalltalk.addMethod(
  1548. "_inspectOn_",
  1549. smalltalk.method({
  1550. selector: "inspectOn:",
  1551. fn: function (anInspector){
  1552. var self=this;
  1553. return smalltalk.withContext(function($ctx1) { $ctx1.variables=nil;
  1554. $ctx1.locals.variables=_st((smalltalk.Dictionary || Dictionary))._new();
  1555. _st($ctx1.locals.variables)._at_put_("#self",_st(self)._jsObject());
  1556. _st(anInspector)._setLabel_(_st(self)._printString());
  1557. _st(self)._addObjectVariablesTo_($ctx1.locals.variables);
  1558. _st(anInspector)._setVariables_($ctx1.locals.variables);
  1559. return self}, self, "inspectOn:", [anInspector], smalltalk.JSObjectProxy)}
  1560. }),
  1561. smalltalk.JSObjectProxy);
  1562. smalltalk.addMethod(
  1563. "_jsObject",
  1564. smalltalk.method({
  1565. selector: "jsObject",
  1566. fn: function (){
  1567. var self=this;
  1568. return smalltalk.withContext(function($ctx1) { return self["@jsObject"];
  1569. }, self, "jsObject", [], smalltalk.JSObjectProxy)}
  1570. }),
  1571. smalltalk.JSObjectProxy);
  1572. smalltalk.addMethod(
  1573. "_jsObject_",
  1574. smalltalk.method({
  1575. selector: "jsObject:",
  1576. fn: function (aJSObject){
  1577. var self=this;
  1578. return smalltalk.withContext(function($ctx1) { self["@jsObject"]=aJSObject;
  1579. return self}, self, "jsObject:", [aJSObject], smalltalk.JSObjectProxy)}
  1580. }),
  1581. smalltalk.JSObjectProxy);
  1582. smalltalk.addMethod(
  1583. "_printString",
  1584. smalltalk.method({
  1585. selector: "printString",
  1586. fn: function (){
  1587. var self=this;
  1588. return smalltalk.withContext(function($ctx1) { var $1;
  1589. $1=_st(_st(self)._jsObject())._toString();
  1590. return $1;
  1591. }, self, "printString", [], smalltalk.JSObjectProxy)}
  1592. }),
  1593. smalltalk.JSObjectProxy);
  1594. smalltalk.addMethod(
  1595. "_on_",
  1596. smalltalk.method({
  1597. selector: "on:",
  1598. fn: function (aJSObject){
  1599. var self=this;
  1600. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1601. $2=_st(self)._new();
  1602. _st($2)._jsObject_(aJSObject);
  1603. $3=_st($2)._yourself();
  1604. $1=$3;
  1605. return $1;
  1606. }, self, "on:", [aJSObject], smalltalk.JSObjectProxy.klass)}
  1607. }),
  1608. smalltalk.JSObjectProxy.klass);
  1609. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  1610. smalltalk.addMethod(
  1611. "__and",
  1612. smalltalk.method({
  1613. selector: "&",
  1614. fn: function (aNumber){
  1615. var self=this;
  1616. return smalltalk.withContext(function($ctx1) { return self & aNumber;
  1617. ;
  1618. return self}, self, "&", [aNumber], smalltalk.Number)}
  1619. }),
  1620. smalltalk.Number);
  1621. smalltalk.addMethod(
  1622. "__star",
  1623. smalltalk.method({
  1624. selector: "*",
  1625. fn: function (aNumber){
  1626. var self=this;
  1627. return smalltalk.withContext(function($ctx1) { return self * aNumber;
  1628. ;
  1629. return self}, self, "*", [aNumber], smalltalk.Number)}
  1630. }),
  1631. smalltalk.Number);
  1632. smalltalk.addMethod(
  1633. "__plus",
  1634. smalltalk.method({
  1635. selector: "+",
  1636. fn: function (aNumber){
  1637. var self=this;
  1638. return smalltalk.withContext(function($ctx1) { return self + aNumber;
  1639. ;
  1640. return self}, self, "+", [aNumber], smalltalk.Number)}
  1641. }),
  1642. smalltalk.Number);
  1643. smalltalk.addMethod(
  1644. "__minus",
  1645. smalltalk.method({
  1646. selector: "-",
  1647. fn: function (aNumber){
  1648. var self=this;
  1649. return smalltalk.withContext(function($ctx1) { return self - aNumber;
  1650. ;
  1651. return self}, self, "-", [aNumber], smalltalk.Number)}
  1652. }),
  1653. smalltalk.Number);
  1654. smalltalk.addMethod(
  1655. "__slash",
  1656. smalltalk.method({
  1657. selector: "/",
  1658. fn: function (aNumber){
  1659. var self=this;
  1660. return smalltalk.withContext(function($ctx1) { return self / aNumber;
  1661. ;
  1662. return self}, self, "/", [aNumber], smalltalk.Number)}
  1663. }),
  1664. smalltalk.Number);
  1665. smalltalk.addMethod(
  1666. "__lt",
  1667. smalltalk.method({
  1668. selector: "<",
  1669. fn: function (aNumber){
  1670. var self=this;
  1671. return smalltalk.withContext(function($ctx1) { return self < aNumber;
  1672. ;
  1673. return self}, self, "<", [aNumber], smalltalk.Number)}
  1674. }),
  1675. smalltalk.Number);
  1676. smalltalk.addMethod(
  1677. "__lt_eq",
  1678. smalltalk.method({
  1679. selector: "<=",
  1680. fn: function (aNumber){
  1681. var self=this;
  1682. return smalltalk.withContext(function($ctx1) { return self <= aNumber;
  1683. ;
  1684. return self}, self, "<=", [aNumber], smalltalk.Number)}
  1685. }),
  1686. smalltalk.Number);
  1687. smalltalk.addMethod(
  1688. "__eq",
  1689. smalltalk.method({
  1690. selector: "=",
  1691. fn: function (aNumber){
  1692. var self=this;
  1693. return smalltalk.withContext(function($ctx1) { var $1;
  1694. $1=_st(aNumber)._isNumber();
  1695. if(! smalltalk.assert($1)){
  1696. return false;
  1697. };
  1698. return Number(self) == aNumber;
  1699. ;
  1700. return self}, self, "=", [aNumber], smalltalk.Number)}
  1701. }),
  1702. smalltalk.Number);
  1703. smalltalk.addMethod(
  1704. "__gt",
  1705. smalltalk.method({
  1706. selector: ">",
  1707. fn: function (aNumber){
  1708. var self=this;
  1709. return smalltalk.withContext(function($ctx1) { return self > aNumber;
  1710. ;
  1711. return self}, self, ">", [aNumber], smalltalk.Number)}
  1712. }),
  1713. smalltalk.Number);
  1714. smalltalk.addMethod(
  1715. "__gt_eq",
  1716. smalltalk.method({
  1717. selector: ">=",
  1718. fn: function (aNumber){
  1719. var self=this;
  1720. return smalltalk.withContext(function($ctx1) { return self >= aNumber;
  1721. ;
  1722. return self}, self, ">=", [aNumber], smalltalk.Number)}
  1723. }),
  1724. smalltalk.Number);
  1725. smalltalk.addMethod(
  1726. "__at",
  1727. smalltalk.method({
  1728. selector: "@",
  1729. fn: function (aNumber){
  1730. var self=this;
  1731. return smalltalk.withContext(function($ctx1) { var $1;
  1732. $1=_st((smalltalk.Point || Point))._x_y_(self,aNumber);
  1733. return $1;
  1734. }, self, "@", [aNumber], smalltalk.Number)}
  1735. }),
  1736. smalltalk.Number);
  1737. smalltalk.addMethod(
  1738. "__backslash",
  1739. smalltalk.method({
  1740. selector: "\x5c",
  1741. fn: function (aNumber){
  1742. var self=this;
  1743. return smalltalk.withContext(function($ctx1) { return self % aNumber;
  1744. ;
  1745. return self}, self, "\x5c\x5c", [aNumber], smalltalk.Number)}
  1746. }),
  1747. smalltalk.Number);
  1748. smalltalk.addMethod(
  1749. "__backslash_backslash",
  1750. smalltalk.method({
  1751. selector: "\x5c\x5c",
  1752. fn: function (aNumber) {
  1753. var self = this;
  1754. return self % aNumber;
  1755. return self;
  1756. }
  1757. }),
  1758. smalltalk.Number);
  1759. smalltalk.addMethod(
  1760. "_abs",
  1761. smalltalk.method({
  1762. selector: "abs",
  1763. fn: function (){
  1764. var self=this;
  1765. return smalltalk.withContext(function($ctx1) { var $1;
  1766. $1=Math.abs(self);;
  1767. ;
  1768. return $1;
  1769. }, self, "abs", [], smalltalk.Number)}
  1770. }),
  1771. smalltalk.Number);
  1772. smalltalk.addMethod(
  1773. "_asJSON",
  1774. smalltalk.method({
  1775. selector: "asJSON",
  1776. fn: function (){
  1777. var self=this;
  1778. return smalltalk.withContext(function($ctx1) { return self;
  1779. }, self, "asJSON", [], smalltalk.Number)}
  1780. }),
  1781. smalltalk.Number);
  1782. smalltalk.addMethod(
  1783. "_asJavascript",
  1784. smalltalk.method({
  1785. selector: "asJavascript",
  1786. fn: function (){
  1787. var self=this;
  1788. return smalltalk.withContext(function($ctx1) { var $1;
  1789. $1=_st(_st("(").__comma(_st(self)._printString())).__comma(")");
  1790. return $1;
  1791. }, self, "asJavascript", [], smalltalk.Number)}
  1792. }),
  1793. smalltalk.Number);
  1794. smalltalk.addMethod(
  1795. "_asPoint",
  1796. smalltalk.method({
  1797. selector: "asPoint",
  1798. fn: function (){
  1799. var self=this;
  1800. return smalltalk.withContext(function($ctx1) { var $1;
  1801. $1=_st((smalltalk.Point || Point))._x_y_(self,self);
  1802. return $1;
  1803. }, self, "asPoint", [], smalltalk.Number)}
  1804. }),
  1805. smalltalk.Number);
  1806. smalltalk.addMethod(
  1807. "_asString",
  1808. smalltalk.method({
  1809. selector: "asString",
  1810. fn: function (){
  1811. var self=this;
  1812. return smalltalk.withContext(function($ctx1) { var $1;
  1813. $1=_st(self)._printString();
  1814. return $1;
  1815. }, self, "asString", [], smalltalk.Number)}
  1816. }),
  1817. smalltalk.Number);
  1818. smalltalk.addMethod(
  1819. "_atRandom",
  1820. smalltalk.method({
  1821. selector: "atRandom",
  1822. fn: function (){
  1823. var self=this;
  1824. return smalltalk.withContext(function($ctx1) { var $1;
  1825. $1=_st(_st(_st(_st(_st((smalltalk.Random || Random))._new())._next()).__star(self))._truncated()).__plus((1));
  1826. return $1;
  1827. }, self, "atRandom", [], smalltalk.Number)}
  1828. }),
  1829. smalltalk.Number);
  1830. smalltalk.addMethod(
  1831. "_clearInterval",
  1832. smalltalk.method({
  1833. selector: "clearInterval",
  1834. fn: function (){
  1835. var self=this;
  1836. return smalltalk.withContext(function($ctx1) { clearInterval(Number(self));
  1837. ;
  1838. return self}, self, "clearInterval", [], smalltalk.Number)}
  1839. }),
  1840. smalltalk.Number);
  1841. smalltalk.addMethod(
  1842. "_clearTimeout",
  1843. smalltalk.method({
  1844. selector: "clearTimeout",
  1845. fn: function (){
  1846. var self=this;
  1847. return smalltalk.withContext(function($ctx1) { clearTimeout(Number(self));
  1848. ;
  1849. return self}, self, "clearTimeout", [], smalltalk.Number)}
  1850. }),
  1851. smalltalk.Number);
  1852. smalltalk.addMethod(
  1853. "_copy",
  1854. smalltalk.method({
  1855. selector: "copy",
  1856. fn: function (){
  1857. var self=this;
  1858. return smalltalk.withContext(function($ctx1) { return self;
  1859. }, self, "copy", [], smalltalk.Number)}
  1860. }),
  1861. smalltalk.Number);
  1862. smalltalk.addMethod(
  1863. "_deepCopy",
  1864. smalltalk.method({
  1865. selector: "deepCopy",
  1866. fn: function (){
  1867. var self=this;
  1868. return smalltalk.withContext(function($ctx1) { var $1;
  1869. $1=_st(self)._copy();
  1870. return $1;
  1871. }, self, "deepCopy", [], smalltalk.Number)}
  1872. }),
  1873. smalltalk.Number);
  1874. smalltalk.addMethod(
  1875. "_even",
  1876. smalltalk.method({
  1877. selector: "even",
  1878. fn: function (){
  1879. var self=this;
  1880. return smalltalk.withContext(function($ctx1) { var $1;
  1881. $1=_st((0)).__eq(_st(self).__backslash_backslash((2)));
  1882. return $1;
  1883. }, self, "even", [], smalltalk.Number)}
  1884. }),
  1885. smalltalk.Number);
  1886. smalltalk.addMethod(
  1887. "_identityHash",
  1888. smalltalk.method({
  1889. selector: "identityHash",
  1890. fn: function (){
  1891. var self=this;
  1892. return smalltalk.withContext(function($ctx1) { var $1;
  1893. $1=_st(_st(self)._asString()).__comma("n");
  1894. return $1;
  1895. }, self, "identityHash", [], smalltalk.Number)}
  1896. }),
  1897. smalltalk.Number);
  1898. smalltalk.addMethod(
  1899. "_isNumber",
  1900. smalltalk.method({
  1901. selector: "isNumber",
  1902. fn: function (){
  1903. var self=this;
  1904. return smalltalk.withContext(function($ctx1) { return true;
  1905. }, self, "isNumber", [], smalltalk.Number)}
  1906. }),
  1907. smalltalk.Number);
  1908. smalltalk.addMethod(
  1909. "_isZero",
  1910. smalltalk.method({
  1911. selector: "isZero",
  1912. fn: function (){
  1913. var self=this;
  1914. return smalltalk.withContext(function($ctx1) { var $1;
  1915. $1=_st(self).__eq((0));
  1916. return $1;
  1917. }, self, "isZero", [], smalltalk.Number)}
  1918. }),
  1919. smalltalk.Number);
  1920. smalltalk.addMethod(
  1921. "_max_",
  1922. smalltalk.method({
  1923. selector: "max:",
  1924. fn: function (aNumber){
  1925. var self=this;
  1926. return smalltalk.withContext(function($ctx1) { return Math.max(self, aNumber);;
  1927. ;
  1928. return self}, self, "max:", [aNumber], smalltalk.Number)}
  1929. }),
  1930. smalltalk.Number);
  1931. smalltalk.addMethod(
  1932. "_min_",
  1933. smalltalk.method({
  1934. selector: "min:",
  1935. fn: function (aNumber){
  1936. var self=this;
  1937. return smalltalk.withContext(function($ctx1) { return Math.min(self, aNumber);;
  1938. ;
  1939. return self}, self, "min:", [aNumber], smalltalk.Number)}
  1940. }),
  1941. smalltalk.Number);
  1942. smalltalk.addMethod(
  1943. "_negated",
  1944. smalltalk.method({
  1945. selector: "negated",
  1946. fn: function (){
  1947. var self=this;
  1948. return smalltalk.withContext(function($ctx1) { var $1;
  1949. $1=_st((0)).__minus(self);
  1950. return $1;
  1951. }, self, "negated", [], smalltalk.Number)}
  1952. }),
  1953. smalltalk.Number);
  1954. smalltalk.addMethod(
  1955. "_negative",
  1956. smalltalk.method({
  1957. selector: "negative",
  1958. fn: function (){
  1959. var self=this;
  1960. return smalltalk.withContext(function($ctx1) { var $1;
  1961. $1=_st(self).__lt((0));
  1962. return $1;
  1963. }, self, "negative", [], smalltalk.Number)}
  1964. }),
  1965. smalltalk.Number);
  1966. smalltalk.addMethod(
  1967. "_odd",
  1968. smalltalk.method({
  1969. selector: "odd",
  1970. fn: function (){
  1971. var self=this;
  1972. return smalltalk.withContext(function($ctx1) { var $1;
  1973. $1=_st(_st(self)._even())._not();
  1974. return $1;
  1975. }, self, "odd", [], smalltalk.Number)}
  1976. }),
  1977. smalltalk.Number);
  1978. smalltalk.addMethod(
  1979. "_positive",
  1980. smalltalk.method({
  1981. selector: "positive",
  1982. fn: function (){
  1983. var self=this;
  1984. return smalltalk.withContext(function($ctx1) { var $1;
  1985. $1=_st(self).__gt_eq((0));
  1986. return $1;
  1987. }, self, "positive", [], smalltalk.Number)}
  1988. }),
  1989. smalltalk.Number);
  1990. smalltalk.addMethod(
  1991. "_printShowingDecimalPlaces_",
  1992. smalltalk.method({
  1993. selector: "printShowingDecimalPlaces:",
  1994. fn: function (placesDesired){
  1995. var self=this;
  1996. return smalltalk.withContext(function($ctx1) { return self.toFixed(placesDesired);
  1997. ;
  1998. return self}, self, "printShowingDecimalPlaces:", [placesDesired], smalltalk.Number)}
  1999. }),
  2000. smalltalk.Number);
  2001. smalltalk.addMethod(
  2002. "_printString",
  2003. smalltalk.method({
  2004. selector: "printString",
  2005. fn: function (){
  2006. var self=this;
  2007. return smalltalk.withContext(function($ctx1) { return String(self);
  2008. ;
  2009. return self}, self, "printString", [], smalltalk.Number)}
  2010. }),
  2011. smalltalk.Number);
  2012. smalltalk.addMethod(
  2013. "_rounded",
  2014. smalltalk.method({
  2015. selector: "rounded",
  2016. fn: function (){
  2017. var self=this;
  2018. return smalltalk.withContext(function($ctx1) { return Math.round(self);;
  2019. ;
  2020. return self}, self, "rounded", [], smalltalk.Number)}
  2021. }),
  2022. smalltalk.Number);
  2023. smalltalk.addMethod(
  2024. "_sqrt",
  2025. smalltalk.method({
  2026. selector: "sqrt",
  2027. fn: function (){
  2028. var self=this;
  2029. return smalltalk.withContext(function($ctx1) { return Math.sqrt(self);
  2030. ;
  2031. return self}, self, "sqrt", [], smalltalk.Number)}
  2032. }),
  2033. smalltalk.Number);
  2034. smalltalk.addMethod(
  2035. "_squared",
  2036. smalltalk.method({
  2037. selector: "squared",
  2038. fn: function (){
  2039. var self=this;
  2040. return smalltalk.withContext(function($ctx1) { var $1;
  2041. $1=_st(self).__star(self);
  2042. return $1;
  2043. }, self, "squared", [], smalltalk.Number)}
  2044. }),
  2045. smalltalk.Number);
  2046. smalltalk.addMethod(
  2047. "_timesRepeat_",
  2048. smalltalk.method({
  2049. selector: "timesRepeat:",
  2050. fn: function (aBlock){
  2051. var self=this;
  2052. return smalltalk.withContext(function($ctx1) { $ctx1.integer=nil;
  2053. $ctx1.count=nil;
  2054. $ctx1.locals.integer=_st(self)._truncated();
  2055. $ctx1.locals.count=(1);
  2056. _st((function(){
  2057. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.count).__gt(self);
  2058. })}))._whileFalse_((function(){
  2059. return smalltalk.withContext(function($ctx2) { _st(aBlock)._value();
  2060. $ctx1.locals.count=_st($ctx1.locals.count).__plus((1));
  2061. return $ctx1.locals.count;
  2062. })}));
  2063. return self}, self, "timesRepeat:", [aBlock], smalltalk.Number)}
  2064. }),
  2065. smalltalk.Number);
  2066. smalltalk.addMethod(
  2067. "_to_",
  2068. smalltalk.method({
  2069. selector: "to:",
  2070. fn: function (aNumber){
  2071. var self=this;
  2072. return smalltalk.withContext(function($ctx1) { $ctx1.array=nil;
  2073. $ctx1.first=nil;
  2074. $ctx1.last=nil;
  2075. $ctx1.count=nil;
  2076. $ctx1.locals.first=_st(self)._truncated();
  2077. $ctx1.locals.last=_st(_st(aNumber)._truncated()).__plus((1));
  2078. $ctx1.locals.count=(1);
  2079. $ctx1.locals.array=_st((smalltalk.Array || Array))._new();
  2080. _st(_st($ctx1.locals.last).__minus($ctx1.locals.first))._timesRepeat_((function(){
  2081. return smalltalk.withContext(function($ctx2) { _st($ctx1.locals.array)._at_put_($ctx1.locals.count,$ctx1.locals.first);
  2082. $ctx1.locals.count=_st($ctx1.locals.count).__plus((1));
  2083. $ctx1.locals.count;
  2084. $ctx1.locals.first=_st($ctx1.locals.first).__plus((1));
  2085. return $ctx1.locals.first;
  2086. })}));
  2087. return $ctx1.locals.array;
  2088. }, self, "to:", [aNumber], smalltalk.Number)}
  2089. }),
  2090. smalltalk.Number);
  2091. smalltalk.addMethod(
  2092. "_to_by_",
  2093. smalltalk.method({
  2094. selector: "to:by:",
  2095. fn: function (stop,step){
  2096. var self=this;
  2097. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2098. $ctx1.array=nil;
  2099. $ctx1.value=nil;
  2100. $ctx1.pos=nil;
  2101. $ctx1.locals.value=self;
  2102. $ctx1.locals.array=_st((smalltalk.Array || Array))._new();
  2103. $ctx1.locals.pos=(1);
  2104. $1=_st(step).__eq((0));
  2105. if(smalltalk.assert($1)){
  2106. _st(self)._error_("step must be non-zero");
  2107. };
  2108. $2=_st(step).__lt((0));
  2109. if(smalltalk.assert($2)){
  2110. _st((function(){
  2111. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.value).__gt_eq(stop);
  2112. })}))._whileTrue_((function(){
  2113. return smalltalk.withContext(function($ctx2) { _st($ctx1.locals.array)._at_put_($ctx1.locals.pos,$ctx1.locals.value);
  2114. $ctx1.locals.pos=_st($ctx1.locals.pos).__plus((1));
  2115. $ctx1.locals.pos;
  2116. $ctx1.locals.value=_st($ctx1.locals.value).__plus(step);
  2117. return $ctx1.locals.value;
  2118. })}));
  2119. } else {
  2120. _st((function(){
  2121. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.value).__lt_eq(stop);
  2122. })}))._whileTrue_((function(){
  2123. return smalltalk.withContext(function($ctx2) { _st($ctx1.locals.array)._at_put_($ctx1.locals.pos,$ctx1.locals.value);
  2124. $ctx1.locals.pos=_st($ctx1.locals.pos).__plus((1));
  2125. $ctx1.locals.pos;
  2126. $ctx1.locals.value=_st($ctx1.locals.value).__plus(step);
  2127. return $ctx1.locals.value;
  2128. })}));
  2129. };
  2130. return $ctx1.locals.array;
  2131. }, self, "to:by:", [stop,step], smalltalk.Number)}
  2132. }),
  2133. smalltalk.Number);
  2134. smalltalk.addMethod(
  2135. "_to_by_do_",
  2136. smalltalk.method({
  2137. selector: "to:by:do:",
  2138. fn: function (stop,step,aBlock){
  2139. var self=this;
  2140. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2141. $ctx1.value=nil;
  2142. $ctx1.locals.value=self;
  2143. $1=_st(step).__eq((0));
  2144. if(smalltalk.assert($1)){
  2145. _st(self)._error_("step must be non-zero");
  2146. };
  2147. $2=_st(step).__lt((0));
  2148. if(smalltalk.assert($2)){
  2149. _st((function(){
  2150. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.value).__gt_eq(stop);
  2151. })}))._whileTrue_((function(){
  2152. return smalltalk.withContext(function($ctx2) { _st(aBlock)._value_($ctx1.locals.value);
  2153. $ctx1.locals.value=_st($ctx1.locals.value).__plus(step);
  2154. return $ctx1.locals.value;
  2155. })}));
  2156. } else {
  2157. _st((function(){
  2158. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.value).__lt_eq(stop);
  2159. })}))._whileTrue_((function(){
  2160. return smalltalk.withContext(function($ctx2) { _st(aBlock)._value_($ctx1.locals.value);
  2161. $ctx1.locals.value=_st($ctx1.locals.value).__plus(step);
  2162. return $ctx1.locals.value;
  2163. })}));
  2164. };
  2165. return self}, self, "to:by:do:", [stop,step,aBlock], smalltalk.Number)}
  2166. }),
  2167. smalltalk.Number);
  2168. smalltalk.addMethod(
  2169. "_to_do_",
  2170. smalltalk.method({
  2171. selector: "to:do:",
  2172. fn: function (stop,aBlock){
  2173. var self=this;
  2174. return smalltalk.withContext(function($ctx1) { $ctx1.nextValue=nil;
  2175. $ctx1.locals.nextValue=self;
  2176. _st((function(){
  2177. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.nextValue).__lt_eq(stop);
  2178. })}))._whileTrue_((function(){
  2179. return smalltalk.withContext(function($ctx2) { _st(aBlock)._value_($ctx1.locals.nextValue);
  2180. $ctx1.locals.nextValue=_st($ctx1.locals.nextValue).__plus((1));
  2181. return $ctx1.locals.nextValue;
  2182. })}));
  2183. return self}, self, "to:do:", [stop,aBlock], smalltalk.Number)}
  2184. }),
  2185. smalltalk.Number);
  2186. smalltalk.addMethod(
  2187. "_truncated",
  2188. smalltalk.method({
  2189. selector: "truncated",
  2190. fn: function (){
  2191. var self=this;
  2192. return smalltalk.withContext(function($ctx1) {
  2193. if(self >= 0) {
  2194. return Math.floor(self);
  2195. } else {
  2196. return Math.floor(self * (-1)) * (-1);
  2197. };
  2198. ;
  2199. ;
  2200. return self}, self, "truncated", [], smalltalk.Number)}
  2201. }),
  2202. smalltalk.Number);
  2203. smalltalk.addMethod(
  2204. "__or",
  2205. smalltalk.method({
  2206. selector: "|",
  2207. fn: function (aNumber){
  2208. var self=this;
  2209. return smalltalk.withContext(function($ctx1) { return self | aNumber;
  2210. ;
  2211. return self}, self, "|", [aNumber], smalltalk.Number)}
  2212. }),
  2213. smalltalk.Number);
  2214. smalltalk.addMethod(
  2215. "_pi",
  2216. smalltalk.method({
  2217. selector: "pi",
  2218. fn: function (){
  2219. var self=this;
  2220. return smalltalk.withContext(function($ctx1) { return Math.PI;
  2221. ;
  2222. return self}, self, "pi", [], smalltalk.Number.klass)}
  2223. }),
  2224. smalltalk.Number.klass);
  2225. smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Objects');
  2226. smalltalk.addMethod(
  2227. "_addElement_",
  2228. smalltalk.method({
  2229. selector: "addElement:",
  2230. fn: function (anObject){
  2231. var self=this;
  2232. return smalltalk.withContext(function($ctx1) { self.elements.addElement(anObject);
  2233. ;
  2234. return self}, self, "addElement:", [anObject], smalltalk.Organizer)}
  2235. }),
  2236. smalltalk.Organizer);
  2237. smalltalk.addMethod(
  2238. "_elements",
  2239. smalltalk.method({
  2240. selector: "elements",
  2241. fn: function (){
  2242. var self=this;
  2243. return smalltalk.withContext(function($ctx1) { var $1;
  2244. $1=_st(_st(self)._basicAt_("elements"))._copy();
  2245. return $1;
  2246. }, self, "elements", [], smalltalk.Organizer)}
  2247. }),
  2248. smalltalk.Organizer);
  2249. smalltalk.addMethod(
  2250. "_removeElement_",
  2251. smalltalk.method({
  2252. selector: "removeElement:",
  2253. fn: function (anObject){
  2254. var self=this;
  2255. return smalltalk.withContext(function($ctx1) { self.elements.removeElement(anObject);
  2256. ;
  2257. return self}, self, "removeElement:", [anObject], smalltalk.Organizer)}
  2258. }),
  2259. smalltalk.Organizer);
  2260. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  2261. smalltalk.addMethod(
  2262. "_classes",
  2263. smalltalk.method({
  2264. selector: "classes",
  2265. fn: function (){
  2266. var self=this;
  2267. return smalltalk.withContext(function($ctx1) { var $1;
  2268. $1=_st(_st(self)._organization())._elements();
  2269. return $1;
  2270. }, self, "classes", [], smalltalk.Package)}
  2271. }),
  2272. smalltalk.Package);
  2273. smalltalk.addMethod(
  2274. "_commitPathJs",
  2275. smalltalk.method({
  2276. selector: "commitPathJs",
  2277. fn: function (){
  2278. var self=this;
  2279. return smalltalk.withContext(function($ctx1) { var $1;
  2280. if(($receiver = self["@commitPathJs"]) == nil || $receiver == undefined){
  2281. $1=_st(_st(self)._class())._defaultCommitPathJs();
  2282. } else {
  2283. $1=self["@commitPathJs"];
  2284. };
  2285. return $1;
  2286. }, self, "commitPathJs", [], smalltalk.Package)}
  2287. }),
  2288. smalltalk.Package);
  2289. smalltalk.addMethod(
  2290. "_commitPathJs_",
  2291. smalltalk.method({
  2292. selector: "commitPathJs:",
  2293. fn: function (aString){
  2294. var self=this;
  2295. return smalltalk.withContext(function($ctx1) { self["@commitPathJs"]=aString;
  2296. return self}, self, "commitPathJs:", [aString], smalltalk.Package)}
  2297. }),
  2298. smalltalk.Package);
  2299. smalltalk.addMethod(
  2300. "_commitPathSt",
  2301. smalltalk.method({
  2302. selector: "commitPathSt",
  2303. fn: function (){
  2304. var self=this;
  2305. return smalltalk.withContext(function($ctx1) { var $1;
  2306. if(($receiver = self["@commitPathSt"]) == nil || $receiver == undefined){
  2307. $1=_st(_st(self)._class())._defaultCommitPathSt();
  2308. } else {
  2309. $1=self["@commitPathSt"];
  2310. };
  2311. return $1;
  2312. }, self, "commitPathSt", [], smalltalk.Package)}
  2313. }),
  2314. smalltalk.Package);
  2315. smalltalk.addMethod(
  2316. "_commitPathSt_",
  2317. smalltalk.method({
  2318. selector: "commitPathSt:",
  2319. fn: function (aString){
  2320. var self=this;
  2321. return smalltalk.withContext(function($ctx1) { self["@commitPathSt"]=aString;
  2322. return self}, self, "commitPathSt:", [aString], smalltalk.Package)}
  2323. }),
  2324. smalltalk.Package);
  2325. smalltalk.addMethod(
  2326. "_dependencies",
  2327. smalltalk.method({
  2328. selector: "dependencies",
  2329. fn: function (){
  2330. var self=this;
  2331. return smalltalk.withContext(function($ctx1) { var $1;
  2332. $1=_st(self)._propertyAt_ifAbsent_("dependencies",(function(){
  2333. return smalltalk.withContext(function($ctx2) { return [];
  2334. })}));
  2335. return $1;
  2336. }, self, "dependencies", [], smalltalk.Package)}
  2337. }),
  2338. smalltalk.Package);
  2339. smalltalk.addMethod(
  2340. "_dependencies_",
  2341. smalltalk.method({
  2342. selector: "dependencies:",
  2343. fn: function (anArray){
  2344. var self=this;
  2345. return smalltalk.withContext(function($ctx1) { var $1;
  2346. $1=_st(self)._propertyAt_put_("dependencies",anArray);
  2347. return $1;
  2348. }, self, "dependencies:", [anArray], smalltalk.Package)}
  2349. }),
  2350. smalltalk.Package);
  2351. smalltalk.addMethod(
  2352. "_jsProperties",
  2353. smalltalk.method({
  2354. selector: "jsProperties",
  2355. fn: function (){
  2356. var self=this;
  2357. return smalltalk.withContext(function($ctx1) { return self.properties;
  2358. ;
  2359. return self}, self, "jsProperties", [], smalltalk.Package)}
  2360. }),
  2361. smalltalk.Package);
  2362. smalltalk.addMethod(
  2363. "_jsProperties_",
  2364. smalltalk.method({
  2365. selector: "jsProperties:",
  2366. fn: function (aJSObject){
  2367. var self=this;
  2368. return smalltalk.withContext(function($ctx1) { return self.properties = aJSObject;
  2369. ;
  2370. return self}, self, "jsProperties:", [aJSObject], smalltalk.Package)}
  2371. }),
  2372. smalltalk.Package);
  2373. smalltalk.addMethod(
  2374. "_name",
  2375. smalltalk.method({
  2376. selector: "name",
  2377. fn: function (){
  2378. var self=this;
  2379. return smalltalk.withContext(function($ctx1) { return self.pkgName;
  2380. ;
  2381. return self}, self, "name", [], smalltalk.Package)}
  2382. }),
  2383. smalltalk.Package);
  2384. smalltalk.addMethod(
  2385. "_name_",
  2386. smalltalk.method({
  2387. selector: "name:",
  2388. fn: function (aString){
  2389. var self=this;
  2390. return smalltalk.withContext(function($ctx1) { self.pkgName = aString;
  2391. ;
  2392. return self}, self, "name:", [aString], smalltalk.Package)}
  2393. }),
  2394. smalltalk.Package);
  2395. smalltalk.addMethod(
  2396. "_organization",
  2397. smalltalk.method({
  2398. selector: "organization",
  2399. fn: function (){
  2400. var self=this;
  2401. return smalltalk.withContext(function($ctx1) { var $1;
  2402. $1=_st(self)._basicAt_("organization");
  2403. return $1;
  2404. }, self, "organization", [], smalltalk.Package)}
  2405. }),
  2406. smalltalk.Package);
  2407. smalltalk.addMethod(
  2408. "_printString",
  2409. smalltalk.method({
  2410. selector: "printString",
  2411. fn: function (){
  2412. var self=this;
  2413. return smalltalk.withContext(function($ctx1) { var $1;
  2414. $1=_st(self)._name();
  2415. return $1;
  2416. }, self, "printString", [], smalltalk.Package)}
  2417. }),
  2418. smalltalk.Package);
  2419. smalltalk.addMethod(
  2420. "_properties",
  2421. smalltalk.method({
  2422. selector: "properties",
  2423. fn: function (){
  2424. var self=this;
  2425. return smalltalk.withContext(function($ctx1) { var $1;
  2426. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._readJSObject_(_st(self)._basicAt_("properties"));
  2427. return $1;
  2428. }, self, "properties", [], smalltalk.Package)}
  2429. }),
  2430. smalltalk.Package);
  2431. smalltalk.addMethod(
  2432. "_propertiesAsJSON",
  2433. smalltalk.method({
  2434. selector: "propertiesAsJSON",
  2435. fn: function (){
  2436. var self=this;
  2437. return smalltalk.withContext(function($ctx1) { return JSON.stringify(self.properties);
  2438. ;
  2439. return self}, self, "propertiesAsJSON", [], smalltalk.Package)}
  2440. }),
  2441. smalltalk.Package);
  2442. smalltalk.addMethod(
  2443. "_propertyAt_",
  2444. smalltalk.method({
  2445. selector: "propertyAt:",
  2446. fn: function (key){
  2447. var self=this;
  2448. return smalltalk.withContext(function($ctx1) { return self.properties[key];
  2449. ;
  2450. return self}, self, "propertyAt:", [key], smalltalk.Package)}
  2451. }),
  2452. smalltalk.Package);
  2453. smalltalk.addMethod(
  2454. "_propertyAt_ifAbsent_",
  2455. smalltalk.method({
  2456. selector: "propertyAt:ifAbsent:",
  2457. fn: function (key,block){
  2458. var self=this;
  2459. return smalltalk.withContext(function($ctx1) { var $2,$1;
  2460. $2=_st(self)._propertyAt_(key);
  2461. if(($receiver = $2) == nil || $receiver == undefined){
  2462. $1=_st(block)._value();
  2463. } else {
  2464. $1=$2;
  2465. };
  2466. return $1;
  2467. }, self, "propertyAt:ifAbsent:", [key,block], smalltalk.Package)}
  2468. }),
  2469. smalltalk.Package);
  2470. smalltalk.addMethod(
  2471. "_propertyAt_put_",
  2472. smalltalk.method({
  2473. selector: "propertyAt:put:",
  2474. fn: function (key,value){
  2475. var self=this;
  2476. return smalltalk.withContext(function($ctx1) { return self.properties[key] = value;
  2477. ;
  2478. return self}, self, "propertyAt:put:", [key,value], smalltalk.Package)}
  2479. }),
  2480. smalltalk.Package);
  2481. smalltalk.addMethod(
  2482. "_sortedClasses",
  2483. smalltalk.method({
  2484. selector: "sortedClasses",
  2485. fn: function (){
  2486. var self=this;
  2487. return smalltalk.withContext(function($ctx1) { var $1;
  2488. $1=_st(_st(self)._class())._sortedClasses_(_st(self)._classes());
  2489. return $1;
  2490. }, self, "sortedClasses", [], smalltalk.Package)}
  2491. }),
  2492. smalltalk.Package);
  2493. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  2494. smalltalk.addMethod(
  2495. "_commitToLocalStorage_",
  2496. smalltalk.method({
  2497. selector: "commitToLocalStorage:",
  2498. fn: function (aPackageName){
  2499. var self=this;
  2500. return smalltalk.withContext(function($ctx1) { $ctx1.key=nil;
  2501. $ctx1.sourceCode=nil;
  2502. $ctx1.locals.key=_st("smalltalk.packages.").__comma(aPackageName);
  2503. $ctx1.locals.sourceCode=_st(_st((smalltalk.Exporter || Exporter))._new())._exportPackage_(aPackageName);
  2504. localStorage[key] = escape(sourceCode);
  2505. ;
  2506. return self}, self, "commitToLocalStorage:", [aPackageName], smalltalk.Package.klass)}
  2507. }),
  2508. smalltalk.Package.klass);
  2509. smalltalk.addMethod(
  2510. "_defaultCommitPathJs",
  2511. smalltalk.method({
  2512. selector: "defaultCommitPathJs",
  2513. fn: function (){
  2514. var self=this;
  2515. return smalltalk.withContext(function($ctx1) { var $1;
  2516. if(($receiver = self["@defaultCommitPathJs"]) == nil || $receiver == undefined){
  2517. self["@defaultCommitPathJs"]="js";
  2518. $1=self["@defaultCommitPathJs"];
  2519. } else {
  2520. $1=self["@defaultCommitPathJs"];
  2521. };
  2522. return $1;
  2523. }, self, "defaultCommitPathJs", [], smalltalk.Package.klass)}
  2524. }),
  2525. smalltalk.Package.klass);
  2526. smalltalk.addMethod(
  2527. "_defaultCommitPathJs_",
  2528. smalltalk.method({
  2529. selector: "defaultCommitPathJs:",
  2530. fn: function (aString){
  2531. var self=this;
  2532. return smalltalk.withContext(function($ctx1) { self["@defaultCommitPathJs"]=aString;
  2533. return self}, self, "defaultCommitPathJs:", [aString], smalltalk.Package.klass)}
  2534. }),
  2535. smalltalk.Package.klass);
  2536. smalltalk.addMethod(
  2537. "_defaultCommitPathSt",
  2538. smalltalk.method({
  2539. selector: "defaultCommitPathSt",
  2540. fn: function (){
  2541. var self=this;
  2542. return smalltalk.withContext(function($ctx1) { var $1;
  2543. if(($receiver = self["@defaultCommitPathSt"]) == nil || $receiver == undefined){
  2544. self["@defaultCommitPathSt"]="st";
  2545. $1=self["@defaultCommitPathSt"];
  2546. } else {
  2547. $1=self["@defaultCommitPathSt"];
  2548. };
  2549. return $1;
  2550. }, self, "defaultCommitPathSt", [], smalltalk.Package.klass)}
  2551. }),
  2552. smalltalk.Package.klass);
  2553. smalltalk.addMethod(
  2554. "_defaultCommitPathSt_",
  2555. smalltalk.method({
  2556. selector: "defaultCommitPathSt:",
  2557. fn: function (aString){
  2558. var self=this;
  2559. return smalltalk.withContext(function($ctx1) { self["@defaultCommitPathSt"]=aString;
  2560. return self}, self, "defaultCommitPathSt:", [aString], smalltalk.Package.klass)}
  2561. }),
  2562. smalltalk.Package.klass);
  2563. smalltalk.addMethod(
  2564. "_fetch_",
  2565. smalltalk.method({
  2566. selector: "fetch:",
  2567. fn: function (aPackageName){
  2568. var self=this;
  2569. return smalltalk.withContext(function($ctx1) { _st(self)._fetch_prefix_(aPackageName,_st(_st(self)._defaultCommitPathJs()).__comma("/"));
  2570. return self}, self, "fetch:", [aPackageName], smalltalk.Package.klass)}
  2571. }),
  2572. smalltalk.Package.klass);
  2573. smalltalk.addMethod(
  2574. "_fetch_prefix_",
  2575. smalltalk.method({
  2576. selector: "fetch:prefix:",
  2577. fn: function (aPackageName,aPrefix){
  2578. var self=this;
  2579. return smalltalk.withContext(function($ctx1) { _st(jQuery)._getScript_onSuccess_(_st(_st(aPrefix).__comma(aPackageName)).__comma(".js"),(function(){
  2580. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.Package || Package))._init_(aPackageName);
  2581. })}));
  2582. return self}, self, "fetch:prefix:", [aPackageName,aPrefix], smalltalk.Package.klass)}
  2583. }),
  2584. smalltalk.Package.klass);
  2585. smalltalk.addMethod(
  2586. "_init_",
  2587. smalltalk.method({
  2588. selector: "init:",
  2589. fn: function (aPackageName){
  2590. var self=this;
  2591. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2592. $1=_st(_st(smalltalk)._classes())._select_((function(each){
  2593. return smalltalk.withContext(function($ctx2) { return each.pkg.pkgName == aPackageName;
  2594. ;
  2595. })}));
  2596. _st($1)._do_((function(each){
  2597. return smalltalk.withContext(function($ctx2) { return smalltalk.init(each);
  2598. ;
  2599. })}));
  2600. $2=_st($1)._do_((function(each){
  2601. return smalltalk.withContext(function($ctx2) { return _st(each)._initialize();
  2602. })}));
  2603. return self}, self, "init:", [aPackageName], smalltalk.Package.klass)}
  2604. }),
  2605. smalltalk.Package.klass);
  2606. smalltalk.addMethod(
  2607. "_named_",
  2608. smalltalk.method({
  2609. selector: "named:",
  2610. fn: function (aPackageName){
  2611. var self=this;
  2612. return smalltalk.withContext(function($ctx1) { var $1;
  2613. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_(aPackageName);
  2614. return $1;
  2615. }, self, "named:", [aPackageName], smalltalk.Package.klass)}
  2616. }),
  2617. smalltalk.Package.klass);
  2618. smalltalk.addMethod(
  2619. "_named_ifAbsent_",
  2620. smalltalk.method({
  2621. selector: "named:ifAbsent:",
  2622. fn: function (aPackageName,aBlock){
  2623. var self=this;
  2624. return smalltalk.withContext(function($ctx1) { var $1;
  2625. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_ifAbsent_(aPackageName,aBlock);
  2626. return $1;
  2627. }, self, "named:ifAbsent:", [aPackageName,aBlock], smalltalk.Package.klass)}
  2628. }),
  2629. smalltalk.Package.klass);
  2630. smalltalk.addMethod(
  2631. "_resetCommitPaths",
  2632. smalltalk.method({
  2633. selector: "resetCommitPaths",
  2634. fn: function (){
  2635. var self=this;
  2636. return smalltalk.withContext(function($ctx1) { self["@defaultCommitPathJs"]=nil;
  2637. self["@defaultCommitPathSt"]=nil;
  2638. return self}, self, "resetCommitPaths", [], smalltalk.Package.klass)}
  2639. }),
  2640. smalltalk.Package.klass);
  2641. smalltalk.addMethod(
  2642. "_sortedClasses_",
  2643. smalltalk.method({
  2644. selector: "sortedClasses:",
  2645. fn: function (classes){
  2646. var self=this;
  2647. return smalltalk.withContext(function($ctx1) { var $1;
  2648. $ctx1.children=nil;
  2649. $ctx1.others=nil;
  2650. $ctx1.nodes=nil;
  2651. $ctx1.expandedClasses=nil;
  2652. $ctx1.locals.children=[];
  2653. $ctx1.locals.others=[];
  2654. _st(classes)._do_((function(each){
  2655. return smalltalk.withContext(function($ctx2) { $1=_st(classes)._includes_(_st(each)._superclass());
  2656. if(smalltalk.assert($1)){
  2657. return _st($ctx1.locals.others)._add_(each);
  2658. } else {
  2659. return _st($ctx1.locals.children)._add_(each);
  2660. };
  2661. })}));
  2662. $ctx1.locals.nodes=_st($ctx1.locals.children)._collect_((function(each){
  2663. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.ClassSorterNode || ClassSorterNode))._on_classes_level_(each,$ctx1.locals.others,(0));
  2664. })}));
  2665. $ctx1.locals.nodes=_st($ctx1.locals.nodes)._sorted_((function(a,b){
  2666. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  2667. })}));
  2668. $ctx1.locals.expandedClasses=_st((smalltalk.Array || Array))._new();
  2669. _st($ctx1.locals.nodes)._do_((function(aNode){
  2670. return smalltalk.withContext(function($ctx2) { return _st(aNode)._traverseClassesWith_($ctx1.locals.expandedClasses);
  2671. })}));
  2672. return $ctx1.locals.expandedClasses;
  2673. }, self, "sortedClasses:", [classes], smalltalk.Package.klass)}
  2674. }),
  2675. smalltalk.Package.klass);
  2676. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  2677. smalltalk.addMethod(
  2678. "__star",
  2679. smalltalk.method({
  2680. selector: "*",
  2681. fn: function (aPoint){
  2682. var self=this;
  2683. return smalltalk.withContext(function($ctx1) { var $1;
  2684. $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()));
  2685. return $1;
  2686. }, self, "*", [aPoint], smalltalk.Point)}
  2687. }),
  2688. smalltalk.Point);
  2689. smalltalk.addMethod(
  2690. "__plus",
  2691. smalltalk.method({
  2692. selector: "+",
  2693. fn: function (aPoint){
  2694. var self=this;
  2695. return smalltalk.withContext(function($ctx1) { var $1;
  2696. $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()));
  2697. return $1;
  2698. }, self, "+", [aPoint], smalltalk.Point)}
  2699. }),
  2700. smalltalk.Point);
  2701. smalltalk.addMethod(
  2702. "__minus",
  2703. smalltalk.method({
  2704. selector: "-",
  2705. fn: function (aPoint){
  2706. var self=this;
  2707. return smalltalk.withContext(function($ctx1) { var $1;
  2708. $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()));
  2709. return $1;
  2710. }, self, "-", [aPoint], smalltalk.Point)}
  2711. }),
  2712. smalltalk.Point);
  2713. smalltalk.addMethod(
  2714. "__slash",
  2715. smalltalk.method({
  2716. selector: "/",
  2717. fn: function (aPoint){
  2718. var self=this;
  2719. return smalltalk.withContext(function($ctx1) { var $1;
  2720. $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()));
  2721. return $1;
  2722. }, self, "/", [aPoint], smalltalk.Point)}
  2723. }),
  2724. smalltalk.Point);
  2725. smalltalk.addMethod(
  2726. "__eq",
  2727. smalltalk.method({
  2728. selector: "=",
  2729. fn: function (aPoint){
  2730. var self=this;
  2731. return smalltalk.withContext(function($ctx1) { var $1;
  2732. $1=_st(_st(_st(aPoint)._class()).__eq(_st(self)._class()))._and_((function(){
  2733. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(aPoint)._x()).__eq(_st(self)._x())).__and(_st(_st(aPoint)._y()).__eq(_st(self)._y()));
  2734. })}));
  2735. return $1;
  2736. }, self, "=", [aPoint], smalltalk.Point)}
  2737. }),
  2738. smalltalk.Point);
  2739. smalltalk.addMethod(
  2740. "_asPoint",
  2741. smalltalk.method({
  2742. selector: "asPoint",
  2743. fn: function (){
  2744. var self=this;
  2745. return smalltalk.withContext(function($ctx1) { return self;
  2746. }, self, "asPoint", [], smalltalk.Point)}
  2747. }),
  2748. smalltalk.Point);
  2749. smalltalk.addMethod(
  2750. "_printString",
  2751. smalltalk.method({
  2752. selector: "printString",
  2753. fn: function (){
  2754. var self=this;
  2755. return smalltalk.withContext(function($ctx1) { var $2,$1;
  2756. $1=_st((smalltalk.String || String))._streamContents_((function(stream){
  2757. return smalltalk.withContext(function($ctx2) { _st(stream)._nextPutAll_(_st(_st(self["@x"])._printString()).__comma("@"));
  2758. $2=_st(_st(self["@y"])._notNil())._and_((function(){
  2759. return smalltalk.withContext(function($ctx3) { return _st(self["@y"])._negative();
  2760. })}));
  2761. if(smalltalk.assert($2)){
  2762. _st(stream)._space();
  2763. };
  2764. return _st(stream)._nextPutAll_(_st(self["@y"])._printString());
  2765. })}));
  2766. return $1;
  2767. }, self, "printString", [], smalltalk.Point)}
  2768. }),
  2769. smalltalk.Point);
  2770. smalltalk.addMethod(
  2771. "_translateBy_",
  2772. smalltalk.method({
  2773. selector: "translateBy:",
  2774. fn: function (delta){
  2775. var self=this;
  2776. return smalltalk.withContext(function($ctx1) { var $1;
  2777. $1=_st(_st(_st(delta)._x()).__plus(self["@x"])).__at(_st(_st(delta)._y()).__plus(self["@y"]));
  2778. return $1;
  2779. }, self, "translateBy:", [delta], smalltalk.Point)}
  2780. }),
  2781. smalltalk.Point);
  2782. smalltalk.addMethod(
  2783. "_x",
  2784. smalltalk.method({
  2785. selector: "x",
  2786. fn: function (){
  2787. var self=this;
  2788. return smalltalk.withContext(function($ctx1) { return self["@x"];
  2789. }, self, "x", [], smalltalk.Point)}
  2790. }),
  2791. smalltalk.Point);
  2792. smalltalk.addMethod(
  2793. "_x_",
  2794. smalltalk.method({
  2795. selector: "x:",
  2796. fn: function (aNumber){
  2797. var self=this;
  2798. return smalltalk.withContext(function($ctx1) { self["@x"]=aNumber;
  2799. return self}, self, "x:", [aNumber], smalltalk.Point)}
  2800. }),
  2801. smalltalk.Point);
  2802. smalltalk.addMethod(
  2803. "_y",
  2804. smalltalk.method({
  2805. selector: "y",
  2806. fn: function (){
  2807. var self=this;
  2808. return smalltalk.withContext(function($ctx1) { return self["@y"];
  2809. }, self, "y", [], smalltalk.Point)}
  2810. }),
  2811. smalltalk.Point);
  2812. smalltalk.addMethod(
  2813. "_y_",
  2814. smalltalk.method({
  2815. selector: "y:",
  2816. fn: function (aNumber){
  2817. var self=this;
  2818. return smalltalk.withContext(function($ctx1) { self["@y"]=aNumber;
  2819. return self}, self, "y:", [aNumber], smalltalk.Point)}
  2820. }),
  2821. smalltalk.Point);
  2822. smalltalk.addMethod(
  2823. "_x_y_",
  2824. smalltalk.method({
  2825. selector: "x:y:",
  2826. fn: function (aNumber,anotherNumber){
  2827. var self=this;
  2828. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  2829. $2=_st(self)._new();
  2830. _st($2)._x_(aNumber);
  2831. _st($2)._y_(anotherNumber);
  2832. $3=_st($2)._yourself();
  2833. $1=$3;
  2834. return $1;
  2835. }, self, "x:y:", [aNumber,anotherNumber], smalltalk.Point.klass)}
  2836. }),
  2837. smalltalk.Point.klass);
  2838. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  2839. smalltalk.addMethod(
  2840. "_next",
  2841. smalltalk.method({
  2842. selector: "next",
  2843. fn: function (){
  2844. var self=this;
  2845. return smalltalk.withContext(function($ctx1) { return Math.random();
  2846. ;
  2847. return self}, self, "next", [], smalltalk.Random)}
  2848. }),
  2849. smalltalk.Random);
  2850. smalltalk.addMethod(
  2851. "_next_",
  2852. smalltalk.method({
  2853. selector: "next:",
  2854. fn: function (anInteger){
  2855. var self=this;
  2856. return smalltalk.withContext(function($ctx1) { var $1;
  2857. $1=_st(_st((1))._to_(anInteger))._collect_((function(each){
  2858. return smalltalk.withContext(function($ctx2) { return _st(self)._next();
  2859. })}));
  2860. return $1;
  2861. }, self, "next:", [anInteger], smalltalk.Random)}
  2862. }),
  2863. smalltalk.Random);
  2864. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  2865. smalltalk.addMethod(
  2866. "_at_",
  2867. smalltalk.method({
  2868. selector: "at:",
  2869. fn: function (aSymbol){
  2870. var self=this;
  2871. return smalltalk.withContext(function($ctx1) { return self[aSymbol._asString()];
  2872. ;
  2873. return self}, self, "at:", [aSymbol], smalltalk.Smalltalk)}
  2874. }),
  2875. smalltalk.Smalltalk);
  2876. smalltalk.addMethod(
  2877. "_basicParse_",
  2878. smalltalk.method({
  2879. selector: "basicParse:",
  2880. fn: function (aString){
  2881. var self=this;
  2882. return smalltalk.withContext(function($ctx1) { return smalltalk.parser.parse(aString);
  2883. ;
  2884. return self}, self, "basicParse:", [aString], smalltalk.Smalltalk)}
  2885. }),
  2886. smalltalk.Smalltalk);
  2887. smalltalk.addMethod(
  2888. "_classes",
  2889. smalltalk.method({
  2890. selector: "classes",
  2891. fn: function (){
  2892. var self=this;
  2893. return smalltalk.withContext(function($ctx1) { return self.classes();
  2894. ;
  2895. return self}, self, "classes", [], smalltalk.Smalltalk)}
  2896. }),
  2897. smalltalk.Smalltalk);
  2898. smalltalk.addMethod(
  2899. "_createPackage_",
  2900. smalltalk.method({
  2901. selector: "createPackage:",
  2902. fn: function (packageName){
  2903. var self=this;
  2904. return smalltalk.withContext(function($ctx1) { return smalltalk.addPackage(packageName);
  2905. ;
  2906. return self}, self, "createPackage:", [packageName], smalltalk.Smalltalk)}
  2907. }),
  2908. smalltalk.Smalltalk);
  2909. smalltalk.addMethod(
  2910. "_deleteClass_",
  2911. smalltalk.method({
  2912. selector: "deleteClass:",
  2913. fn: function (aClass){
  2914. var self=this;
  2915. return smalltalk.withContext(function($ctx1) { self.removeClass(aClass);
  2916. ;
  2917. return self}, self, "deleteClass:", [aClass], smalltalk.Smalltalk)}
  2918. }),
  2919. smalltalk.Smalltalk);
  2920. smalltalk.addMethod(
  2921. "_deletePackage_",
  2922. smalltalk.method({
  2923. selector: "deletePackage:",
  2924. fn: function (packageName){
  2925. var self=this;
  2926. return smalltalk.withContext(function($ctx1) { delete smalltalk.packages[packageName];
  2927. ;
  2928. return self}, self, "deletePackage:", [packageName], smalltalk.Smalltalk)}
  2929. }),
  2930. smalltalk.Smalltalk);
  2931. smalltalk.addMethod(
  2932. "_packageAt_",
  2933. smalltalk.method({
  2934. selector: "packageAt:",
  2935. fn: function (packageName){
  2936. var self=this;
  2937. return smalltalk.withContext(function($ctx1) { return self.packages[packageName];
  2938. ;
  2939. return self}, self, "packageAt:", [packageName], smalltalk.Smalltalk)}
  2940. }),
  2941. smalltalk.Smalltalk);
  2942. smalltalk.addMethod(
  2943. "_packageAt_ifAbsent_",
  2944. smalltalk.method({
  2945. selector: "packageAt:ifAbsent:",
  2946. fn: function (packageName,aBlock){
  2947. var self=this;
  2948. return smalltalk.withContext(function($ctx1) { var $2,$1;
  2949. $2=_st(self)._packageAt_(packageName);
  2950. $1=_st($2)._ifNil_(aBlock);
  2951. return $1;
  2952. }, self, "packageAt:ifAbsent:", [packageName,aBlock], smalltalk.Smalltalk)}
  2953. }),
  2954. smalltalk.Smalltalk);
  2955. smalltalk.addMethod(
  2956. "_packages",
  2957. smalltalk.method({
  2958. selector: "packages",
  2959. fn: function (){
  2960. var self=this;
  2961. return smalltalk.withContext(function($ctx1) { return self.packages.all();
  2962. ;
  2963. return self}, self, "packages", [], smalltalk.Smalltalk)}
  2964. }),
  2965. smalltalk.Smalltalk);
  2966. smalltalk.addMethod(
  2967. "_parse_",
  2968. smalltalk.method({
  2969. selector: "parse:",
  2970. fn: function (aString){
  2971. var self=this;
  2972. return smalltalk.withContext(function($ctx1) { $ctx1.result=nil;
  2973. _st(self)._try_catch_((function(){
  2974. return smalltalk.withContext(function($ctx2) { $ctx1.locals.result=_st(self)._basicParse_(aString);
  2975. return $ctx1.locals.result;
  2976. })}),(function(ex){
  2977. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._parseError_parsing_(ex,aString))._signal();
  2978. })}));
  2979. return $ctx1.locals.result;
  2980. }, self, "parse:", [aString], smalltalk.Smalltalk)}
  2981. }),
  2982. smalltalk.Smalltalk);
  2983. smalltalk.addMethod(
  2984. "_parseError_parsing_",
  2985. smalltalk.method({
  2986. selector: "parseError:parsing:",
  2987. fn: function (anException,aString){
  2988. var self=this;
  2989. return smalltalk.withContext(function($ctx1) { var $1;
  2990. $1=_st(_st((smalltalk.ParseError || ParseError))._new())._messageText_(_st(_st(_st(_st(_st("Parse error on line ").__comma(_st(anException)._basicAt_("line"))).__comma(" column ")).__comma(_st(anException)._basicAt_("column"))).__comma(" : Unexpected character ")).__comma(_st(anException)._basicAt_("found")));
  2991. return $1;
  2992. }, self, "parseError:parsing:", [anException,aString], smalltalk.Smalltalk)}
  2993. }),
  2994. smalltalk.Smalltalk);
  2995. smalltalk.addMethod(
  2996. "_pseudoVariableNames",
  2997. smalltalk.method({
  2998. selector: "pseudoVariableNames",
  2999. fn: function (){
  3000. var self=this;
  3001. return smalltalk.withContext(function($ctx1) { return ["self", "super", "nil", "true", "false", "thisContext"];
  3002. }, self, "pseudoVariableNames", [], smalltalk.Smalltalk)}
  3003. }),
  3004. smalltalk.Smalltalk);
  3005. smalltalk.addMethod(
  3006. "_readJSObject_",
  3007. smalltalk.method({
  3008. selector: "readJSObject:",
  3009. fn: function (anObject){
  3010. var self=this;
  3011. return smalltalk.withContext(function($ctx1) { return self.readJSObject(anObject);
  3012. ;
  3013. return self}, self, "readJSObject:", [anObject], smalltalk.Smalltalk)}
  3014. }),
  3015. smalltalk.Smalltalk);
  3016. smalltalk.addMethod(
  3017. "_removeClass_",
  3018. smalltalk.method({
  3019. selector: "removeClass:",
  3020. fn: function (aClass){
  3021. var self=this;
  3022. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  3023. $1=_st(aClass)._isMetaclass();
  3024. if(smalltalk.assert($1)){
  3025. _st(self)._error_(_st(_st(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!"));
  3026. };
  3027. _st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
  3028. return smalltalk.withContext(function($ctx2) { return _st(aClass)._removeCompiledMethod_(each);
  3029. })}));
  3030. _st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
  3031. return smalltalk.withContext(function($ctx2) { return _st(_st(aClass)._class())._removeCompiledMethod_(each);
  3032. })}));
  3033. _st(self)._deleteClass_(aClass);
  3034. $2=_st((smalltalk.ClassRemoved || ClassRemoved))._new();
  3035. _st($2)._theClass_(aClass);
  3036. $3=_st($2)._yourself();
  3037. _st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($3);
  3038. return self}, self, "removeClass:", [aClass], smalltalk.Smalltalk)}
  3039. }),
  3040. smalltalk.Smalltalk);
  3041. smalltalk.addMethod(
  3042. "_removePackage_",
  3043. smalltalk.method({
  3044. selector: "removePackage:",
  3045. fn: function (packageName){
  3046. var self=this;
  3047. return smalltalk.withContext(function($ctx1) { $ctx1.pkg=nil;
  3048. $ctx1.locals.pkg=_st(self)._packageAt_ifAbsent_(packageName,(function(){
  3049. return smalltalk.withContext(function($ctx2) { return _st(self)._error_(_st("Missing package: ").__comma(packageName));
  3050. })}));
  3051. _st(_st($ctx1.locals.pkg)._classes())._do_((function(each){
  3052. return smalltalk.withContext(function($ctx2) { return _st(self)._removeClass_(each);
  3053. })}));
  3054. _st(self)._deletePackage_(packageName);
  3055. return self}, self, "removePackage:", [packageName], smalltalk.Smalltalk)}
  3056. }),
  3057. smalltalk.Smalltalk);
  3058. smalltalk.addMethod(
  3059. "_renamePackage_to_",
  3060. smalltalk.method({
  3061. selector: "renamePackage:to:",
  3062. fn: function (packageName,newName){
  3063. var self=this;
  3064. return smalltalk.withContext(function($ctx1) { var $1;
  3065. $ctx1.pkg=nil;
  3066. $ctx1.locals.pkg=_st(self)._packageAt_ifAbsent_(packageName,(function(){
  3067. return smalltalk.withContext(function($ctx2) { return _st(self)._error_(_st("Missing package: ").__comma(packageName));
  3068. })}));
  3069. $1=_st(self)._packageAt_(newName);
  3070. if(($receiver = $1) == nil || $receiver == undefined){
  3071. $1;
  3072. } else {
  3073. _st(self)._error_(_st("Already exists a package called: ").__comma(newName));
  3074. };
  3075. smalltalk.packages[newName] = smalltalk.packages[packageName];
  3076. ;
  3077. _st($ctx1.locals.pkg)._name_(newName);
  3078. _st(self)._deletePackage_(packageName);
  3079. return self}, self, "renamePackage:to:", [packageName,newName], smalltalk.Smalltalk)}
  3080. }),
  3081. smalltalk.Smalltalk);
  3082. smalltalk.addMethod(
  3083. "_reservedWords",
  3084. smalltalk.method({
  3085. selector: "reservedWords",
  3086. fn: function (){
  3087. var self=this;
  3088. return smalltalk.withContext(function($ctx1) { return self.reservedWords;
  3089. ;
  3090. return self}, self, "reservedWords", [], smalltalk.Smalltalk)}
  3091. }),
  3092. smalltalk.Smalltalk);
  3093. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  3094. smalltalk.addMethod(
  3095. "_current",
  3096. smalltalk.method({
  3097. selector: "current",
  3098. fn: function (){
  3099. var self=this;
  3100. return smalltalk.withContext(function($ctx1) { return smalltalk;
  3101. ;
  3102. return self}, self, "current", [], smalltalk.Smalltalk.klass)}
  3103. }),
  3104. smalltalk.Smalltalk.klass);
  3105. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  3106. smalltalk.addMethod(
  3107. "_asJSON",
  3108. smalltalk.method({
  3109. selector: "asJSON",
  3110. fn: function (){
  3111. var self=this;
  3112. return smalltalk.withContext(function($ctx1) { return null;
  3113. }, self, "asJSON", [], smalltalk.UndefinedObject)}
  3114. }),
  3115. smalltalk.UndefinedObject);
  3116. smalltalk.addMethod(
  3117. "_deepCopy",
  3118. smalltalk.method({
  3119. selector: "deepCopy",
  3120. fn: function (){
  3121. var self=this;
  3122. return smalltalk.withContext(function($ctx1) { return self;
  3123. }, self, "deepCopy", [], smalltalk.UndefinedObject)}
  3124. }),
  3125. smalltalk.UndefinedObject);
  3126. smalltalk.addMethod(
  3127. "_ifNil_",
  3128. smalltalk.method({
  3129. selector: "ifNil:",
  3130. fn: function (aBlock){
  3131. var self=this;
  3132. return smalltalk.withContext(function($ctx1) { var $1;
  3133. $1=_st(self)._ifNil_ifNotNil_(aBlock,(function(){
  3134. return smalltalk.withContext(function($ctx2) { })}));
  3135. return $1;
  3136. }, self, "ifNil:", [aBlock], smalltalk.UndefinedObject)}
  3137. }),
  3138. smalltalk.UndefinedObject);
  3139. smalltalk.addMethod(
  3140. "_ifNil_ifNotNil_",
  3141. smalltalk.method({
  3142. selector: "ifNil:ifNotNil:",
  3143. fn: function (aBlock,anotherBlock){
  3144. var self=this;
  3145. return smalltalk.withContext(function($ctx1) { var $1;
  3146. $1=_st(aBlock)._value();
  3147. return $1;
  3148. }, self, "ifNil:ifNotNil:", [aBlock,anotherBlock], smalltalk.UndefinedObject)}
  3149. }),
  3150. smalltalk.UndefinedObject);
  3151. smalltalk.addMethod(
  3152. "_ifNotNil_",
  3153. smalltalk.method({
  3154. selector: "ifNotNil:",
  3155. fn: function (aBlock){
  3156. var self=this;
  3157. return smalltalk.withContext(function($ctx1) { return self;
  3158. }, self, "ifNotNil:", [aBlock], smalltalk.UndefinedObject)}
  3159. }),
  3160. smalltalk.UndefinedObject);
  3161. smalltalk.addMethod(
  3162. "_ifNotNil_ifNil_",
  3163. smalltalk.method({
  3164. selector: "ifNotNil:ifNil:",
  3165. fn: function (aBlock,anotherBlock){
  3166. var self=this;
  3167. return smalltalk.withContext(function($ctx1) { var $1;
  3168. $1=_st(anotherBlock)._value();
  3169. return $1;
  3170. }, self, "ifNotNil:ifNil:", [aBlock,anotherBlock], smalltalk.UndefinedObject)}
  3171. }),
  3172. smalltalk.UndefinedObject);
  3173. smalltalk.addMethod(
  3174. "_isNil",
  3175. smalltalk.method({
  3176. selector: "isNil",
  3177. fn: function (){
  3178. var self=this;
  3179. return smalltalk.withContext(function($ctx1) { return true;
  3180. }, self, "isNil", [], smalltalk.UndefinedObject)}
  3181. }),
  3182. smalltalk.UndefinedObject);
  3183. smalltalk.addMethod(
  3184. "_notNil",
  3185. smalltalk.method({
  3186. selector: "notNil",
  3187. fn: function (){
  3188. var self=this;
  3189. return smalltalk.withContext(function($ctx1) { return false;
  3190. }, self, "notNil", [], smalltalk.UndefinedObject)}
  3191. }),
  3192. smalltalk.UndefinedObject);
  3193. smalltalk.addMethod(
  3194. "_printString",
  3195. smalltalk.method({
  3196. selector: "printString",
  3197. fn: function (){
  3198. var self=this;
  3199. return smalltalk.withContext(function($ctx1) { return "nil";
  3200. }, self, "printString", [], smalltalk.UndefinedObject)}
  3201. }),
  3202. smalltalk.UndefinedObject);
  3203. smalltalk.addMethod(
  3204. "_shallowCopy",
  3205. smalltalk.method({
  3206. selector: "shallowCopy",
  3207. fn: function (){
  3208. var self=this;
  3209. return smalltalk.withContext(function($ctx1) { return self;
  3210. }, self, "shallowCopy", [], smalltalk.UndefinedObject)}
  3211. }),
  3212. smalltalk.UndefinedObject);
  3213. smalltalk.addMethod(
  3214. "_subclass_instanceVariableNames_",
  3215. smalltalk.method({
  3216. selector: "subclass:instanceVariableNames:",
  3217. fn: function (aString,anotherString){
  3218. var self=this;
  3219. return smalltalk.withContext(function($ctx1) { var $1;
  3220. $1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  3221. return $1;
  3222. }, self, "subclass:instanceVariableNames:", [aString,anotherString], smalltalk.UndefinedObject)}
  3223. }),
  3224. smalltalk.UndefinedObject);
  3225. smalltalk.addMethod(
  3226. "_subclass_instanceVariableNames_category_",
  3227. smalltalk.method({
  3228. selector: "subclass:instanceVariableNames:category:",
  3229. fn: function (aString,aString2,aString3){
  3230. var self=this;
  3231. return smalltalk.withContext(function($ctx1) { var $1;
  3232. _st(self)._deprecatedAPI();
  3233. $1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  3234. return $1;
  3235. }, self, "subclass:instanceVariableNames:category:", [aString,aString2,aString3], smalltalk.UndefinedObject)}
  3236. }),
  3237. smalltalk.UndefinedObject);
  3238. smalltalk.addMethod(
  3239. "_subclass_instanceVariableNames_package_",
  3240. smalltalk.method({
  3241. selector: "subclass:instanceVariableNames:package:",
  3242. fn: function (aString,aString2,aString3){
  3243. var self=this;
  3244. return smalltalk.withContext(function($ctx1) { var $1;
  3245. $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._superclass_subclass_instanceVariableNames_package_(self,aString,aString2,aString3);
  3246. return $1;
  3247. }, self, "subclass:instanceVariableNames:package:", [aString,aString2,aString3], smalltalk.UndefinedObject)}
  3248. }),
  3249. smalltalk.UndefinedObject);
  3250. smalltalk.addMethod(
  3251. "_new",
  3252. smalltalk.method({
  3253. selector: "new",
  3254. fn: function (){
  3255. var self=this;
  3256. return smalltalk.withContext(function($ctx1) { _st(self)._error_("You cannot create new instances of UndefinedObject. Use nil");
  3257. return self}, self, "new", [], smalltalk.UndefinedObject.klass)}
  3258. }),
  3259. smalltalk.UndefinedObject.klass);