Kernel-Objects.deploy.js 62 KB

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