Kernel-Objects.js 115 KB

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