12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929 |
- define(["amber/boot", "require", "amber/core/Kernel-Objects"], function($boot,requirejs){"use strict";
- var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
- var $pkg = $core.addPackage("Kernel-Methods");
- $pkg.innerEval = function (expr) { return eval(expr); };
- $pkg.transport = {"type":"amd","amdNamespace":"amber/core"};
- $core.addClass("BlockClosure", $globals.Object, ["prototype", "length"], "Kernel-Methods");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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 | ... ] `";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "applyTo:arguments:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject", "aCollection"],
- source: "applyTo: anObject arguments: aCollection\x0a\x09<inlineJS: 'return self.apply(anObject, aCollection)'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return self.apply(anObject, aCollection)"]]],
- messageSends: []
- }, function ($methodClass){ return function (anObject,aCollection){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self.apply(anObject, aCollection);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "asCompiledMethod:",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "asCompiledMethod: aString\x0a\x09<inlineJS: 'return $core.method({selector:aString, fn:self});'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return $core.method({selector:aString, fn:self});"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $core.method({selector:aString, fn:self});;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asCompiledMethod:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "asJavaScriptObject",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asJavaScriptObject\x0a\x09^ self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return self;
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "asJavaScriptSource",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asJavaScriptSource\x0a\x09<inlineJS: 'return $self.toString();'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return $self.toString();"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self.toString();;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSource",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "compiledSource",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "compiledSource\x0a\x09<inlineJS: 'return self.toString()'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return self.toString()"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self.toString();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"compiledSource",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "currySelf",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "currySelf\x0a\x09\x22Transforms [ :selfarg :x :y | stcode ] block\x0a\x09which represents JS function (selfarg, x, y, ...) {jscode}\x0a\x09into function (x, y, ...) {jscode} that takes selfarg from 'this'.\x0a\x09IOW, it is usable as JS method and first arg takes the receiver.\x22\x0a\x09\x0a\x09<inlineJS: '\x0a\x09\x09return function () {\x0a\x09\x09\x09var args = [ this ];\x0a\x09\x09\x09args.push.apply(args, arguments);\x0a\x09\x09\x09return self.apply(null, args);\x0a\x09\x09}\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return function () {\x0a\x09\x09\x09var args = [ this ];\x0a\x09\x09\x09args.push.apply(args, arguments);\x0a\x09\x09\x09return self.apply(null, args);\x0a\x09\x09}\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return function () {
- var args = [ this ];
- args.push.apply(args, arguments);
- return self.apply(null, args);
- }
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"currySelf",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "ensure:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- source: "ensure: aBlock\x0a\x09<inlineJS: 'try{return $self._value()}finally{aBlock._value()}'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["try{return $self._value()}finally{aBlock._value()}"]]],
- messageSends: []
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- try{return $self._value()}finally{aBlock._value()};
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"ensure:",{aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "fork",
- protocol: "timeout/interval",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "fork\x0a\x09ForkPool default fork: self",
- referencedClasses: ["ForkPool"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["fork:", "default"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($recv($globals.ForkPool)._default())._fork_(self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"fork",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "new",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "new\x0a\x09\x22Use the receiver as a JS constructor.\x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<inlineJS: 'return new self()'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return new self()"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return new self();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"new",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "newValue:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "newValue: anObject\x0a\x09^ self newWithValues: { anObject }",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["newWithValues:"]
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._newWithValues_([anObject]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"newValue:",{anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "newValue:value:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject", "anObject2"],
- source: "newValue: anObject value: anObject2\x0a\x09^ self newWithValues: { anObject. anObject2 }.",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["newWithValues:"]
- }, function ($methodClass){ return function (anObject,anObject2){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._newWithValues_([anObject,anObject2]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"newValue:value:",{anObject:anObject,anObject2:anObject2})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "newValue:value:value:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject", "anObject2", "anObject3"],
- source: "newValue: anObject value: anObject2 value: anObject3\x0a\x09^ self newWithValues: { anObject. anObject2. anObject3 }.",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["newWithValues:"]
- }, function ($methodClass){ return function (anObject,anObject2,anObject3){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._newWithValues_([anObject,anObject2,anObject3]);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"newValue:value:value:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "newWithValues:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCollection"],
- source: "newWithValues: aCollection\x0a\x09\x22Simulates JS new operator by combination of Object.create and .apply\x22\x0a\x09<inlineJS: '\x0a\x09\x09var object = Object.create(self.prototype);\x0a\x09\x09var result = self.apply(object, aCollection);\x0a\x09\x09return typeof result === \x22object\x22 ? result : object;\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var object = Object.create(self.prototype);\x0a\x09\x09var result = self.apply(object, aCollection);\x0a\x09\x09return typeof result === \x22object\x22 ? result : object;\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aCollection){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var object = Object.create(self.prototype);
- var result = self.apply(object, aCollection);
- return typeof result === "object" ? result : object;
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"newWithValues:",{aCollection:aCollection})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "numArgs",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "numArgs\x0a\x09^ length",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.length;
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "on:do:",
- protocol: "error handling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anErrorClass", "aBlock"],
- source: "on: anErrorClass do: aBlock\x0a\x09^ Smalltalk try: self ifTrue: [ :err | err isKindOf: anErrorClass ] catch: aBlock",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["try:ifTrue:catch:", "isKindOf:"]
- }, function ($methodClass){ return function (anErrorClass,aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.Smalltalk)._try_ifTrue_catch_(self,(function(err){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(err)._isKindOf_(anErrorClass);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({err:err},$ctx1,1)});
- //>>excludeEnd("ctx");
- }),aBlock);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"on:do:",{anErrorClass:anErrorClass,aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "prototype",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "prototype\x0a\x09^ prototype",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.prototype;
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "provided",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "provided\x0a\x09\x22Returns JS proxy that allows to access 'static API', as in\x0a\x09 require provided resolve: ...\x0a\x09or\x0a\x09 XMLHttpRequest provided DONE\x22\x0a\x09\x0a\x09^ JSObjectProxy on: self",
- referencedClasses: ["JSObjectProxy"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["on:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.JSObjectProxy)._on_(self);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"provided",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "receiver",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "receiver\x0a\x09^ nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return nil;
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "timeToRun",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "timeToRun\x0a\x09\x22Answer the number of milliseconds taken to execute this block.\x22\x0a\x0a\x09^ Date millisecondsToRun: self",
- referencedClasses: ["Date"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["millisecondsToRun:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.Date)._millisecondsToRun_(self);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"timeToRun",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "tryCatch:",
- protocol: "error handling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- source: "tryCatch: aBlock\x0a\x09<inlineJS: '\x0a\x09\x09try {\x0a\x09\x09\x09return $self._value();\x0a\x09\x09} catch(error) {\x0a\x09\x09\x09// pass non-local returns undetected\x0a\x09\x09\x09if (Array.isArray(error) && error.length === 1) throw error;\x0a\x09\x09\x09return aBlock._value_(error);\x0a\x09\x09}\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09try {\x0a\x09\x09\x09return $self._value();\x0a\x09\x09} catch(error) {\x0a\x09\x09\x09// pass non-local returns undetected\x0a\x09\x09\x09if (Array.isArray(error) && error.length === 1) throw error;\x0a\x09\x09\x09return aBlock._value_(error);\x0a\x09\x09}\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- try {
- return $self._value();
- } catch(error) {
- // pass non-local returns undetected
- if (Array.isArray(error) && error.length === 1) throw error;
- return aBlock._value_(error);
- }
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"tryCatch:",{aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "tryIfTrue:catch:",
- protocol: "error handling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anotherBlock", "aBlock"],
- source: "tryIfTrue: anotherBlock catch: aBlock\x0a\x09<inlineJS: '\x0a\x09\x09try {\x0a\x09\x09\x09return $self._value();\x0a\x09\x09} catch(error) {\x0a\x09\x09\x09// pass non-local returns undetected\x0a\x09\x09\x09if (Array.isArray(error) && error.length === 1) throw error;\x0a\x09\x09\x09if (!anotherBlock._value_(error)) throw error;\x0a\x09\x09\x09return aBlock._value_(error);\x0a\x09\x09}\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09try {\x0a\x09\x09\x09return $self._value();\x0a\x09\x09} catch(error) {\x0a\x09\x09\x09// pass non-local returns undetected\x0a\x09\x09\x09if (Array.isArray(error) && error.length === 1) throw error;\x0a\x09\x09\x09if (!anotherBlock._value_(error)) throw error;\x0a\x09\x09\x09return aBlock._value_(error);\x0a\x09\x09}\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (anotherBlock,aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- try {
- return $self._value();
- } catch(error) {
- // pass non-local returns undetected
- if (Array.isArray(error) && error.length === 1) throw error;
- if (!anotherBlock._value_(error)) throw error;
- return aBlock._value_(error);
- }
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"tryIfTrue:catch:",{anotherBlock:anotherBlock,aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "value",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "value\x0a\x09<inlineJS: 'return self();'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return self();"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self();;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "value:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArg"],
- source: "value: anArg\x0a\x09<inlineJS: 'return self(anArg);'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return self(anArg);"]]],
- messageSends: []
- }, function ($methodClass){ return function (anArg){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self(anArg);;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:",{anArg:anArg})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "value:value:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["firstArg", "secondArg"],
- source: "value: firstArg value: secondArg\x0a\x09<inlineJS: 'return self(firstArg, secondArg);'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return self(firstArg, secondArg);"]]],
- messageSends: []
- }, function ($methodClass){ return function (firstArg,secondArg){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self(firstArg, secondArg);;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArg:firstArg,secondArg:secondArg})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "value:value:value:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["firstArg", "secondArg", "thirdArg"],
- source: "value: firstArg value: secondArg value: thirdArg\x0a\x09<inlineJS: 'return self(firstArg, secondArg, thirdArg);'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return self(firstArg, secondArg, thirdArg);"]]],
- messageSends: []
- }, function ($methodClass){ return function (firstArg,secondArg,thirdArg){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self(firstArg, secondArg, thirdArg);;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArg:firstArg,secondArg:secondArg,thirdArg:thirdArg})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "valueWithInterval:",
- protocol: "timeout/interval",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNumber"],
- source: "valueWithInterval: aNumber\x0a\x09<inlineJS: '\x0a\x09\x09var interval = setInterval(self, aNumber);\x0a\x09\x09return $globals.Timeout._on_(interval);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var interval = setInterval(self, aNumber);\x0a\x09\x09return $globals.Timeout._on_(interval);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aNumber){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var interval = setInterval(self, aNumber);
- return $globals.Timeout._on_(interval);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"valueWithInterval:",{aNumber:aNumber})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "valueWithPossibleArguments:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aCollection"],
- source: "valueWithPossibleArguments: aCollection\x0a\x09<inlineJS: 'return self.apply(null, aCollection);'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return self.apply(null, aCollection);"]]],
- messageSends: []
- }, function ($methodClass){ return function (aCollection){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self.apply(null, aCollection);;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "valueWithTimeout:",
- protocol: "timeout/interval",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aNumber"],
- source: "valueWithTimeout: aNumber\x0a\x09<inlineJS: '\x0a\x09\x09var timeout = setTimeout(self, aNumber);\x0a\x09\x09return $globals.Timeout._on_(timeout);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var timeout = setTimeout(self, aNumber);\x0a\x09\x09return $globals.Timeout._on_(timeout);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aNumber){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var timeout = setTimeout(self, aNumber);
- return $globals.Timeout._on_(timeout);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"valueWithTimeout:",{aNumber:aNumber})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "whileFalse",
- protocol: "controlling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "whileFalse\x0a\x09self whileFalse: []",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["whileFalse:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._whileFalse_((function(){
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"whileFalse",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "whileFalse:",
- protocol: "controlling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- source: "whileFalse: aBlock\x0a\x09<inlineJS: 'while(!$core.assert($self._value())) {aBlock._value()}'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["while(!$core.assert($self._value())) {aBlock._value()}"]]],
- messageSends: []
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- while(!$core.assert($self._value())) {aBlock._value()};
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"whileFalse:",{aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "whileTrue",
- protocol: "controlling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "whileTrue\x0a\x09self whileTrue: []",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["whileTrue:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._whileTrue_((function(){
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"whileTrue",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "whileTrue:",
- protocol: "controlling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- source: "whileTrue: aBlock\x0a\x09<inlineJS: 'while($core.assert($self._value())) {aBlock._value()}'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["while($core.assert($self._value())) {aBlock._value()}"]]],
- messageSends: []
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- while($core.assert($self._value())) {aBlock._value()};
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"whileTrue:",{aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure);
- $core.addMethod(
- $core.method({
- selector: "javaScriptConstructorFor:initializingVia:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aPrototype", "aMethodBlock"],
- source: "javaScriptConstructorFor: aPrototype initializingVia: aMethodBlock\x0a\x09<inlineJS: '\x0a\x09\x09function Ctr () {\x0a\x09\x09\x09aMethodBlock.apply(this, arguments);\x0a\x09\x09}\x0a\x09\x09Ctr.prototype = aPrototype;\x0a\x09\x09return Ctr;\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09function Ctr () {\x0a\x09\x09\x09aMethodBlock.apply(this, arguments);\x0a\x09\x09}\x0a\x09\x09Ctr.prototype = aPrototype;\x0a\x09\x09return Ctr;\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aPrototype,aMethodBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- function Ctr () {
- aMethodBlock.apply(this, arguments);
- }
- Ctr.prototype = aPrototype;
- return Ctr;
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"javaScriptConstructorFor:initializingVia:",{aPrototype:aPrototype,aMethodBlock:aMethodBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.BlockClosure.a$cls);
- $core.addClass("CompiledMethod", $globals.Object, ["args", "instantiateFn", "fn", "messageSends", "pragmas", "owner", "methodClass", "protocol", "referencedClasses", "selector", "source"], "Kernel-Methods");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "arguments",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "arguments\x0a\x09^ args ifNil: [ #() ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.args;
- if($1 == null || $1.a$nil){
- return [];
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"arguments",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "asString",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asString\x0a\x09^ self asStringForClass: self methodClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["asStringForClass:", "methodClass"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._asStringForClass_($self._methodClass());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asString",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "asStringForClass:",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aClass"],
- source: "asStringForClass: aClass\x0a\x09| result |\x0a\x09result := aClass name.\x0a\x09self methodClass = aClass \x0a\x09\x09ifFalse: [ result := result, ' (', (self methodClass ifNil: [ 'nil' ] ifNotNil: [ self methodClass name ]), ')'].\x0a\x09(self origin = aClass | (self origin = self methodClass)) \x0a\x09\x09ifFalse: [ result := result, ' /', (self origin ifNil: [ 'nil' ] ifNotNil: [ self origin name ]), '/'].\x0a\x09^ result, ' >> ', self selector symbolPrintString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["name", "ifFalse:", "=", "methodClass", ",", "ifNil:ifNotNil:", "|", "origin", "symbolPrintString", "selector"]
- }, function ($methodClass){ return function (aClass){
- var self=this,$self=this;
- var result;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4,$5,$6;
- result=[$recv(aClass)._name()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["name"]=1
- //>>excludeEnd("ctx");
- ][0];
- if(!$core.assert([$recv([$self._methodClass()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methodClass"]=1
- //>>excludeEnd("ctx");
- ][0]).__eq(aClass)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["="]=1
- //>>excludeEnd("ctx");
- ][0])){
- $1=[$recv(result).__comma(" (")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=3
- //>>excludeEnd("ctx");
- ][0];
- $2=[$self._methodClass()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methodClass"]=2
- //>>excludeEnd("ctx");
- ][0];
- if($2 == null || $2.a$nil){
- $3="nil";
- } else {
- $3=[$recv([$self._methodClass()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methodClass"]=3
- //>>excludeEnd("ctx");
- ][0])._name()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["name"]=2
- //>>excludeEnd("ctx");
- ][0];
- }
- result=[$recv([$recv($1).__comma($3)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=2
- //>>excludeEnd("ctx");
- ][0]).__comma(")")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=1
- //>>excludeEnd("ctx");
- ][0];
- result;
- }
- if(!$core.assert($recv([$recv([$self._origin()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["origin"]=1
- //>>excludeEnd("ctx");
- ][0]).__eq(aClass)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["="]=2
- //>>excludeEnd("ctx");
- ][0]).__or($recv([$self._origin()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["origin"]=2
- //>>excludeEnd("ctx");
- ][0]).__eq($self._methodClass())))){
- $4=[$recv(result).__comma(" /")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=6
- //>>excludeEnd("ctx");
- ][0];
- $5=[$self._origin()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["origin"]=3
- //>>excludeEnd("ctx");
- ][0];
- if($5 == null || $5.a$nil){
- $6="nil";
- } else {
- $6=$recv($self._origin())._name();
- }
- result=[$recv([$recv($4).__comma($6)
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=5
- //>>excludeEnd("ctx");
- ][0]).__comma("/")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=4
- //>>excludeEnd("ctx");
- ][0];
- result;
- }
- return [$recv($recv(result).__comma(" >> ")).__comma($recv($self._selector())._symbolPrintString())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=7
- //>>excludeEnd("ctx");
- ][0];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asStringForClass:",{aClass:aClass,result:result})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "basicPragmas",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "basicPragmas\x0a\x09^ pragmas ifNil: [ #() ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.pragmas;
- if($1 == null || $1.a$nil){
- return [];
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicPragmas",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "browse",
- protocol: "browsing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "browse\x0a\x09Finder findMethod: self",
- referencedClasses: ["Finder"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["findMethod:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($globals.Finder)._findMethod_(self);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"browse",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "category",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "category\x0a\x09^ self protocol",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["protocol"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $self._protocol();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"category",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "defaultProtocol",
- protocol: "defaults",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "defaultProtocol\x0a\x09^ 'as yet unclassified'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return "as yet unclassified";
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "fn",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "fn\x0a\x09^ fn",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.fn;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "instantiateFn",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "instantiateFn\x0a\x09^ instantiateFn",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.instantiateFn;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "instantiateFn:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "instantiateFn: anObject\x0a\x09instantiateFn := anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- $self.instantiateFn=anObject;
- return self;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "isCompiledMethod",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isCompiledMethod\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return true;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "isOverridden",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isOverridden\x0a self methodClass allSubclassesDo: [ :each |\x0a\x09 (each includesSelector: selector)\x0a \x09ifTrue: [ ^ true ] ].\x0a\x09^ false",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["allSubclassesDo:", "methodClass", "ifTrue:", "includesSelector:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $early={};
- try {
- $recv($self._methodClass())._allSubclassesDo_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- if($core.assert($recv(each)._includesSelector_($self.selector))){
- throw $early=[true];
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return false;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"isOverridden",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "isOverride",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["superclass", "methodClass", "ifNil:", "notNil", "lookupSelector:", "selector"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- var superclass;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- superclass=[$recv([$self._methodClass()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methodClass"]=1
- //>>excludeEnd("ctx");
- ][0])._superclass()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["superclass"]=1
- //>>excludeEnd("ctx");
- ][0];
- $1=superclass;
- if($1 == null || $1.a$nil){
- return false;
- } else {
- $1;
- }
- return $recv($recv($recv($self._methodClass())._superclass())._lookupSelector_($self._selector()))._notNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"isOverride",{superclass:superclass})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "messageSends",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "messageSends\x0a\x09^ messageSends",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.messageSends;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "methodClass",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "methodClass\x0a\x09^ methodClass",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.methodClass;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "origin",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "origin\x0a\x09^ owner",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.owner;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "package",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "package\x0a\x09\x22Answer the package the receiver belongs to:\x0a\x09- if it is an extension method, answer the corresponding package\x0a\x09- else answer the `methodClass` package\x22\x0a\x09\x0a\x09^ self origin ifNotNil: [ :class | class packageOfProtocol: self protocol ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNotNil:", "origin", "packageOfProtocol:", "protocol"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._origin();
- if($1 == null || $1.a$nil){
- return $1;
- } else {
- var class_;
- class_=$1;
- return $recv(class_)._packageOfProtocol_($self._protocol());
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"package",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "pragmas",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "pragmas\x0a\x09^ self basicPragmas collect: [ :each | Message selector: each first arguments: each second ]",
- referencedClasses: ["Message"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["collect:", "basicPragmas", "selector:arguments:", "first", "second"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._basicPragmas())._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($globals.Message)._selector_arguments_($recv(each)._first(),$recv(each)._second());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"pragmas",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "pragmas:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArrayOfMessages"],
- source: "pragmas: anArrayOfMessages\x0a\x09pragmas := anArrayOfMessages collect: [ :each | { each selector. each arguments } ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["collect:", "selector", "arguments"]
- }, function ($methodClass){ return function (anArrayOfMessages){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self.pragmas=$recv(anArrayOfMessages)._collect_((function(each){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return [$recv(each)._selector(),$recv(each)._arguments()];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"pragmas:",{anArrayOfMessages:anArrayOfMessages})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "protocol",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "protocol\x0a\x09^ protocol ifNil: [ self defaultProtocol ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "defaultProtocol"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.protocol;
- if($1 == null || $1.a$nil){
- return $self._defaultProtocol();
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"protocol",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "protocol:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "protocol: aString\x0a\x09| oldProtocol |\x0a\x09oldProtocol := self protocol.\x0a\x09protocol := aString.\x0a\x0a\x09oldProtocol ifNotNil: [\x0a\x09\x09SystemAnnouncer current announce: (MethodMoved new\x0a\x09\x09\x09method: self;\x0a\x09\x09\x09oldProtocol: oldProtocol;\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09self origin ifNotNil: [ :origin |\x0a\x09\x09origin organization addElement: aString.\x0a\x09\x09origin removeProtocolIfEmpty: oldProtocol ]",
- referencedClasses: ["SystemAnnouncer", "MethodMoved"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["protocol", "ifNotNil:", "announce:", "current", "method:", "new", "oldProtocol:", "yourself", "origin", "addElement:", "organization", "removeProtocolIfEmpty:"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- var oldProtocol;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4;
- oldProtocol=$self._protocol();
- $self.protocol=aString;
- $1=oldProtocol;
- if($1 == null || $1.a$nil){
- $1;
- } else {
- $2=$recv($globals.SystemAnnouncer)._current();
- $3=$recv($globals.MethodMoved)._new();
- $recv($3)._method_(self);
- $recv($3)._oldProtocol_(oldProtocol);
- $recv($2)._announce_($recv($3)._yourself());
- }
- $4=$self._origin();
- if($4 == null || $4.a$nil){
- $4;
- } else {
- var origin;
- origin=$4;
- $recv($recv(origin)._organization())._addElement_(aString);
- $recv(origin)._removeProtocolIfEmpty_(oldProtocol);
- }
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString,oldProtocol:oldProtocol})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "referencedClasses",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "referencedClasses\x0a\x09^ referencedClasses",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.referencedClasses;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "selector",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selector\x0a\x09^ selector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.selector;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "selector:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- $self.selector=aString;
- return self;
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "sendTo:arguments:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject", "aCollection"],
- source: "sendTo: anObject arguments: aCollection\x0a\x09^ self fn applyTo: anObject arguments: aCollection",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["applyTo:arguments:", "fn"]
- }, function ($methodClass){ return function (anObject,aCollection){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._fn())._applyTo_arguments_(anObject,aCollection);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"sendTo:arguments:",{anObject:anObject,aCollection:aCollection})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "source",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "source\x0a\x09^ source ifNil: [ '' ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.source;
- if($1 == null || $1.a$nil){
- return "";
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"source",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.CompiledMethod);
- $core.addMethod(
- $core.method({
- selector: "source:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- $self.source=aString;
- return self;
- }; }),
- $globals.CompiledMethod);
- $core.addClass("ForkPool", $globals.Object, ["poolSize", "maxPoolSize", "queue", "worker"], "Kernel-Methods");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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`";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "addWorker",
- protocol: "private",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "addWorker\x0a\x09worker valueWithTimeout: 0.\x0a\x09poolSize := poolSize + 1",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["valueWithTimeout:", "+"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.worker)._valueWithTimeout_((0));
- $self.poolSize=$recv($self.poolSize).__plus((1));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"addWorker",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ForkPool);
- $core.addMethod(
- $core.method({
- selector: "defaultMaxPoolSize",
- protocol: "defaults",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "defaultMaxPoolSize\x0a\x09^ self class defaultMaxPoolSize",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["defaultMaxPoolSize", "class"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._class())._defaultMaxPoolSize();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ForkPool);
- $core.addMethod(
- $core.method({
- selector: "fork:",
- protocol: "actions",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aBlock"],
- source: "fork: aBlock\x0a\x09poolSize < self maxPoolSize ifTrue: [ self addWorker ].\x0a\x09queue nextPut: aBlock",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifTrue:", "<", "maxPoolSize", "addWorker", "nextPut:"]
- }, function ($methodClass){ return function (aBlock){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- if($core.assert($recv($self.poolSize).__lt($self._maxPoolSize()))){
- $self._addWorker();
- }
- $recv($self.queue)._nextPut_(aBlock);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"fork:",{aBlock:aBlock})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ForkPool);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: "initialization",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09poolSize := 0.\x0a\x09queue := Queue new.\x0a\x09worker := self makeWorker",
- referencedClasses: ["Queue"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["initialize", "new", "makeWorker"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- [(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._initialize.call($self))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- $self.poolSize=(0);
- $self.queue=$recv($globals.Queue)._new();
- $self.worker=$self._makeWorker();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ForkPool);
- $core.addMethod(
- $core.method({
- selector: "makeWorker",
- protocol: "initialization",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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 ] ]]",
- referencedClasses: ["Object"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["new", "-", "nextIfAbsent:", "ifFalse:", "==", "ensure:", "value", "addWorker"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- var sentinel;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- sentinel=$recv($globals.Object)._new();
- return (function(){
- var block;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $self.poolSize=$recv($self.poolSize).__minus((1));
- block=$recv($self.queue)._nextIfAbsent_((function(){
- return sentinel;
- }));
- if(!$core.assert($recv(block).__eq_eq(sentinel))){
- return $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $recv(block)._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
- //>>excludeEnd("ctx");
- }))._ensure_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx3) {
- //>>excludeEnd("ctx");
- return $self._addWorker();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)});
- //>>excludeEnd("ctx");
- }));
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({block:block},$ctx1,1)});
- //>>excludeEnd("ctx");
- });
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"makeWorker",{sentinel:sentinel})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ForkPool);
- $core.addMethod(
- $core.method({
- selector: "maxPoolSize",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "maxPoolSize\x0a\x09^ maxPoolSize ifNil: [ self defaultMaxPoolSize ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "defaultMaxPoolSize"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.maxPoolSize;
- if($1 == null || $1.a$nil){
- return $self._defaultMaxPoolSize();
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"maxPoolSize",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ForkPool);
- $core.addMethod(
- $core.method({
- selector: "maxPoolSize:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anInteger"],
- source: "maxPoolSize: anInteger\x0a\x09maxPoolSize := anInteger",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (anInteger){
- var self=this,$self=this;
- $self.maxPoolSize=anInteger;
- return self;
- }; }),
- $globals.ForkPool);
- $core.setSlots($globals.ForkPool.a$cls, ["default"]);
- $core.addMethod(
- $core.method({
- selector: "default",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "default\x0a\x09^ default ifNil: [ default := self new ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "new"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.default;
- if($1 == null || $1.a$nil){
- $self.default=$self._new();
- return $self.default;
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"default",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.ForkPool.a$cls);
- $core.addMethod(
- $core.method({
- selector: "defaultMaxPoolSize",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "defaultMaxPoolSize\x0a\x09^ 100",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return (100);
- }; }),
- $globals.ForkPool.a$cls);
- $core.addMethod(
- $core.method({
- selector: "resetDefault",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "resetDefault\x0a\x09default := nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- $self.default=nil;
- return self;
- }; }),
- $globals.ForkPool.a$cls);
- $core.addClass("Message", $globals.Object, ["selector", "arguments"], "Kernel-Methods");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "arguments",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "arguments\x0a\x09^ arguments",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.arguments;
- }; }),
- $globals.Message);
- $core.addMethod(
- $core.method({
- selector: "arguments:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArray"],
- source: "arguments: anArray\x0a\x09arguments := anArray",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (anArray){
- var self=this,$self=this;
- $self.arguments=anArray;
- return self;
- }; }),
- $globals.Message);
- $core.addMethod(
- $core.method({
- selector: "printOn:",
- protocol: "printing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStream"],
- source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream\x0a\x09\x09nextPutAll: '(';\x0a\x09\x09nextPutAll: self selector;\x0a\x09\x09nextPutAll: ')'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["printOn:", "nextPutAll:", "selector"]
- }, function ($methodClass){ return function (aStream){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- [(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._printOn_.call($self,aStream))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- [$recv(aStream)._nextPutAll_("(")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["nextPutAll:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(aStream)._nextPutAll_($self._selector())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["nextPutAll:"]=2
- //>>excludeEnd("ctx");
- ][0];
- $recv(aStream)._nextPutAll_(")");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Message);
- $core.addMethod(
- $core.method({
- selector: "selector",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selector\x0a\x09^ selector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.selector;
- }; }),
- $globals.Message);
- $core.addMethod(
- $core.method({
- selector: "selector:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- $self.selector=aString;
- return self;
- }; }),
- $globals.Message);
- $core.addMethod(
- $core.method({
- selector: "sendTo:",
- protocol: "actions",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "sendTo: anObject\x0a\x09^ anObject perform: self selector withArguments: self arguments",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["perform:withArguments:", "selector", "arguments"]
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(anObject)._perform_withArguments_($self._selector(),$self._arguments());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"sendTo:",{anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Message);
- $core.addMethod(
- $core.method({
- selector: "selector:arguments:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anArray"],
- source: "selector: aString arguments: anArray\x0a\x09^ self new\x0a\x09\x09selector: aString;\x0a\x09\x09arguments: anArray;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["selector:", "new", "arguments:", "yourself"]
- }, function ($methodClass){ return function (aString,anArray){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._new();
- $recv($1)._selector_(aString);
- $recv($1)._arguments_(anArray);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"selector:arguments:",{aString:aString,anArray:anArray})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Message.a$cls);
- $core.addMethod(
- $core.method({
- selector: "selector:arguments:notUnderstoodBy:",
- protocol: "dnu handling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anArray", "anObject"],
- source: "selector: aString arguments: anArray notUnderstoodBy: anObject\x0a\x09\x22Creates the message and passes it to #doesNotUnderstand:.\x0a\x09Used by kernel to handle MNU.\x22\x0a\x09^ anObject doesNotUnderstand:\x0a\x09\x09(self selector: aString arguments: anArray)",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["doesNotUnderstand:", "selector:arguments:"]
- }, function ($methodClass){ return function (aString,anArray,anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(anObject)._doesNotUnderstand_($self._selector_arguments_(aString,anArray));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"selector:arguments:notUnderstoodBy:",{aString:aString,anArray:anArray,anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Message.a$cls);
- $core.addClass("MessageSend", $globals.Object, ["receiver", "message"], "Kernel-Methods");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "arguments",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "arguments\x0a\x09^ message arguments",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["arguments"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self.message)._arguments();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"arguments",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "arguments:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArray"],
- source: "arguments: anArray\x0a\x09message arguments: anArray",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["arguments:"]
- }, function ($methodClass){ return function (anArray){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.message)._arguments_(anArray);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"arguments:",{anArray:anArray})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "initialize",
- protocol: "initialization",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09message := Message new",
- referencedClasses: ["Message"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["initialize", "new"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- [(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._initialize.call($self))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- $self.message=$recv($globals.Message)._new();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"initialize",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "printOn:",
- protocol: "printing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStream"],
- 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: ')'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["printOn:", "nextPutAll:", "receiver", "selector"]
- }, function ($methodClass){ return function (aStream){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- [(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._printOn_.call($self,aStream))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- [$recv(aStream)._nextPutAll_("(")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["nextPutAll:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(aStream)._nextPutAll_($self._receiver())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["nextPutAll:"]=2
- //>>excludeEnd("ctx");
- ][0];
- [$recv(aStream)._nextPutAll_(" >> ")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["nextPutAll:"]=3
- //>>excludeEnd("ctx");
- ][0];
- [$recv(aStream)._nextPutAll_($self._selector())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["nextPutAll:"]=4
- //>>excludeEnd("ctx");
- ][0];
- $recv(aStream)._nextPutAll_(")");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "receiver",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "receiver\x0a\x09^ receiver",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.receiver;
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "receiver:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "receiver: anObject\x0a\x09receiver := anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- $self.receiver=anObject;
- return self;
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "selector",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selector\x0a\x09^ message selector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["selector"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self.message)._selector();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"selector",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "selector:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "selector: aString\x0a\x09message selector: aString",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["selector:"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv($self.message)._selector_(aString);
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "value",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "value\x0a\x09^ message sendTo: self receiver",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["sendTo:", "receiver"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self.message)._sendTo_($self._receiver());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "value:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "value: anObject\x0a\x09^ message \x0a\x09\x09arguments: { anObject };\x0a\x09\x09sendTo: self receiver",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["arguments:", "sendTo:", "receiver"]
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.message;
- $recv($1)._arguments_([anObject]);
- return $recv($1)._sendTo_($self._receiver());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "value:value:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["firstArgument", "secondArgument"],
- source: "value: firstArgument value: secondArgument\x0a\x09^ message \x0a\x09\x09arguments: { firstArgument. secondArgument };\x0a\x09\x09sendTo: self receiver",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["arguments:", "sendTo:", "receiver"]
- }, function ($methodClass){ return function (firstArgument,secondArgument){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.message;
- $recv($1)._arguments_([firstArgument,secondArgument]);
- return $recv($1)._sendTo_($self._receiver());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "value:value:value:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["firstArgument", "secondArgument", "thirdArgument"],
- source: "value: firstArgument value: secondArgument value: thirdArgument\x0a\x09^ message \x0a\x09\x09arguments: { firstArgument. secondArgument. thirdArgument };\x0a\x09\x09sendTo: self receiver",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["arguments:", "sendTo:", "receiver"]
- }, function ($methodClass){ return function (firstArgument,secondArgument,thirdArgument){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.message;
- $recv($1)._arguments_([firstArgument,secondArgument,thirdArgument]);
- return $recv($1)._sendTo_($self._receiver());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addMethod(
- $core.method({
- selector: "valueWithPossibleArguments:",
- protocol: "evaluating",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anArray"],
- source: "valueWithPossibleArguments: anArray\x0a\x09self arguments: anArray.\x0a\x09^ self value",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["arguments:", "value"]
- }, function ($methodClass){ return function (anArray){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._arguments_(anArray);
- return $self._value();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{anArray:anArray})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MessageSend);
- $core.addClass("MethodContext", $globals.Object, ["receiver", "evaluatedSelector", "homeContext", "index", "locals", "outerContext", "selector", "sendIdx", "supercall"], "Kernel-Methods");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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`.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "basicReceiver",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "basicReceiver\x0a\x09^ receiver",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.receiver;
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "evaluatedSelector",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "evaluatedSelector\x0a\x09^ evaluatedSelector",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.evaluatedSelector;
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "home",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "home\x0a\x09^ homeContext ifNotNil: [ :c | c hydrated ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNotNil:", "hydrated"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.homeContext;
- if($1 == null || $1.a$nil){
- return $1;
- } else {
- var c;
- c=$1;
- return $recv(c)._hydrated();
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"home",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "hydrated",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "hydrated\x0a\x09<inlineJS: 'if (!$self.selector && !$self.outerContext) $self.setup(self); return self;'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["if (!$self.selector && !$self.outerContext) $self.setup(self); return self;"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- if (!$self.selector && !$self.outerContext) $self.setup(self); return self;;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"hydrated",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "index",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "index\x0a\x09^ index ifNil: [ 0 ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.index;
- if($1 == null || $1.a$nil){
- return (0);
- } else {
- return $1;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"index",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "locals",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "locals\x0a\x09^ locals",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.locals;
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "outerContext",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "outerContext\x0a\x09^ outerContext ifNil: [ self home ] ifNotNil: [ :c | c hydrated ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:ifNotNil:", "home", "hydrated"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.outerContext;
- if($1 == null || $1.a$nil){
- return $self._home();
- } else {
- var c;
- c=$1;
- return $recv(c)._hydrated();
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"outerContext",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "selector",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selector\x0a\x09^ selector ifNotNil: [ Smalltalk core js2st: selector ]",
- referencedClasses: ["Smalltalk"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNotNil:", "js2st:", "core"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self.selector;
- if($1 == null || $1.a$nil){
- return $1;
- } else {
- return $recv($recv($globals.Smalltalk)._core())._js2st_($self.selector);
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"selector",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "sendIndexes",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "sendIndexes\x0a\x09^ sendIdx",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- return $self.sendIdx;
- }; }),
- $globals.MethodContext);
- $core.addMethod(
- $core.method({
- selector: "supercall",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "supercall\x0a\x09^ supercall = true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["="]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self.supercall).__eq(true);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"supercall",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.MethodContext);
- $core.addClass("NativeFunction", $globals.Object, [], "Kernel-Methods");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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' ]";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "constructorNamed:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "constructorNamed: aString\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return new nativeFunc();\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return new nativeFunc();\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals()[aString];
- return new nativeFunc();
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"constructorNamed:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "constructorNamed:value:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anObject"],
- source: "constructorNamed: aString value: anObject\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return new nativeFunc(anObject);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return new nativeFunc(anObject);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString,anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals()[aString];
- return new nativeFunc(anObject);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"constructorNamed:value:",{aString:aString,anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "constructorNamed:value:value:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anObject", "anObject2"],
- source: "constructorNamed: aString value: anObject value: anObject2\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return new nativeFunc(anObject,anObject2);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return new nativeFunc(anObject,anObject2);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString,anObject,anObject2){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals()[aString];
- return new nativeFunc(anObject,anObject2);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"constructorNamed:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "constructorNamed:value:value:value:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anObject", "anObject2", "anObject3"],
- source: "constructorNamed: aString value: anObject value: anObject2 value: anObject3\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return new nativeFunc(anObject,anObject2, anObject3);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return new nativeFunc(anObject,anObject2, anObject3);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString,anObject,anObject2,anObject3){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals()[aString];
- return new nativeFunc(anObject,anObject2, anObject3);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"constructorNamed:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "constructorOf:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc"],
- source: "constructorOf: nativeFunc\x0a\x09<inlineJS: '\x0a\x09\x09return new nativeFunc();\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return new nativeFunc();\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return new nativeFunc();
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"constructorOf:",{nativeFunc:nativeFunc})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "constructorOf:value:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "anObject"],
- source: "constructorOf: nativeFunc value: anObject\x0a\x09<inlineJS: '\x0a\x09\x09return new nativeFunc(anObject);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return new nativeFunc(anObject);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return new nativeFunc(anObject);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"constructorOf:value:",{nativeFunc:nativeFunc,anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "constructorOf:value:value:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "anObject", "anObject2"],
- source: "constructorOf: nativeFunc value: anObject value: anObject2\x0a\x09<inlineJS: '\x0a\x09\x09return new nativeFunc(anObject,anObject2);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return new nativeFunc(anObject,anObject2);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,anObject,anObject2){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return new nativeFunc(anObject,anObject2);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"constructorOf:value:value:",{nativeFunc:nativeFunc,anObject:anObject,anObject2:anObject2})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "constructorOf:value:value:value:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "anObject", "anObject2", "anObject3"],
- source: "constructorOf: nativeFunc value: anObject value: anObject2 value: anObject3\x0a\x09<inlineJS: '\x0a\x09\x09return new nativeFunc(anObject,anObject2, anObject3);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return new nativeFunc(anObject,anObject2, anObject3);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,anObject,anObject2,anObject3){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return new nativeFunc(anObject,anObject2, anObject3);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"constructorOf:value:value:value:",{nativeFunc:nativeFunc,anObject:anObject,anObject2:anObject2,anObject3:anObject3})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "exists:",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "exists: aString\x0a\x09^ Platform includesGlobal: aString",
- referencedClasses: ["Platform"],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["includesGlobal:"]
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.Platform)._includesGlobal_(aString);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionNamed:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString"],
- source: "functionNamed: aString\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals[aString];\x0a\x09\x09return nativeFunc();\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals[aString];\x0a\x09\x09return nativeFunc();\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals[aString];
- return nativeFunc();
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionNamed:",{aString:aString})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionNamed:value:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anObject"],
- source: "functionNamed: aString value: anObject\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return nativeFunc(anObject);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return nativeFunc(anObject);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString,anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals()[aString];
- return nativeFunc(anObject);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionNamed:value:",{aString:aString,anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionNamed:value:value:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anObject", "anObject2"],
- source: "functionNamed: aString value: anObject value: anObject2\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return nativeFunc(anObject,anObject2);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return nativeFunc(anObject,anObject2);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString,anObject,anObject2){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals()[aString];
- return nativeFunc(anObject,anObject2);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionNamed:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionNamed:value:value:value:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "anObject", "anObject2", "anObject3"],
- source: "functionNamed: aString value: anObject value: anObject2 value: anObject3\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return nativeFunc(anObject,anObject2, anObject3);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return nativeFunc(anObject,anObject2, anObject3);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString,anObject,anObject2,anObject3){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals()[aString];
- return nativeFunc(anObject,anObject2, anObject3);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionNamed:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionNamed:valueWithArgs:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aString", "args"],
- source: "functionNamed: aString valueWithArgs: args\x0a\x09<inlineJS: '\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return Function.prototype.apply.call(nativeFunc, null, args);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var nativeFunc=$globals.Platform._globals()[aString];\x0a\x09\x09return Function.prototype.apply.call(nativeFunc, null, args);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (aString,args){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var nativeFunc=$globals.Platform._globals()[aString];
- return Function.prototype.apply.call(nativeFunc, null, args);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionNamed:valueWithArgs:",{aString:aString,args:args})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionOf:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc"],
- source: "functionOf: nativeFunc\x0a\x09<inlineJS: '\x0a\x09\x09return nativeFunc();\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return nativeFunc();\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return nativeFunc();
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionOf:",{nativeFunc:nativeFunc})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionOf:value:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "anObject"],
- source: "functionOf: nativeFunc value: anObject\x0a\x09<inlineJS: '\x0a\x09\x09return nativeFunc(anObject);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return nativeFunc(anObject);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return nativeFunc(anObject);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionOf:value:",{nativeFunc:nativeFunc,anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionOf:value:value:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "anObject", "anObject2"],
- source: "functionOf: nativeFunc value: anObject value: anObject2\x0a\x09<inlineJS: '\x0a\x09\x09return nativeFunc(anObject,anObject2);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return nativeFunc(anObject,anObject2);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,anObject,anObject2){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return nativeFunc(anObject,anObject2);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionOf:value:value:",{nativeFunc:nativeFunc,anObject:anObject,anObject2:anObject2})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionOf:value:value:value:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "anObject", "anObject2", "anObject3"],
- source: "functionOf: nativeFunc value: anObject value: anObject2 value: anObject3\x0a\x09<inlineJS: '\x0a\x09\x09return nativeFunc(anObject,anObject2, anObject3);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return nativeFunc(anObject,anObject2, anObject3);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,anObject,anObject2,anObject3){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return nativeFunc(anObject,anObject2, anObject3);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionOf:value:value:value:",{nativeFunc:nativeFunc,anObject:anObject,anObject2:anObject2,anObject3:anObject3})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "functionOf:valueWithArgs:",
- protocol: "function calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "args"],
- source: "functionOf: nativeFunc valueWithArgs: args\x0a\x09<inlineJS: '\x0a\x09\x09return Function.prototype.apply.call(nativeFunc, null, args);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return Function.prototype.apply.call(nativeFunc, null, args);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,args){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return Function.prototype.apply.call(nativeFunc, null, args);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"functionOf:valueWithArgs:",{nativeFunc:nativeFunc,args:args})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "isNativeFunction:",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "isNativeFunction: anObject\x0a\x09<inlineJS: 'return typeof anObject === \x22function\x22'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["return typeof anObject === \x22function\x22"]]],
- messageSends: []
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return typeof anObject === "function";
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"isNativeFunction:",{anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "methodOf:this:",
- protocol: "method calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "thisObject"],
- source: "methodOf: nativeFunc this: thisObject\x0a\x09<inlineJS: '\x0a\x09\x09return Function.prototype.call.call(nativeFunc, thisObject);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return Function.prototype.call.call(nativeFunc, thisObject);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,thisObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return Function.prototype.call.call(nativeFunc, thisObject);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodOf:this:",{nativeFunc:nativeFunc,thisObject:thisObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "methodOf:this:value:",
- protocol: "method calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "thisObject", "anObject"],
- source: "methodOf: nativeFunc this: thisObject value: anObject\x0a\x09<inlineJS: '\x0a\x09\x09return Function.prototype.call.call(nativeFunc, thisObject, anObject);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return Function.prototype.call.call(nativeFunc, thisObject, anObject);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,thisObject,anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return Function.prototype.call.call(nativeFunc, thisObject, anObject);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodOf:this:value:",{nativeFunc:nativeFunc,thisObject:thisObject,anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "methodOf:this:value:value:",
- protocol: "method calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "thisObject", "anObject", "anObject2"],
- source: "methodOf: nativeFunc this: thisObject value: anObject value: anObject2\x0a\x09<inlineJS: '\x0a\x09\x09return Function.prototype.call.call(nativeFunc, thisObject,anObject,anObject2);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return Function.prototype.call.call(nativeFunc, thisObject,anObject,anObject2);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,thisObject,anObject,anObject2){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return Function.prototype.call.call(nativeFunc, thisObject,anObject,anObject2);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodOf:this:value:value:",{nativeFunc:nativeFunc,thisObject:thisObject,anObject:anObject,anObject2:anObject2})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "methodOf:this:value:value:value:",
- protocol: "method calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "thisObject", "anObject", "anObject2", "anObject3"],
- source: "methodOf: nativeFunc this: thisObject value: anObject value: anObject2 value: anObject3\x0a\x09<inlineJS: '\x0a\x09\x09return Function.prototype.call.call(nativeFunc, thisObject,anObject,anObject2, anObject3);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return Function.prototype.call.call(nativeFunc, thisObject,anObject,anObject2, anObject3);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,thisObject,anObject,anObject2,anObject3){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return Function.prototype.call.call(nativeFunc, thisObject,anObject,anObject2, anObject3);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodOf:this:value:value:value:",{nativeFunc:nativeFunc,thisObject:thisObject,anObject:anObject,anObject2:anObject2,anObject3:anObject3})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addMethod(
- $core.method({
- selector: "methodOf:this:valueWithArgs:",
- protocol: "method calling",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["nativeFunc", "thisObject", "args"],
- source: "methodOf: nativeFunc this: thisObject valueWithArgs: args\x0a\x09<inlineJS: '\x0a\x09\x09return Function.prototype.apply.call(nativeFunc, thisObject, args);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09return Function.prototype.apply.call(nativeFunc, thisObject, args);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (nativeFunc,thisObject,args){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return Function.prototype.apply.call(nativeFunc, thisObject, args);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodOf:this:valueWithArgs:",{nativeFunc:nativeFunc,thisObject:thisObject,args:args})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.NativeFunction.a$cls);
- $core.addTrait("TMethodContext", "Kernel-Methods");
- $core.addMethod(
- $core.method({
- selector: "asString",
- protocol: "converting",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "asString\x0a\x09^ self isBlockContext\x0a\x09\x09ifTrue: [ 'a block (in ', self methodContext asString, ')' ]\x0a\x09\x09ifFalse: [ self method\x0a\x09\x09\x09ifNotNil: [ :method | method asStringForClass: self receiver class ]\x0a\x09\x09\x09ifNil: [ 'missing method ', self selector symbolPrintString ] ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifTrue:ifFalse:", "isBlockContext", ",", "asString", "methodContext", "ifNotNil:ifNil:", "method", "asStringForClass:", "class", "receiver", "symbolPrintString", "selector"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- if($core.assert($self._isBlockContext())){
- return [$recv(["a block (in ".__comma($recv($self._methodContext())._asString())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=2
- //>>excludeEnd("ctx");
- ][0]).__comma(")")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx[","]=1
- //>>excludeEnd("ctx");
- ][0];
- } else {
- $1=$self._method();
- if($1 == null || $1.a$nil){
- return "missing method ".__comma($recv($self._selector())._symbolPrintString());
- } else {
- var method;
- method=$1;
- return $recv(method)._asStringForClass_($recv($self._receiver())._class());
- }
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"asString",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "basicReceiver",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "basicReceiver\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"basicReceiver",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "findContextSuchThat:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["testBlock"],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["whileFalse:", "isNil", "ifTrue:", "value:", "outerContext"]
- }, function ($methodClass){ return function (testBlock){
- var self=this,$self=this;
- var context;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $early={};
- try {
- context=self;
- $recv((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(context)._isNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }))._whileFalse_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- if($core.assert($recv(testBlock)._value_(context))){
- throw $early=[context];
- }
- context=$recv(context)._outerContext();
- return context;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return nil;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"findContextSuchThat:",{testBlock:testBlock,context:context})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "home",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "home\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"home",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "index",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "index\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"index",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "isBlockContext",
- protocol: "testing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isBlockContext\x0a\x09\x22Block context do not have selectors.\x22\x0a\x09\x0a\x09^ self selector isNil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["isNil", "selector"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($self._selector())._isNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "locals",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "locals\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"locals",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "method",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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 ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifNil:", "methodContext", "class", "receiver", "lookupSelector:", "selector", "ifNil:ifNotNil:", "outerContext", "supercall", "ifFalse:ifTrue:", "superclass", "methodClass"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- var method,lookupClass,receiverClass,supercall;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2;
- $1=[$self._methodContext()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methodContext"]=1
- //>>excludeEnd("ctx");
- ][0];
- if($1 == null || $1.a$nil){
- return nil;
- } else {
- $1;
- }
- receiverClass=$recv($recv([$self._methodContext()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methodContext"]=2
- //>>excludeEnd("ctx");
- ][0])._receiver())._class();
- method=[$recv(receiverClass)._lookupSelector_([$recv([$self._methodContext()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["methodContext"]=3
- //>>excludeEnd("ctx");
- ][0])._selector()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["selector"]=1
- //>>excludeEnd("ctx");
- ][0])
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["lookupSelector:"]=1
- //>>excludeEnd("ctx");
- ][0];
- $2=$self._outerContext();
- if($2 == null || $2.a$nil){
- supercall=false;
- } else {
- var outer;
- outer=$2;
- supercall=$recv(outer)._supercall();
- }
- if($core.assert(supercall)){
- return $recv($recv($recv(method)._methodClass())._superclass())._lookupSelector_($recv($self._methodContext())._selector());
- } else {
- return method;
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"method",{method:method,lookupClass:lookupClass,receiverClass:receiverClass,supercall:supercall})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "methodContext",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "methodContext\x0a\x09self isBlockContext ifFalse: [ ^ self ].\x0a\x09\x0a\x09^ self outerContext ifNotNil: [ :outer |\x0a\x09\x09outer methodContext ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifFalse:", "isBlockContext", "ifNotNil:", "outerContext", "methodContext"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- if(!$core.assert($self._isBlockContext())){
- return self;
- }
- $1=$self._outerContext();
- if($1 == null || $1.a$nil){
- return $1;
- } else {
- var outer;
- outer=$1;
- return $recv(outer)._methodContext();
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"methodContext",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "outerContext",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "outerContext\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"outerContext",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "printOn:",
- protocol: "printing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStream"],
- source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream \x0a\x09\x09nextPutAll: '(';\x0a\x09\x09nextPutAll: self asString;\x0a\x09\x09nextPutAll: ')'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["printOn:", "nextPutAll:", "asString"]
- }, function ($methodClass){ return function (aStream){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- [(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($methodClass.superclass||$boot.nilAsClass).fn.prototype._printOn_.call($self,aStream))
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.supercall = false
- //>>excludeEnd("ctx");
- ][0];
- [$recv(aStream)._nextPutAll_("(")
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["nextPutAll:"]=1
- //>>excludeEnd("ctx");
- ][0];
- [$recv(aStream)._nextPutAll_($self._asString())
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx1.sendIdx["nextPutAll:"]=2
- //>>excludeEnd("ctx");
- ][0];
- $recv(aStream)._nextPutAll_(")");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "receiver",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "receiver\x0a\x09^ (self isBlockContext and: [ self outerContext notNil ])\x0a\x09\x09ifTrue: [ self outerContext receiver ]\x0a\x09\x09ifFalse: [ self basicReceiver ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["ifTrue:ifFalse:", "and:", "isBlockContext", "notNil", "outerContext", "receiver", "basicReceiver"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- if($core.assert($recv($self._isBlockContext())._and_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv([$self._outerContext()
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- ,$ctx2.sendIdx["outerContext"]=1
- //>>excludeEnd("ctx");
- ][0])._notNil();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- })))){
- return $recv($self._outerContext())._receiver();
- } else {
- return $self._basicReceiver();
- }
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"receiver",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "selector",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "selector\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"selector",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "sendIndexes",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "sendIndexes\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"sendIndexes",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addMethod(
- $core.method({
- selector: "supercall",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "supercall\x0a\x09self subclassResponsibility",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["subclassResponsibility"]
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._subclassResponsibility();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"supercall",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.TMethodContext);
- $core.addClass("Timeout", $globals.Object, ["rawTimeout"], "Kernel-Methods");
- //>>excludeStart("ide", pragmas.excludeIdeData);
- $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.";
- //>>excludeEnd("ide");
- $core.addMethod(
- $core.method({
- selector: "clearInterval",
- protocol: "timeout/interval",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "clearInterval\x0a\x09<inlineJS: '\x0a\x09\x09var interval = $self.rawTimeout;\x0a\x09\x09clearInterval(interval);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var interval = $self.rawTimeout;\x0a\x09\x09clearInterval(interval);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var interval = $self.rawTimeout;
- clearInterval(interval);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"clearInterval",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Timeout);
- $core.addMethod(
- $core.method({
- selector: "clearTimeout",
- protocol: "timeout/interval",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "clearTimeout\x0a\x09<inlineJS: '\x0a\x09\x09var timeout = $self.rawTimeout;\x0a\x09\x09clearTimeout(timeout);\x0a\x09'>",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [["inlineJS:", ["\x0a\x09\x09var timeout = $self.rawTimeout;\x0a\x09\x09clearTimeout(timeout);\x0a\x09"]]],
- messageSends: []
- }, function ($methodClass){ return function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var timeout = $self.rawTimeout;
- clearTimeout(timeout);
- ;
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"clearTimeout",{})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Timeout);
- $core.addMethod(
- $core.method({
- selector: "rawTimeout:",
- protocol: "accessing",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "rawTimeout: anObject\x0a\x09rawTimeout := anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- $self.rawTimeout=anObject;
- return self;
- }; }),
- $globals.Timeout);
- $core.addMethod(
- $core.method({
- selector: "on:",
- protocol: "instance creation",
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "on: anObject\x0a\x09^ self new rawTimeout: anObject; yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["rawTimeout:", "new", "yourself"]
- }, function ($methodClass){ return function (anObject){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._new();
- $recv($1)._rawTimeout_(anObject);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject})});
- //>>excludeEnd("ctx");
- }; }),
- $globals.Timeout.a$cls);
- $core.setTraitComposition([{trait: $globals.TMethodContext}], $globals.MethodContext);
- });
|