2
0

Kernel-Objects.js 108 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695
  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)})}));
  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:", "at:put:", "asJSON", "instVarAt:", "allInstanceVariableNames", "class"],
  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)})}));
  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:", "instVarAt:", "allInstanceVariableNames", "class", "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:", "inheritsFrom:", "class", "isMemberOf:"],
  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)})}));
  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)})}));
  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)})}),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)})}));
  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)})}),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: 'arithmetic',
  2096. fn: function (aNumber){
  2097. var self=this;
  2098. return smalltalk.withContext(function($ctx1) {
  2099. return self + aNumber;
  2100. return self}, function($ctx1) {$ctx1.fill(self,"+",{aNumber:aNumber},smalltalk.Number)})},
  2101. args: ["aNumber"],
  2102. source: "+ aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self + aNumber>",
  2103. messageSends: [],
  2104. referencedClasses: []
  2105. }),
  2106. smalltalk.Number);
  2107. smalltalk.addMethod(
  2108. smalltalk.method({
  2109. selector: "-",
  2110. category: 'arithmetic',
  2111. fn: function (aNumber){
  2112. var self=this;
  2113. return smalltalk.withContext(function($ctx1) {
  2114. return self - aNumber;
  2115. return self}, function($ctx1) {$ctx1.fill(self,"-",{aNumber:aNumber},smalltalk.Number)})},
  2116. args: ["aNumber"],
  2117. source: "- aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self - aNumber>",
  2118. messageSends: [],
  2119. referencedClasses: []
  2120. }),
  2121. smalltalk.Number);
  2122. smalltalk.addMethod(
  2123. smalltalk.method({
  2124. selector: "/",
  2125. category: 'arithmetic',
  2126. fn: function (aNumber){
  2127. var self=this;
  2128. return smalltalk.withContext(function($ctx1) {
  2129. return self / aNumber;
  2130. return self}, function($ctx1) {$ctx1.fill(self,"/",{aNumber:aNumber},smalltalk.Number)})},
  2131. args: ["aNumber"],
  2132. source: "/ aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self / aNumber>",
  2133. messageSends: [],
  2134. referencedClasses: []
  2135. }),
  2136. smalltalk.Number);
  2137. smalltalk.addMethod(
  2138. smalltalk.method({
  2139. selector: "<",
  2140. category: 'comparing',
  2141. fn: function (aNumber){
  2142. var self=this;
  2143. return smalltalk.withContext(function($ctx1) {
  2144. return self < aNumber;
  2145. return self}, function($ctx1) {$ctx1.fill(self,"<",{aNumber:aNumber},smalltalk.Number)})},
  2146. args: ["aNumber"],
  2147. source: "< aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self < aNumber>",
  2148. messageSends: [],
  2149. referencedClasses: []
  2150. }),
  2151. smalltalk.Number);
  2152. smalltalk.addMethod(
  2153. smalltalk.method({
  2154. selector: "<=",
  2155. category: 'comparing',
  2156. fn: function (aNumber){
  2157. var self=this;
  2158. return smalltalk.withContext(function($ctx1) {
  2159. return self <= aNumber;
  2160. return self}, function($ctx1) {$ctx1.fill(self,"<=",{aNumber:aNumber},smalltalk.Number)})},
  2161. args: ["aNumber"],
  2162. source: "<= aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self <= aNumber>",
  2163. messageSends: [],
  2164. referencedClasses: []
  2165. }),
  2166. smalltalk.Number);
  2167. smalltalk.addMethod(
  2168. smalltalk.method({
  2169. selector: "=",
  2170. category: 'comparing',
  2171. fn: function (aNumber){
  2172. var self=this;
  2173. return smalltalk.withContext(function($ctx1) {
  2174. if(! aNumber._isNumber || ! aNumber._isNumber()) {
  2175. return false;
  2176. }
  2177. return Number(self) == aNumber
  2178. ;
  2179. return self}, function($ctx1) {$ctx1.fill(self,"=",{aNumber:aNumber},smalltalk.Number)})},
  2180. args: ["aNumber"],
  2181. 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>",
  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. return self >= aNumber;
  2209. return self}, function($ctx1) {$ctx1.fill(self,">=",{aNumber:aNumber},smalltalk.Number)})},
  2210. args: ["aNumber"],
  2211. source: ">= aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self >>= aNumber>",
  2212. messageSends: [],
  2213. referencedClasses: []
  2214. }),
  2215. smalltalk.Number);
  2216. smalltalk.addMethod(
  2217. smalltalk.method({
  2218. selector: "@",
  2219. category: 'converting',
  2220. fn: function (aNumber){
  2221. var self=this;
  2222. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2223. return smalltalk.withContext(function($ctx1) {
  2224. var $1;
  2225. $1=_st($Point())._x_y_(self,aNumber);
  2226. return $1;
  2227. }, function($ctx1) {$ctx1.fill(self,"@",{aNumber:aNumber},smalltalk.Number)})},
  2228. args: ["aNumber"],
  2229. source: "@ aNumber\x0a\x09^Point x: self y: aNumber",
  2230. messageSends: ["x:y:"],
  2231. referencedClasses: ["Point"]
  2232. }),
  2233. smalltalk.Number);
  2234. smalltalk.addMethod(
  2235. smalltalk.method({
  2236. selector: "\x5c\x5c",
  2237. category: 'arithmetic',
  2238. fn: function (aNumber){
  2239. var self=this;
  2240. return smalltalk.withContext(function($ctx1) {
  2241. return self % aNumber;
  2242. return self}, function($ctx1) {$ctx1.fill(self,"\x5c\x5c",{aNumber:aNumber},smalltalk.Number)})},
  2243. args: ["aNumber"],
  2244. source: "\x5c\x5c aNumber\x0a\x09<return self % aNumber>",
  2245. messageSends: [],
  2246. referencedClasses: []
  2247. }),
  2248. smalltalk.Number);
  2249. smalltalk.addMethod(
  2250. smalltalk.method({
  2251. selector: "abs",
  2252. category: 'arithmetic',
  2253. fn: function (){
  2254. var self=this;
  2255. return smalltalk.withContext(function($ctx1) {
  2256. return Math.abs(self);;
  2257. return self}, function($ctx1) {$ctx1.fill(self,"abs",{},smalltalk.Number)})},
  2258. args: [],
  2259. source: "abs\x0a\x09<return Math.abs(self);>",
  2260. messageSends: [],
  2261. referencedClasses: []
  2262. }),
  2263. smalltalk.Number);
  2264. smalltalk.addMethod(
  2265. smalltalk.method({
  2266. selector: "asJSON",
  2267. category: 'converting',
  2268. fn: function (){
  2269. var self=this;
  2270. return smalltalk.withContext(function($ctx1) {
  2271. var $1;
  2272. $1=self;
  2273. return $1;
  2274. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.Number)})},
  2275. args: [],
  2276. source: "asJSON\x0a\x09^self",
  2277. messageSends: [],
  2278. referencedClasses: []
  2279. }),
  2280. smalltalk.Number);
  2281. smalltalk.addMethod(
  2282. smalltalk.method({
  2283. selector: "asJavascript",
  2284. category: 'converting',
  2285. fn: function (){
  2286. var self=this;
  2287. return smalltalk.withContext(function($ctx1) {
  2288. var $1;
  2289. $1=_st("(".__comma(self._printString())).__comma(")");
  2290. return $1;
  2291. }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Number)})},
  2292. args: [],
  2293. source: "asJavascript\x0a\x09^'(', self printString, ')'",
  2294. messageSends: [",", "printString"],
  2295. referencedClasses: []
  2296. }),
  2297. smalltalk.Number);
  2298. smalltalk.addMethod(
  2299. smalltalk.method({
  2300. selector: "asNumber",
  2301. category: 'converting',
  2302. fn: function (){
  2303. var self=this;
  2304. return smalltalk.withContext(function($ctx1) {
  2305. var $1;
  2306. $1=self;
  2307. return $1;
  2308. }, function($ctx1) {$ctx1.fill(self,"asNumber",{},smalltalk.Number)})},
  2309. args: [],
  2310. source: "asNumber\x0a\x09^ self",
  2311. messageSends: [],
  2312. referencedClasses: []
  2313. }),
  2314. smalltalk.Number);
  2315. smalltalk.addMethod(
  2316. smalltalk.method({
  2317. selector: "asPoint",
  2318. category: 'converting',
  2319. fn: function (){
  2320. var self=this;
  2321. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2322. return smalltalk.withContext(function($ctx1) {
  2323. var $1;
  2324. $1=_st($Point())._x_y_(self,self);
  2325. return $1;
  2326. }, function($ctx1) {$ctx1.fill(self,"asPoint",{},smalltalk.Number)})},
  2327. args: [],
  2328. source: "asPoint\x0a\x09^Point x: self y: self",
  2329. messageSends: ["x:y:"],
  2330. referencedClasses: ["Point"]
  2331. }),
  2332. smalltalk.Number);
  2333. smalltalk.addMethod(
  2334. smalltalk.method({
  2335. selector: "asString",
  2336. category: 'converting',
  2337. fn: function (){
  2338. var self=this;
  2339. return smalltalk.withContext(function($ctx1) {
  2340. return String(self) ;
  2341. return self}, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.Number)})},
  2342. args: [],
  2343. source: "asString\x0a\x09< return String(self) >",
  2344. messageSends: [],
  2345. referencedClasses: []
  2346. }),
  2347. smalltalk.Number);
  2348. smalltalk.addMethod(
  2349. smalltalk.method({
  2350. selector: "atRandom",
  2351. category: 'converting',
  2352. fn: function (){
  2353. var self=this;
  2354. function $Random(){return smalltalk.Random||(typeof Random=="undefined"?nil:Random)}
  2355. return smalltalk.withContext(function($ctx1) {
  2356. var $1;
  2357. $1=_st(_st(_st(_st(_st($Random())._new())._next()).__star(self))._truncated()).__plus((1));
  2358. return $1;
  2359. }, function($ctx1) {$ctx1.fill(self,"atRandom",{},smalltalk.Number)})},
  2360. args: [],
  2361. source: "atRandom\x0a\x09^(Random new next * self) truncated + 1",
  2362. messageSends: ["+", "truncated", "*", "next", "new"],
  2363. referencedClasses: ["Random"]
  2364. }),
  2365. smalltalk.Number);
  2366. smalltalk.addMethod(
  2367. smalltalk.method({
  2368. selector: "ceiling",
  2369. category: 'converting',
  2370. fn: function (){
  2371. var self=this;
  2372. return smalltalk.withContext(function($ctx1) {
  2373. return Math.ceil(self);;
  2374. return self}, function($ctx1) {$ctx1.fill(self,"ceiling",{},smalltalk.Number)})},
  2375. args: [],
  2376. source: "ceiling\x0a\x09<return Math.ceil(self);>",
  2377. messageSends: [],
  2378. referencedClasses: []
  2379. }),
  2380. smalltalk.Number);
  2381. smalltalk.addMethod(
  2382. smalltalk.method({
  2383. selector: "copy",
  2384. category: 'copying',
  2385. fn: function (){
  2386. var self=this;
  2387. return smalltalk.withContext(function($ctx1) {
  2388. var $1;
  2389. $1=self;
  2390. return $1;
  2391. }, function($ctx1) {$ctx1.fill(self,"copy",{},smalltalk.Number)})},
  2392. args: [],
  2393. source: "copy\x0a\x09^self",
  2394. messageSends: [],
  2395. referencedClasses: []
  2396. }),
  2397. smalltalk.Number);
  2398. smalltalk.addMethod(
  2399. smalltalk.method({
  2400. selector: "deepCopy",
  2401. category: 'copying',
  2402. fn: function (){
  2403. var self=this;
  2404. return smalltalk.withContext(function($ctx1) {
  2405. var $1;
  2406. $1=self._copy();
  2407. return $1;
  2408. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.Number)})},
  2409. args: [],
  2410. source: "deepCopy\x0a\x09^self copy",
  2411. messageSends: ["copy"],
  2412. referencedClasses: []
  2413. }),
  2414. smalltalk.Number);
  2415. smalltalk.addMethod(
  2416. smalltalk.method({
  2417. selector: "even",
  2418. category: 'testing',
  2419. fn: function (){
  2420. var self=this;
  2421. return smalltalk.withContext(function($ctx1) {
  2422. var $1;
  2423. $1=(0).__eq(self.__backslash_backslash((2)));
  2424. return $1;
  2425. }, function($ctx1) {$ctx1.fill(self,"even",{},smalltalk.Number)})},
  2426. args: [],
  2427. source: "even\x0a\x09^ 0 = (self \x5c\x5c 2)",
  2428. messageSends: ["=", "\x5c\x5c"],
  2429. referencedClasses: []
  2430. }),
  2431. smalltalk.Number);
  2432. smalltalk.addMethod(
  2433. smalltalk.method({
  2434. selector: "floor",
  2435. category: 'converting',
  2436. fn: function (){
  2437. var self=this;
  2438. return smalltalk.withContext(function($ctx1) {
  2439. return Math.floor(self);;
  2440. return self}, function($ctx1) {$ctx1.fill(self,"floor",{},smalltalk.Number)})},
  2441. args: [],
  2442. source: "floor\x0a\x09<return Math.floor(self);>",
  2443. messageSends: [],
  2444. referencedClasses: []
  2445. }),
  2446. smalltalk.Number);
  2447. smalltalk.addMethod(
  2448. smalltalk.method({
  2449. selector: "identityHash",
  2450. category: 'accessing',
  2451. fn: function (){
  2452. var self=this;
  2453. return smalltalk.withContext(function($ctx1) {
  2454. var $1;
  2455. $1=_st(self._asString()).__comma("n");
  2456. return $1;
  2457. }, function($ctx1) {$ctx1.fill(self,"identityHash",{},smalltalk.Number)})},
  2458. args: [],
  2459. source: "identityHash\x0a\x09^self asString, 'n'",
  2460. messageSends: [",", "asString"],
  2461. referencedClasses: []
  2462. }),
  2463. smalltalk.Number);
  2464. smalltalk.addMethod(
  2465. smalltalk.method({
  2466. selector: "isImmutable",
  2467. category: 'testing',
  2468. fn: function (){
  2469. var self=this;
  2470. return smalltalk.withContext(function($ctx1) {
  2471. return true;
  2472. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.Number)})},
  2473. args: [],
  2474. source: "isImmutable\x0a\x09^ true",
  2475. messageSends: [],
  2476. referencedClasses: []
  2477. }),
  2478. smalltalk.Number);
  2479. smalltalk.addMethod(
  2480. smalltalk.method({
  2481. selector: "isNumber",
  2482. category: 'testing',
  2483. fn: function (){
  2484. var self=this;
  2485. return smalltalk.withContext(function($ctx1) {
  2486. return true;
  2487. }, function($ctx1) {$ctx1.fill(self,"isNumber",{},smalltalk.Number)})},
  2488. args: [],
  2489. source: "isNumber\x0a\x09^true",
  2490. messageSends: [],
  2491. referencedClasses: []
  2492. }),
  2493. smalltalk.Number);
  2494. smalltalk.addMethod(
  2495. smalltalk.method({
  2496. selector: "isZero",
  2497. category: 'testing',
  2498. fn: function (){
  2499. var self=this;
  2500. return smalltalk.withContext(function($ctx1) {
  2501. var $1;
  2502. $1=self.__eq((0));
  2503. return $1;
  2504. }, function($ctx1) {$ctx1.fill(self,"isZero",{},smalltalk.Number)})},
  2505. args: [],
  2506. source: "isZero\x0a\x09^self = 0",
  2507. messageSends: ["="],
  2508. referencedClasses: []
  2509. }),
  2510. smalltalk.Number);
  2511. smalltalk.addMethod(
  2512. smalltalk.method({
  2513. selector: "max:",
  2514. category: 'arithmetic',
  2515. fn: function (aNumber){
  2516. var self=this;
  2517. return smalltalk.withContext(function($ctx1) {
  2518. return Math.max(self, aNumber);;
  2519. return self}, function($ctx1) {$ctx1.fill(self,"max:",{aNumber:aNumber},smalltalk.Number)})},
  2520. args: ["aNumber"],
  2521. source: "max: aNumber\x0a\x09<return Math.max(self, aNumber);>",
  2522. messageSends: [],
  2523. referencedClasses: []
  2524. }),
  2525. smalltalk.Number);
  2526. smalltalk.addMethod(
  2527. smalltalk.method({
  2528. selector: "min:",
  2529. category: 'arithmetic',
  2530. fn: function (aNumber){
  2531. var self=this;
  2532. return smalltalk.withContext(function($ctx1) {
  2533. return Math.min(self, aNumber);;
  2534. return self}, function($ctx1) {$ctx1.fill(self,"min:",{aNumber:aNumber},smalltalk.Number)})},
  2535. args: ["aNumber"],
  2536. source: "min: aNumber\x0a\x09<return Math.min(self, aNumber);>",
  2537. messageSends: [],
  2538. referencedClasses: []
  2539. }),
  2540. smalltalk.Number);
  2541. smalltalk.addMethod(
  2542. smalltalk.method({
  2543. selector: "negated",
  2544. category: 'arithmetic',
  2545. fn: function (){
  2546. var self=this;
  2547. return smalltalk.withContext(function($ctx1) {
  2548. var $1;
  2549. $1=(0).__minus(self);
  2550. return $1;
  2551. }, function($ctx1) {$ctx1.fill(self,"negated",{},smalltalk.Number)})},
  2552. args: [],
  2553. source: "negated\x0a\x09^0 - self",
  2554. messageSends: ["-"],
  2555. referencedClasses: []
  2556. }),
  2557. smalltalk.Number);
  2558. smalltalk.addMethod(
  2559. smalltalk.method({
  2560. selector: "negative",
  2561. category: 'testing',
  2562. fn: function (){
  2563. var self=this;
  2564. return smalltalk.withContext(function($ctx1) {
  2565. var $1;
  2566. $1=self.__lt((0));
  2567. return $1;
  2568. }, function($ctx1) {$ctx1.fill(self,"negative",{},smalltalk.Number)})},
  2569. args: [],
  2570. source: "negative\x0a\x09\x22Answer whether the receiver is mathematically negative.\x22\x0a\x0a\x09^ self < 0",
  2571. messageSends: ["<"],
  2572. referencedClasses: []
  2573. }),
  2574. smalltalk.Number);
  2575. smalltalk.addMethod(
  2576. smalltalk.method({
  2577. selector: "odd",
  2578. category: 'testing',
  2579. fn: function (){
  2580. var self=this;
  2581. return smalltalk.withContext(function($ctx1) {
  2582. var $1;
  2583. $1=_st(self._even())._not();
  2584. return $1;
  2585. }, function($ctx1) {$ctx1.fill(self,"odd",{},smalltalk.Number)})},
  2586. args: [],
  2587. source: "odd\x0a\x09^ self even not",
  2588. messageSends: ["not", "even"],
  2589. referencedClasses: []
  2590. }),
  2591. smalltalk.Number);
  2592. smalltalk.addMethod(
  2593. smalltalk.method({
  2594. selector: "positive",
  2595. category: 'testing',
  2596. fn: function (){
  2597. var self=this;
  2598. return smalltalk.withContext(function($ctx1) {
  2599. var $1;
  2600. $1=self.__gt_eq((0));
  2601. return $1;
  2602. }, function($ctx1) {$ctx1.fill(self,"positive",{},smalltalk.Number)})},
  2603. args: [],
  2604. source: "positive\x0a\x09\x22Answer whether the receiver is positive or equal to 0. (ST-80 protocol).\x22\x0a\x0a\x09^ self >= 0",
  2605. messageSends: [">="],
  2606. referencedClasses: []
  2607. }),
  2608. smalltalk.Number);
  2609. smalltalk.addMethod(
  2610. smalltalk.method({
  2611. selector: "printOn:",
  2612. category: 'printing',
  2613. fn: function (aStream){
  2614. var self=this;
  2615. return smalltalk.withContext(function($ctx1) {
  2616. _st(aStream)._nextPutAll_(self._asString());
  2617. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Number)})},
  2618. args: ["aStream"],
  2619. source: "printOn: aStream\x0a\x09aStream nextPutAll: self asString",
  2620. messageSends: ["nextPutAll:", "asString"],
  2621. referencedClasses: []
  2622. }),
  2623. smalltalk.Number);
  2624. smalltalk.addMethod(
  2625. smalltalk.method({
  2626. selector: "printShowingDecimalPlaces:",
  2627. category: 'printing',
  2628. fn: function (placesDesired){
  2629. var self=this;
  2630. return smalltalk.withContext(function($ctx1) {
  2631. return self.toFixed(placesDesired);
  2632. return self}, function($ctx1) {$ctx1.fill(self,"printShowingDecimalPlaces:",{placesDesired:placesDesired},smalltalk.Number)})},
  2633. args: ["placesDesired"],
  2634. source: "printShowingDecimalPlaces: placesDesired\x0a\x09<return self.toFixed(placesDesired)>",
  2635. messageSends: [],
  2636. referencedClasses: []
  2637. }),
  2638. smalltalk.Number);
  2639. smalltalk.addMethod(
  2640. smalltalk.method({
  2641. selector: "rounded",
  2642. category: 'converting',
  2643. fn: function (){
  2644. var self=this;
  2645. return smalltalk.withContext(function($ctx1) {
  2646. return Math.round(self);;
  2647. return self}, function($ctx1) {$ctx1.fill(self,"rounded",{},smalltalk.Number)})},
  2648. args: [],
  2649. source: "rounded\x0a\x09<return Math.round(self);>",
  2650. messageSends: [],
  2651. referencedClasses: []
  2652. }),
  2653. smalltalk.Number);
  2654. smalltalk.addMethod(
  2655. smalltalk.method({
  2656. selector: "sqrt",
  2657. category: 'arithmetic',
  2658. fn: function (){
  2659. var self=this;
  2660. return smalltalk.withContext(function($ctx1) {
  2661. return Math.sqrt(self);
  2662. return self}, function($ctx1) {$ctx1.fill(self,"sqrt",{},smalltalk.Number)})},
  2663. args: [],
  2664. source: "sqrt\x0a\x09<return Math.sqrt(self)>",
  2665. messageSends: [],
  2666. referencedClasses: []
  2667. }),
  2668. smalltalk.Number);
  2669. smalltalk.addMethod(
  2670. smalltalk.method({
  2671. selector: "squared",
  2672. category: 'arithmetic',
  2673. fn: function (){
  2674. var self=this;
  2675. return smalltalk.withContext(function($ctx1) {
  2676. var $1;
  2677. $1=self.__star(self);
  2678. return $1;
  2679. }, function($ctx1) {$ctx1.fill(self,"squared",{},smalltalk.Number)})},
  2680. args: [],
  2681. source: "squared\x0a\x09^self * self",
  2682. messageSends: ["*"],
  2683. referencedClasses: []
  2684. }),
  2685. smalltalk.Number);
  2686. smalltalk.addMethod(
  2687. smalltalk.method({
  2688. selector: "timesRepeat:",
  2689. category: 'enumerating',
  2690. fn: function (aBlock){
  2691. var self=this;
  2692. var count;
  2693. return smalltalk.withContext(function($ctx1) {
  2694. count=(1);
  2695. _st((function(){
  2696. return smalltalk.withContext(function($ctx2) {
  2697. return _st(count).__gt(self);
  2698. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  2699. return smalltalk.withContext(function($ctx2) {
  2700. _st(aBlock)._value();
  2701. count=_st(count).__plus((1));
  2702. return count;
  2703. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2704. return self}, function($ctx1) {$ctx1.fill(self,"timesRepeat:",{aBlock:aBlock,count:count},smalltalk.Number)})},
  2705. args: ["aBlock"],
  2706. source: "timesRepeat: aBlock\x0a\x09| count |\x0a\x09count := 1.\x0a\x09[count > self] whileFalse: [\x0a\x09\x09aBlock value.\x0a\x09\x09count := count + 1]",
  2707. messageSends: ["whileFalse:", "value", "+", ">"],
  2708. referencedClasses: []
  2709. }),
  2710. smalltalk.Number);
  2711. smalltalk.addMethod(
  2712. smalltalk.method({
  2713. selector: "to:",
  2714. category: 'converting',
  2715. fn: function (aNumber){
  2716. var self=this;
  2717. var array,first,last,count;
  2718. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2719. return smalltalk.withContext(function($ctx1) {
  2720. var $1;
  2721. first=self._truncated();
  2722. last=_st(_st(aNumber)._truncated()).__plus((1));
  2723. count=(1);
  2724. array=_st($Array())._new();
  2725. _st(_st(last).__minus(first))._timesRepeat_((function(){
  2726. return smalltalk.withContext(function($ctx2) {
  2727. _st(array)._at_put_(count,first);
  2728. count=_st(count).__plus((1));
  2729. count;
  2730. first=_st(first).__plus((1));
  2731. return first;
  2732. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2733. $1=array;
  2734. return $1;
  2735. }, function($ctx1) {$ctx1.fill(self,"to:",{aNumber:aNumber,array:array,first:first,last:last,count:count},smalltalk.Number)})},
  2736. args: ["aNumber"],
  2737. 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",
  2738. messageSends: ["truncated", "+", "new", "timesRepeat:", "at:put:", "-"],
  2739. referencedClasses: ["Array"]
  2740. }),
  2741. smalltalk.Number);
  2742. smalltalk.addMethod(
  2743. smalltalk.method({
  2744. selector: "to:by:",
  2745. category: 'converting',
  2746. fn: function (stop,step){
  2747. var self=this;
  2748. var array,value,pos;
  2749. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2750. return smalltalk.withContext(function($ctx1) {
  2751. var $1,$2,$3;
  2752. value=self;
  2753. array=_st($Array())._new();
  2754. pos=(1);
  2755. $1=_st(step).__eq((0));
  2756. if(smalltalk.assert($1)){
  2757. self._error_("step must be non-zero");
  2758. };
  2759. $2=_st(step).__lt((0));
  2760. if(smalltalk.assert($2)){
  2761. _st((function(){
  2762. return smalltalk.withContext(function($ctx2) {
  2763. return _st(value).__gt_eq(stop);
  2764. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2765. return smalltalk.withContext(function($ctx2) {
  2766. _st(array)._at_put_(pos,value);
  2767. pos=_st(pos).__plus((1));
  2768. pos;
  2769. value=_st(value).__plus(step);
  2770. return value;
  2771. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2772. } else {
  2773. _st((function(){
  2774. return smalltalk.withContext(function($ctx2) {
  2775. return _st(value).__lt_eq(stop);
  2776. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2777. return smalltalk.withContext(function($ctx2) {
  2778. _st(array)._at_put_(pos,value);
  2779. pos=_st(pos).__plus((1));
  2780. pos;
  2781. value=_st(value).__plus(step);
  2782. return value;
  2783. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2784. };
  2785. $3=array;
  2786. return $3;
  2787. }, function($ctx1) {$ctx1.fill(self,"to:by:",{stop:stop,step:step,array:array,value:value,pos:pos},smalltalk.Number)})},
  2788. args: ["stop", "step"],
  2789. 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",
  2790. messageSends: ["new", "ifTrue:", "error:", "=", "ifTrue:ifFalse:", "whileTrue:", "at:put:", "+", ">=", "<=", "<"],
  2791. referencedClasses: ["Array"]
  2792. }),
  2793. smalltalk.Number);
  2794. smalltalk.addMethod(
  2795. smalltalk.method({
  2796. selector: "to:by:do:",
  2797. category: 'enumerating',
  2798. fn: function (stop,step,aBlock){
  2799. var self=this;
  2800. var value;
  2801. return smalltalk.withContext(function($ctx1) {
  2802. var $1,$2;
  2803. value=self;
  2804. $1=_st(step).__eq((0));
  2805. if(smalltalk.assert($1)){
  2806. self._error_("step must be non-zero");
  2807. };
  2808. $2=_st(step).__lt((0));
  2809. if(smalltalk.assert($2)){
  2810. _st((function(){
  2811. return smalltalk.withContext(function($ctx2) {
  2812. return _st(value).__gt_eq(stop);
  2813. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2814. return smalltalk.withContext(function($ctx2) {
  2815. _st(aBlock)._value_(value);
  2816. value=_st(value).__plus(step);
  2817. return value;
  2818. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2819. } else {
  2820. _st((function(){
  2821. return smalltalk.withContext(function($ctx2) {
  2822. return _st(value).__lt_eq(stop);
  2823. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2824. return smalltalk.withContext(function($ctx2) {
  2825. _st(aBlock)._value_(value);
  2826. value=_st(value).__plus(step);
  2827. return value;
  2828. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2829. };
  2830. return self}, function($ctx1) {$ctx1.fill(self,"to:by:do:",{stop:stop,step:step,aBlock:aBlock,value:value},smalltalk.Number)})},
  2831. args: ["stop", "step", "aBlock"],
  2832. 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]]",
  2833. messageSends: ["ifTrue:", "error:", "=", "ifTrue:ifFalse:", "whileTrue:", "value:", "+", ">=", "<=", "<"],
  2834. referencedClasses: []
  2835. }),
  2836. smalltalk.Number);
  2837. smalltalk.addMethod(
  2838. smalltalk.method({
  2839. selector: "to:do:",
  2840. category: 'enumerating',
  2841. fn: function (stop,aBlock){
  2842. var self=this;
  2843. var nextValue;
  2844. return smalltalk.withContext(function($ctx1) {
  2845. nextValue=self;
  2846. _st((function(){
  2847. return smalltalk.withContext(function($ctx2) {
  2848. return _st(nextValue).__lt_eq(stop);
  2849. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  2850. return smalltalk.withContext(function($ctx2) {
  2851. _st(aBlock)._value_(nextValue);
  2852. nextValue=_st(nextValue).__plus((1));
  2853. return nextValue;
  2854. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2855. return self}, function($ctx1) {$ctx1.fill(self,"to:do:",{stop:stop,aBlock:aBlock,nextValue:nextValue},smalltalk.Number)})},
  2856. args: ["stop", "aBlock"],
  2857. 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]",
  2858. messageSends: ["whileTrue:", "value:", "+", "<="],
  2859. referencedClasses: []
  2860. }),
  2861. smalltalk.Number);
  2862. smalltalk.addMethod(
  2863. smalltalk.method({
  2864. selector: "truncated",
  2865. category: 'converting',
  2866. fn: function (){
  2867. var self=this;
  2868. return smalltalk.withContext(function($ctx1) {
  2869. if(self >= 0) {
  2870. return Math.floor(self);
  2871. } else {
  2872. return Math.floor(self * (-1)) * (-1);
  2873. };
  2874. ;
  2875. return self}, function($ctx1) {$ctx1.fill(self,"truncated",{},smalltalk.Number)})},
  2876. args: [],
  2877. 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>",
  2878. messageSends: [],
  2879. referencedClasses: []
  2880. }),
  2881. smalltalk.Number);
  2882. smalltalk.addMethod(
  2883. smalltalk.method({
  2884. selector: "|",
  2885. category: 'converting',
  2886. fn: function (aNumber){
  2887. var self=this;
  2888. return smalltalk.withContext(function($ctx1) {
  2889. return self | aNumber;
  2890. return self}, function($ctx1) {$ctx1.fill(self,"|",{aNumber:aNumber},smalltalk.Number)})},
  2891. args: ["aNumber"],
  2892. source: "| aNumber\x0a\x09<return self | aNumber>",
  2893. messageSends: [],
  2894. referencedClasses: []
  2895. }),
  2896. smalltalk.Number);
  2897. smalltalk.addMethod(
  2898. smalltalk.method({
  2899. selector: "heliosClass",
  2900. category: 'helios',
  2901. fn: function (){
  2902. var self=this;
  2903. return smalltalk.withContext(function($ctx1) {
  2904. return "magnitude";
  2905. }, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Number.klass)})},
  2906. args: [],
  2907. source: "heliosClass\x0a\x09^ 'magnitude'",
  2908. messageSends: [],
  2909. referencedClasses: []
  2910. }),
  2911. smalltalk.Number.klass);
  2912. smalltalk.addMethod(
  2913. smalltalk.method({
  2914. selector: "pi",
  2915. category: 'instance creation',
  2916. fn: function (){
  2917. var self=this;
  2918. return smalltalk.withContext(function($ctx1) {
  2919. return Math.PI;
  2920. return self}, function($ctx1) {$ctx1.fill(self,"pi",{},smalltalk.Number.klass)})},
  2921. args: [],
  2922. source: "pi\x0a\x09<return Math.PI>",
  2923. messageSends: [],
  2924. referencedClasses: []
  2925. }),
  2926. smalltalk.Number.klass);
  2927. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  2928. 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";
  2929. smalltalk.addMethod(
  2930. smalltalk.method({
  2931. selector: "*",
  2932. category: 'arithmetic',
  2933. fn: function (aPoint){
  2934. var self=this;
  2935. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2936. return smalltalk.withContext(function($ctx1) {
  2937. var $1;
  2938. $1=_st($Point())._x_y_(_st(self._x()).__star(_st(_st(aPoint)._asPoint())._x()),_st(self._y()).__star(_st(_st(aPoint)._asPoint())._y()));
  2939. return $1;
  2940. }, function($ctx1) {$ctx1.fill(self,"*",{aPoint:aPoint},smalltalk.Point)})},
  2941. args: ["aPoint"],
  2942. source: "* aPoint\x0a\x09^Point x: self x * aPoint asPoint x y: self y * aPoint asPoint y",
  2943. messageSends: ["x:y:", "*", "x", "asPoint", "y"],
  2944. referencedClasses: ["Point"]
  2945. }),
  2946. smalltalk.Point);
  2947. smalltalk.addMethod(
  2948. smalltalk.method({
  2949. selector: "+",
  2950. category: 'arithmetic',
  2951. fn: function (aPoint){
  2952. var self=this;
  2953. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2954. return smalltalk.withContext(function($ctx1) {
  2955. var $1;
  2956. $1=_st($Point())._x_y_(_st(self._x()).__plus(_st(_st(aPoint)._asPoint())._x()),_st(self._y()).__plus(_st(_st(aPoint)._asPoint())._y()));
  2957. return $1;
  2958. }, function($ctx1) {$ctx1.fill(self,"+",{aPoint:aPoint},smalltalk.Point)})},
  2959. args: ["aPoint"],
  2960. source: "+ aPoint\x0a\x09^Point x: self x + aPoint asPoint x y: self y + aPoint asPoint y",
  2961. messageSends: ["x:y:", "+", "x", "asPoint", "y"],
  2962. referencedClasses: ["Point"]
  2963. }),
  2964. smalltalk.Point);
  2965. smalltalk.addMethod(
  2966. smalltalk.method({
  2967. selector: "-",
  2968. category: 'arithmetic',
  2969. fn: function (aPoint){
  2970. var self=this;
  2971. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2972. return smalltalk.withContext(function($ctx1) {
  2973. var $1;
  2974. $1=_st($Point())._x_y_(_st(self._x()).__minus(_st(_st(aPoint)._asPoint())._x()),_st(self._y()).__minus(_st(_st(aPoint)._asPoint())._y()));
  2975. return $1;
  2976. }, function($ctx1) {$ctx1.fill(self,"-",{aPoint:aPoint},smalltalk.Point)})},
  2977. args: ["aPoint"],
  2978. source: "- aPoint\x0a\x09^Point x: self x - aPoint asPoint x y: self y - aPoint asPoint y",
  2979. messageSends: ["x:y:", "-", "x", "asPoint", "y"],
  2980. referencedClasses: ["Point"]
  2981. }),
  2982. smalltalk.Point);
  2983. smalltalk.addMethod(
  2984. smalltalk.method({
  2985. selector: "/",
  2986. category: 'arithmetic',
  2987. fn: function (aPoint){
  2988. var self=this;
  2989. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2990. return smalltalk.withContext(function($ctx1) {
  2991. var $1;
  2992. $1=_st($Point())._x_y_(_st(self._x()).__slash(_st(_st(aPoint)._asPoint())._x()),_st(self._y()).__slash(_st(_st(aPoint)._asPoint())._y()));
  2993. return $1;
  2994. }, function($ctx1) {$ctx1.fill(self,"/",{aPoint:aPoint},smalltalk.Point)})},
  2995. args: ["aPoint"],
  2996. source: "/ aPoint\x0a\x09^Point x: self x / aPoint asPoint x y: self y / aPoint asPoint y",
  2997. messageSends: ["x:y:", "/", "x", "asPoint", "y"],
  2998. referencedClasses: ["Point"]
  2999. }),
  3000. smalltalk.Point);
  3001. smalltalk.addMethod(
  3002. smalltalk.method({
  3003. selector: "=",
  3004. category: 'arithmetic',
  3005. fn: function (aPoint){
  3006. var self=this;
  3007. return smalltalk.withContext(function($ctx1) {
  3008. var $1;
  3009. $1=_st(_st(_st(aPoint)._class()).__eq(self._class()))._and_((function(){
  3010. return smalltalk.withContext(function($ctx2) {
  3011. return _st(_st(_st(aPoint)._x()).__eq(self._x())).__and(_st(_st(aPoint)._y()).__eq(self._y()));
  3012. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3013. return $1;
  3014. }, function($ctx1) {$ctx1.fill(self,"=",{aPoint:aPoint},smalltalk.Point)})},
  3015. args: ["aPoint"],
  3016. source: "= aPoint\x0a\x09^aPoint class = self class and: [\x0a\x09\x09(aPoint x = self x) & (aPoint y = self y)]",
  3017. messageSends: ["and:", "&", "=", "y", "x", "class"],
  3018. referencedClasses: []
  3019. }),
  3020. smalltalk.Point);
  3021. smalltalk.addMethod(
  3022. smalltalk.method({
  3023. selector: "asPoint",
  3024. category: 'converting',
  3025. fn: function (){
  3026. var self=this;
  3027. return smalltalk.withContext(function($ctx1) {
  3028. var $1;
  3029. $1=self;
  3030. return $1;
  3031. }, function($ctx1) {$ctx1.fill(self,"asPoint",{},smalltalk.Point)})},
  3032. args: [],
  3033. source: "asPoint\x0a\x09^self",
  3034. messageSends: [],
  3035. referencedClasses: []
  3036. }),
  3037. smalltalk.Point);
  3038. smalltalk.addMethod(
  3039. smalltalk.method({
  3040. selector: "printOn:",
  3041. category: 'printing',
  3042. fn: function (aStream){
  3043. var self=this;
  3044. return smalltalk.withContext(function($ctx1) {
  3045. var $1;
  3046. _st(self["@x"])._printOn_(aStream);
  3047. _st(aStream)._nextPutAll_("@");
  3048. $1=_st(_st(self["@y"])._notNil())._and_((function(){
  3049. return smalltalk.withContext(function($ctx2) {
  3050. return _st(self["@y"])._negative();
  3051. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3052. if(smalltalk.assert($1)){
  3053. _st(aStream)._space();
  3054. };
  3055. _st(self["@y"])._printOn_(aStream);
  3056. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Point)})},
  3057. args: ["aStream"],
  3058. 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",
  3059. messageSends: ["printOn:", "nextPutAll:", "ifTrue:", "space", "and:", "negative", "notNil"],
  3060. referencedClasses: []
  3061. }),
  3062. smalltalk.Point);
  3063. smalltalk.addMethod(
  3064. smalltalk.method({
  3065. selector: "translateBy:",
  3066. category: 'transforming',
  3067. fn: function (delta){
  3068. var self=this;
  3069. return smalltalk.withContext(function($ctx1) {
  3070. var $1;
  3071. $1=_st(_st(_st(delta)._x()).__plus(self["@x"])).__at(_st(_st(delta)._y()).__plus(self["@y"]));
  3072. return $1;
  3073. }, function($ctx1) {$ctx1.fill(self,"translateBy:",{delta:delta},smalltalk.Point)})},
  3074. args: ["delta"],
  3075. source: "translateBy: delta\x0a\x09\x22Answer a Point translated by delta (an instance of Point).\x22\x0a\x09^(delta x + x) @ (delta y + y)",
  3076. messageSends: ["@", "+", "y", "x"],
  3077. referencedClasses: []
  3078. }),
  3079. smalltalk.Point);
  3080. smalltalk.addMethod(
  3081. smalltalk.method({
  3082. selector: "x",
  3083. category: 'accessing',
  3084. fn: function (){
  3085. var self=this;
  3086. return smalltalk.withContext(function($ctx1) {
  3087. var $1;
  3088. $1=self["@x"];
  3089. return $1;
  3090. }, function($ctx1) {$ctx1.fill(self,"x",{},smalltalk.Point)})},
  3091. args: [],
  3092. source: "x\x0a\x09^x",
  3093. messageSends: [],
  3094. referencedClasses: []
  3095. }),
  3096. smalltalk.Point);
  3097. smalltalk.addMethod(
  3098. smalltalk.method({
  3099. selector: "x:",
  3100. category: 'accessing',
  3101. fn: function (aNumber){
  3102. var self=this;
  3103. return smalltalk.withContext(function($ctx1) {
  3104. self["@x"]=aNumber;
  3105. return self}, function($ctx1) {$ctx1.fill(self,"x:",{aNumber:aNumber},smalltalk.Point)})},
  3106. args: ["aNumber"],
  3107. source: "x: aNumber\x0a\x09x := aNumber",
  3108. messageSends: [],
  3109. referencedClasses: []
  3110. }),
  3111. smalltalk.Point);
  3112. smalltalk.addMethod(
  3113. smalltalk.method({
  3114. selector: "y",
  3115. category: 'accessing',
  3116. fn: function (){
  3117. var self=this;
  3118. return smalltalk.withContext(function($ctx1) {
  3119. var $1;
  3120. $1=self["@y"];
  3121. return $1;
  3122. }, function($ctx1) {$ctx1.fill(self,"y",{},smalltalk.Point)})},
  3123. args: [],
  3124. source: "y\x0a\x09^y",
  3125. messageSends: [],
  3126. referencedClasses: []
  3127. }),
  3128. smalltalk.Point);
  3129. smalltalk.addMethod(
  3130. smalltalk.method({
  3131. selector: "y:",
  3132. category: 'accessing',
  3133. fn: function (aNumber){
  3134. var self=this;
  3135. return smalltalk.withContext(function($ctx1) {
  3136. self["@y"]=aNumber;
  3137. return self}, function($ctx1) {$ctx1.fill(self,"y:",{aNumber:aNumber},smalltalk.Point)})},
  3138. args: ["aNumber"],
  3139. source: "y: aNumber\x0a\x09y := aNumber",
  3140. messageSends: [],
  3141. referencedClasses: []
  3142. }),
  3143. smalltalk.Point);
  3144. smalltalk.addMethod(
  3145. smalltalk.method({
  3146. selector: "heliosClass",
  3147. category: 'helios',
  3148. fn: function (){
  3149. var self=this;
  3150. return smalltalk.withContext(function($ctx1) {
  3151. return "magnitude";
  3152. }, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Point.klass)})},
  3153. args: [],
  3154. source: "heliosClass\x0a\x09^ 'magnitude'",
  3155. messageSends: [],
  3156. referencedClasses: []
  3157. }),
  3158. smalltalk.Point.klass);
  3159. smalltalk.addMethod(
  3160. smalltalk.method({
  3161. selector: "x:y:",
  3162. category: 'instance creation',
  3163. fn: function (aNumber,anotherNumber){
  3164. var self=this;
  3165. return smalltalk.withContext(function($ctx1) {
  3166. var $2,$3,$1;
  3167. $2=self._new();
  3168. _st($2)._x_(aNumber);
  3169. _st($2)._y_(anotherNumber);
  3170. $3=_st($2)._yourself();
  3171. $1=$3;
  3172. return $1;
  3173. }, function($ctx1) {$ctx1.fill(self,"x:y:",{aNumber:aNumber,anotherNumber:anotherNumber},smalltalk.Point.klass)})},
  3174. args: ["aNumber", "anotherNumber"],
  3175. source: "x: aNumber y: anotherNumber\x0a\x09^self new\x0a\x09\x09x: aNumber;\x0a\x09\x09y: anotherNumber;\x0a\x09\x09yourself",
  3176. messageSends: ["x:", "new", "y:", "yourself"],
  3177. referencedClasses: []
  3178. }),
  3179. smalltalk.Point.klass);
  3180. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  3181. 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'`.";
  3182. smalltalk.addMethod(
  3183. smalltalk.method({
  3184. selector: "next",
  3185. category: 'accessing',
  3186. fn: function (){
  3187. var self=this;
  3188. return smalltalk.withContext(function($ctx1) {
  3189. return Math.random();
  3190. return self}, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Random)})},
  3191. args: [],
  3192. source: "next\x0a\x09<return Math.random()>",
  3193. messageSends: [],
  3194. referencedClasses: []
  3195. }),
  3196. smalltalk.Random);
  3197. smalltalk.addMethod(
  3198. smalltalk.method({
  3199. selector: "next:",
  3200. category: 'accessing',
  3201. fn: function (anInteger){
  3202. var self=this;
  3203. return smalltalk.withContext(function($ctx1) {
  3204. var $1;
  3205. $1=_st((1)._to_(anInteger))._collect_((function(each){
  3206. return smalltalk.withContext(function($ctx2) {
  3207. return self._next();
  3208. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3209. return $1;
  3210. }, function($ctx1) {$ctx1.fill(self,"next:",{anInteger:anInteger},smalltalk.Random)})},
  3211. args: ["anInteger"],
  3212. source: "next: anInteger\x0a\x09^(1 to: anInteger) collect: [:each | self next]",
  3213. messageSends: ["collect:", "next", "to:"],
  3214. referencedClasses: []
  3215. }),
  3216. smalltalk.Random);
  3217. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  3218. 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`.";
  3219. smalltalk.addMethod(
  3220. smalltalk.method({
  3221. selector: "asJSON",
  3222. category: 'converting',
  3223. fn: function (){
  3224. var self=this;
  3225. return smalltalk.withContext(function($ctx1) {
  3226. var $1;
  3227. $1=null;
  3228. return $1;
  3229. }, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.UndefinedObject)})},
  3230. args: [],
  3231. source: "asJSON\x0a\x09^null",
  3232. messageSends: [],
  3233. referencedClasses: []
  3234. }),
  3235. smalltalk.UndefinedObject);
  3236. smalltalk.addMethod(
  3237. smalltalk.method({
  3238. selector: "deepCopy",
  3239. category: 'copying',
  3240. fn: function (){
  3241. var self=this;
  3242. return smalltalk.withContext(function($ctx1) {
  3243. var $1;
  3244. $1=self;
  3245. return $1;
  3246. }, function($ctx1) {$ctx1.fill(self,"deepCopy",{},smalltalk.UndefinedObject)})},
  3247. args: [],
  3248. source: "deepCopy\x0a\x09^self",
  3249. messageSends: [],
  3250. referencedClasses: []
  3251. }),
  3252. smalltalk.UndefinedObject);
  3253. smalltalk.addMethod(
  3254. smalltalk.method({
  3255. selector: "ifNil:",
  3256. category: 'testing',
  3257. fn: function (aBlock){
  3258. var self=this;
  3259. return smalltalk.withContext(function($ctx1) {
  3260. var $2,$1;
  3261. $2=self;
  3262. $1=_st($2)._ifNil_ifNotNil_(aBlock,(function(){
  3263. return smalltalk.withContext(function($ctx2) {
  3264. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3265. return $1;
  3266. }, function($ctx1) {$ctx1.fill(self,"ifNil:",{aBlock:aBlock},smalltalk.UndefinedObject)})},
  3267. args: ["aBlock"],
  3268. source: "ifNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifNil: aBlock ifNotNil: []",
  3269. messageSends: ["ifNil:ifNotNil:"],
  3270. referencedClasses: []
  3271. }),
  3272. smalltalk.UndefinedObject);
  3273. smalltalk.addMethod(
  3274. smalltalk.method({
  3275. selector: "ifNil:ifNotNil:",
  3276. category: 'testing',
  3277. fn: function (aBlock,anotherBlock){
  3278. var self=this;
  3279. return smalltalk.withContext(function($ctx1) {
  3280. var $1;
  3281. $1=_st(aBlock)._value();
  3282. return $1;
  3283. }, function($ctx1) {$ctx1.fill(self,"ifNil:ifNotNil:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.UndefinedObject)})},
  3284. args: ["aBlock", "anotherBlock"],
  3285. source: "ifNil: aBlock ifNotNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^aBlock value",
  3286. messageSends: ["value"],
  3287. referencedClasses: []
  3288. }),
  3289. smalltalk.UndefinedObject);
  3290. smalltalk.addMethod(
  3291. smalltalk.method({
  3292. selector: "ifNotNil:",
  3293. category: 'testing',
  3294. fn: function (aBlock){
  3295. var self=this;
  3296. return smalltalk.withContext(function($ctx1) {
  3297. var $1;
  3298. $1=self;
  3299. return $1;
  3300. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:",{aBlock:aBlock},smalltalk.UndefinedObject)})},
  3301. args: ["aBlock"],
  3302. source: "ifNotNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self",
  3303. messageSends: [],
  3304. referencedClasses: []
  3305. }),
  3306. smalltalk.UndefinedObject);
  3307. smalltalk.addMethod(
  3308. smalltalk.method({
  3309. selector: "ifNotNil:ifNil:",
  3310. category: 'testing',
  3311. fn: function (aBlock,anotherBlock){
  3312. var self=this;
  3313. return smalltalk.withContext(function($ctx1) {
  3314. var $1;
  3315. $1=_st(anotherBlock)._value();
  3316. return $1;
  3317. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:ifNil:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.UndefinedObject)})},
  3318. args: ["aBlock", "anotherBlock"],
  3319. source: "ifNotNil: aBlock ifNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^anotherBlock value",
  3320. messageSends: ["value"],
  3321. referencedClasses: []
  3322. }),
  3323. smalltalk.UndefinedObject);
  3324. smalltalk.addMethod(
  3325. smalltalk.method({
  3326. selector: "isImmutable",
  3327. category: 'testing',
  3328. fn: function (){
  3329. var self=this;
  3330. return smalltalk.withContext(function($ctx1) {
  3331. return true;
  3332. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.UndefinedObject)})},
  3333. args: [],
  3334. source: "isImmutable\x0a\x09^ true",
  3335. messageSends: [],
  3336. referencedClasses: []
  3337. }),
  3338. smalltalk.UndefinedObject);
  3339. smalltalk.addMethod(
  3340. smalltalk.method({
  3341. selector: "isNil",
  3342. category: 'testing',
  3343. fn: function (){
  3344. var self=this;
  3345. return smalltalk.withContext(function($ctx1) {
  3346. return true;
  3347. }, function($ctx1) {$ctx1.fill(self,"isNil",{},smalltalk.UndefinedObject)})},
  3348. args: [],
  3349. source: "isNil\x0a\x09^true",
  3350. messageSends: [],
  3351. referencedClasses: []
  3352. }),
  3353. smalltalk.UndefinedObject);
  3354. smalltalk.addMethod(
  3355. smalltalk.method({
  3356. selector: "notNil",
  3357. category: 'testing',
  3358. fn: function (){
  3359. var self=this;
  3360. return smalltalk.withContext(function($ctx1) {
  3361. return false;
  3362. }, function($ctx1) {$ctx1.fill(self,"notNil",{},smalltalk.UndefinedObject)})},
  3363. args: [],
  3364. source: "notNil\x0a\x09^false",
  3365. messageSends: [],
  3366. referencedClasses: []
  3367. }),
  3368. smalltalk.UndefinedObject);
  3369. smalltalk.addMethod(
  3370. smalltalk.method({
  3371. selector: "printOn:",
  3372. category: 'printing',
  3373. fn: function (aStream){
  3374. var self=this;
  3375. return smalltalk.withContext(function($ctx1) {
  3376. _st(aStream)._nextPutAll_("nil");
  3377. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.UndefinedObject)})},
  3378. args: ["aStream"],
  3379. source: "printOn: aStream\x0a\x09aStream nextPutAll: 'nil'",
  3380. messageSends: ["nextPutAll:"],
  3381. referencedClasses: []
  3382. }),
  3383. smalltalk.UndefinedObject);
  3384. smalltalk.addMethod(
  3385. smalltalk.method({
  3386. selector: "shallowCopy",
  3387. category: 'copying',
  3388. fn: function (){
  3389. var self=this;
  3390. return smalltalk.withContext(function($ctx1) {
  3391. var $1;
  3392. $1=self;
  3393. return $1;
  3394. }, function($ctx1) {$ctx1.fill(self,"shallowCopy",{},smalltalk.UndefinedObject)})},
  3395. args: [],
  3396. source: "shallowCopy\x0a\x09^self",
  3397. messageSends: [],
  3398. referencedClasses: []
  3399. }),
  3400. smalltalk.UndefinedObject);
  3401. smalltalk.addMethod(
  3402. smalltalk.method({
  3403. selector: "subclass:instanceVariableNames:",
  3404. category: 'class creation',
  3405. fn: function (aString,anotherString){
  3406. var self=this;
  3407. return smalltalk.withContext(function($ctx1) {
  3408. var $1;
  3409. $1=self._subclass_instanceVariableNames_package_(aString,anotherString,nil);
  3410. return $1;
  3411. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString},smalltalk.UndefinedObject)})},
  3412. args: ["aString", "anotherString"],
  3413. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
  3414. messageSends: ["subclass:instanceVariableNames:package:"],
  3415. referencedClasses: []
  3416. }),
  3417. smalltalk.UndefinedObject);
  3418. smalltalk.addMethod(
  3419. smalltalk.method({
  3420. selector: "subclass:instanceVariableNames:category:",
  3421. category: 'class creation',
  3422. fn: function (aString,aString2,aString3){
  3423. var self=this;
  3424. return smalltalk.withContext(function($ctx1) {
  3425. var $1;
  3426. self._deprecatedAPI();
  3427. $1=self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
  3428. return $1;
  3429. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3},smalltalk.UndefinedObject)})},
  3430. args: ["aString", "aString2", "aString3"],
  3431. 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",
  3432. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  3433. referencedClasses: []
  3434. }),
  3435. smalltalk.UndefinedObject);
  3436. smalltalk.addMethod(
  3437. smalltalk.method({
  3438. selector: "subclass:instanceVariableNames:package:",
  3439. category: 'class creation',
  3440. fn: function (aString,aString2,aString3){
  3441. var self=this;
  3442. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  3443. return smalltalk.withContext(function($ctx1) {
  3444. var $1;
  3445. $1=_st(_st($ClassBuilder())._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
  3446. return $1;
  3447. }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3},smalltalk.UndefinedObject)})},
  3448. args: ["aString", "aString2", "aString3"],
  3449. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09\x09superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
  3450. messageSends: ["superclass:subclass:instanceVariableNames:package:", "asString", "new"],
  3451. referencedClasses: ["ClassBuilder"]
  3452. }),
  3453. smalltalk.UndefinedObject);
  3454. smalltalk.addMethod(
  3455. smalltalk.method({
  3456. selector: "new",
  3457. category: 'instance creation',
  3458. fn: function (){
  3459. var self=this;
  3460. return smalltalk.withContext(function($ctx1) {
  3461. self._error_("You cannot create new instances of UndefinedObject. Use nil");
  3462. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.UndefinedObject.klass)})},
  3463. args: [],
  3464. source: "new\x0a\x09\x09self error: 'You cannot create new instances of UndefinedObject. Use nil'",
  3465. messageSends: ["error:"],
  3466. referencedClasses: []
  3467. }),
  3468. smalltalk.UndefinedObject.klass);
  3469. });