Kernel-Objects.deploy.js 69 KB

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