Kernel-Objects.deploy.js 85 KB

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