Kernel-Objects.js 116 KB

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