Kernel-Objects.js 114 KB

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