Kernel-Objects.deploy.js 60 KB

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