Kernel-Objects.deploy.js 88 KB

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