Kernel-Objects.js 135 KB

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