Kernel-Objects.deploy.js 88 KB

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