2
0

Kernel-Objects.deploy.js 70 KB

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