1
0

Kernel-Objects.deploy.js 78 KB

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