Kernel-Objects.deploy.js 70 KB

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