Kernel-Objects.deploy.js 69 KB

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