1
0

Kernel-Methods.js 132 KB

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