Kernel-Objects.deploy.js 85 KB

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