Kernel-Objects.deploy.js 64 KB

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