1
0

Kernel-Objects.deploy.js 89 KB

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