Kernel-Objects.deploy.js 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591
  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 self === anObject;
  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. '_initialize',
  530. smalltalk.method({
  531. selector: 'initialize',
  532. fn: function (){
  533. var self=this;
  534. return self;}
  535. }),
  536. smalltalk.Object.klass);
  537. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  538. smalltalk.addMethod(
  539. '_classes',
  540. smalltalk.method({
  541. selector: 'classes',
  542. fn: function (){
  543. var self=this;
  544. return self.classes();
  545. return self;}
  546. }),
  547. smalltalk.Smalltalk);
  548. smalltalk.addMethod(
  549. '_at_',
  550. smalltalk.method({
  551. selector: 'at:',
  552. fn: function (aString){
  553. var self=this;
  554. return self[aString];
  555. return self;}
  556. }),
  557. smalltalk.Smalltalk);
  558. smalltalk.addMethod(
  559. '_removeClass_',
  560. smalltalk.method({
  561. selector: 'removeClass:',
  562. fn: function (aClass){
  563. var self=this;
  564. ((($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")])]);})]));
  565. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);})]);
  566. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);})]);
  567. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  568. return self;}
  569. }),
  570. smalltalk.Smalltalk);
  571. smalltalk.addMethod(
  572. '_basicParse_',
  573. smalltalk.method({
  574. selector: 'basicParse:',
  575. fn: function (aString){
  576. var self=this;
  577. return smalltalk.parser.parse(aString);
  578. return self;}
  579. }),
  580. smalltalk.Smalltalk);
  581. smalltalk.addMethod(
  582. '_parse_',
  583. smalltalk.method({
  584. selector: 'parse:',
  585. fn: function (aString){
  586. var self=this;
  587. var result=nil;
  588. 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", []);})]);
  589. return result;
  590. return self;}
  591. }),
  592. smalltalk.Smalltalk);
  593. smalltalk.addMethod(
  594. '_parseError_parsing_',
  595. smalltalk.method({
  596. selector: 'parseError:parsing:',
  597. fn: function (anException, aString){
  598. var self=this;
  599. var row=nil;
  600. var col=nil;
  601. var message=nil;
  602. var lines=nil;
  603. var badLine=nil;
  604. var code=nil;
  605. row = anException.line;
  606. col = anException.column;
  607. message = anException.message;;
  608. lines=smalltalk.send(aString, "_lines", []);
  609. badLine=smalltalk.send(lines, "_at_", [row]);
  610. 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", [])])]);
  611. smalltalk.send(lines, "_at_put_", [row, badLine]);
  612. 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", [])])]);})]);})]);
  613. 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])]);
  614. return self;}
  615. }),
  616. smalltalk.Smalltalk);
  617. smalltalk.addMethod(
  618. '_packages',
  619. smalltalk.method({
  620. selector: 'packages',
  621. fn: function (){
  622. var self=this;
  623. return self.packages.all();
  624. return self;}
  625. }),
  626. smalltalk.Smalltalk);
  627. smalltalk.addMethod(
  628. '_packageAt_',
  629. smalltalk.method({
  630. selector: 'packageAt:',
  631. fn: function (packageName){
  632. var self=this;
  633. return self.packages[packageName];
  634. return self;}
  635. }),
  636. smalltalk.Smalltalk);
  637. smalltalk.addMethod(
  638. '_packageAt_ifAbsent_',
  639. smalltalk.method({
  640. selector: 'packageAt:ifAbsent:',
  641. fn: function (packageName, aBlock){
  642. var self=this;
  643. return smalltalk.send(smalltalk.send(self, "_packageAt_", [packageName]), "_ifNil_", [aBlock]);
  644. return self;}
  645. }),
  646. smalltalk.Smalltalk);
  647. smalltalk.addMethod(
  648. '_createPackage_',
  649. smalltalk.method({
  650. selector: 'createPackage:',
  651. fn: function (packageName){
  652. var self=this;
  653. return smalltalk.addPackage(packageName, nil);
  654. return self;}
  655. }),
  656. smalltalk.Smalltalk);
  657. smalltalk.addMethod(
  658. '_deletePackage_',
  659. smalltalk.method({
  660. selector: 'deletePackage:',
  661. fn: function (packageName){
  662. var self=this;
  663. delete smalltalk.packages[packageName];
  664. return self;}
  665. }),
  666. smalltalk.Smalltalk);
  667. smalltalk.addMethod(
  668. '_removePackage_',
  669. smalltalk.method({
  670. selector: 'removePackage:',
  671. fn: function (packageName){
  672. var self=this;
  673. var pkg=nil;
  674. pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  675. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_removeClass_", [each]);})]);
  676. smalltalk.send(self, "_deletePackage_", [packageName]);
  677. return self;}
  678. }),
  679. smalltalk.Smalltalk);
  680. smalltalk.addMethod(
  681. '_renamePackage_to_',
  682. smalltalk.method({
  683. selector: 'renamePackage:to:',
  684. fn: function (packageName, newName){
  685. var self=this;
  686. var pkg=nil;
  687. pkg=smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, (function(){return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);})]);
  688. (($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;
  689. smalltalk.packages[newName] = smalltalk.packages[packageName];
  690. smalltalk.send(pkg, "_name_", [newName]);
  691. smalltalk.send(self, "_deletePackage_", [packageName]);
  692. return self;}
  693. }),
  694. smalltalk.Smalltalk);
  695. smalltalk.addMethod(
  696. '_reservedWords',
  697. smalltalk.method({
  698. selector: 'reservedWords',
  699. fn: function (){
  700. var self=this;
  701. return self.reservedWords;
  702. return self;}
  703. }),
  704. smalltalk.Smalltalk);
  705. smalltalk.addMethod(
  706. '_createPackage_properties_',
  707. smalltalk.method({
  708. selector: 'createPackage:properties:',
  709. fn: function (packageName, aDict){
  710. var self=this;
  711. var object=nil;
  712. object = {};;
  713. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  714. return smalltalk.addPackage(packageName, object);
  715. return self;}
  716. }),
  717. smalltalk.Smalltalk);
  718. smalltalk.addMethod(
  719. '_readJSObject_',
  720. smalltalk.method({
  721. selector: 'readJSObject:',
  722. fn: function (anObject){
  723. var self=this;
  724. return self.readJSObject(anObject);
  725. return self;}
  726. }),
  727. smalltalk.Smalltalk);
  728. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  729. smalltalk.addMethod(
  730. '_current',
  731. smalltalk.method({
  732. selector: 'current',
  733. fn: function (){
  734. var self=this;
  735. return smalltalk;
  736. return self;}
  737. }),
  738. smalltalk.Smalltalk.klass);
  739. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  740. smalltalk.addMethod(
  741. '_name',
  742. smalltalk.method({
  743. selector: 'name',
  744. fn: function (){
  745. var self=this;
  746. return self.pkgName;
  747. return self;}
  748. }),
  749. smalltalk.Package);
  750. smalltalk.addMethod(
  751. '_name_',
  752. smalltalk.method({
  753. selector: 'name:',
  754. fn: function (aString){
  755. var self=this;
  756. self.pkgName = aString;
  757. return self;}
  758. }),
  759. smalltalk.Package);
  760. smalltalk.addMethod(
  761. '_classes',
  762. smalltalk.method({
  763. selector: 'classes',
  764. fn: function (){
  765. var self=this;
  766. 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]);})]);
  767. return self;}
  768. }),
  769. smalltalk.Package);
  770. smalltalk.addMethod(
  771. '_printString',
  772. smalltalk.method({
  773. selector: 'printString',
  774. fn: function (){
  775. var self=this;
  776. return smalltalk.send(self, "_name", []);
  777. return self;}
  778. }),
  779. smalltalk.Package);
  780. smalltalk.addMethod(
  781. '_dependencies',
  782. smalltalk.method({
  783. selector: 'dependencies',
  784. fn: function (){
  785. var self=this;
  786. return smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", (function(){return [];})]);
  787. return self;}
  788. }),
  789. smalltalk.Package);
  790. smalltalk.addMethod(
  791. '_dependencies_',
  792. smalltalk.method({
  793. selector: 'dependencies:',
  794. fn: function (anArray){
  795. var self=this;
  796. return smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  797. return self;}
  798. }),
  799. smalltalk.Package);
  800. smalltalk.addMethod(
  801. '_properties',
  802. smalltalk.method({
  803. selector: 'properties',
  804. fn: function (){
  805. var self=this;
  806. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  807. return self;}
  808. }),
  809. smalltalk.Package);
  810. smalltalk.addMethod(
  811. '_propertiesAsJSON',
  812. smalltalk.method({
  813. selector: 'propertiesAsJSON',
  814. fn: function (){
  815. var self=this;
  816. return JSON.stringify(self.properties);
  817. return self;}
  818. }),
  819. smalltalk.Package);
  820. smalltalk.addMethod(
  821. '_properties_',
  822. smalltalk.method({
  823. selector: 'properties:',
  824. fn: function (aDict){
  825. var self=this;
  826. var object=nil;
  827. object = {};;
  828. smalltalk.send(aDict, "_keysAndValuesDo_", [(function(key, value){return object[key] = value;})]);
  829. return self.properties = object;
  830. return self;}
  831. }),
  832. smalltalk.Package);
  833. smalltalk.addMethod(
  834. '_jsProperties',
  835. smalltalk.method({
  836. selector: 'jsProperties',
  837. fn: function (){
  838. var self=this;
  839. return self.properties;
  840. return self;}
  841. }),
  842. smalltalk.Package);
  843. smalltalk.addMethod(
  844. '_jsProperties_',
  845. smalltalk.method({
  846. selector: 'jsProperties:',
  847. fn: function (aJSObject){
  848. var self=this;
  849. return self.properties = aJSObject;
  850. return self;}
  851. }),
  852. smalltalk.Package);
  853. smalltalk.addMethod(
  854. '_propertyAt_',
  855. smalltalk.method({
  856. selector: 'propertyAt:',
  857. fn: function (key){
  858. var self=this;
  859. return self.properties[key];
  860. return self;}
  861. }),
  862. smalltalk.Package);
  863. smalltalk.addMethod(
  864. '_propertyAt_put_',
  865. smalltalk.method({
  866. selector: 'propertyAt:put:',
  867. fn: function (key, value){
  868. var self=this;
  869. return self.properties[key] = value;
  870. return self;}
  871. }),
  872. smalltalk.Package);
  873. smalltalk.addMethod(
  874. '_propertyAt_ifAbsent_',
  875. smalltalk.method({
  876. selector: 'propertyAt:ifAbsent:',
  877. fn: function (key, block){
  878. var self=this;
  879. return (($receiver = smalltalk.send(self, "_propertyAt_", [key])) == nil || $receiver == undefined) ? (function(){return smalltalk.send(block, "_value", []);})() : $receiver;
  880. return self;}
  881. }),
  882. smalltalk.Package);
  883. smalltalk.addMethod(
  884. '_commitPathJs',
  885. smalltalk.method({
  886. selector: 'commitPathJs',
  887. fn: function (){
  888. var self=this;
  889. return (($receiver = self['@commitPathJs']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);})() : $receiver;
  890. return self;}
  891. }),
  892. smalltalk.Package);
  893. smalltalk.addMethod(
  894. '_commitPathJs_',
  895. smalltalk.method({
  896. selector: 'commitPathJs:',
  897. fn: function (aString){
  898. var self=this;
  899. self['@commitPathJs']=aString;
  900. return self;}
  901. }),
  902. smalltalk.Package);
  903. smalltalk.addMethod(
  904. '_commitPathSt',
  905. smalltalk.method({
  906. selector: 'commitPathSt',
  907. fn: function (){
  908. var self=this;
  909. return (($receiver = self['@commitPathSt']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);})() : $receiver;
  910. return self;}
  911. }),
  912. smalltalk.Package);
  913. smalltalk.addMethod(
  914. '_commitPathSt_',
  915. smalltalk.method({
  916. selector: 'commitPathSt:',
  917. fn: function (aString){
  918. var self=this;
  919. self['@commitPathSt']=aString;
  920. return self;}
  921. }),
  922. smalltalk.Package);
  923. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  924. smalltalk.addMethod(
  925. '_named_',
  926. smalltalk.method({
  927. selector: 'named:',
  928. fn: function (aPackageName){
  929. var self=this;
  930. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [aPackageName]);
  931. return self;}
  932. }),
  933. smalltalk.Package.klass);
  934. smalltalk.addMethod(
  935. '_named_ifAbsent_',
  936. smalltalk.method({
  937. selector: 'named:ifAbsent:',
  938. fn: function (aPackageName, aBlock){
  939. var self=this;
  940. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  941. return self;}
  942. }),
  943. smalltalk.Package.klass);
  944. smalltalk.addMethod(
  945. '_defaultCommitPathJs',
  946. smalltalk.method({
  947. selector: 'defaultCommitPathJs',
  948. fn: function (){
  949. var self=this;
  950. return (($receiver = self['@defaultCommitPathJs']) == nil || $receiver == undefined) ? (function(){return self['@defaultCommitPathJs']="js";})() : $receiver;
  951. return self;}
  952. }),
  953. smalltalk.Package.klass);
  954. smalltalk.addMethod(
  955. '_defaultCommitPathJs_',
  956. smalltalk.method({
  957. selector: 'defaultCommitPathJs:',
  958. fn: function (aString){
  959. var self=this;
  960. self['@defaultCommitPathJs']=aString;
  961. return self;}
  962. }),
  963. smalltalk.Package.klass);
  964. smalltalk.addMethod(
  965. '_defaultCommitPathSt',
  966. smalltalk.method({
  967. selector: 'defaultCommitPathSt',
  968. fn: function (){
  969. var self=this;
  970. return (($receiver = self['@defaultCommitPathSt']) == nil || $receiver == undefined) ? (function(){return self['@defaultCommitPathSt']="st";})() : $receiver;
  971. return self;}
  972. }),
  973. smalltalk.Package.klass);
  974. smalltalk.addMethod(
  975. '_defaultCommitPathSt_',
  976. smalltalk.method({
  977. selector: 'defaultCommitPathSt:',
  978. fn: function (aString){
  979. var self=this;
  980. self['@defaultCommitPathSt']=aString;
  981. return self;}
  982. }),
  983. smalltalk.Package.klass);
  984. smalltalk.addMethod(
  985. '_resetCommitPaths',
  986. smalltalk.method({
  987. selector: 'resetCommitPaths',
  988. fn: function (){
  989. var self=this;
  990. self['@defaultCommitPathJs']=nil;
  991. self['@defaultCommitPathSt']=nil;
  992. return self;}
  993. }),
  994. smalltalk.Package.klass);
  995. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  996. smalltalk.addMethod(
  997. '__eq',
  998. smalltalk.method({
  999. selector: '=',
  1000. fn: function (aNumber){
  1001. var self=this;
  1002. try{((($receiver = smalltalk.send(smalltalk.send(aNumber, "_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}})})();})]));
  1003. return Number(self) == aNumber;
  1004. return self;
  1005. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  1006. }),
  1007. smalltalk.Number);
  1008. smalltalk.addMethod(
  1009. '__gt',
  1010. smalltalk.method({
  1011. selector: '>',
  1012. fn: function (aNumber){
  1013. var self=this;
  1014. return self > aNumber;
  1015. return self;}
  1016. }),
  1017. smalltalk.Number);
  1018. smalltalk.addMethod(
  1019. '__lt',
  1020. smalltalk.method({
  1021. selector: '<',
  1022. fn: function (aNumber){
  1023. var self=this;
  1024. return self < aNumber;
  1025. return self;}
  1026. }),
  1027. smalltalk.Number);
  1028. smalltalk.addMethod(
  1029. '__gt_eq',
  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_eq',
  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. '__plus',
  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. '__minus',
  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. '__star',
  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. '__slash',
  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. '_max_',
  1090. smalltalk.method({
  1091. selector: 'max:',
  1092. fn: function (aNumber){
  1093. var self=this;
  1094. return Math.max(self, aNumber);;
  1095. return self;}
  1096. }),
  1097. smalltalk.Number);
  1098. smalltalk.addMethod(
  1099. '_min_',
  1100. smalltalk.method({
  1101. selector: 'min:',
  1102. fn: function (aNumber){
  1103. var self=this;
  1104. return Math.min(self, aNumber);;
  1105. return self;}
  1106. }),
  1107. smalltalk.Number);
  1108. smalltalk.addMethod(
  1109. '_rounded',
  1110. smalltalk.method({
  1111. selector: 'rounded',
  1112. fn: function (){
  1113. var self=this;
  1114. return Math.round(self);;
  1115. return self;}
  1116. }),
  1117. smalltalk.Number);
  1118. smalltalk.addMethod(
  1119. '_truncated',
  1120. smalltalk.method({
  1121. selector: 'truncated',
  1122. fn: function (){
  1123. var self=this;
  1124. var result=nil;
  1125. ((($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));;})]));
  1126. return result;
  1127. return self;}
  1128. }),
  1129. smalltalk.Number);
  1130. smalltalk.addMethod(
  1131. '_to_',
  1132. smalltalk.method({
  1133. selector: 'to:',
  1134. fn: function (aNumber){
  1135. var self=this;
  1136. var array=nil;
  1137. var first=nil;
  1138. var last=nil;
  1139. var count=nil;
  1140. first=smalltalk.send(self, "_truncated", []);
  1141. last=((($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
  1142. count=(1);
  1143. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1144. 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)]));})]);
  1145. return array;
  1146. return self;}
  1147. }),
  1148. smalltalk.Number);
  1149. smalltalk.addMethod(
  1150. '_timesRepeat_',
  1151. smalltalk.method({
  1152. selector: 'timesRepeat:',
  1153. fn: function (aBlock){
  1154. var self=this;
  1155. var integer=nil;
  1156. var count=nil;
  1157. integer=smalltalk.send(self, "_truncated", []);
  1158. count=(1);
  1159. (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)]));})()}})();
  1160. return self;}
  1161. }),
  1162. smalltalk.Number);
  1163. smalltalk.addMethod(
  1164. '_to_do_',
  1165. smalltalk.method({
  1166. selector: 'to:do:',
  1167. fn: function (stop, aBlock){
  1168. var self=this;
  1169. var nextValue=nil;
  1170. nextValue=self;
  1171. (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)]));})()}})();
  1172. return self;}
  1173. }),
  1174. smalltalk.Number);
  1175. smalltalk.addMethod(
  1176. '_asString',
  1177. smalltalk.method({
  1178. selector: 'asString',
  1179. fn: function (){
  1180. var self=this;
  1181. return smalltalk.send(self, "_printString", []);
  1182. return self;}
  1183. }),
  1184. smalltalk.Number);
  1185. smalltalk.addMethod(
  1186. '_asJavascript',
  1187. smalltalk.method({
  1188. selector: 'asJavascript',
  1189. fn: function (){
  1190. var self=this;
  1191. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1192. return self;}
  1193. }),
  1194. smalltalk.Number);
  1195. smalltalk.addMethod(
  1196. '_printString',
  1197. smalltalk.method({
  1198. selector: 'printString',
  1199. fn: function (){
  1200. var self=this;
  1201. return String(self);
  1202. return self;}
  1203. }),
  1204. smalltalk.Number);
  1205. smalltalk.addMethod(
  1206. '_isNumber',
  1207. smalltalk.method({
  1208. selector: 'isNumber',
  1209. fn: function (){
  1210. var self=this;
  1211. return true;
  1212. return self;}
  1213. }),
  1214. smalltalk.Number);
  1215. smalltalk.addMethod(
  1216. '_atRandom',
  1217. smalltalk.method({
  1218. selector: 'atRandom',
  1219. fn: function (){
  1220. var self=this;
  1221. 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)]));
  1222. return self;}
  1223. }),
  1224. smalltalk.Number);
  1225. smalltalk.addMethod(
  1226. '__at',
  1227. smalltalk.method({
  1228. selector: '@',
  1229. fn: function (aNumber){
  1230. var self=this;
  1231. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, aNumber]);
  1232. return self;}
  1233. }),
  1234. smalltalk.Number);
  1235. smalltalk.addMethod(
  1236. '_asPoint',
  1237. smalltalk.method({
  1238. selector: 'asPoint',
  1239. fn: function (){
  1240. var self=this;
  1241. return smalltalk.send((smalltalk.Point || Point), "_x_y_", [self, self]);
  1242. return self;}
  1243. }),
  1244. smalltalk.Number);
  1245. smalltalk.addMethod(
  1246. '_clearInterval',
  1247. smalltalk.method({
  1248. selector: 'clearInterval',
  1249. fn: function (){
  1250. var self=this;
  1251. clearInterval(Number(self));
  1252. return self;}
  1253. }),
  1254. smalltalk.Number);
  1255. smalltalk.addMethod(
  1256. '_clearTimeout',
  1257. smalltalk.method({
  1258. selector: 'clearTimeout',
  1259. fn: function (){
  1260. var self=this;
  1261. clearTimeout(Number(self));
  1262. return self;}
  1263. }),
  1264. smalltalk.Number);
  1265. smalltalk.addMethod(
  1266. '_even',
  1267. smalltalk.method({
  1268. selector: 'even',
  1269. fn: function (){
  1270. var self=this;
  1271. return smalltalk.send((0), "__eq", [smalltalk.send(self, "_\\\\", [(2)])]);
  1272. return self;}
  1273. }),
  1274. smalltalk.Number);
  1275. smalltalk.addMethod(
  1276. '_odd',
  1277. smalltalk.method({
  1278. selector: 'odd',
  1279. fn: function (){
  1280. var self=this;
  1281. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1282. return self;}
  1283. }),
  1284. smalltalk.Number);
  1285. smalltalk.addMethod(
  1286. '_negated',
  1287. smalltalk.method({
  1288. selector: 'negated',
  1289. fn: function (){
  1290. var self=this;
  1291. return (0) - self;
  1292. return self;}
  1293. }),
  1294. smalltalk.Number);
  1295. smalltalk.addMethod(
  1296. '__eq_eq',
  1297. smalltalk.method({
  1298. selector: '==',
  1299. fn: function (aNumber){
  1300. var self=this;
  1301. try{((($receiver = smalltalk.send(smalltalk.send(aNumber, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]));
  1302. return Number(self) === Number(aNumber);
  1303. return self;
  1304. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  1305. }),
  1306. smalltalk.Number);
  1307. smalltalk.addMethod(
  1308. '_printShowingDecimalPlaces_',
  1309. smalltalk.method({
  1310. selector: 'printShowingDecimalPlaces:',
  1311. fn: function (placesDesired){
  1312. var self=this;
  1313. return self.toFixed(placesDesired);
  1314. return self;}
  1315. }),
  1316. smalltalk.Number);
  1317. smalltalk.addMethod(
  1318. '_\',
  1319. smalltalk.method({
  1320. selector: '\',
  1321. fn: function (aNumber){
  1322. var self=this;
  1323. return self % aNumber;
  1324. return self;}
  1325. }),
  1326. smalltalk.Number);
  1327. smalltalk.addMethod(
  1328. '_to_by_',
  1329. smalltalk.method({
  1330. selector: 'to:by:',
  1331. fn: function (stop, step){
  1332. var self=this;
  1333. var array=nil;
  1334. var value=nil;
  1335. var pos=nil;
  1336. value=self;
  1337. array=smalltalk.send((smalltalk.Array || Array), "_new", []);
  1338. pos=(1);
  1339. ((($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")]);})]));
  1340. ((($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]));})()}})();})]));
  1341. return array;
  1342. return self;}
  1343. }),
  1344. smalltalk.Number);
  1345. smalltalk.addMethod(
  1346. '_to_by_do_',
  1347. smalltalk.method({
  1348. selector: 'to:by:do:',
  1349. fn: function (stop, step, aBlock){
  1350. var self=this;
  1351. var value=nil;
  1352. value=self;
  1353. ((($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")]);})]));
  1354. ((($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]));})()}})();})]));
  1355. return self;}
  1356. }),
  1357. smalltalk.Number);
  1358. smalltalk.addMethod(
  1359. '_deepCopy',
  1360. smalltalk.method({
  1361. selector: 'deepCopy',
  1362. fn: function (){
  1363. var self=this;
  1364. return smalltalk.send(self, "_copy", []);
  1365. return self;}
  1366. }),
  1367. smalltalk.Number);
  1368. smalltalk.addMethod(
  1369. '_copy',
  1370. smalltalk.method({
  1371. selector: 'copy',
  1372. fn: function (){
  1373. var self=this;
  1374. return self;
  1375. return self;}
  1376. }),
  1377. smalltalk.Number);
  1378. smalltalk.addMethod(
  1379. '_\\',
  1380. smalltalk.method({
  1381. selector: '\\',
  1382. fn: function (aNumber){
  1383. var self=this;
  1384. return self % aNumber;
  1385. return self;}
  1386. }),
  1387. smalltalk.Number);
  1388. smalltalk.addMethod(
  1389. '_sqrt',
  1390. smalltalk.method({
  1391. selector: 'sqrt',
  1392. fn: function (){
  1393. var self=this;
  1394. return Math.sqrt(self);
  1395. return self;}
  1396. }),
  1397. smalltalk.Number);
  1398. smalltalk.addMethod(
  1399. '_squared',
  1400. smalltalk.method({
  1401. selector: 'squared',
  1402. fn: function (){
  1403. var self=this;
  1404. return self * self;
  1405. return self;}
  1406. }),
  1407. smalltalk.Number);
  1408. smalltalk.addMethod(
  1409. '_pi',
  1410. smalltalk.method({
  1411. selector: 'pi',
  1412. fn: function (){
  1413. var self=this;
  1414. return Math.PI;
  1415. return self;}
  1416. }),
  1417. smalltalk.Number.klass);
  1418. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  1419. smalltalk.addMethod(
  1420. '__eq',
  1421. smalltalk.method({
  1422. selector: '=',
  1423. fn: function (aBoolean){
  1424. var self=this;
  1425. 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}})})();})]));
  1426. return Boolean(self == true) == aBoolean;
  1427. return self;
  1428. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
  1429. }),
  1430. smalltalk.Boolean);
  1431. smalltalk.addMethod(
  1432. '_shallowCopy',
  1433. smalltalk.method({
  1434. selector: 'shallowCopy',
  1435. fn: function (){
  1436. var self=this;
  1437. return self;
  1438. return self;}
  1439. }),
  1440. smalltalk.Boolean);
  1441. smalltalk.addMethod(
  1442. '_deepCopy',
  1443. smalltalk.method({
  1444. selector: 'deepCopy',
  1445. fn: function (){
  1446. var self=this;
  1447. return self;
  1448. return self;}
  1449. }),
  1450. smalltalk.Boolean);
  1451. smalltalk.addMethod(
  1452. '_ifTrue_',
  1453. smalltalk.method({
  1454. selector: 'ifTrue:',
  1455. fn: function (aBlock){
  1456. var self=this;
  1457. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
  1458. return self;}
  1459. }),
  1460. smalltalk.Boolean);
  1461. smalltalk.addMethod(
  1462. '_ifFalse_',
  1463. smalltalk.method({
  1464. selector: 'ifFalse:',
  1465. fn: function (aBlock){
  1466. var self=this;
  1467. return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
  1468. return self;}
  1469. }),
  1470. smalltalk.Boolean);
  1471. smalltalk.addMethod(
  1472. '_ifFalse_ifTrue_',
  1473. smalltalk.method({
  1474. selector: 'ifFalse:ifTrue:',
  1475. fn: function (aBlock, anotherBlock){
  1476. var self=this;
  1477. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1478. return self;}
  1479. }),
  1480. smalltalk.Boolean);
  1481. smalltalk.addMethod(
  1482. '_ifTrue_ifFalse_',
  1483. smalltalk.method({
  1484. selector: 'ifTrue:ifFalse:',
  1485. fn: function (aBlock, anotherBlock){
  1486. var self=this;
  1487. if(self == true) {
  1488. return aBlock();
  1489. } else {
  1490. return anotherBlock();
  1491. }
  1492. ;
  1493. return self;}
  1494. }),
  1495. smalltalk.Boolean);
  1496. smalltalk.addMethod(
  1497. '_and_',
  1498. smalltalk.method({
  1499. selector: 'and:',
  1500. fn: function (aBlock){
  1501. var self=this;
  1502. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, (function(){return false;})]);
  1503. return self;}
  1504. }),
  1505. smalltalk.Boolean);
  1506. smalltalk.addMethod(
  1507. '_or_',
  1508. smalltalk.method({
  1509. selector: 'or:',
  1510. fn: function (aBlock){
  1511. var self=this;
  1512. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [(function(){return true;}), aBlock]);
  1513. return self;}
  1514. }),
  1515. smalltalk.Boolean);
  1516. smalltalk.addMethod(
  1517. '_not',
  1518. smalltalk.method({
  1519. selector: 'not',
  1520. fn: function (){
  1521. var self=this;
  1522. return smalltalk.send(self, "__eq", [false]);
  1523. return self;}
  1524. }),
  1525. smalltalk.Boolean);
  1526. smalltalk.addMethod(
  1527. '_printString',
  1528. smalltalk.method({
  1529. selector: 'printString',
  1530. fn: function (){
  1531. var self=this;
  1532. return self.toString();
  1533. return self;}
  1534. }),
  1535. smalltalk.Boolean);
  1536. smalltalk.addMethod(
  1537. '_&',
  1538. smalltalk.method({
  1539. selector: '&',
  1540. fn: function (aBoolean){
  1541. var self=this;
  1542. if(self == true) {
  1543. return aBoolean;
  1544. } else {
  1545. return false;
  1546. }
  1547. ;
  1548. return self;}
  1549. }),
  1550. smalltalk.Boolean);
  1551. smalltalk.addMethod(
  1552. '_|',
  1553. smalltalk.method({
  1554. selector: '|',
  1555. fn: function (aBoolean){
  1556. var self=this;
  1557. if(self == true) {
  1558. return true;
  1559. } else {
  1560. return aBoolean;
  1561. }
  1562. ;
  1563. return self;}
  1564. }),
  1565. smalltalk.Boolean);
  1566. smalltalk.addMethod(
  1567. '__eq_eq',
  1568. smalltalk.method({
  1569. selector: '==',
  1570. fn: function (aBoolean){
  1571. var self=this;
  1572. 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_eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq_eq', fn: function(){return false}})})();})]));
  1573. return Boolean(self == true) === Boolean(aBoolean == true);
  1574. return self;
  1575. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq_eq'){return e.fn()} throw(e)}}
  1576. }),
  1577. smalltalk.Boolean);
  1578. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  1579. smalltalk.addMethod(
  1580. '_year',
  1581. smalltalk.method({
  1582. selector: 'year',
  1583. fn: function (){
  1584. var self=this;
  1585. return self.getFullYear();
  1586. return self;}
  1587. }),
  1588. smalltalk.Date);
  1589. smalltalk.addMethod(
  1590. '_month',
  1591. smalltalk.method({
  1592. selector: 'month',
  1593. fn: function (){
  1594. var self=this;
  1595. return self.getMonth() + 1;
  1596. return self;}
  1597. }),
  1598. smalltalk.Date);
  1599. smalltalk.addMethod(
  1600. '_month_',
  1601. smalltalk.method({
  1602. selector: 'month:',
  1603. fn: function (aNumber){
  1604. var self=this;
  1605. self.setMonth(aNumber - 1);
  1606. return self;}
  1607. }),
  1608. smalltalk.Date);
  1609. smalltalk.addMethod(
  1610. '_day',
  1611. smalltalk.method({
  1612. selector: 'day',
  1613. fn: function (){
  1614. var self=this;
  1615. return smalltalk.send(self, "_dayOfWeek", []);
  1616. return self;}
  1617. }),
  1618. smalltalk.Date);
  1619. smalltalk.addMethod(
  1620. '_dayOfWeek',
  1621. smalltalk.method({
  1622. selector: 'dayOfWeek',
  1623. fn: function (){
  1624. var self=this;
  1625. return self.getDay() + 1;
  1626. return self;}
  1627. }),
  1628. smalltalk.Date);
  1629. smalltalk.addMethod(
  1630. '_dayOfWeek_',
  1631. smalltalk.method({
  1632. selector: 'dayOfWeek:',
  1633. fn: function (aNumber){
  1634. var self=this;
  1635. return self.setDay(aNumber - 1);
  1636. return self;}
  1637. }),
  1638. smalltalk.Date);
  1639. smalltalk.addMethod(
  1640. '_day_',
  1641. smalltalk.method({
  1642. selector: 'day:',
  1643. fn: function (aNumber){
  1644. var self=this;
  1645. smalltalk.send(self, "_day_", [aNumber]);
  1646. return self;}
  1647. }),
  1648. smalltalk.Date);
  1649. smalltalk.addMethod(
  1650. '_year_',
  1651. smalltalk.method({
  1652. selector: 'year:',
  1653. fn: function (aNumber){
  1654. var self=this;
  1655. self.setFullYear(aNumber);
  1656. return self;}
  1657. }),
  1658. smalltalk.Date);
  1659. smalltalk.addMethod(
  1660. '_dayOfMonth',
  1661. smalltalk.method({
  1662. selector: 'dayOfMonth',
  1663. fn: function (){
  1664. var self=this;
  1665. return self.getDate();
  1666. return self;}
  1667. }),
  1668. smalltalk.Date);
  1669. smalltalk.addMethod(
  1670. '_dayOfMonth_',
  1671. smalltalk.method({
  1672. selector: 'dayOfMonth:',
  1673. fn: function (aNumber){
  1674. var self=this;
  1675. self.setDate(aNumber);
  1676. return self;}
  1677. }),
  1678. smalltalk.Date);
  1679. smalltalk.addMethod(
  1680. '_asString',
  1681. smalltalk.method({
  1682. selector: 'asString',
  1683. fn: function (){
  1684. var self=this;
  1685. return self.toString();
  1686. return self;}
  1687. }),
  1688. smalltalk.Date);
  1689. smalltalk.addMethod(
  1690. '_printString',
  1691. smalltalk.method({
  1692. selector: 'printString',
  1693. fn: function (){
  1694. var self=this;
  1695. return smalltalk.send(self, "_asString", []);
  1696. return self;}
  1697. }),
  1698. smalltalk.Date);
  1699. smalltalk.addMethod(
  1700. '_asMilliseconds',
  1701. smalltalk.method({
  1702. selector: 'asMilliseconds',
  1703. fn: function (){
  1704. var self=this;
  1705. return smalltalk.send(self, "_time", []);
  1706. return self;}
  1707. }),
  1708. smalltalk.Date);
  1709. smalltalk.addMethod(
  1710. '_time',
  1711. smalltalk.method({
  1712. selector: 'time',
  1713. fn: function (){
  1714. var self=this;
  1715. return self.getTime();
  1716. return self;}
  1717. }),
  1718. smalltalk.Date);
  1719. smalltalk.addMethod(
  1720. '_time_',
  1721. smalltalk.method({
  1722. selector: 'time:',
  1723. fn: function (aNumber){
  1724. var self=this;
  1725. self.setTime(aNumber);
  1726. return self;}
  1727. }),
  1728. smalltalk.Date);
  1729. smalltalk.addMethod(
  1730. '_asDateString',
  1731. smalltalk.method({
  1732. selector: 'asDateString',
  1733. fn: function (){
  1734. var self=this;
  1735. return self.toDateString();
  1736. return self;}
  1737. }),
  1738. smalltalk.Date);
  1739. smalltalk.addMethod(
  1740. '_asTimeString',
  1741. smalltalk.method({
  1742. selector: 'asTimeString',
  1743. fn: function (){
  1744. var self=this;
  1745. return self.toTimeString();
  1746. return self;}
  1747. }),
  1748. smalltalk.Date);
  1749. smalltalk.addMethod(
  1750. '_asLocaleString',
  1751. smalltalk.method({
  1752. selector: 'asLocaleString',
  1753. fn: function (){
  1754. var self=this;
  1755. return self.toLocaleString();
  1756. return self;}
  1757. }),
  1758. smalltalk.Date);
  1759. smalltalk.addMethod(
  1760. '_asNumber',
  1761. smalltalk.method({
  1762. selector: 'asNumber',
  1763. fn: function (){
  1764. var self=this;
  1765. return smalltalk.send(self, "_asMilliseconds", []);
  1766. return self;}
  1767. }),
  1768. smalltalk.Date);
  1769. smalltalk.addMethod(
  1770. '_hours_',
  1771. smalltalk.method({
  1772. selector: 'hours:',
  1773. fn: function (aNumber){
  1774. var self=this;
  1775. self.setHours(aNumber);
  1776. return self;}
  1777. }),
  1778. smalltalk.Date);
  1779. smalltalk.addMethod(
  1780. '_minutes_',
  1781. smalltalk.method({
  1782. selector: 'minutes:',
  1783. fn: function (aNumber){
  1784. var self=this;
  1785. self.setMinutes(aNumber);
  1786. return self;}
  1787. }),
  1788. smalltalk.Date);
  1789. smalltalk.addMethod(
  1790. '_seconds_',
  1791. smalltalk.method({
  1792. selector: 'seconds:',
  1793. fn: function (aNumber){
  1794. var self=this;
  1795. self.setSeconds(aNumber);
  1796. return self;}
  1797. }),
  1798. smalltalk.Date);
  1799. smalltalk.addMethod(
  1800. '_milliseconds_',
  1801. smalltalk.method({
  1802. selector: 'milliseconds:',
  1803. fn: function (aNumber){
  1804. var self=this;
  1805. self.setMilliseconds(aNumber);
  1806. return self;}
  1807. }),
  1808. smalltalk.Date);
  1809. smalltalk.addMethod(
  1810. '_hours',
  1811. smalltalk.method({
  1812. selector: 'hours',
  1813. fn: function (){
  1814. var self=this;
  1815. return self.getHours();
  1816. return self;}
  1817. }),
  1818. smalltalk.Date);
  1819. smalltalk.addMethod(
  1820. '_minutes',
  1821. smalltalk.method({
  1822. selector: 'minutes',
  1823. fn: function (){
  1824. var self=this;
  1825. return self.getMinutes();
  1826. return self;}
  1827. }),
  1828. smalltalk.Date);
  1829. smalltalk.addMethod(
  1830. '_seconds',
  1831. smalltalk.method({
  1832. selector: 'seconds',
  1833. fn: function (){
  1834. var self=this;
  1835. return self.getSeconds();
  1836. return self;}
  1837. }),
  1838. smalltalk.Date);
  1839. smalltalk.addMethod(
  1840. '_milliseconds',
  1841. smalltalk.method({
  1842. selector: 'milliseconds',
  1843. fn: function (){
  1844. var self=this;
  1845. return self.getMilliseconds();
  1846. return self;}
  1847. }),
  1848. smalltalk.Date);
  1849. smalltalk.addMethod(
  1850. '__lt',
  1851. smalltalk.method({
  1852. selector: '<',
  1853. fn: function (aDate){
  1854. var self=this;
  1855. return self < aDate;
  1856. return self;}
  1857. }),
  1858. smalltalk.Date);
  1859. smalltalk.addMethod(
  1860. '__gt',
  1861. smalltalk.method({
  1862. selector: '>',
  1863. fn: function (aDate){
  1864. var self=this;
  1865. return self > aDate;
  1866. return self;}
  1867. }),
  1868. smalltalk.Date);
  1869. smalltalk.addMethod(
  1870. '__lt_eq',
  1871. smalltalk.method({
  1872. selector: '<=',
  1873. fn: function (aDate){
  1874. var self=this;
  1875. return self <= aDate;
  1876. return self;}
  1877. }),
  1878. smalltalk.Date);
  1879. smalltalk.addMethod(
  1880. '__gt_eq',
  1881. smalltalk.method({
  1882. selector: '>=',
  1883. fn: function (aDate){
  1884. var self=this;
  1885. return self >= aDate;
  1886. return self;}
  1887. }),
  1888. smalltalk.Date);
  1889. smalltalk.addMethod(
  1890. '__minus',
  1891. smalltalk.method({
  1892. selector: '-',
  1893. fn: function (aDate){
  1894. var self=this;
  1895. return self - aDate;
  1896. return self;}
  1897. }),
  1898. smalltalk.Date);
  1899. smalltalk.addMethod(
  1900. '__plus',
  1901. smalltalk.method({
  1902. selector: '+',
  1903. fn: function (aDate){
  1904. var self=this;
  1905. return self + aDate;
  1906. return self;}
  1907. }),
  1908. smalltalk.Date);
  1909. smalltalk.addMethod(
  1910. '_new_',
  1911. smalltalk.method({
  1912. selector: 'new:',
  1913. fn: function (anObject){
  1914. var self=this;
  1915. return new Date(anObject);
  1916. return self;}
  1917. }),
  1918. smalltalk.Date.klass);
  1919. smalltalk.addMethod(
  1920. '_fromString_',
  1921. smalltalk.method({
  1922. selector: 'fromString:',
  1923. fn: function (aString){
  1924. var self=this;
  1925. return smalltalk.send(self, "_new_", [aString]);
  1926. return self;}
  1927. }),
  1928. smalltalk.Date.klass);
  1929. smalltalk.addMethod(
  1930. '_fromSeconds_',
  1931. smalltalk.method({
  1932. selector: 'fromSeconds:',
  1933. fn: function (aNumber){
  1934. var self=this;
  1935. return smalltalk.send(self, "_fromMilliseconds_", [((($receiver = aNumber).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))]);
  1936. return self;}
  1937. }),
  1938. smalltalk.Date.klass);
  1939. smalltalk.addMethod(
  1940. '_fromMilliseconds_',
  1941. smalltalk.method({
  1942. selector: 'fromMilliseconds:',
  1943. fn: function (aNumber){
  1944. var self=this;
  1945. return smalltalk.send(self, "_new_", [aNumber]);
  1946. return self;}
  1947. }),
  1948. smalltalk.Date.klass);
  1949. smalltalk.addMethod(
  1950. '_today',
  1951. smalltalk.method({
  1952. selector: 'today',
  1953. fn: function (){
  1954. var self=this;
  1955. return smalltalk.send(self, "_new", []);
  1956. return self;}
  1957. }),
  1958. smalltalk.Date.klass);
  1959. smalltalk.addMethod(
  1960. '_now',
  1961. smalltalk.method({
  1962. selector: 'now',
  1963. fn: function (){
  1964. var self=this;
  1965. return smalltalk.send(self, "_today", []);
  1966. return self;}
  1967. }),
  1968. smalltalk.Date.klass);
  1969. smalltalk.addMethod(
  1970. '_millisecondsToRun_',
  1971. smalltalk.method({
  1972. selector: 'millisecondsToRun:',
  1973. fn: function (aBlock){
  1974. var self=this;
  1975. var t=nil;
  1976. t=smalltalk.send((smalltalk.Date || Date), "_now", []);
  1977. smalltalk.send(aBlock, "_value", []);
  1978. return ((($receiver = smalltalk.send((smalltalk.Date || Date), "_now", [])).klass === smalltalk.Number) ? $receiver -t : smalltalk.send($receiver, "__minus", [t]));
  1979. return self;}
  1980. }),
  1981. smalltalk.Date.klass);
  1982. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  1983. smalltalk.addMethod(
  1984. '_subclass_instanceVariableNames_',
  1985. smalltalk.method({
  1986. selector: 'subclass:instanceVariableNames:',
  1987. fn: function (aString, anotherString){
  1988. var self=this;
  1989. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  1990. return self;}
  1991. }),
  1992. smalltalk.UndefinedObject);
  1993. smalltalk.addMethod(
  1994. '_subclass_instanceVariableNames_category_',
  1995. smalltalk.method({
  1996. selector: 'subclass:instanceVariableNames:category:',
  1997. fn: function (aString, aString2, aString3){
  1998. var self=this;
  1999. smalltalk.send(self, "_deprecatedAPI", []);
  2000. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  2001. return self;}
  2002. }),
  2003. smalltalk.UndefinedObject);
  2004. smalltalk.addMethod(
  2005. '_shallowCopy',
  2006. smalltalk.method({
  2007. selector: 'shallowCopy',
  2008. fn: function (){
  2009. var self=this;
  2010. return self;
  2011. return self;}
  2012. }),
  2013. smalltalk.UndefinedObject);
  2014. smalltalk.addMethod(
  2015. '_deepCopy',
  2016. smalltalk.method({
  2017. selector: 'deepCopy',
  2018. fn: function (){
  2019. var self=this;
  2020. return self;
  2021. return self;}
  2022. }),
  2023. smalltalk.UndefinedObject);
  2024. smalltalk.addMethod(
  2025. '_ifNil_',
  2026. smalltalk.method({
  2027. selector: 'ifNil:',
  2028. fn: function (aBlock){
  2029. var self=this;
  2030. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
  2031. return self;}
  2032. }),
  2033. smalltalk.UndefinedObject);
  2034. smalltalk.addMethod(
  2035. '_ifNotNil_',
  2036. smalltalk.method({
  2037. selector: 'ifNotNil:',
  2038. fn: function (aBlock){
  2039. var self=this;
  2040. return self;
  2041. return self;}
  2042. }),
  2043. smalltalk.UndefinedObject);
  2044. smalltalk.addMethod(
  2045. '_ifNil_ifNotNil_',
  2046. smalltalk.method({
  2047. selector: 'ifNil:ifNotNil:',
  2048. fn: function (aBlock, anotherBlock){
  2049. var self=this;
  2050. return smalltalk.send(aBlock, "_value", []);
  2051. return self;}
  2052. }),
  2053. smalltalk.UndefinedObject);
  2054. smalltalk.addMethod(
  2055. '_ifNotNil_ifNil_',
  2056. smalltalk.method({
  2057. selector: 'ifNotNil:ifNil:',
  2058. fn: function (aBlock, anotherBlock){
  2059. var self=this;
  2060. return smalltalk.send(anotherBlock, "_value", []);
  2061. return self;}
  2062. }),
  2063. smalltalk.UndefinedObject);
  2064. smalltalk.addMethod(
  2065. '_isNil',
  2066. smalltalk.method({
  2067. selector: 'isNil',
  2068. fn: function (){
  2069. var self=this;
  2070. return true;
  2071. return self;}
  2072. }),
  2073. smalltalk.UndefinedObject);
  2074. smalltalk.addMethod(
  2075. '_notNil',
  2076. smalltalk.method({
  2077. selector: 'notNil',
  2078. fn: function (){
  2079. var self=this;
  2080. return false;
  2081. return self;}
  2082. }),
  2083. smalltalk.UndefinedObject);
  2084. smalltalk.addMethod(
  2085. '_printString',
  2086. smalltalk.method({
  2087. selector: 'printString',
  2088. fn: function (){
  2089. var self=this;
  2090. return "nil";
  2091. return self;}
  2092. }),
  2093. smalltalk.UndefinedObject);
  2094. smalltalk.addMethod(
  2095. '_subclass_instanceVariableNames_package_',
  2096. smalltalk.method({
  2097. selector: 'subclass:instanceVariableNames:package:',
  2098. fn: function (aString, aString2, aString3){
  2099. var self=this;
  2100. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  2101. return self;}
  2102. }),
  2103. smalltalk.UndefinedObject);
  2104. smalltalk.addMethod(
  2105. '_new',
  2106. smalltalk.method({
  2107. selector: 'new',
  2108. fn: function (){
  2109. var self=this;
  2110. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2111. return self;}
  2112. }),
  2113. smalltalk.UndefinedObject.klass);
  2114. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  2115. smalltalk.addMethod(
  2116. '_next',
  2117. smalltalk.method({
  2118. selector: 'next',
  2119. fn: function (){
  2120. var self=this;
  2121. return Math.random();
  2122. return self;}
  2123. }),
  2124. smalltalk.Random);
  2125. smalltalk.addMethod(
  2126. '_next_',
  2127. smalltalk.method({
  2128. selector: 'next:',
  2129. fn: function (anInteger){
  2130. var self=this;
  2131. return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
  2132. return self;}
  2133. }),
  2134. smalltalk.Random);
  2135. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  2136. smalltalk.addMethod(
  2137. '_x',
  2138. smalltalk.method({
  2139. selector: 'x',
  2140. fn: function (){
  2141. var self=this;
  2142. return self['@x'];
  2143. return self;}
  2144. }),
  2145. smalltalk.Point);
  2146. smalltalk.addMethod(
  2147. '_y',
  2148. smalltalk.method({
  2149. selector: 'y',
  2150. fn: function (){
  2151. var self=this;
  2152. return self['@y'];
  2153. return self;}
  2154. }),
  2155. smalltalk.Point);
  2156. smalltalk.addMethod(
  2157. '_y_',
  2158. smalltalk.method({
  2159. selector: 'y:',
  2160. fn: function (aNumber){
  2161. var self=this;
  2162. self['@y']=aNumber;
  2163. return self;}
  2164. }),
  2165. smalltalk.Point);
  2166. smalltalk.addMethod(
  2167. '_x_',
  2168. smalltalk.method({
  2169. selector: 'x:',
  2170. fn: function (aNumber){
  2171. var self=this;
  2172. self['@x']=aNumber;
  2173. return self;}
  2174. }),
  2175. smalltalk.Point);
  2176. smalltalk.addMethod(
  2177. '__star',
  2178. smalltalk.method({
  2179. selector: '*',
  2180. fn: function (aPoint){
  2181. var self=this;
  2182. 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", [])]))]);
  2183. return self;}
  2184. }),
  2185. smalltalk.Point);
  2186. smalltalk.addMethod(
  2187. '__plus',
  2188. smalltalk.method({
  2189. selector: '+',
  2190. fn: function (aPoint){
  2191. var self=this;
  2192. 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", [])]))]);
  2193. return self;}
  2194. }),
  2195. smalltalk.Point);
  2196. smalltalk.addMethod(
  2197. '__minus',
  2198. smalltalk.method({
  2199. selector: '-',
  2200. fn: function (aPoint){
  2201. var self=this;
  2202. 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", [])]))]);
  2203. return self;}
  2204. }),
  2205. smalltalk.Point);
  2206. smalltalk.addMethod(
  2207. '__slash',
  2208. smalltalk.method({
  2209. selector: '/',
  2210. fn: function (aPoint){
  2211. var self=this;
  2212. 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", [])]))]);
  2213. return self;}
  2214. }),
  2215. smalltalk.Point);
  2216. smalltalk.addMethod(
  2217. '_asPoint',
  2218. smalltalk.method({
  2219. selector: 'asPoint',
  2220. fn: function (){
  2221. var self=this;
  2222. return self;
  2223. return self;}
  2224. }),
  2225. smalltalk.Point);
  2226. smalltalk.addMethod(
  2227. '__eq',
  2228. smalltalk.method({
  2229. selector: '=',
  2230. fn: function (aPoint){
  2231. var self=this;
  2232. 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", [])])]);})]);
  2233. return self;}
  2234. }),
  2235. smalltalk.Point);
  2236. smalltalk.addMethod(
  2237. '_x_y_',
  2238. smalltalk.method({
  2239. selector: 'x:y:',
  2240. fn: function (aNumber, anotherNumber){
  2241. var self=this;
  2242. return (function($rec){smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2243. return self;}
  2244. }),
  2245. smalltalk.Point.klass);
  2246. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  2247. smalltalk.addMethod(
  2248. '_jsObject_',
  2249. smalltalk.method({
  2250. selector: 'jsObject:',
  2251. fn: function (aJSObject){
  2252. var self=this;
  2253. self['@jsObject']=aJSObject;
  2254. return self;}
  2255. }),
  2256. smalltalk.JSObjectProxy);
  2257. smalltalk.addMethod(
  2258. '_jsObject',
  2259. smalltalk.method({
  2260. selector: 'jsObject',
  2261. fn: function (){
  2262. var self=this;
  2263. return self['@jsObject'];
  2264. return self;}
  2265. }),
  2266. smalltalk.JSObjectProxy);
  2267. smalltalk.addMethod(
  2268. '_printString',
  2269. smalltalk.method({
  2270. selector: 'printString',
  2271. fn: function (){
  2272. var self=this;
  2273. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  2274. return self;}
  2275. }),
  2276. smalltalk.JSObjectProxy);
  2277. smalltalk.addMethod(
  2278. '_inspectOn_',
  2279. smalltalk.method({
  2280. selector: 'inspectOn:',
  2281. fn: function (anInspector){
  2282. var self=this;
  2283. var variables=nil;
  2284. variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
  2285. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  2286. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  2287. for(var i in self['@jsObject']) {
  2288. variables._at_put_(i, self['@jsObject'][i]);
  2289. };
  2290. smalltalk.send(anInspector, "_setVariables_", [variables]);
  2291. return self;}
  2292. }),
  2293. smalltalk.JSObjectProxy);
  2294. smalltalk.addMethod(
  2295. '_doesNotUnderstand_',
  2296. smalltalk.method({
  2297. selector: 'doesNotUnderstand:',
  2298. fn: function (aMessage){
  2299. var self=this;
  2300. var obj=nil;
  2301. var selector=nil;
  2302. var jsSelector=nil;
  2303. var arguments=nil;
  2304. obj=smalltalk.send(self, "_jsObject", []);
  2305. selector=smalltalk.send(aMessage, "_selector", []);
  2306. jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []);
  2307. arguments=smalltalk.send(aMessage, "_arguments", []);
  2308. if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
  2309. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  2310. return self;}
  2311. }),
  2312. smalltalk.JSObjectProxy);
  2313. smalltalk.addMethod(
  2314. '_at_',
  2315. smalltalk.method({
  2316. selector: 'at:',
  2317. fn: function (aString){
  2318. var self=this;
  2319. return self['@jsObject'][aString];
  2320. return self;}
  2321. }),
  2322. smalltalk.JSObjectProxy);
  2323. smalltalk.addMethod(
  2324. '_at_put_',
  2325. smalltalk.method({
  2326. selector: 'at:put:',
  2327. fn: function (aString, anObject){
  2328. var self=this;
  2329. self['@jsObject'][aString] = anObject;
  2330. return self;}
  2331. }),
  2332. smalltalk.JSObjectProxy);
  2333. smalltalk.addMethod(
  2334. '_on_',
  2335. smalltalk.method({
  2336. selector: 'on:',
  2337. fn: function (aJSObject){
  2338. var self=this;
  2339. return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  2340. return self;}
  2341. }),
  2342. smalltalk.JSObjectProxy.klass);