1
0

Kernel-Objects.deploy.js 69 KB

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