1
0

Kernel-Objects.deploy.js 78 KB

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