1
0

Kernel-Objects.js 144 KB

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