1
0

Kernel-Methods.js 93 KB

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