Kernel-Objects.deploy.js 73 KB

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