1
0

Kernel-Methods.js 109 KB

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