1
0

Kernel-Objects.deploy.js 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449
  1. smalltalk.addPackage('Kernel-Objects', {});
  2. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
  3. smalltalk.addMethod(
  4. "__minus_gt",
  5. smalltalk.method({
  6. selector: "->",
  7. fn: function (anObject) {
  8. var self = this;
  9. var $1;
  10. $1 = smalltalk.send(smalltalk.Association || Association, "_key_value_", [self, anObject]);
  11. return $1;
  12. }
  13. }),
  14. smalltalk.Object);
  15. smalltalk.addMethod(
  16. "__eq",
  17. smalltalk.method({
  18. selector: "=",
  19. fn: function (anObject) {
  20. var self = this;
  21. var $1;
  22. $1 = smalltalk.send(self, "__eq_eq", [anObject]);
  23. return $1;
  24. }
  25. }),
  26. smalltalk.Object);
  27. smalltalk.addMethod(
  28. "__eq_eq",
  29. smalltalk.method({
  30. selector: "==",
  31. fn: function (anObject) {
  32. var self = this;
  33. var $1;
  34. $1 = smalltalk.send(smalltalk.send(self, "_identityHash", []), "__eq", [smalltalk.send(anObject, "_identityHash", [])]);
  35. return $1;
  36. }
  37. }),
  38. smalltalk.Object);
  39. smalltalk.addMethod(
  40. "_asJSON",
  41. smalltalk.method({
  42. selector: "asJSON",
  43. fn: function () {
  44. var self = this;
  45. var variables;
  46. variables = smalltalk.send(smalltalk.HashedCollection || HashedCollection, "_new", []);
  47. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_allInstanceVariableNames", []), "_do_", [function (each) {return smalltalk.send(variables, "_at_put_", [each, smalltalk.send(smalltalk.send(self, "_instVarAt_", [each]), "_asJSON", [])]);}]);
  48. return variables;
  49. }
  50. }),
  51. smalltalk.Object);
  52. smalltalk.addMethod(
  53. "_asJSONString",
  54. smalltalk.method({
  55. selector: "asJSONString",
  56. fn: function () {
  57. var self = this;
  58. var $1;
  59. $1 = smalltalk.send(smalltalk.JSON || JSON, "_stringify_", [smalltalk.send(self, "_asJSON", [])]);
  60. return $1;
  61. }
  62. }),
  63. smalltalk.Object);
  64. smalltalk.addMethod(
  65. "_asJavascript",
  66. smalltalk.method({
  67. selector: "asJavascript",
  68. fn: function () {
  69. var self = this;
  70. var $1;
  71. $1 = smalltalk.send(self, "_asString", []);
  72. return $1;
  73. }
  74. }),
  75. smalltalk.Object);
  76. smalltalk.addMethod(
  77. "_asString",
  78. smalltalk.method({
  79. selector: "asString",
  80. fn: function () {
  81. var self = this;
  82. var $1;
  83. $1 = smalltalk.send(self, "_printString", []);
  84. return $1;
  85. }
  86. }),
  87. smalltalk.Object);
  88. smalltalk.addMethod(
  89. "_basicAt_",
  90. smalltalk.method({
  91. selector: "basicAt:",
  92. fn: function (aString) {
  93. var self = this;
  94. return self[aString];
  95. return self;
  96. }
  97. }),
  98. smalltalk.Object);
  99. smalltalk.addMethod(
  100. "_basicAt_put_",
  101. smalltalk.method({
  102. selector: "basicAt:put:",
  103. fn: function (aString, anObject) {
  104. var self = this;
  105. return self[aString] = anObject;
  106. return self;
  107. }
  108. }),
  109. smalltalk.Object);
  110. smalltalk.addMethod(
  111. "_basicDelete_",
  112. smalltalk.method({
  113. selector: "basicDelete:",
  114. fn: function (aString) {
  115. var self = this;
  116. delete self[aString];
  117. return aString;
  118. return self;
  119. }
  120. }),
  121. smalltalk.Object);
  122. smalltalk.addMethod(
  123. "_basicPerform_",
  124. smalltalk.method({
  125. selector: "basicPerform:",
  126. fn: function (aSymbol) {
  127. var self = this;
  128. var $1;
  129. $1 = smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  130. return $1;
  131. }
  132. }),
  133. smalltalk.Object);
  134. smalltalk.addMethod(
  135. "_basicPerform_withArguments_",
  136. smalltalk.method({
  137. selector: "basicPerform:withArguments:",
  138. fn: function (aSymbol, aCollection) {
  139. var self = this;
  140. return self[aSymbol].apply(self, aCollection);
  141. return self;
  142. }
  143. }),
  144. smalltalk.Object);
  145. smalltalk.addMethod(
  146. "_class",
  147. smalltalk.method({
  148. selector: "class",
  149. fn: function () {
  150. var self = this;
  151. return self.klass;
  152. return self;
  153. }
  154. }),
  155. smalltalk.Object);
  156. smalltalk.addMethod(
  157. "_copy",
  158. smalltalk.method({
  159. selector: "copy",
  160. fn: function () {
  161. var self = this;
  162. var $1;
  163. $1 = smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  164. return $1;
  165. }
  166. }),
  167. smalltalk.Object);
  168. smalltalk.addMethod(
  169. "_deepCopy",
  170. smalltalk.method({
  171. selector: "deepCopy",
  172. fn: function () {
  173. var self = this;
  174. var copy = self.klass._new();
  175. for (var i in self) {
  176. if (/^@.+/.test(i)) {
  177. copy[i] = self[i]._deepCopy();
  178. }
  179. }
  180. return copy;
  181. return self;
  182. }
  183. }),
  184. smalltalk.Object);
  185. smalltalk.addMethod(
  186. "_deprecatedAPI",
  187. smalltalk.method({
  188. selector: "deprecatedAPI",
  189. fn: function () {
  190. var self = this;
  191. smalltalk.send(console, "_warn_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.getThisContext(), "_home", []), "_asString", []), "__comma", [" is deprecated! (in "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.getThisContext(), "_home", []), "_home", []), "_asString", [])]), "__comma", [")"])]);
  192. return self;
  193. }
  194. }),
  195. smalltalk.Object);
  196. smalltalk.addMethod(
  197. "_doesNotUnderstand_",
  198. smalltalk.method({
  199. selector: "doesNotUnderstand:",
  200. fn: function (aMessage) {
  201. var self = this;
  202. var $1, $2;
  203. $1 = smalltalk.send(smalltalk.MessageNotUnderstood || MessageNotUnderstood, "_new", []);
  204. smalltalk.send($1, "_receiver_", [self]);
  205. smalltalk.send($1, "_message_", [aMessage]);
  206. $2 = smalltalk.send($1, "_signal", []);
  207. return self;
  208. }
  209. }),
  210. smalltalk.Object);
  211. smalltalk.addMethod(
  212. "_error_",
  213. smalltalk.method({
  214. selector: "error:",
  215. fn: function (aString) {
  216. var self = this;
  217. smalltalk.send(smalltalk.Error || Error, "_signal_", [aString]);
  218. return self;
  219. }
  220. }),
  221. smalltalk.Object);
  222. smalltalk.addMethod(
  223. "_halt",
  224. smalltalk.method({
  225. selector: "halt",
  226. fn: function () {
  227. var self = this;
  228. smalltalk.send(self, "_error_", ["Halt encountered"]);
  229. return self;
  230. }
  231. }),
  232. smalltalk.Object);
  233. smalltalk.addMethod(
  234. "_identityHash",
  235. smalltalk.method({
  236. selector: "identityHash",
  237. fn: function () {
  238. var self = this;
  239. var hash = self.identityHash;
  240. if (hash) {
  241. return hash;
  242. }
  243. hash = smalltalk.nextId();
  244. Object.defineProperty(self, "identityHash", {value: hash});
  245. return hash;
  246. return self;
  247. }
  248. }),
  249. smalltalk.Object);
  250. smalltalk.addMethod(
  251. "_ifNil_",
  252. smalltalk.method({
  253. selector: "ifNil:",
  254. fn: function (aBlock) {
  255. var self = this;
  256. return self;
  257. }
  258. }),
  259. smalltalk.Object);
  260. smalltalk.addMethod(
  261. "_ifNil_ifNotNil_",
  262. smalltalk.method({
  263. selector: "ifNil:ifNotNil:",
  264. fn: function (aBlock, anotherBlock) {
  265. var self = this;
  266. var $1;
  267. $1 = smalltalk.send(anotherBlock, "_value", []);
  268. return $1;
  269. }
  270. }),
  271. smalltalk.Object);
  272. smalltalk.addMethod(
  273. "_ifNotNil_",
  274. smalltalk.method({
  275. selector: "ifNotNil:",
  276. fn: function (aBlock) {
  277. var self = this;
  278. var $1;
  279. $1 = smalltalk.send(aBlock, "_value", []);
  280. return $1;
  281. }
  282. }),
  283. smalltalk.Object);
  284. smalltalk.addMethod(
  285. "_ifNotNil_ifNil_",
  286. smalltalk.method({
  287. selector: "ifNotNil:ifNil:",
  288. fn: function (aBlock, anotherBlock) {
  289. var self = this;
  290. var $1;
  291. $1 = smalltalk.send(aBlock, "_value", []);
  292. return $1;
  293. }
  294. }),
  295. smalltalk.Object);
  296. smalltalk.addMethod(
  297. "_initialize",
  298. smalltalk.method({
  299. selector: "initialize",
  300. fn: function () {
  301. var self = this;
  302. return self;
  303. }
  304. }),
  305. smalltalk.Object);
  306. smalltalk.addMethod(
  307. "_instVarAt_",
  308. smalltalk.method({
  309. selector: "instVarAt:",
  310. fn: function (aSymbol){
  311. var self=this;
  312. return smalltalk.withContext(function($ctx1) { return self['@'+aSymbol._asString()];
  313. ;
  314. return self}, self, "instVarAt:", [aSymbol], smalltalk.Object)}
  315. }),
  316. smalltalk.Object);
  317. smalltalk.addMethod(
  318. "_instVarAt_put_",
  319. smalltalk.method({
  320. selector: "instVarAt:put:",
  321. fn: function (aSymbol,anObject){
  322. var self=this;
  323. return smalltalk.withContext(function($ctx1) { self['@' + aSymbol._asString()] = anObject;
  324. ;
  325. return self}, self, "instVarAt:put:", [aSymbol,anObject], smalltalk.Object)}
  326. }),
  327. smalltalk.Object);
  328. smalltalk.addMethod(
  329. "_isClass",
  330. smalltalk.method({
  331. selector: "isClass",
  332. fn: function () {
  333. var self = this;
  334. return false;
  335. }
  336. }),
  337. smalltalk.Object);
  338. smalltalk.addMethod(
  339. "_isKindOf_",
  340. smalltalk.method({
  341. selector: "isKindOf:",
  342. fn: function (aClass) {
  343. var self = this;
  344. var $2, $1;
  345. $2 = smalltalk.send(self, "_isMemberOf_", [aClass]);
  346. if (smalltalk.assert($2)) {
  347. $1 = true;
  348. } else {
  349. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);
  350. }
  351. return $1;
  352. }
  353. }),
  354. smalltalk.Object);
  355. smalltalk.addMethod(
  356. "_isMemberOf_",
  357. smalltalk.method({
  358. selector: "isMemberOf:",
  359. fn: function (aClass) {
  360. var self = this;
  361. var $1;
  362. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  363. return $1;
  364. }
  365. }),
  366. smalltalk.Object);
  367. smalltalk.addMethod(
  368. "_isMetaclass",
  369. smalltalk.method({
  370. selector: "isMetaclass",
  371. fn: function () {
  372. var self = this;
  373. return false;
  374. }
  375. }),
  376. smalltalk.Object);
  377. smalltalk.addMethod(
  378. "_isNil",
  379. smalltalk.method({
  380. selector: "isNil",
  381. fn: function () {
  382. var self = this;
  383. return false;
  384. }
  385. }),
  386. smalltalk.Object);
  387. smalltalk.addMethod(
  388. "_isNumber",
  389. smalltalk.method({
  390. selector: "isNumber",
  391. fn: function () {
  392. var self = this;
  393. return false;
  394. }
  395. }),
  396. smalltalk.Object);
  397. smalltalk.addMethod(
  398. "_isParseFailure",
  399. smalltalk.method({
  400. selector: "isParseFailure",
  401. fn: function () {
  402. var self = this;
  403. return false;
  404. }
  405. }),
  406. smalltalk.Object);
  407. smalltalk.addMethod(
  408. "_isString",
  409. smalltalk.method({
  410. selector: "isString",
  411. fn: function () {
  412. var self = this;
  413. return false;
  414. }
  415. }),
  416. smalltalk.Object);
  417. smalltalk.addMethod(
  418. "_isSymbol",
  419. smalltalk.method({
  420. selector: "isSymbol",
  421. fn: function () {
  422. var self = this;
  423. return false;
  424. }
  425. }),
  426. smalltalk.Object);
  427. smalltalk.addMethod(
  428. "_log_block_",
  429. smalltalk.method({
  430. selector: "log:block:",
  431. fn: function (aString, aBlock) {
  432. var self = this;
  433. var result;
  434. smalltalk.send(console, "_log_", [smalltalk.send(smalltalk.send(aString, "__comma", [" time: "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.Date || Date, "_millisecondsToRun_", [function () {result = smalltalk.send(aBlock, "_value", []);return result;}]), "_printString", [])])]);
  435. return result;
  436. }
  437. }),
  438. smalltalk.Object);
  439. smalltalk.addMethod(
  440. "_notNil",
  441. smalltalk.method({
  442. selector: "notNil",
  443. fn: function () {
  444. var self = this;
  445. var $1;
  446. $1 = smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  447. return $1;
  448. }
  449. }),
  450. smalltalk.Object);
  451. smalltalk.addMethod(
  452. "_perform_",
  453. smalltalk.method({
  454. selector: "perform:",
  455. fn: function (aSymbol) {
  456. var self = this;
  457. var $1;
  458. $1 = smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  459. return $1;
  460. }
  461. }),
  462. smalltalk.Object);
  463. smalltalk.addMethod(
  464. "_perform_withArguments_",
  465. smalltalk.method({
  466. selector: "perform:withArguments:",
  467. fn: function (aSymbol,aCollection){
  468. var self=this;
  469. return smalltalk.withContext(function($ctx1) { return smalltalk.send(self, aSymbol._asSelector(), aCollection);
  470. ;
  471. return self}, self, "perform:withArguments:", [aSymbol,aCollection], smalltalk.Object)}
  472. }),
  473. smalltalk.Object);
  474. smalltalk.addMethod(
  475. "_postCopy",
  476. smalltalk.method({
  477. selector: "postCopy",
  478. fn: function () {
  479. var self = this;
  480. return self;
  481. }
  482. }),
  483. smalltalk.Object);
  484. smalltalk.addMethod(
  485. "_printNl",
  486. smalltalk.method({
  487. selector: "printNl",
  488. fn: function () {
  489. var self = this;
  490. console.log(self);
  491. return self;
  492. }
  493. }),
  494. smalltalk.Object);
  495. smalltalk.addMethod(
  496. "_printString",
  497. smalltalk.method({
  498. selector: "printString",
  499. fn: function () {
  500. var self = this;
  501. var $1;
  502. $1 = smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  503. return $1;
  504. }
  505. }),
  506. smalltalk.Object);
  507. smalltalk.addMethod(
  508. "_respondsTo_",
  509. smalltalk.method({
  510. selector: "respondsTo:",
  511. fn: function (aSelector) {
  512. var self = this;
  513. var $1;
  514. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "_canUnderstand_", [aSelector]);
  515. return $1;
  516. }
  517. }),
  518. smalltalk.Object);
  519. smalltalk.addMethod(
  520. "_shallowCopy",
  521. smalltalk.method({
  522. selector: "shallowCopy",
  523. fn: function () {
  524. var self = this;
  525. var copy = self.klass._new();
  526. for (var i in self) {
  527. if (/^@.+/.test(i)) {
  528. copy[i] = self[i];
  529. }
  530. }
  531. return copy;
  532. return self;
  533. }
  534. }),
  535. smalltalk.Object);
  536. smalltalk.addMethod(
  537. "_shouldNotImplement",
  538. smalltalk.method({
  539. selector: "shouldNotImplement",
  540. fn: function () {
  541. var self = this;
  542. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  543. return self;
  544. }
  545. }),
  546. smalltalk.Object);
  547. smalltalk.addMethod(
  548. "_size",
  549. smalltalk.method({
  550. selector: "size",
  551. fn: function () {
  552. var self = this;
  553. smalltalk.send(self, "_error_", ["Object not indexable"]);
  554. return self;
  555. }
  556. }),
  557. smalltalk.Object);
  558. smalltalk.addMethod(
  559. "_storeOn_",
  560. smalltalk.method({
  561. selector: "storeOn:",
  562. fn: function (aStream) {
  563. var self = this;
  564. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(self, "_printString", [])]);
  565. return self;
  566. }
  567. }),
  568. smalltalk.Object);
  569. smalltalk.addMethod(
  570. "_storeString",
  571. smalltalk.method({
  572. selector: "storeString",
  573. fn: function () {
  574. var self = this;
  575. var $1;
  576. $1 = smalltalk.send(smalltalk.String || String, "_streamContents_", [function (s) {return smalltalk.send(self, "_storeOn_", [s]);}]);
  577. return $1;
  578. }
  579. }),
  580. smalltalk.Object);
  581. smalltalk.addMethod(
  582. "_subclassResponsibility",
  583. smalltalk.method({
  584. selector: "subclassResponsibility",
  585. fn: function () {
  586. var self = this;
  587. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  588. return self;
  589. }
  590. }),
  591. smalltalk.Object);
  592. smalltalk.addMethod(
  593. "_throw_",
  594. smalltalk.method({
  595. selector: "throw:",
  596. fn: function (anObject) {
  597. var self = this;
  598. throw anObject;
  599. return self;
  600. }
  601. }),
  602. smalltalk.Object);
  603. smalltalk.addMethod(
  604. "_try_catch_",
  605. smalltalk.method({
  606. selector: "try:catch:",
  607. fn: function (aBlock, anotherBlock) {
  608. var self = this;
  609. try {
  610. result = aBlock();
  611. } catch (e) {
  612. result = anotherBlock(e);
  613. }
  614. return result;
  615. return self;
  616. }
  617. }),
  618. smalltalk.Object);
  619. smalltalk.addMethod(
  620. "_value",
  621. smalltalk.method({
  622. selector: "value",
  623. fn: function () {
  624. var self = this;
  625. return self;
  626. }
  627. }),
  628. smalltalk.Object);
  629. smalltalk.addMethod(
  630. "_yourself",
  631. smalltalk.method({
  632. selector: "yourself",
  633. fn: function () {
  634. var self = this;
  635. return self;
  636. }
  637. }),
  638. smalltalk.Object);
  639. smalltalk.addMethod(
  640. "__tild_eq",
  641. smalltalk.method({
  642. selector: "~=",
  643. fn: function (anObject) {
  644. var self = this;
  645. var $1;
  646. $1 = smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq", [false]);
  647. return $1;
  648. }
  649. }),
  650. smalltalk.Object);
  651. smalltalk.addMethod(
  652. "__tild_tild",
  653. smalltalk.method({
  654. selector: "~~",
  655. fn: function (anObject) {
  656. var self = this;
  657. var $1;
  658. $1 = smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
  659. return $1;
  660. }
  661. }),
  662. smalltalk.Object);
  663. smalltalk.addMethod(
  664. "_initialize",
  665. smalltalk.method({
  666. selector: "initialize",
  667. fn: function () {
  668. var self = this;
  669. return self;
  670. }
  671. }),
  672. smalltalk.Object.klass);
  673. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  674. smalltalk.addMethod(
  675. "__and",
  676. smalltalk.method({
  677. selector: "&",
  678. fn: function (aBoolean) {
  679. var self = this;
  680. if (self == true) {
  681. return aBoolean;
  682. } else {
  683. return false;
  684. }
  685. return self;
  686. }
  687. }),
  688. smalltalk.Boolean);
  689. smalltalk.addMethod(
  690. "__eq",
  691. smalltalk.method({
  692. selector: "=",
  693. fn: function (aBoolean) {
  694. var self = this;
  695. var $1;
  696. $1 = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]);
  697. if (!smalltalk.assert($1)) {
  698. return false;
  699. }
  700. return Boolean(self == true) == aBoolean;
  701. return self;
  702. }
  703. }),
  704. smalltalk.Boolean);
  705. smalltalk.addMethod(
  706. "__eq_eq",
  707. smalltalk.method({
  708. selector: "==",
  709. fn: function (aBoolean) {
  710. var self = this;
  711. var $1;
  712. $1 = smalltalk.send(self, "__eq", [aBoolean]);
  713. return $1;
  714. }
  715. }),
  716. smalltalk.Boolean);
  717. smalltalk.addMethod(
  718. "_and_",
  719. smalltalk.method({
  720. selector: "and:",
  721. fn: function (aBlock) {
  722. var self = this;
  723. var $2, $1;
  724. $2 = smalltalk.send(self, "__eq", [true]);
  725. $1 = smalltalk.send($2, "_ifTrue_ifFalse_", [aBlock, function () {return false;}]);
  726. return $1;
  727. }
  728. }),
  729. smalltalk.Boolean);
  730. smalltalk.addMethod(
  731. "_asJSON",
  732. smalltalk.method({
  733. selector: "asJSON",
  734. fn: function () {
  735. var self = this;
  736. return self;
  737. }
  738. }),
  739. smalltalk.Boolean);
  740. smalltalk.addMethod(
  741. "_deepCopy",
  742. smalltalk.method({
  743. selector: "deepCopy",
  744. fn: function () {
  745. var self = this;
  746. return self;
  747. }
  748. }),
  749. smalltalk.Boolean);
  750. smalltalk.addMethod(
  751. "_ifFalse_",
  752. smalltalk.method({
  753. selector: "ifFalse:",
  754. fn: function (aBlock) {
  755. var self = this;
  756. var $1;
  757. $1 = smalltalk.send(self, "_ifTrue_ifFalse_", [function () {}, aBlock]);
  758. return $1;
  759. }
  760. }),
  761. smalltalk.Boolean);
  762. smalltalk.addMethod(
  763. "_ifFalse_ifTrue_",
  764. smalltalk.method({
  765. selector: "ifFalse:ifTrue:",
  766. fn: function (aBlock, anotherBlock) {
  767. var self = this;
  768. var $1;
  769. $1 = smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  770. return $1;
  771. }
  772. }),
  773. smalltalk.Boolean);
  774. smalltalk.addMethod(
  775. "_ifTrue_",
  776. smalltalk.method({
  777. selector: "ifTrue:",
  778. fn: function (aBlock) {
  779. var self = this;
  780. var $1;
  781. $1 = smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, function () {}]);
  782. return $1;
  783. }
  784. }),
  785. smalltalk.Boolean);
  786. smalltalk.addMethod(
  787. "_ifTrue_ifFalse_",
  788. smalltalk.method({
  789. selector: "ifTrue:ifFalse:",
  790. fn: function (aBlock, anotherBlock) {
  791. var self = this;
  792. if (self == true) {
  793. return aBlock();
  794. } else {
  795. return anotherBlock();
  796. }
  797. return self;
  798. }
  799. }),
  800. smalltalk.Boolean);
  801. smalltalk.addMethod(
  802. "_not",
  803. smalltalk.method({
  804. selector: "not",
  805. fn: function () {
  806. var self = this;
  807. var $1;
  808. $1 = smalltalk.send(self, "__eq", [false]);
  809. return $1;
  810. }
  811. }),
  812. smalltalk.Boolean);
  813. smalltalk.addMethod(
  814. "_or_",
  815. smalltalk.method({
  816. selector: "or:",
  817. fn: function (aBlock) {
  818. var self = this;
  819. var $2, $1;
  820. $2 = smalltalk.send(self, "__eq", [true]);
  821. $1 = smalltalk.send($2, "_ifTrue_ifFalse_", [function () {return true;}, aBlock]);
  822. return $1;
  823. }
  824. }),
  825. smalltalk.Boolean);
  826. smalltalk.addMethod(
  827. "_printString",
  828. smalltalk.method({
  829. selector: "printString",
  830. fn: function () {
  831. var self = this;
  832. return self.toString();
  833. return self;
  834. }
  835. }),
  836. smalltalk.Boolean);
  837. smalltalk.addMethod(
  838. "_shallowCopy",
  839. smalltalk.method({
  840. selector: "shallowCopy",
  841. fn: function () {
  842. var self = this;
  843. return self;
  844. }
  845. }),
  846. smalltalk.Boolean);
  847. smalltalk.addMethod(
  848. "__or",
  849. smalltalk.method({
  850. selector: "|",
  851. fn: function (aBoolean) {
  852. var self = this;
  853. if (self == true) {
  854. return true;
  855. } else {
  856. return aBoolean;
  857. }
  858. return self;
  859. }
  860. }),
  861. smalltalk.Boolean);
  862. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  863. smalltalk.addMethod(
  864. "_arguments",
  865. smalltalk.method({
  866. selector: "arguments",
  867. fn: function () {
  868. var self = this;
  869. return self.args || [];
  870. return self;
  871. }
  872. }),
  873. smalltalk.CompiledMethod);
  874. smalltalk.addMethod(
  875. "_category",
  876. smalltalk.method({
  877. selector: "category",
  878. fn: function () {
  879. var self = this;
  880. var $2, $1;
  881. $2 = smalltalk.send(self, "_basicAt_", ["category"]);
  882. if (($receiver = $2) == nil || $receiver == undefined) {
  883. $1 = "";
  884. } else {
  885. $1 = $2;
  886. }
  887. return $1;
  888. }
  889. }),
  890. smalltalk.CompiledMethod);
  891. smalltalk.addMethod(
  892. "_category_",
  893. smalltalk.method({
  894. selector: "category:",
  895. fn: function (aString){
  896. var self=this;
  897. var $1;
  898. var oldCategory;
  899. oldCategory=smalltalk.send(self,"_category",[]);
  900. smalltalk.send(self,"_basicAt_put_",["category",aString]);
  901. $1=smalltalk.send(self,"_methodClass",[]);
  902. if(($receiver = $1) == nil || $receiver == undefined){
  903. $1;
  904. } else {
  905. smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodClass",[]),"_organization",[]),"_addElement_",[aString]);
  906. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodClass",[]),"_methods",[]),"_select_",[(function(each){
  907. return smalltalk.send(smalltalk.send(each,"_category",[]),"__eq",[oldCategory]);
  908. })]),"_ifEmpty_",[(function(){
  909. return smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodClass",[]),"_organization",[]),"_removeElement_",[oldCategory]);
  910. })]);
  911. };
  912. return self}
  913. }),
  914. smalltalk.CompiledMethod);
  915. smalltalk.addMethod(
  916. "_fn",
  917. smalltalk.method({
  918. selector: "fn",
  919. fn: function () {
  920. var self = this;
  921. var $1;
  922. $1 = smalltalk.send(self, "_basicAt_", ["fn"]);
  923. return $1;
  924. }
  925. }),
  926. smalltalk.CompiledMethod);
  927. smalltalk.addMethod(
  928. "_fn_",
  929. smalltalk.method({
  930. selector: "fn:",
  931. fn: function (aBlock) {
  932. var self = this;
  933. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  934. return self;
  935. }
  936. }),
  937. smalltalk.CompiledMethod);
  938. smalltalk.addMethod(
  939. "_messageSends",
  940. smalltalk.method({
  941. selector: "messageSends",
  942. fn: function () {
  943. var self = this;
  944. var $1;
  945. $1 = smalltalk.send(self, "_basicAt_", ["messageSends"]);
  946. return $1;
  947. }
  948. }),
  949. smalltalk.CompiledMethod);
  950. smalltalk.addMethod(
  951. "_methodClass",
  952. smalltalk.method({
  953. selector: "methodClass",
  954. fn: function () {
  955. var self = this;
  956. var $1;
  957. $1 = smalltalk.send(self, "_basicAt_", ["methodClass"]);
  958. return $1;
  959. }
  960. }),
  961. smalltalk.CompiledMethod);
  962. smalltalk.addMethod(
  963. "_protocol",
  964. smalltalk.method({
  965. selector: "protocol",
  966. fn: function () {
  967. var self = this;
  968. var $1;
  969. $1 = smalltalk.send(self, "_category", []);
  970. return $1;
  971. }
  972. }),
  973. smalltalk.CompiledMethod);
  974. smalltalk.addMethod(
  975. "_referencedClasses",
  976. smalltalk.method({
  977. selector: "referencedClasses",
  978. fn: function () {
  979. var self = this;
  980. var $1;
  981. $1 = smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  982. return $1;
  983. }
  984. }),
  985. smalltalk.CompiledMethod);
  986. smalltalk.addMethod(
  987. "_selector",
  988. smalltalk.method({
  989. selector: "selector",
  990. fn: function () {
  991. var self = this;
  992. var $1;
  993. $1 = smalltalk.send(self, "_basicAt_", ["selector"]);
  994. return $1;
  995. }
  996. }),
  997. smalltalk.CompiledMethod);
  998. smalltalk.addMethod(
  999. "_selector_",
  1000. smalltalk.method({
  1001. selector: "selector:",
  1002. fn: function (aString) {
  1003. var self = this;
  1004. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  1005. return self;
  1006. }
  1007. }),
  1008. smalltalk.CompiledMethod);
  1009. smalltalk.addMethod(
  1010. "_source",
  1011. smalltalk.method({
  1012. selector: "source",
  1013. fn: function () {
  1014. var self = this;
  1015. var $2, $1;
  1016. $2 = smalltalk.send(self, "_basicAt_", ["source"]);
  1017. if (($receiver = $2) == nil || $receiver == undefined) {
  1018. $1 = "";
  1019. } else {
  1020. $1 = $2;
  1021. }
  1022. return $1;
  1023. }
  1024. }),
  1025. smalltalk.CompiledMethod);
  1026. smalltalk.addMethod(
  1027. "_source_",
  1028. smalltalk.method({
  1029. selector: "source:",
  1030. fn: function (aString) {
  1031. var self = this;
  1032. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  1033. return self;
  1034. }
  1035. }),
  1036. smalltalk.CompiledMethod);
  1037. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  1038. smalltalk.addMethod(
  1039. "__plus",
  1040. smalltalk.method({
  1041. selector: "+",
  1042. fn: function (aDate) {
  1043. var self = this;
  1044. return self + aDate;
  1045. return self;
  1046. }
  1047. }),
  1048. smalltalk.Date);
  1049. smalltalk.addMethod(
  1050. "__minus",
  1051. smalltalk.method({
  1052. selector: "-",
  1053. fn: function (aDate) {
  1054. var self = this;
  1055. return self - aDate;
  1056. return self;
  1057. }
  1058. }),
  1059. smalltalk.Date);
  1060. smalltalk.addMethod(
  1061. "__lt",
  1062. smalltalk.method({
  1063. selector: "<",
  1064. fn: function (aDate) {
  1065. var self = this;
  1066. return self < aDate;
  1067. return self;
  1068. }
  1069. }),
  1070. smalltalk.Date);
  1071. smalltalk.addMethod(
  1072. "__lt_eq",
  1073. smalltalk.method({
  1074. selector: "<=",
  1075. fn: function (aDate) {
  1076. var self = this;
  1077. return self <= aDate;
  1078. return self;
  1079. }
  1080. }),
  1081. smalltalk.Date);
  1082. smalltalk.addMethod(
  1083. "__gt",
  1084. smalltalk.method({
  1085. selector: ">",
  1086. fn: function (aDate) {
  1087. var self = this;
  1088. return self > aDate;
  1089. return self;
  1090. }
  1091. }),
  1092. smalltalk.Date);
  1093. smalltalk.addMethod(
  1094. "__gt_eq",
  1095. smalltalk.method({
  1096. selector: ">=",
  1097. fn: function (aDate) {
  1098. var self = this;
  1099. return self >= aDate;
  1100. return self;
  1101. }
  1102. }),
  1103. smalltalk.Date);
  1104. smalltalk.addMethod(
  1105. "_asDateString",
  1106. smalltalk.method({
  1107. selector: "asDateString",
  1108. fn: function () {
  1109. var self = this;
  1110. return self.toDateString();
  1111. return self;
  1112. }
  1113. }),
  1114. smalltalk.Date);
  1115. smalltalk.addMethod(
  1116. "_asLocaleString",
  1117. smalltalk.method({
  1118. selector: "asLocaleString",
  1119. fn: function () {
  1120. var self = this;
  1121. return self.toLocaleString();
  1122. return self;
  1123. }
  1124. }),
  1125. smalltalk.Date);
  1126. smalltalk.addMethod(
  1127. "_asMilliseconds",
  1128. smalltalk.method({
  1129. selector: "asMilliseconds",
  1130. fn: function () {
  1131. var self = this;
  1132. var $1;
  1133. $1 = smalltalk.send(self, "_time", []);
  1134. return $1;
  1135. }
  1136. }),
  1137. smalltalk.Date);
  1138. smalltalk.addMethod(
  1139. "_asNumber",
  1140. smalltalk.method({
  1141. selector: "asNumber",
  1142. fn: function () {
  1143. var self = this;
  1144. var $1;
  1145. $1 = smalltalk.send(self, "_asMilliseconds", []);
  1146. return $1;
  1147. }
  1148. }),
  1149. smalltalk.Date);
  1150. smalltalk.addMethod(
  1151. "_asString",
  1152. smalltalk.method({
  1153. selector: "asString",
  1154. fn: function () {
  1155. var self = this;
  1156. return self.toString();
  1157. return self;
  1158. }
  1159. }),
  1160. smalltalk.Date);
  1161. smalltalk.addMethod(
  1162. "_asTimeString",
  1163. smalltalk.method({
  1164. selector: "asTimeString",
  1165. fn: function () {
  1166. var self = this;
  1167. return self.toTimeString();
  1168. return self;
  1169. }
  1170. }),
  1171. smalltalk.Date);
  1172. smalltalk.addMethod(
  1173. "_day",
  1174. smalltalk.method({
  1175. selector: "day",
  1176. fn: function () {
  1177. var self = this;
  1178. var $1;
  1179. $1 = smalltalk.send(self, "_dayOfWeek", []);
  1180. return $1;
  1181. }
  1182. }),
  1183. smalltalk.Date);
  1184. smalltalk.addMethod(
  1185. "_day_",
  1186. smalltalk.method({
  1187. selector: "day:",
  1188. fn: function (aNumber) {
  1189. var self = this;
  1190. smalltalk.send(self, "_dayOfWeek_", [aNumber]);
  1191. return self;
  1192. }
  1193. }),
  1194. smalltalk.Date);
  1195. smalltalk.addMethod(
  1196. "_dayOfMonth",
  1197. smalltalk.method({
  1198. selector: "dayOfMonth",
  1199. fn: function () {
  1200. var self = this;
  1201. return self.getDate();
  1202. return self;
  1203. }
  1204. }),
  1205. smalltalk.Date);
  1206. smalltalk.addMethod(
  1207. "_dayOfMonth_",
  1208. smalltalk.method({
  1209. selector: "dayOfMonth:",
  1210. fn: function (aNumber) {
  1211. var self = this;
  1212. self.setDate(aNumber);
  1213. return self;
  1214. }
  1215. }),
  1216. smalltalk.Date);
  1217. smalltalk.addMethod(
  1218. "_dayOfWeek",
  1219. smalltalk.method({
  1220. selector: "dayOfWeek",
  1221. fn: function () {
  1222. var self = this;
  1223. return self.getDay() + 1;
  1224. return self;
  1225. }
  1226. }),
  1227. smalltalk.Date);
  1228. smalltalk.addMethod(
  1229. "_dayOfWeek_",
  1230. smalltalk.method({
  1231. selector: "dayOfWeek:",
  1232. fn: function (aNumber) {
  1233. var self = this;
  1234. return self.setDay(aNumber - 1);
  1235. return self;
  1236. }
  1237. }),
  1238. smalltalk.Date);
  1239. smalltalk.addMethod(
  1240. "_hours",
  1241. smalltalk.method({
  1242. selector: "hours",
  1243. fn: function () {
  1244. var self = this;
  1245. return self.getHours();
  1246. return self;
  1247. }
  1248. }),
  1249. smalltalk.Date);
  1250. smalltalk.addMethod(
  1251. "_hours_",
  1252. smalltalk.method({
  1253. selector: "hours:",
  1254. fn: function (aNumber) {
  1255. var self = this;
  1256. self.setHours(aNumber);
  1257. return self;
  1258. }
  1259. }),
  1260. smalltalk.Date);
  1261. smalltalk.addMethod(
  1262. "_milliseconds",
  1263. smalltalk.method({
  1264. selector: "milliseconds",
  1265. fn: function () {
  1266. var self = this;
  1267. return self.getMilliseconds();
  1268. return self;
  1269. }
  1270. }),
  1271. smalltalk.Date);
  1272. smalltalk.addMethod(
  1273. "_milliseconds_",
  1274. smalltalk.method({
  1275. selector: "milliseconds:",
  1276. fn: function (aNumber) {
  1277. var self = this;
  1278. self.setMilliseconds(aNumber);
  1279. return self;
  1280. }
  1281. }),
  1282. smalltalk.Date);
  1283. smalltalk.addMethod(
  1284. "_minutes",
  1285. smalltalk.method({
  1286. selector: "minutes",
  1287. fn: function () {
  1288. var self = this;
  1289. return self.getMinutes();
  1290. return self;
  1291. }
  1292. }),
  1293. smalltalk.Date);
  1294. smalltalk.addMethod(
  1295. "_minutes_",
  1296. smalltalk.method({
  1297. selector: "minutes:",
  1298. fn: function (aNumber) {
  1299. var self = this;
  1300. self.setMinutes(aNumber);
  1301. return self;
  1302. }
  1303. }),
  1304. smalltalk.Date);
  1305. smalltalk.addMethod(
  1306. "_month",
  1307. smalltalk.method({
  1308. selector: "month",
  1309. fn: function () {
  1310. var self = this;
  1311. return self.getMonth() + 1;
  1312. return self;
  1313. }
  1314. }),
  1315. smalltalk.Date);
  1316. smalltalk.addMethod(
  1317. "_month_",
  1318. smalltalk.method({
  1319. selector: "month:",
  1320. fn: function (aNumber) {
  1321. var self = this;
  1322. self.setMonth(aNumber - 1);
  1323. return self;
  1324. }
  1325. }),
  1326. smalltalk.Date);
  1327. smalltalk.addMethod(
  1328. "_printString",
  1329. smalltalk.method({
  1330. selector: "printString",
  1331. fn: function () {
  1332. var self = this;
  1333. var $1;
  1334. $1 = smalltalk.send(self, "_asString", []);
  1335. return $1;
  1336. }
  1337. }),
  1338. smalltalk.Date);
  1339. smalltalk.addMethod(
  1340. "_seconds",
  1341. smalltalk.method({
  1342. selector: "seconds",
  1343. fn: function () {
  1344. var self = this;
  1345. return self.getSeconds();
  1346. return self;
  1347. }
  1348. }),
  1349. smalltalk.Date);
  1350. smalltalk.addMethod(
  1351. "_seconds_",
  1352. smalltalk.method({
  1353. selector: "seconds:",
  1354. fn: function (aNumber) {
  1355. var self = this;
  1356. self.setSeconds(aNumber);
  1357. return self;
  1358. }
  1359. }),
  1360. smalltalk.Date);
  1361. smalltalk.addMethod(
  1362. "_time",
  1363. smalltalk.method({
  1364. selector: "time",
  1365. fn: function () {
  1366. var self = this;
  1367. return self.getTime();
  1368. return self;
  1369. }
  1370. }),
  1371. smalltalk.Date);
  1372. smalltalk.addMethod(
  1373. "_time_",
  1374. smalltalk.method({
  1375. selector: "time:",
  1376. fn: function (aNumber) {
  1377. var self = this;
  1378. self.setTime(aNumber);
  1379. return self;
  1380. }
  1381. }),
  1382. smalltalk.Date);
  1383. smalltalk.addMethod(
  1384. "_year",
  1385. smalltalk.method({
  1386. selector: "year",
  1387. fn: function () {
  1388. var self = this;
  1389. return self.getFullYear();
  1390. return self;
  1391. }
  1392. }),
  1393. smalltalk.Date);
  1394. smalltalk.addMethod(
  1395. "_year_",
  1396. smalltalk.method({
  1397. selector: "year:",
  1398. fn: function (aNumber) {
  1399. var self = this;
  1400. self.setFullYear(aNumber);
  1401. return self;
  1402. }
  1403. }),
  1404. smalltalk.Date);
  1405. smalltalk.addMethod(
  1406. "_fromMilliseconds_",
  1407. smalltalk.method({
  1408. selector: "fromMilliseconds:",
  1409. fn: function (aNumber) {
  1410. var self = this;
  1411. var $1;
  1412. $1 = smalltalk.send(self, "_new_", [aNumber]);
  1413. return $1;
  1414. }
  1415. }),
  1416. smalltalk.Date.klass);
  1417. smalltalk.addMethod(
  1418. "_fromSeconds_",
  1419. smalltalk.method({
  1420. selector: "fromSeconds:",
  1421. fn: function (aNumber) {
  1422. var self = this;
  1423. var $1;
  1424. $1 = smalltalk.send(self, "_fromMilliseconds_", [smalltalk.send(aNumber, "__star", [1000])]);
  1425. return $1;
  1426. }
  1427. }),
  1428. smalltalk.Date.klass);
  1429. smalltalk.addMethod(
  1430. "_fromString_",
  1431. smalltalk.method({
  1432. selector: "fromString:",
  1433. fn: function (aString) {
  1434. var self = this;
  1435. var $1;
  1436. $1 = smalltalk.send(self, "_new_", [aString]);
  1437. return $1;
  1438. }
  1439. }),
  1440. smalltalk.Date.klass);
  1441. smalltalk.addMethod(
  1442. "_millisecondsToRun_",
  1443. smalltalk.method({
  1444. selector: "millisecondsToRun:",
  1445. fn: function (aBlock) {
  1446. var self = this;
  1447. var $1;
  1448. var t;
  1449. t = smalltalk.send(smalltalk.Date || Date, "_now", []);
  1450. smalltalk.send(aBlock, "_value", []);
  1451. $1 = smalltalk.send(smalltalk.send(smalltalk.Date || Date, "_now", []), "__minus", [t]);
  1452. return $1;
  1453. }
  1454. }),
  1455. smalltalk.Date.klass);
  1456. smalltalk.addMethod(
  1457. "_new_",
  1458. smalltalk.method({
  1459. selector: "new:",
  1460. fn: function (anObject) {
  1461. var self = this;
  1462. return new Date(anObject);
  1463. return self;
  1464. }
  1465. }),
  1466. smalltalk.Date.klass);
  1467. smalltalk.addMethod(
  1468. "_now",
  1469. smalltalk.method({
  1470. selector: "now",
  1471. fn: function () {
  1472. var self = this;
  1473. var $1;
  1474. $1 = smalltalk.send(self, "_today", []);
  1475. return $1;
  1476. }
  1477. }),
  1478. smalltalk.Date.klass);
  1479. smalltalk.addMethod(
  1480. "_today",
  1481. smalltalk.method({
  1482. selector: "today",
  1483. fn: function () {
  1484. var self = this;
  1485. var $1;
  1486. $1 = smalltalk.send(self, "_new", []);
  1487. return $1;
  1488. }
  1489. }),
  1490. smalltalk.Date.klass);
  1491. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  1492. smalltalk.addMethod(
  1493. "_addObjectVariablesTo_",
  1494. smalltalk.method({
  1495. selector: "addObjectVariablesTo:",
  1496. fn: function (aDictionary){
  1497. var self=this;
  1498. return smalltalk.withContext(function($ctx1) { for(var i in self['@jsObject']) {
  1499. aDictionary._at_put_(i, self['@jsObject'][i]);
  1500. };
  1501. ;
  1502. return self}, self, "addObjectVariablesTo:", [aDictionary], smalltalk.JSObjectProxy)}
  1503. }),
  1504. smalltalk.JSObjectProxy);
  1505. smalltalk.addMethod(
  1506. "_at_",
  1507. smalltalk.method({
  1508. selector: "at:",
  1509. fn: function (aSymbol){
  1510. var self=this;
  1511. return smalltalk.withContext(function($ctx1) { return self['@jsObject'][aSymbol._asString()];
  1512. ;
  1513. return self}, self, "at:", [aSymbol], smalltalk.JSObjectProxy)}
  1514. }),
  1515. smalltalk.JSObjectProxy);
  1516. smalltalk.addMethod(
  1517. "_at_put_",
  1518. smalltalk.method({
  1519. selector: "at:put:",
  1520. fn: function (aSymbol,anObject){
  1521. var self=this;
  1522. return smalltalk.withContext(function($ctx1) { self['@jsObject'][aSymbol._asString()] = anObject;
  1523. ;
  1524. return self}, self, "at:put:", [aSymbol,anObject], smalltalk.JSObjectProxy)}
  1525. }),
  1526. smalltalk.JSObjectProxy);
  1527. smalltalk.addMethod(
  1528. "_doesNotUnderstand_",
  1529. smalltalk.method({
  1530. selector: "doesNotUnderstand:",
  1531. fn: function (aMessage){
  1532. var self=this;
  1533. return smalltalk.withContext(function($ctx1) {
  1534. var jsSelector = aMessage._selector()._asJavaScriptSelector();
  1535. var object = self._jsObject();
  1536. if(jsSelector in object) {
  1537. return smalltalk.send(object, jsSelector, aMessage._arguments());
  1538. }
  1539. ;
  1540. ;
  1541. smalltalk.Object.fn.prototype._doesNotUnderstand_.apply(_st(self), [aMessage]);
  1542. return self}, self, "doesNotUnderstand:", [aMessage], smalltalk.JSObjectProxy)}
  1543. }),
  1544. smalltalk.JSObjectProxy);
  1545. smalltalk.addMethod(
  1546. "_inspectOn_",
  1547. smalltalk.method({
  1548. selector: "inspectOn:",
  1549. fn: function (anInspector){
  1550. var self=this;
  1551. return smalltalk.withContext(function($ctx1) { $ctx1.variables=nil;
  1552. $ctx1.variables=_st((smalltalk.Dictionary || Dictionary))._new();
  1553. _st($ctx1.variables)._at_put_("#self",_st(self)._jsObject());
  1554. _st(anInspector)._setLabel_(_st(self)._printString());
  1555. _st(self)._addObjectVariablesTo_($ctx1.variables);
  1556. _st(anInspector)._setVariables_($ctx1.variables);
  1557. return self}, self, "inspectOn:", [anInspector], smalltalk.JSObjectProxy)}
  1558. }),
  1559. smalltalk.JSObjectProxy);
  1560. smalltalk.addMethod(
  1561. "_jsObject",
  1562. smalltalk.method({
  1563. selector: "jsObject",
  1564. fn: function () {
  1565. var self = this;
  1566. return self['@jsObject'];
  1567. }
  1568. }),
  1569. smalltalk.JSObjectProxy);
  1570. smalltalk.addMethod(
  1571. "_jsObject_",
  1572. smalltalk.method({
  1573. selector: "jsObject:",
  1574. fn: function (aJSObject) {
  1575. var self = this;
  1576. self['@jsObject'] = aJSObject;
  1577. return self;
  1578. }
  1579. }),
  1580. smalltalk.JSObjectProxy);
  1581. smalltalk.addMethod(
  1582. "_printString",
  1583. smalltalk.method({
  1584. selector: "printString",
  1585. fn: function () {
  1586. var self = this;
  1587. var $1;
  1588. $1 = smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  1589. return $1;
  1590. }
  1591. }),
  1592. smalltalk.JSObjectProxy);
  1593. smalltalk.addMethod(
  1594. "_on_",
  1595. smalltalk.method({
  1596. selector: "on:",
  1597. fn: function (aJSObject) {
  1598. var self = this;
  1599. var $2, $3, $1;
  1600. $2 = smalltalk.send(self, "_new", []);
  1601. smalltalk.send($2, "_jsObject_", [aJSObject]);
  1602. $3 = smalltalk.send($2, "_yourself", []);
  1603. $1 = $3;
  1604. return $1;
  1605. }
  1606. }),
  1607. smalltalk.JSObjectProxy.klass);
  1608. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  1609. smalltalk.addMethod(
  1610. "__and",
  1611. smalltalk.method({
  1612. selector: "&",
  1613. fn: function (aNumber) {
  1614. var self = this;
  1615. return self & aNumber;
  1616. return self;
  1617. }
  1618. }),
  1619. smalltalk.Number);
  1620. smalltalk.addMethod(
  1621. "__star",
  1622. smalltalk.method({
  1623. selector: "*",
  1624. fn: function (aNumber) {
  1625. var self = this;
  1626. return self * aNumber;
  1627. return self;
  1628. }
  1629. }),
  1630. smalltalk.Number);
  1631. smalltalk.addMethod(
  1632. "__plus",
  1633. smalltalk.method({
  1634. selector: "+",
  1635. fn: function (aNumber) {
  1636. var self = this;
  1637. return self + aNumber;
  1638. return self;
  1639. }
  1640. }),
  1641. smalltalk.Number);
  1642. smalltalk.addMethod(
  1643. "__minus",
  1644. smalltalk.method({
  1645. selector: "-",
  1646. fn: function (aNumber) {
  1647. var self = this;
  1648. return self - aNumber;
  1649. return self;
  1650. }
  1651. }),
  1652. smalltalk.Number);
  1653. smalltalk.addMethod(
  1654. "__slash",
  1655. smalltalk.method({
  1656. selector: "/",
  1657. fn: function (aNumber) {
  1658. var self = this;
  1659. return self / aNumber;
  1660. return self;
  1661. }
  1662. }),
  1663. smalltalk.Number);
  1664. smalltalk.addMethod(
  1665. "__lt",
  1666. smalltalk.method({
  1667. selector: "<",
  1668. fn: function (aNumber) {
  1669. var self = this;
  1670. return self < aNumber;
  1671. return self;
  1672. }
  1673. }),
  1674. smalltalk.Number);
  1675. smalltalk.addMethod(
  1676. "__lt_eq",
  1677. smalltalk.method({
  1678. selector: "<=",
  1679. fn: function (aNumber) {
  1680. var self = this;
  1681. return self <= aNumber;
  1682. return self;
  1683. }
  1684. }),
  1685. smalltalk.Number);
  1686. smalltalk.addMethod(
  1687. "__eq",
  1688. smalltalk.method({
  1689. selector: "=",
  1690. fn: function (aNumber) {
  1691. var self = this;
  1692. var $1;
  1693. $1 = smalltalk.send(aNumber, "_isNumber", []);
  1694. if (!smalltalk.assert($1)) {
  1695. return false;
  1696. }
  1697. return Number(self) == aNumber;
  1698. return self;
  1699. }
  1700. }),
  1701. smalltalk.Number);
  1702. smalltalk.addMethod(
  1703. "__gt",
  1704. smalltalk.method({
  1705. selector: ">",
  1706. fn: function (aNumber) {
  1707. var self = this;
  1708. return self > aNumber;
  1709. return self;
  1710. }
  1711. }),
  1712. smalltalk.Number);
  1713. smalltalk.addMethod(
  1714. "__gt_eq",
  1715. smalltalk.method({
  1716. selector: ">=",
  1717. fn: function (aNumber) {
  1718. var self = this;
  1719. return self >= aNumber;
  1720. return self;
  1721. }
  1722. }),
  1723. smalltalk.Number);
  1724. smalltalk.addMethod(
  1725. "__at",
  1726. smalltalk.method({
  1727. selector: "@",
  1728. fn: function (aNumber) {
  1729. var self = this;
  1730. var $1;
  1731. $1 = smalltalk.send(smalltalk.Point || Point, "_x_y_", [self, aNumber]);
  1732. return $1;
  1733. }
  1734. }),
  1735. smalltalk.Number);
  1736. smalltalk.addMethod(
  1737. "__backslash_backslash",
  1738. smalltalk.method({
  1739. selector: "\x5c\x5c",
  1740. fn: function (aNumber) {
  1741. var self = this;
  1742. return self % aNumber;
  1743. return self;
  1744. }
  1745. }),
  1746. smalltalk.Number);
  1747. smalltalk.addMethod(
  1748. "_abs",
  1749. smalltalk.method({
  1750. selector: "abs",
  1751. fn: function () {
  1752. var self = this;
  1753. var $1;
  1754. $1 = Math.abs(self);
  1755. return $1;
  1756. }
  1757. }),
  1758. smalltalk.Number);
  1759. smalltalk.addMethod(
  1760. "_asJSON",
  1761. smalltalk.method({
  1762. selector: "asJSON",
  1763. fn: function () {
  1764. var self = this;
  1765. return self;
  1766. }
  1767. }),
  1768. smalltalk.Number);
  1769. smalltalk.addMethod(
  1770. "_asJavascript",
  1771. smalltalk.method({
  1772. selector: "asJavascript",
  1773. fn: function () {
  1774. var self = this;
  1775. var $1;
  1776. $1 = smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [")"]);
  1777. return $1;
  1778. }
  1779. }),
  1780. smalltalk.Number);
  1781. smalltalk.addMethod(
  1782. "_asPoint",
  1783. smalltalk.method({
  1784. selector: "asPoint",
  1785. fn: function () {
  1786. var self = this;
  1787. var $1;
  1788. $1 = smalltalk.send(smalltalk.Point || Point, "_x_y_", [self, self]);
  1789. return $1;
  1790. }
  1791. }),
  1792. smalltalk.Number);
  1793. smalltalk.addMethod(
  1794. "_asString",
  1795. smalltalk.method({
  1796. selector: "asString",
  1797. fn: function () {
  1798. var self = this;
  1799. var $1;
  1800. $1 = smalltalk.send(self, "_printString", []);
  1801. return $1;
  1802. }
  1803. }),
  1804. smalltalk.Number);
  1805. smalltalk.addMethod(
  1806. "_atRandom",
  1807. smalltalk.method({
  1808. selector: "atRandom",
  1809. fn: function () {
  1810. var self = this;
  1811. var $1;
  1812. $1 = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Random || Random, "_new", []), "_next", []), "__star", [self]), "_truncated", []), "__plus", [1]);
  1813. return $1;
  1814. }
  1815. }),
  1816. smalltalk.Number);
  1817. smalltalk.addMethod(
  1818. "_clearInterval",
  1819. smalltalk.method({
  1820. selector: "clearInterval",
  1821. fn: function () {
  1822. var self = this;
  1823. clearInterval(Number(self));
  1824. return self;
  1825. }
  1826. }),
  1827. smalltalk.Number);
  1828. smalltalk.addMethod(
  1829. "_clearTimeout",
  1830. smalltalk.method({
  1831. selector: "clearTimeout",
  1832. fn: function () {
  1833. var self = this;
  1834. clearTimeout(Number(self));
  1835. return self;
  1836. }
  1837. }),
  1838. smalltalk.Number);
  1839. smalltalk.addMethod(
  1840. "_copy",
  1841. smalltalk.method({
  1842. selector: "copy",
  1843. fn: function () {
  1844. var self = this;
  1845. return self;
  1846. }
  1847. }),
  1848. smalltalk.Number);
  1849. smalltalk.addMethod(
  1850. "_deepCopy",
  1851. smalltalk.method({
  1852. selector: "deepCopy",
  1853. fn: function () {
  1854. var self = this;
  1855. var $1;
  1856. $1 = smalltalk.send(self, "_copy", []);
  1857. return $1;
  1858. }
  1859. }),
  1860. smalltalk.Number);
  1861. smalltalk.addMethod(
  1862. "_even",
  1863. smalltalk.method({
  1864. selector: "even",
  1865. fn: function () {
  1866. var self = this;
  1867. var $1;
  1868. $1 = smalltalk.send(0, "__eq", [smalltalk.send(self, "_\\\\", [2])]);
  1869. return $1;
  1870. }
  1871. }),
  1872. smalltalk.Number);
  1873. smalltalk.addMethod(
  1874. "_identityHash",
  1875. smalltalk.method({
  1876. selector: "identityHash",
  1877. fn: function () {
  1878. var self = this;
  1879. var $1;
  1880. $1 = smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", ["n"]);
  1881. return $1;
  1882. }
  1883. }),
  1884. smalltalk.Number);
  1885. smalltalk.addMethod(
  1886. "_isNumber",
  1887. smalltalk.method({
  1888. selector: "isNumber",
  1889. fn: function () {
  1890. var self = this;
  1891. return true;
  1892. }
  1893. }),
  1894. smalltalk.Number);
  1895. smalltalk.addMethod(
  1896. "_isZero",
  1897. smalltalk.method({
  1898. selector: "isZero",
  1899. fn: function () {
  1900. var self = this;
  1901. var $1;
  1902. $1 = smalltalk.send(self, "__eq", [0]);
  1903. return $1;
  1904. }
  1905. }),
  1906. smalltalk.Number);
  1907. smalltalk.addMethod(
  1908. "_max_",
  1909. smalltalk.method({
  1910. selector: "max:",
  1911. fn: function (aNumber) {
  1912. var self = this;
  1913. return Math.max(self, aNumber);
  1914. return self;
  1915. }
  1916. }),
  1917. smalltalk.Number);
  1918. smalltalk.addMethod(
  1919. "_min_",
  1920. smalltalk.method({
  1921. selector: "min:",
  1922. fn: function (aNumber) {
  1923. var self = this;
  1924. return Math.min(self, aNumber);
  1925. return self;
  1926. }
  1927. }),
  1928. smalltalk.Number);
  1929. smalltalk.addMethod(
  1930. "_negated",
  1931. smalltalk.method({
  1932. selector: "negated",
  1933. fn: function () {
  1934. var self = this;
  1935. var $1;
  1936. $1 = smalltalk.send(0, "__minus", [self]);
  1937. return $1;
  1938. }
  1939. }),
  1940. smalltalk.Number);
  1941. smalltalk.addMethod(
  1942. "_negative",
  1943. smalltalk.method({
  1944. selector: "negative",
  1945. fn: function () {
  1946. var self = this;
  1947. var $1;
  1948. $1 = smalltalk.send(self, "__lt", [0]);
  1949. return $1;
  1950. }
  1951. }),
  1952. smalltalk.Number);
  1953. smalltalk.addMethod(
  1954. "_odd",
  1955. smalltalk.method({
  1956. selector: "odd",
  1957. fn: function () {
  1958. var self = this;
  1959. var $1;
  1960. $1 = smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  1961. return $1;
  1962. }
  1963. }),
  1964. smalltalk.Number);
  1965. smalltalk.addMethod(
  1966. "_positive",
  1967. smalltalk.method({
  1968. selector: "positive",
  1969. fn: function () {
  1970. var self = this;
  1971. var $1;
  1972. $1 = smalltalk.send(self, "__gt_eq", [0]);
  1973. return $1;
  1974. }
  1975. }),
  1976. smalltalk.Number);
  1977. smalltalk.addMethod(
  1978. "_printShowingDecimalPlaces_",
  1979. smalltalk.method({
  1980. selector: "printShowingDecimalPlaces:",
  1981. fn: function (placesDesired) {
  1982. var self = this;
  1983. return self.toFixed(placesDesired);
  1984. return self;
  1985. }
  1986. }),
  1987. smalltalk.Number);
  1988. smalltalk.addMethod(
  1989. "_printString",
  1990. smalltalk.method({
  1991. selector: "printString",
  1992. fn: function () {
  1993. var self = this;
  1994. return String(self);
  1995. return self;
  1996. }
  1997. }),
  1998. smalltalk.Number);
  1999. smalltalk.addMethod(
  2000. "_rounded",
  2001. smalltalk.method({
  2002. selector: "rounded",
  2003. fn: function () {
  2004. var self = this;
  2005. return Math.round(self);
  2006. return self;
  2007. }
  2008. }),
  2009. smalltalk.Number);
  2010. smalltalk.addMethod(
  2011. "_sqrt",
  2012. smalltalk.method({
  2013. selector: "sqrt",
  2014. fn: function () {
  2015. var self = this;
  2016. return Math.sqrt(self);
  2017. return self;
  2018. }
  2019. }),
  2020. smalltalk.Number);
  2021. smalltalk.addMethod(
  2022. "_squared",
  2023. smalltalk.method({
  2024. selector: "squared",
  2025. fn: function () {
  2026. var self = this;
  2027. var $1;
  2028. $1 = smalltalk.send(self, "__star", [self]);
  2029. return $1;
  2030. }
  2031. }),
  2032. smalltalk.Number);
  2033. smalltalk.addMethod(
  2034. "_timesRepeat_",
  2035. smalltalk.method({
  2036. selector: "timesRepeat:",
  2037. fn: function (aBlock) {
  2038. var self = this;
  2039. var integer;
  2040. var count;
  2041. integer = smalltalk.send(self, "_truncated", []);
  2042. count = 1;
  2043. smalltalk.send(function () {return smalltalk.send(count, "__gt", [self]);}, "_whileFalse_", [function () {smalltalk.send(aBlock, "_value", []);count = smalltalk.send(count, "__plus", [1]);return count;}]);
  2044. return self;
  2045. }
  2046. }),
  2047. smalltalk.Number);
  2048. smalltalk.addMethod(
  2049. "_to_",
  2050. smalltalk.method({
  2051. selector: "to:",
  2052. fn: function (aNumber) {
  2053. var self = this;
  2054. var array;
  2055. var first;
  2056. var last;
  2057. var count;
  2058. first = smalltalk.send(self, "_truncated", []);
  2059. last = smalltalk.send(smalltalk.send(aNumber, "_truncated", []), "__plus", [1]);
  2060. count = 1;
  2061. array = smalltalk.send(smalltalk.Array || Array, "_new", []);
  2062. smalltalk.send(smalltalk.send(last, "__minus", [first]), "_timesRepeat_", [function () {smalltalk.send(array, "_at_put_", [count, first]);count = smalltalk.send(count, "__plus", [1]);count;first = smalltalk.send(first, "__plus", [1]);return first;}]);
  2063. return array;
  2064. }
  2065. }),
  2066. smalltalk.Number);
  2067. smalltalk.addMethod(
  2068. "_to_by_",
  2069. smalltalk.method({
  2070. selector: "to:by:",
  2071. fn: function (stop, step) {
  2072. var self = this;
  2073. var $1, $2;
  2074. var array;
  2075. var value;
  2076. var pos;
  2077. value = self;
  2078. array = smalltalk.send(smalltalk.Array || Array, "_new", []);
  2079. pos = 1;
  2080. $1 = smalltalk.send(step, "__eq", [0]);
  2081. if (smalltalk.assert($1)) {
  2082. smalltalk.send(self, "_error_", ["step must be non-zero"]);
  2083. }
  2084. $2 = smalltalk.send(step, "__lt", [0]);
  2085. if (smalltalk.assert($2)) {
  2086. smalltalk.send(function () {return smalltalk.send(value, "__gt_eq", [stop]);}, "_whileTrue_", [function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = smalltalk.send(pos, "__plus", [1]);pos;value = smalltalk.send(value, "__plus", [step]);return value;}]);
  2087. } else {
  2088. smalltalk.send(function () {return smalltalk.send(value, "__lt_eq", [stop]);}, "_whileTrue_", [function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = smalltalk.send(pos, "__plus", [1]);pos;value = smalltalk.send(value, "__plus", [step]);return value;}]);
  2089. }
  2090. return array;
  2091. }
  2092. }),
  2093. smalltalk.Number);
  2094. smalltalk.addMethod(
  2095. "_to_by_do_",
  2096. smalltalk.method({
  2097. selector: "to:by:do:",
  2098. fn: function (stop, step, aBlock) {
  2099. var self = this;
  2100. var $1, $2;
  2101. var value;
  2102. value = self;
  2103. $1 = smalltalk.send(step, "__eq", [0]);
  2104. if (smalltalk.assert($1)) {
  2105. smalltalk.send(self, "_error_", ["step must be non-zero"]);
  2106. }
  2107. $2 = smalltalk.send(step, "__lt", [0]);
  2108. if (smalltalk.assert($2)) {
  2109. smalltalk.send(function () {return smalltalk.send(value, "__gt_eq", [stop]);}, "_whileTrue_", [function () {smalltalk.send(aBlock, "_value_", [value]);value = smalltalk.send(value, "__plus", [step]);return value;}]);
  2110. } else {
  2111. smalltalk.send(function () {return smalltalk.send(value, "__lt_eq", [stop]);}, "_whileTrue_", [function () {smalltalk.send(aBlock, "_value_", [value]);value = smalltalk.send(value, "__plus", [step]);return value;}]);
  2112. }
  2113. return self;
  2114. }
  2115. }),
  2116. smalltalk.Number);
  2117. smalltalk.addMethod(
  2118. "_to_do_",
  2119. smalltalk.method({
  2120. selector: "to:do:",
  2121. fn: function (stop, aBlock) {
  2122. var self = this;
  2123. var nextValue;
  2124. nextValue = self;
  2125. smalltalk.send(function () {return smalltalk.send(nextValue, "__lt_eq", [stop]);}, "_whileTrue_", [function () {smalltalk.send(aBlock, "_value_", [nextValue]);nextValue = smalltalk.send(nextValue, "__plus", [1]);return nextValue;}]);
  2126. return self;
  2127. }
  2128. }),
  2129. smalltalk.Number);
  2130. smalltalk.addMethod(
  2131. "_truncated",
  2132. smalltalk.method({
  2133. selector: "truncated",
  2134. fn: function (){
  2135. var self=this;
  2136. return smalltalk.withContext(function($ctx1) {
  2137. if(self >= 0) {
  2138. return Math.floor(self);
  2139. } else {
  2140. return Math.floor(self * (-1)) * (-1);
  2141. };
  2142. ;
  2143. ;
  2144. return self}, self, "truncated", [], smalltalk.Number)}
  2145. }),
  2146. smalltalk.Number);
  2147. smalltalk.addMethod(
  2148. "__or",
  2149. smalltalk.method({
  2150. selector: "|",
  2151. fn: function (aNumber) {
  2152. var self = this;
  2153. return self | aNumber;
  2154. return self;
  2155. }
  2156. }),
  2157. smalltalk.Number);
  2158. smalltalk.addMethod(
  2159. "_pi",
  2160. smalltalk.method({
  2161. selector: "pi",
  2162. fn: function () {
  2163. var self = this;
  2164. return Math.PI;
  2165. return self;
  2166. }
  2167. }),
  2168. smalltalk.Number.klass);
  2169. smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Objects');
  2170. smalltalk.addMethod(
  2171. "_addElement_",
  2172. smalltalk.method({
  2173. selector: "addElement:",
  2174. fn: function (anObject){
  2175. var self=this;
  2176. return smalltalk.withContext(function($ctx1) { self.elements.addElement(anObject);
  2177. ;
  2178. return self}, self, "addElement:", [anObject], smalltalk.Organizer)}
  2179. }),
  2180. smalltalk.Organizer);
  2181. smalltalk.addMethod(
  2182. "_elements",
  2183. smalltalk.method({
  2184. selector: "elements",
  2185. fn: function () {
  2186. var self = this;
  2187. var $1;
  2188. $1 = smalltalk.send(smalltalk.send(self, "_basicAt_", ["elements"]), "_copy", []);
  2189. return $1;
  2190. }
  2191. }),
  2192. smalltalk.Organizer);
  2193. smalltalk.addMethod(
  2194. "_removeElement_",
  2195. smalltalk.method({
  2196. selector: "removeElement:",
  2197. fn: function (anObject){
  2198. var self=this;
  2199. return smalltalk.withContext(function($ctx1) { self.elements.removeElement(anObject);
  2200. ;
  2201. return self}, self, "removeElement:", [anObject], smalltalk.Organizer)}
  2202. }),
  2203. smalltalk.Organizer);
  2204. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  2205. smalltalk.addMethod(
  2206. "_classes",
  2207. smalltalk.method({
  2208. selector: "classes",
  2209. fn: function () {
  2210. var self = this;
  2211. var $1;
  2212. $1 = smalltalk.send(smalltalk.send(self, "_organization", []), "_elements", []);
  2213. return $1;
  2214. }
  2215. }),
  2216. smalltalk.Package);
  2217. smalltalk.addMethod(
  2218. "_commitPathJs",
  2219. smalltalk.method({
  2220. selector: "commitPathJs",
  2221. fn: function () {
  2222. var self = this;
  2223. var $1;
  2224. if (($receiver = self['@commitPathJs']) == nil ||
  2225. $receiver == undefined) {
  2226. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);
  2227. } else {
  2228. $1 = self['@commitPathJs'];
  2229. }
  2230. return $1;
  2231. }
  2232. }),
  2233. smalltalk.Package);
  2234. smalltalk.addMethod(
  2235. "_commitPathJs_",
  2236. smalltalk.method({
  2237. selector: "commitPathJs:",
  2238. fn: function (aString) {
  2239. var self = this;
  2240. self['@commitPathJs'] = aString;
  2241. return self;
  2242. }
  2243. }),
  2244. smalltalk.Package);
  2245. smalltalk.addMethod(
  2246. "_commitPathSt",
  2247. smalltalk.method({
  2248. selector: "commitPathSt",
  2249. fn: function () {
  2250. var self = this;
  2251. var $1;
  2252. if (($receiver = self['@commitPathSt']) == nil ||
  2253. $receiver == undefined) {
  2254. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);
  2255. } else {
  2256. $1 = self['@commitPathSt'];
  2257. }
  2258. return $1;
  2259. }
  2260. }),
  2261. smalltalk.Package);
  2262. smalltalk.addMethod(
  2263. "_commitPathSt_",
  2264. smalltalk.method({
  2265. selector: "commitPathSt:",
  2266. fn: function (aString) {
  2267. var self = this;
  2268. self['@commitPathSt'] = aString;
  2269. return self;
  2270. }
  2271. }),
  2272. smalltalk.Package);
  2273. smalltalk.addMethod(
  2274. "_dependencies",
  2275. smalltalk.method({
  2276. selector: "dependencies",
  2277. fn: function () {
  2278. var self = this;
  2279. var $1;
  2280. $1 = smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", function () {return [];}]);
  2281. return $1;
  2282. }
  2283. }),
  2284. smalltalk.Package);
  2285. smalltalk.addMethod(
  2286. "_dependencies_",
  2287. smalltalk.method({
  2288. selector: "dependencies:",
  2289. fn: function (anArray) {
  2290. var self = this;
  2291. var $1;
  2292. $1 = smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  2293. return $1;
  2294. }
  2295. }),
  2296. smalltalk.Package);
  2297. smalltalk.addMethod(
  2298. "_jsProperties",
  2299. smalltalk.method({
  2300. selector: "jsProperties",
  2301. fn: function () {
  2302. var self = this;
  2303. return self.properties;
  2304. return self;
  2305. }
  2306. }),
  2307. smalltalk.Package);
  2308. smalltalk.addMethod(
  2309. "_jsProperties_",
  2310. smalltalk.method({
  2311. selector: "jsProperties:",
  2312. fn: function (aJSObject) {
  2313. var self = this;
  2314. return self.properties = aJSObject;
  2315. return self;
  2316. }
  2317. }),
  2318. smalltalk.Package);
  2319. smalltalk.addMethod(
  2320. "_name",
  2321. smalltalk.method({
  2322. selector: "name",
  2323. fn: function () {
  2324. var self = this;
  2325. return self.pkgName;
  2326. return self;
  2327. }
  2328. }),
  2329. smalltalk.Package);
  2330. smalltalk.addMethod(
  2331. "_name_",
  2332. smalltalk.method({
  2333. selector: "name:",
  2334. fn: function (aString) {
  2335. var self = this;
  2336. self.pkgName = aString;
  2337. return self;
  2338. }
  2339. }),
  2340. smalltalk.Package);
  2341. smalltalk.addMethod(
  2342. "_organization",
  2343. smalltalk.method({
  2344. selector: "organization",
  2345. fn: function () {
  2346. var self = this;
  2347. var $1;
  2348. $1 = smalltalk.send(self, "_basicAt_", ["organization"]);
  2349. return $1;
  2350. }
  2351. }),
  2352. smalltalk.Package);
  2353. smalltalk.addMethod(
  2354. "_printString",
  2355. smalltalk.method({
  2356. selector: "printString",
  2357. fn: function () {
  2358. var self = this;
  2359. var $1;
  2360. $1 = smalltalk.send(self, "_name", []);
  2361. return $1;
  2362. }
  2363. }),
  2364. smalltalk.Package);
  2365. smalltalk.addMethod(
  2366. "_properties",
  2367. smalltalk.method({
  2368. selector: "properties",
  2369. fn: function () {
  2370. var self = this;
  2371. var $1;
  2372. $1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  2373. return $1;
  2374. }
  2375. }),
  2376. smalltalk.Package);
  2377. smalltalk.addMethod(
  2378. "_propertiesAsJSON",
  2379. smalltalk.method({
  2380. selector: "propertiesAsJSON",
  2381. fn: function () {
  2382. var self = this;
  2383. return JSON.stringify(self.properties);
  2384. return self;
  2385. }
  2386. }),
  2387. smalltalk.Package);
  2388. smalltalk.addMethod(
  2389. "_propertyAt_",
  2390. smalltalk.method({
  2391. selector: "propertyAt:",
  2392. fn: function (key) {
  2393. var self = this;
  2394. return self.properties[key];
  2395. return self;
  2396. }
  2397. }),
  2398. smalltalk.Package);
  2399. smalltalk.addMethod(
  2400. "_propertyAt_ifAbsent_",
  2401. smalltalk.method({
  2402. selector: "propertyAt:ifAbsent:",
  2403. fn: function (key, block) {
  2404. var self = this;
  2405. var $2, $1;
  2406. $2 = smalltalk.send(self, "_propertyAt_", [key]);
  2407. if (($receiver = $2) == nil || $receiver == undefined) {
  2408. $1 = smalltalk.send(block, "_value", []);
  2409. } else {
  2410. $1 = $2;
  2411. }
  2412. return $1;
  2413. }
  2414. }),
  2415. smalltalk.Package);
  2416. smalltalk.addMethod(
  2417. "_propertyAt_put_",
  2418. smalltalk.method({
  2419. selector: "propertyAt:put:",
  2420. fn: function (key, value) {
  2421. var self = this;
  2422. return self.properties[key] = value;
  2423. return self;
  2424. }
  2425. }),
  2426. smalltalk.Package);
  2427. smalltalk.addMethod(
  2428. "_sortedClasses",
  2429. smalltalk.method({
  2430. selector: "sortedClasses",
  2431. fn: function () {
  2432. var self = this;
  2433. var $1;
  2434. $1 = smalltalk.send(smalltalk.send(self, "_class", []), "_sortedClasses_", [smalltalk.send(self, "_classes", [])]);
  2435. return $1;
  2436. }
  2437. }),
  2438. smalltalk.Package);
  2439. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  2440. smalltalk.addMethod(
  2441. "_commitToLocalStorage_",
  2442. smalltalk.method({
  2443. selector: "commitToLocalStorage:",
  2444. fn: function (aPackageName) {
  2445. var self = this;
  2446. var key;
  2447. var sourceCode;
  2448. key = smalltalk.send("smalltalk.packages.", "__comma", [aPackageName]);
  2449. sourceCode = smalltalk.send(smalltalk.send(smalltalk.Exporter || Exporter, "_new", []), "_exportPackage_", [aPackageName]);
  2450. localStorage[key] = escape(sourceCode);
  2451. return self;
  2452. }
  2453. }),
  2454. smalltalk.Package.klass);
  2455. smalltalk.addMethod(
  2456. "_defaultCommitPathJs",
  2457. smalltalk.method({
  2458. selector: "defaultCommitPathJs",
  2459. fn: function () {
  2460. var self = this;
  2461. var $1;
  2462. if (($receiver = self['@defaultCommitPathJs']) == nil ||
  2463. $receiver == undefined) {
  2464. self['@defaultCommitPathJs'] = "js";
  2465. $1 = self['@defaultCommitPathJs'];
  2466. } else {
  2467. $1 = self['@defaultCommitPathJs'];
  2468. }
  2469. return $1;
  2470. }
  2471. }),
  2472. smalltalk.Package.klass);
  2473. smalltalk.addMethod(
  2474. "_defaultCommitPathJs_",
  2475. smalltalk.method({
  2476. selector: "defaultCommitPathJs:",
  2477. fn: function (aString) {
  2478. var self = this;
  2479. self['@defaultCommitPathJs'] = aString;
  2480. return self;
  2481. }
  2482. }),
  2483. smalltalk.Package.klass);
  2484. smalltalk.addMethod(
  2485. "_defaultCommitPathSt",
  2486. smalltalk.method({
  2487. selector: "defaultCommitPathSt",
  2488. fn: function () {
  2489. var self = this;
  2490. var $1;
  2491. if (($receiver = self['@defaultCommitPathSt']) == nil ||
  2492. $receiver == undefined) {
  2493. self['@defaultCommitPathSt'] = "st";
  2494. $1 = self['@defaultCommitPathSt'];
  2495. } else {
  2496. $1 = self['@defaultCommitPathSt'];
  2497. }
  2498. return $1;
  2499. }
  2500. }),
  2501. smalltalk.Package.klass);
  2502. smalltalk.addMethod(
  2503. "_defaultCommitPathSt_",
  2504. smalltalk.method({
  2505. selector: "defaultCommitPathSt:",
  2506. fn: function (aString) {
  2507. var self = this;
  2508. self['@defaultCommitPathSt'] = aString;
  2509. return self;
  2510. }
  2511. }),
  2512. smalltalk.Package.klass);
  2513. smalltalk.addMethod(
  2514. "_fetch_",
  2515. smalltalk.method({
  2516. selector: "fetch:",
  2517. fn: function (aPackageName) {
  2518. var self = this;
  2519. smalltalk.send(self, "_fetch_prefix_", [aPackageName, smalltalk.send(smalltalk.send(self, "_defaultCommitPathJs", []), "__comma", ["/"])]);
  2520. return self;
  2521. }
  2522. }),
  2523. smalltalk.Package.klass);
  2524. smalltalk.addMethod(
  2525. "_fetch_prefix_",
  2526. smalltalk.method({
  2527. selector: "fetch:prefix:",
  2528. fn: function (aPackageName, aPrefix) {
  2529. var self = this;
  2530. smalltalk.send(jQuery, "_getScript_onSuccess_", [smalltalk.send(smalltalk.send(aPrefix, "__comma", [aPackageName]), "__comma", [".js"]), function () {return smalltalk.send(smalltalk.Package || Package, "_init_", [aPackageName]);}]);
  2531. return self;
  2532. }
  2533. }),
  2534. smalltalk.Package.klass);
  2535. smalltalk.addMethod(
  2536. "_init_",
  2537. smalltalk.method({
  2538. selector: "init:",
  2539. fn: function (aPackageName) {
  2540. var self = this;
  2541. var $1, $2;
  2542. $1 = smalltalk.send(smalltalk.send(smalltalk, "_classes", []), "_select_", [function (each) {return each.pkg.pkgName == aPackageName;}]);
  2543. smalltalk.send($1, "_do_", [function (each) {return smalltalk.init(each);}]);
  2544. $2 = smalltalk.send($1, "_do_", [function (each) {return smalltalk.send(each, "_initialize", []);}]);
  2545. return self;
  2546. }
  2547. }),
  2548. smalltalk.Package.klass);
  2549. smalltalk.addMethod(
  2550. "_named_",
  2551. smalltalk.method({
  2552. selector: "named:",
  2553. fn: function (aPackageName) {
  2554. var self = this;
  2555. var $1;
  2556. $1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packageAt_", [aPackageName]);
  2557. return $1;
  2558. }
  2559. }),
  2560. smalltalk.Package.klass);
  2561. smalltalk.addMethod(
  2562. "_named_ifAbsent_",
  2563. smalltalk.method({
  2564. selector: "named:ifAbsent:",
  2565. fn: function (aPackageName, aBlock) {
  2566. var self = this;
  2567. var $1;
  2568. $1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  2569. return $1;
  2570. }
  2571. }),
  2572. smalltalk.Package.klass);
  2573. smalltalk.addMethod(
  2574. "_resetCommitPaths",
  2575. smalltalk.method({
  2576. selector: "resetCommitPaths",
  2577. fn: function () {
  2578. var self = this;
  2579. self['@defaultCommitPathJs'] = nil;
  2580. self['@defaultCommitPathSt'] = nil;
  2581. return self;
  2582. }
  2583. }),
  2584. smalltalk.Package.klass);
  2585. smalltalk.addMethod(
  2586. "_sortedClasses_",
  2587. smalltalk.method({
  2588. selector: "sortedClasses:",
  2589. fn: function (classes) {
  2590. var self = this;
  2591. var $1;
  2592. var children;
  2593. var others;
  2594. var nodes;
  2595. var expandedClasses;
  2596. children = [];
  2597. others = [];
  2598. smalltalk.send(classes, "_do_", [function (each) {$1 = smalltalk.send(classes, "_includes_", [smalltalk.send(each, "_superclass", [])]);if (smalltalk.assert($1)) {return smalltalk.send(others, "_add_", [each]);} else {return smalltalk.send(children, "_add_", [each]);}}]);
  2599. nodes = smalltalk.send(children, "_collect_", [function (each) {return smalltalk.send(smalltalk.ClassSorterNode || ClassSorterNode, "_on_classes_level_", [each, others, 0]);}]);
  2600. nodes = smalltalk.send(nodes, "_sorted_", [function (a, b) {return smalltalk.send(smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", []), "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]);}]);
  2601. expandedClasses = smalltalk.send(smalltalk.Array || Array, "_new", []);
  2602. smalltalk.send(nodes, "_do_", [function (aNode) {return smalltalk.send(aNode, "_traverseClassesWith_", [expandedClasses]);}]);
  2603. return expandedClasses;
  2604. }
  2605. }),
  2606. smalltalk.Package.klass);
  2607. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  2608. smalltalk.addMethod(
  2609. "__star",
  2610. smalltalk.method({
  2611. selector: "*",
  2612. fn: function (aPoint) {
  2613. var self = this;
  2614. var $1;
  2615. $1 = smalltalk.send(smalltalk.Point || Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  2616. return $1;
  2617. }
  2618. }),
  2619. smalltalk.Point);
  2620. smalltalk.addMethod(
  2621. "__plus",
  2622. smalltalk.method({
  2623. selector: "+",
  2624. fn: function (aPoint) {
  2625. var self = this;
  2626. var $1;
  2627. $1 = smalltalk.send(smalltalk.Point || Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  2628. return $1;
  2629. }
  2630. }),
  2631. smalltalk.Point);
  2632. smalltalk.addMethod(
  2633. "__minus",
  2634. smalltalk.method({
  2635. selector: "-",
  2636. fn: function (aPoint) {
  2637. var self = this;
  2638. var $1;
  2639. $1 = smalltalk.send(smalltalk.Point || Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  2640. return $1;
  2641. }
  2642. }),
  2643. smalltalk.Point);
  2644. smalltalk.addMethod(
  2645. "__slash",
  2646. smalltalk.method({
  2647. selector: "/",
  2648. fn: function (aPoint) {
  2649. var self = this;
  2650. var $1;
  2651. $1 = smalltalk.send(smalltalk.Point || Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  2652. return $1;
  2653. }
  2654. }),
  2655. smalltalk.Point);
  2656. smalltalk.addMethod(
  2657. "__eq",
  2658. smalltalk.method({
  2659. selector: "=",
  2660. fn: function (aPoint) {
  2661. var self = this;
  2662. var $1;
  2663. $1 = 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", [])])]);}]);
  2664. return $1;
  2665. }
  2666. }),
  2667. smalltalk.Point);
  2668. smalltalk.addMethod(
  2669. "_asPoint",
  2670. smalltalk.method({
  2671. selector: "asPoint",
  2672. fn: function () {
  2673. var self = this;
  2674. return self;
  2675. }
  2676. }),
  2677. smalltalk.Point);
  2678. smalltalk.addMethod(
  2679. "_printString",
  2680. smalltalk.method({
  2681. selector: "printString",
  2682. fn: function () {
  2683. var self = this;
  2684. var $2, $1;
  2685. $1 = smalltalk.send(smalltalk.String || String, "_streamContents_", [function (stream) {smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@x'], "_printString", []), "__comma", ["@"])]);$2 = smalltalk.send(smalltalk.send(self['@y'], "_notNil", []), "_and_", [function () {return smalltalk.send(self['@y'], "_negative", []);}]);if (smalltalk.assert($2)) {smalltalk.send(stream, "_space", []);}return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self['@y'], "_printString", [])]);}]);
  2686. return $1;
  2687. }
  2688. }),
  2689. smalltalk.Point);
  2690. smalltalk.addMethod(
  2691. "_translateBy_",
  2692. smalltalk.method({
  2693. selector: "translateBy:",
  2694. fn: function (delta) {
  2695. var self = this;
  2696. var $1;
  2697. $1 = smalltalk.send(smalltalk.send(smalltalk.send(delta, "_x", []), "__plus", [self['@x']]), "__at", [smalltalk.send(smalltalk.send(delta, "_y", []), "__plus", [self['@y']])]);
  2698. return $1;
  2699. }
  2700. }),
  2701. smalltalk.Point);
  2702. smalltalk.addMethod(
  2703. "_x",
  2704. smalltalk.method({
  2705. selector: "x",
  2706. fn: function () {
  2707. var self = this;
  2708. return self['@x'];
  2709. }
  2710. }),
  2711. smalltalk.Point);
  2712. smalltalk.addMethod(
  2713. "_x_",
  2714. smalltalk.method({
  2715. selector: "x:",
  2716. fn: function (aNumber) {
  2717. var self = this;
  2718. self['@x'] = aNumber;
  2719. return self;
  2720. }
  2721. }),
  2722. smalltalk.Point);
  2723. smalltalk.addMethod(
  2724. "_y",
  2725. smalltalk.method({
  2726. selector: "y",
  2727. fn: function () {
  2728. var self = this;
  2729. return self['@y'];
  2730. }
  2731. }),
  2732. smalltalk.Point);
  2733. smalltalk.addMethod(
  2734. "_y_",
  2735. smalltalk.method({
  2736. selector: "y:",
  2737. fn: function (aNumber) {
  2738. var self = this;
  2739. self['@y'] = aNumber;
  2740. return self;
  2741. }
  2742. }),
  2743. smalltalk.Point);
  2744. smalltalk.addMethod(
  2745. "_x_y_",
  2746. smalltalk.method({
  2747. selector: "x:y:",
  2748. fn: function (aNumber, anotherNumber) {
  2749. var self = this;
  2750. var $2, $3, $1;
  2751. $2 = smalltalk.send(self, "_new", []);
  2752. smalltalk.send($2, "_x_", [aNumber]);
  2753. smalltalk.send($2, "_y_", [anotherNumber]);
  2754. $3 = smalltalk.send($2, "_yourself", []);
  2755. $1 = $3;
  2756. return $1;
  2757. }
  2758. }),
  2759. smalltalk.Point.klass);
  2760. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  2761. smalltalk.addMethod(
  2762. "_next",
  2763. smalltalk.method({
  2764. selector: "next",
  2765. fn: function () {
  2766. var self = this;
  2767. return Math.random();
  2768. return self;
  2769. }
  2770. }),
  2771. smalltalk.Random);
  2772. smalltalk.addMethod(
  2773. "_next_",
  2774. smalltalk.method({
  2775. selector: "next:",
  2776. fn: function (anInteger) {
  2777. var self = this;
  2778. var $1;
  2779. $1 = smalltalk.send(smalltalk.send(1, "_to_", [anInteger]), "_collect_", [function (each) {return smalltalk.send(self, "_next", []);}]);
  2780. return $1;
  2781. }
  2782. }),
  2783. smalltalk.Random);
  2784. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  2785. smalltalk.addMethod(
  2786. "_at_",
  2787. smalltalk.method({
  2788. selector: "at:",
  2789. fn: function (aSymbol) {
  2790. var self = this;
  2791. return self[aSymbol._asString()];
  2792. return self;
  2793. }
  2794. }),
  2795. smalltalk.Smalltalk);
  2796. smalltalk.addMethod(
  2797. "_basicParse_",
  2798. smalltalk.method({
  2799. selector: "basicParse:",
  2800. fn: function (aString) {
  2801. var self = this;
  2802. return smalltalk.parser.parse(aString);
  2803. return self;
  2804. }
  2805. }),
  2806. smalltalk.Smalltalk);
  2807. smalltalk.addMethod(
  2808. "_classes",
  2809. smalltalk.method({
  2810. selector: "classes",
  2811. fn: function () {
  2812. var self = this;
  2813. return self.classes();
  2814. return self;
  2815. }
  2816. }),
  2817. smalltalk.Smalltalk);
  2818. smalltalk.addMethod(
  2819. "_createPackage_",
  2820. smalltalk.method({
  2821. selector: "createPackage:",
  2822. fn: function (packageName){
  2823. var self=this;
  2824. return smalltalk.withContext(function($ctx1) { return smalltalk.addPackage(packageName);
  2825. ;
  2826. return self}, self, "createPackage:", [packageName], smalltalk.Smalltalk)}
  2827. }),
  2828. smalltalk.Smalltalk);
  2829. smalltalk.addMethod(
  2830. "_deleteClass_",
  2831. smalltalk.method({
  2832. selector: "deleteClass:",
  2833. fn: function (aClass) {
  2834. var self = this;
  2835. self.removeClass(aClass);
  2836. return self;
  2837. }
  2838. }),
  2839. smalltalk.Smalltalk);
  2840. smalltalk.addMethod(
  2841. "_deletePackage_",
  2842. smalltalk.method({
  2843. selector: "deletePackage:",
  2844. fn: function (packageName) {
  2845. var self = this;
  2846. delete smalltalk.packages[packageName];
  2847. return self;
  2848. }
  2849. }),
  2850. smalltalk.Smalltalk);
  2851. smalltalk.addMethod(
  2852. "_packageAt_",
  2853. smalltalk.method({
  2854. selector: "packageAt:",
  2855. fn: function (packageName) {
  2856. var self = this;
  2857. return self.packages[packageName];
  2858. return self;
  2859. }
  2860. }),
  2861. smalltalk.Smalltalk);
  2862. smalltalk.addMethod(
  2863. "_packageAt_ifAbsent_",
  2864. smalltalk.method({
  2865. selector: "packageAt:ifAbsent:",
  2866. fn: function (packageName, aBlock) {
  2867. var self = this;
  2868. var $2, $1;
  2869. $2 = smalltalk.send(self, "_packageAt_", [packageName]);
  2870. $1 = smalltalk.send($2, "_ifNil_", [aBlock]);
  2871. return $1;
  2872. }
  2873. }),
  2874. smalltalk.Smalltalk);
  2875. smalltalk.addMethod(
  2876. "_packages",
  2877. smalltalk.method({
  2878. selector: "packages",
  2879. fn: function () {
  2880. var self = this;
  2881. return self.packages.all();
  2882. return self;
  2883. }
  2884. }),
  2885. smalltalk.Smalltalk);
  2886. smalltalk.addMethod(
  2887. "_parse_",
  2888. smalltalk.method({
  2889. selector: "parse:",
  2890. fn: function (aString) {
  2891. var self = this;
  2892. var result;
  2893. smalltalk.send(self, "_try_catch_", [function () {result = smalltalk.send(self, "_basicParse_", [aString]);return result;}, function (ex) {return smalltalk.send(smalltalk.send(self, "_parseError_parsing_", [ex, aString]), "_signal", []);}]);
  2894. return result;
  2895. }
  2896. }),
  2897. smalltalk.Smalltalk);
  2898. smalltalk.addMethod(
  2899. "_parseError_parsing_",
  2900. smalltalk.method({
  2901. selector: "parseError:parsing:",
  2902. fn: function (anException,aString){
  2903. var self=this;
  2904. return smalltalk.withContext(function($ctx1) { var $1;
  2905. $1=_st(_st((smalltalk.ParseError || ParseError))._new())._messageText_(_st(_st(_st(_st(_st("Parse error on line ").__comma(_st(anException)._basicAt_("line"))).__comma(" column ")).__comma(_st(anException)._basicAt_("column"))).__comma(" : Unexpected character ")).__comma(_st(anException)._basicAt_("found")));
  2906. return $1;
  2907. }, self, "parseError:parsing:", [anException,aString], smalltalk.Smalltalk)}
  2908. }),
  2909. smalltalk.Smalltalk);
  2910. smalltalk.addMethod(
  2911. "_pseudoVariableNames",
  2912. smalltalk.method({
  2913. selector: "pseudoVariableNames",
  2914. fn: function () {
  2915. var self = this;
  2916. return ["self", "super", "nil", "true", "false", "thisContext"];
  2917. }
  2918. }),
  2919. smalltalk.Smalltalk);
  2920. smalltalk.addMethod(
  2921. "_readJSObject_",
  2922. smalltalk.method({
  2923. selector: "readJSObject:",
  2924. fn: function (anObject) {
  2925. var self = this;
  2926. return self.readJSObject(anObject);
  2927. return self;
  2928. }
  2929. }),
  2930. smalltalk.Smalltalk);
  2931. smalltalk.addMethod(
  2932. "_removeClass_",
  2933. smalltalk.method({
  2934. selector: "removeClass:",
  2935. fn: function (aClass) {
  2936. var self = this;
  2937. var $1, $2, $3;
  2938. $1 = smalltalk.send(aClass, "_isMetaclass", []);
  2939. if (smalltalk.assert($1)) {
  2940. smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [" is a Metaclass and cannot be removed!"])]);
  2941. }
  2942. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);}]);
  2943. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);}]);
  2944. smalltalk.send(self, "_deleteClass_", [aClass]);
  2945. $2 = smalltalk.send(smalltalk.ClassRemoved || ClassRemoved, "_new", []);
  2946. smalltalk.send($2, "_theClass_", [aClass]);
  2947. $3 = smalltalk.send($2, "_yourself", []);
  2948. smalltalk.send(smalltalk.send(smalltalk.SystemAnnouncer || SystemAnnouncer, "_current", []), "_announce_", [$3]);
  2949. return self;
  2950. }
  2951. }),
  2952. smalltalk.Smalltalk);
  2953. smalltalk.addMethod(
  2954. "_removePackage_",
  2955. smalltalk.method({
  2956. selector: "removePackage:",
  2957. fn: function (packageName) {
  2958. var self = this;
  2959. var pkg;
  2960. pkg = smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, function () {return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);}]);
  2961. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [function (each) {return smalltalk.send(self, "_removeClass_", [each]);}]);
  2962. smalltalk.send(self, "_deletePackage_", [packageName]);
  2963. return self;
  2964. }
  2965. }),
  2966. smalltalk.Smalltalk);
  2967. smalltalk.addMethod(
  2968. "_renamePackage_to_",
  2969. smalltalk.method({
  2970. selector: "renamePackage:to:",
  2971. fn: function (packageName, newName) {
  2972. var self = this;
  2973. var $1;
  2974. var pkg;
  2975. pkg = smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, function () {return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);}]);
  2976. $1 = smalltalk.send(self, "_packageAt_", [newName]);
  2977. if (($receiver = $1) == nil || $receiver == undefined) {
  2978. } else {
  2979. smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);
  2980. }
  2981. smalltalk.packages[newName] = smalltalk.packages[packageName];
  2982. smalltalk.send(pkg, "_name_", [newName]);
  2983. smalltalk.send(self, "_deletePackage_", [packageName]);
  2984. return self;
  2985. }
  2986. }),
  2987. smalltalk.Smalltalk);
  2988. smalltalk.addMethod(
  2989. "_reservedWords",
  2990. smalltalk.method({
  2991. selector: "reservedWords",
  2992. fn: function () {
  2993. var self = this;
  2994. return self.reservedWords;
  2995. return self;
  2996. }
  2997. }),
  2998. smalltalk.Smalltalk);
  2999. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  3000. smalltalk.addMethod(
  3001. "_current",
  3002. smalltalk.method({
  3003. selector: "current",
  3004. fn: function () {
  3005. var self = this;
  3006. return smalltalk;
  3007. return self;
  3008. }
  3009. }),
  3010. smalltalk.Smalltalk.klass);
  3011. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  3012. smalltalk.addMethod(
  3013. "_asJSON",
  3014. smalltalk.method({
  3015. selector: "asJSON",
  3016. fn: function () {
  3017. var self = this;
  3018. return null;
  3019. }
  3020. }),
  3021. smalltalk.UndefinedObject);
  3022. smalltalk.addMethod(
  3023. "_deepCopy",
  3024. smalltalk.method({
  3025. selector: "deepCopy",
  3026. fn: function () {
  3027. var self = this;
  3028. return self;
  3029. }
  3030. }),
  3031. smalltalk.UndefinedObject);
  3032. smalltalk.addMethod(
  3033. "_ifNil_",
  3034. smalltalk.method({
  3035. selector: "ifNil:",
  3036. fn: function (aBlock) {
  3037. var self = this;
  3038. var $1;
  3039. $1 = smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, function () {}]);
  3040. return $1;
  3041. }
  3042. }),
  3043. smalltalk.UndefinedObject);
  3044. smalltalk.addMethod(
  3045. "_ifNil_ifNotNil_",
  3046. smalltalk.method({
  3047. selector: "ifNil:ifNotNil:",
  3048. fn: function (aBlock, anotherBlock) {
  3049. var self = this;
  3050. var $1;
  3051. $1 = smalltalk.send(aBlock, "_value", []);
  3052. return $1;
  3053. }
  3054. }),
  3055. smalltalk.UndefinedObject);
  3056. smalltalk.addMethod(
  3057. "_ifNotNil_",
  3058. smalltalk.method({
  3059. selector: "ifNotNil:",
  3060. fn: function (aBlock) {
  3061. var self = this;
  3062. return self;
  3063. }
  3064. }),
  3065. smalltalk.UndefinedObject);
  3066. smalltalk.addMethod(
  3067. "_ifNotNil_ifNil_",
  3068. smalltalk.method({
  3069. selector: "ifNotNil:ifNil:",
  3070. fn: function (aBlock, anotherBlock) {
  3071. var self = this;
  3072. var $1;
  3073. $1 = smalltalk.send(anotherBlock, "_value", []);
  3074. return $1;
  3075. }
  3076. }),
  3077. smalltalk.UndefinedObject);
  3078. smalltalk.addMethod(
  3079. "_isNil",
  3080. smalltalk.method({
  3081. selector: "isNil",
  3082. fn: function () {
  3083. var self = this;
  3084. return true;
  3085. }
  3086. }),
  3087. smalltalk.UndefinedObject);
  3088. smalltalk.addMethod(
  3089. "_notNil",
  3090. smalltalk.method({
  3091. selector: "notNil",
  3092. fn: function () {
  3093. var self = this;
  3094. return false;
  3095. }
  3096. }),
  3097. smalltalk.UndefinedObject);
  3098. smalltalk.addMethod(
  3099. "_printString",
  3100. smalltalk.method({
  3101. selector: "printString",
  3102. fn: function () {
  3103. var self = this;
  3104. return "nil";
  3105. }
  3106. }),
  3107. smalltalk.UndefinedObject);
  3108. smalltalk.addMethod(
  3109. "_shallowCopy",
  3110. smalltalk.method({
  3111. selector: "shallowCopy",
  3112. fn: function () {
  3113. var self = this;
  3114. return self;
  3115. }
  3116. }),
  3117. smalltalk.UndefinedObject);
  3118. smalltalk.addMethod(
  3119. "_subclass_instanceVariableNames_",
  3120. smalltalk.method({
  3121. selector: "subclass:instanceVariableNames:",
  3122. fn: function (aString, anotherString) {
  3123. var self = this;
  3124. var $1;
  3125. $1 = smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  3126. return $1;
  3127. }
  3128. }),
  3129. smalltalk.UndefinedObject);
  3130. smalltalk.addMethod(
  3131. "_subclass_instanceVariableNames_category_",
  3132. smalltalk.method({
  3133. selector: "subclass:instanceVariableNames:category:",
  3134. fn: function (aString, aString2, aString3) {
  3135. var self = this;
  3136. var $1;
  3137. smalltalk.send(self, "_deprecatedAPI", []);
  3138. $1 = smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  3139. return $1;
  3140. }
  3141. }),
  3142. smalltalk.UndefinedObject);
  3143. smalltalk.addMethod(
  3144. "_subclass_instanceVariableNames_package_",
  3145. smalltalk.method({
  3146. selector: "subclass:instanceVariableNames:package:",
  3147. fn: function (aString, aString2, aString3) {
  3148. var self = this;
  3149. var $1;
  3150. $1 = smalltalk.send(smalltalk.send(smalltalk.ClassBuilder || ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  3151. return $1;
  3152. }
  3153. }),
  3154. smalltalk.UndefinedObject);
  3155. smalltalk.addMethod(
  3156. "_new",
  3157. smalltalk.method({
  3158. selector: "new",
  3159. fn: function () {
  3160. var self = this;
  3161. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  3162. return self;
  3163. }
  3164. }),
  3165. smalltalk.UndefinedObject.klass);