Kernel-Infrastructure.js 185 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408
  1. define("amber_core/Kernel-Infrastructure", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections"], function($boot){
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. var smalltalk=$core,_st=$recv,globals=$globals;
  4. $core.addPackage('Kernel-Infrastructure');
  5. $core.packages["Kernel-Infrastructure"].transport = {"type":"amd","amdNamespace":"amber_core"};
  6. $core.addClass('ConsoleErrorHandler', $globals.Object, [], 'Kernel-Infrastructure');
  7. //>>excludeStart("ide", pragmas.excludeIdeData);
  8. $globals.ConsoleErrorHandler.comment="I am manage Smalltalk errors, displaying the stack in the console.";
  9. //>>excludeEnd("ide");
  10. $core.addMethod(
  11. $core.method({
  12. selector: "handleError:",
  13. protocol: 'error handling',
  14. fn: function (anError){
  15. var self=this;
  16. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  17. return $core.withContext(function($ctx1) {
  18. //>>excludeEnd("ctx");
  19. var $1,$receiver;
  20. $1=$recv(anError)._context();
  21. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  22. $ctx1.sendIdx["context"]=1;
  23. //>>excludeEnd("ctx");
  24. if(($receiver = $1) == null || $receiver.isNil){
  25. $1;
  26. } else {
  27. self._logErrorContext_($recv(anError)._context());
  28. };
  29. self._logError_(anError);
  30. return self;
  31. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  32. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},$globals.ConsoleErrorHandler)});
  33. //>>excludeEnd("ctx");
  34. },
  35. //>>excludeStart("ide", pragmas.excludeIdeData);
  36. args: ["anError"],
  37. source: "handleError: anError\x0a\x09anError context ifNotNil: [ self logErrorContext: anError context ].\x0a\x09self logError: anError",
  38. referencedClasses: [],
  39. //>>excludeEnd("ide");
  40. messageSends: ["ifNotNil:", "context", "logErrorContext:", "logError:"]
  41. }),
  42. $globals.ConsoleErrorHandler);
  43. $core.addMethod(
  44. $core.method({
  45. selector: "log:",
  46. protocol: 'private',
  47. fn: function (aString){
  48. var self=this;
  49. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  50. return $core.withContext(function($ctx1) {
  51. //>>excludeEnd("ctx");
  52. $recv(console)._log_(aString);
  53. return self;
  54. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  55. }, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString},$globals.ConsoleErrorHandler)});
  56. //>>excludeEnd("ctx");
  57. },
  58. //>>excludeStart("ide", pragmas.excludeIdeData);
  59. args: ["aString"],
  60. source: "log: aString\x0a\x09console log: aString",
  61. referencedClasses: [],
  62. //>>excludeEnd("ide");
  63. messageSends: ["log:"]
  64. }),
  65. $globals.ConsoleErrorHandler);
  66. $core.addMethod(
  67. $core.method({
  68. selector: "logContext:",
  69. protocol: 'private',
  70. fn: function (aContext){
  71. var self=this;
  72. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  73. return $core.withContext(function($ctx1) {
  74. //>>excludeEnd("ctx");
  75. var $1,$receiver;
  76. $1=$recv(aContext)._home();
  77. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  78. $ctx1.sendIdx["home"]=1;
  79. //>>excludeEnd("ctx");
  80. if(($receiver = $1) == null || $receiver.isNil){
  81. $1;
  82. } else {
  83. self._logContext_($recv(aContext)._home());
  84. };
  85. self._log_($recv(aContext)._asString());
  86. return self;
  87. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  88. }, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext},$globals.ConsoleErrorHandler)});
  89. //>>excludeEnd("ctx");
  90. },
  91. //>>excludeStart("ide", pragmas.excludeIdeData);
  92. args: ["aContext"],
  93. source: "logContext: aContext\x0a\x09aContext home ifNotNil: [\x0a\x09\x09self logContext: aContext home ].\x0a\x09self log: aContext asString",
  94. referencedClasses: [],
  95. //>>excludeEnd("ide");
  96. messageSends: ["ifNotNil:", "home", "logContext:", "log:", "asString"]
  97. }),
  98. $globals.ConsoleErrorHandler);
  99. $core.addMethod(
  100. $core.method({
  101. selector: "logError:",
  102. protocol: 'private',
  103. fn: function (anError){
  104. var self=this;
  105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  106. return $core.withContext(function($ctx1) {
  107. //>>excludeEnd("ctx");
  108. self._log_($recv(anError)._messageText());
  109. return self;
  110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  111. }, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError},$globals.ConsoleErrorHandler)});
  112. //>>excludeEnd("ctx");
  113. },
  114. //>>excludeStart("ide", pragmas.excludeIdeData);
  115. args: ["anError"],
  116. source: "logError: anError\x0a\x09self log: anError messageText",
  117. referencedClasses: [],
  118. //>>excludeEnd("ide");
  119. messageSends: ["log:", "messageText"]
  120. }),
  121. $globals.ConsoleErrorHandler);
  122. $core.addMethod(
  123. $core.method({
  124. selector: "logErrorContext:",
  125. protocol: 'private',
  126. fn: function (aContext){
  127. var self=this;
  128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  129. return $core.withContext(function($ctx1) {
  130. //>>excludeEnd("ctx");
  131. var $1,$receiver;
  132. if(($receiver = aContext) == null || $receiver.isNil){
  133. aContext;
  134. } else {
  135. $1=$recv(aContext)._home();
  136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  137. $ctx1.sendIdx["home"]=1;
  138. //>>excludeEnd("ctx");
  139. if(($receiver = $1) == null || $receiver.isNil){
  140. $1;
  141. } else {
  142. self._logContext_($recv(aContext)._home());
  143. };
  144. };
  145. return self;
  146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  147. }, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext},$globals.ConsoleErrorHandler)});
  148. //>>excludeEnd("ctx");
  149. },
  150. //>>excludeStart("ide", pragmas.excludeIdeData);
  151. args: ["aContext"],
  152. source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home ]]",
  153. referencedClasses: [],
  154. //>>excludeEnd("ide");
  155. messageSends: ["ifNotNil:", "home", "logContext:"]
  156. }),
  157. $globals.ConsoleErrorHandler);
  158. $globals.ConsoleErrorHandler.klass.iVarNames = ['current'];
  159. $core.addMethod(
  160. $core.method({
  161. selector: "initialize",
  162. protocol: 'initialization',
  163. fn: function (){
  164. var self=this;
  165. function $ErrorHandler(){return $globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  167. return $core.withContext(function($ctx1) {
  168. //>>excludeEnd("ctx");
  169. $recv($ErrorHandler())._registerIfNone_(self._new());
  170. return self;
  171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  172. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ConsoleErrorHandler.klass)});
  173. //>>excludeEnd("ctx");
  174. },
  175. //>>excludeStart("ide", pragmas.excludeIdeData);
  176. args: [],
  177. source: "initialize\x0a\x09ErrorHandler registerIfNone: self new",
  178. referencedClasses: ["ErrorHandler"],
  179. //>>excludeEnd("ide");
  180. messageSends: ["registerIfNone:", "new"]
  181. }),
  182. $globals.ConsoleErrorHandler.klass);
  183. $core.addClass('InterfacingObject', $globals.Object, [], 'Kernel-Infrastructure');
  184. //>>excludeStart("ide", pragmas.excludeIdeData);
  185. $globals.InterfacingObject.comment="I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me. I delegate all of the above APIs to `PlatformInterface`.\x0a\x0a## API\x0a\x0a self alert: 'Hey, there is a problem'.\x0a self confirm: 'Affirmative?'.\x0a self prompt: 'Your name:'.\x0a\x0a self ajax: #{\x0a 'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a }.";
  186. //>>excludeEnd("ide");
  187. $core.addMethod(
  188. $core.method({
  189. selector: "ajax:",
  190. protocol: 'actions',
  191. fn: function (anObject){
  192. var self=this;
  193. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  195. return $core.withContext(function($ctx1) {
  196. //>>excludeEnd("ctx");
  197. var $1;
  198. $1=$recv($PlatformInterface())._ajax_(anObject);
  199. return $1;
  200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  201. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},$globals.InterfacingObject)});
  202. //>>excludeEnd("ctx");
  203. },
  204. //>>excludeStart("ide", pragmas.excludeIdeData);
  205. args: ["anObject"],
  206. source: "ajax: anObject\x0a\x09^ PlatformInterface ajax: anObject",
  207. referencedClasses: ["PlatformInterface"],
  208. //>>excludeEnd("ide");
  209. messageSends: ["ajax:"]
  210. }),
  211. $globals.InterfacingObject);
  212. $core.addMethod(
  213. $core.method({
  214. selector: "alert:",
  215. protocol: 'actions',
  216. fn: function (aString){
  217. var self=this;
  218. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  220. return $core.withContext(function($ctx1) {
  221. //>>excludeEnd("ctx");
  222. var $1;
  223. $1=$recv($PlatformInterface())._alert_(aString);
  224. return $1;
  225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  226. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},$globals.InterfacingObject)});
  227. //>>excludeEnd("ctx");
  228. },
  229. //>>excludeStart("ide", pragmas.excludeIdeData);
  230. args: ["aString"],
  231. source: "alert: aString\x0a\x09^ PlatformInterface alert: aString",
  232. referencedClasses: ["PlatformInterface"],
  233. //>>excludeEnd("ide");
  234. messageSends: ["alert:"]
  235. }),
  236. $globals.InterfacingObject);
  237. $core.addMethod(
  238. $core.method({
  239. selector: "confirm:",
  240. protocol: 'actions',
  241. fn: function (aString){
  242. var self=this;
  243. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  245. return $core.withContext(function($ctx1) {
  246. //>>excludeEnd("ctx");
  247. var $1;
  248. $1=$recv($PlatformInterface())._confirm_(aString);
  249. return $1;
  250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  251. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},$globals.InterfacingObject)});
  252. //>>excludeEnd("ctx");
  253. },
  254. //>>excludeStart("ide", pragmas.excludeIdeData);
  255. args: ["aString"],
  256. source: "confirm: aString\x0a\x09^ PlatformInterface confirm: aString",
  257. referencedClasses: ["PlatformInterface"],
  258. //>>excludeEnd("ide");
  259. messageSends: ["confirm:"]
  260. }),
  261. $globals.InterfacingObject);
  262. $core.addMethod(
  263. $core.method({
  264. selector: "prompt:",
  265. protocol: 'actions',
  266. fn: function (aString){
  267. var self=this;
  268. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  270. return $core.withContext(function($ctx1) {
  271. //>>excludeEnd("ctx");
  272. var $1;
  273. $1=$recv($PlatformInterface())._prompt_(aString);
  274. return $1;
  275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  276. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},$globals.InterfacingObject)});
  277. //>>excludeEnd("ctx");
  278. },
  279. //>>excludeStart("ide", pragmas.excludeIdeData);
  280. args: ["aString"],
  281. source: "prompt: aString\x0a\x09^ PlatformInterface prompt: aString",
  282. referencedClasses: ["PlatformInterface"],
  283. //>>excludeEnd("ide");
  284. messageSends: ["prompt:"]
  285. }),
  286. $globals.InterfacingObject);
  287. $core.addMethod(
  288. $core.method({
  289. selector: "prompt:default:",
  290. protocol: 'actions',
  291. fn: function (aString,defaultString){
  292. var self=this;
  293. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  295. return $core.withContext(function($ctx1) {
  296. //>>excludeEnd("ctx");
  297. var $1;
  298. $1=$recv($PlatformInterface())._prompt_default_(aString,defaultString);
  299. return $1;
  300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  301. }, function($ctx1) {$ctx1.fill(self,"prompt:default:",{aString:aString,defaultString:defaultString},$globals.InterfacingObject)});
  302. //>>excludeEnd("ctx");
  303. },
  304. //>>excludeStart("ide", pragmas.excludeIdeData);
  305. args: ["aString", "defaultString"],
  306. source: "prompt: aString default: defaultString\x0a\x09^ PlatformInterface prompt: aString default: defaultString",
  307. referencedClasses: ["PlatformInterface"],
  308. //>>excludeEnd("ide");
  309. messageSends: ["prompt:default:"]
  310. }),
  311. $globals.InterfacingObject);
  312. $core.addClass('Environment', $globals.InterfacingObject, [], 'Kernel-Infrastructure');
  313. //>>excludeStart("ide", pragmas.excludeIdeData);
  314. $globals.Environment.comment="I provide an unified entry point to manipulate Amber packages, classes and methods.\x0a\x0aTypical use cases include IDEs, remote access and restricting browsing.";
  315. //>>excludeEnd("ide");
  316. $core.addMethod(
  317. $core.method({
  318. selector: "addInstVarNamed:to:",
  319. protocol: 'compiling',
  320. fn: function (aString,aClass){
  321. var self=this;
  322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  323. return $core.withContext(function($ctx1) {
  324. //>>excludeEnd("ctx");
  325. var $1,$2,$3,$4,$5;
  326. $1=self._classBuilder();
  327. $2=$recv(aClass)._superclass();
  328. $3=$recv(aClass)._name();
  329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  330. $ctx1.sendIdx["name"]=1;
  331. //>>excludeEnd("ctx");
  332. $4=$recv($recv(aClass)._instanceVariableNames())._copy();
  333. $recv($4)._add_(aString);
  334. $5=$recv($4)._yourself();
  335. $recv($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$5,$recv($recv(aClass)._package())._name());
  336. return self;
  337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  338. }, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},$globals.Environment)});
  339. //>>excludeEnd("ctx");
  340. },
  341. //>>excludeStart("ide", pragmas.excludeIdeData);
  342. args: ["aString", "aClass"],
  343. source: "addInstVarNamed: aString to: aClass\x0a\x09self classBuilder\x0a\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09named: aClass name \x0a\x09\x09instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)\x0a\x09\x09package: aClass package name",
  344. referencedClasses: [],
  345. //>>excludeEnd("ide");
  346. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "classBuilder", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package"]
  347. }),
  348. $globals.Environment);
  349. $core.addMethod(
  350. $core.method({
  351. selector: "allSelectors",
  352. protocol: 'accessing',
  353. fn: function (){
  354. var self=this;
  355. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  357. return $core.withContext(function($ctx1) {
  358. //>>excludeEnd("ctx");
  359. var $1;
  360. $1=$recv($recv($Smalltalk())._core())._allSelectors();
  361. return $1;
  362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  363. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},$globals.Environment)});
  364. //>>excludeEnd("ctx");
  365. },
  366. //>>excludeStart("ide", pragmas.excludeIdeData);
  367. args: [],
  368. source: "allSelectors\x0a\x09^ Smalltalk core allSelectors",
  369. referencedClasses: ["Smalltalk"],
  370. //>>excludeEnd("ide");
  371. messageSends: ["allSelectors", "core"]
  372. }),
  373. $globals.Environment);
  374. $core.addMethod(
  375. $core.method({
  376. selector: "availableClassNames",
  377. protocol: 'accessing',
  378. fn: function (){
  379. var self=this;
  380. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  382. return $core.withContext(function($ctx1) {
  383. //>>excludeEnd("ctx");
  384. var $1;
  385. $1=$recv($recv($Smalltalk())._classes())._collect_((function(each){
  386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  387. return $core.withContext(function($ctx2) {
  388. //>>excludeEnd("ctx");
  389. return $recv(each)._name();
  390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  391. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  392. //>>excludeEnd("ctx");
  393. }));
  394. return $1;
  395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  396. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},$globals.Environment)});
  397. //>>excludeEnd("ctx");
  398. },
  399. //>>excludeStart("ide", pragmas.excludeIdeData);
  400. args: [],
  401. source: "availableClassNames\x0a\x09^ Smalltalk classes \x0a\x09\x09collect: [ :each | each name ]",
  402. referencedClasses: ["Smalltalk"],
  403. //>>excludeEnd("ide");
  404. messageSends: ["collect:", "classes", "name"]
  405. }),
  406. $globals.Environment);
  407. $core.addMethod(
  408. $core.method({
  409. selector: "availablePackageNames",
  410. protocol: 'accessing',
  411. fn: function (){
  412. var self=this;
  413. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  415. return $core.withContext(function($ctx1) {
  416. //>>excludeEnd("ctx");
  417. var $1;
  418. $1=$recv($recv($Smalltalk())._packages())._collect_((function(each){
  419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  420. return $core.withContext(function($ctx2) {
  421. //>>excludeEnd("ctx");
  422. return $recv(each)._name();
  423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  424. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  425. //>>excludeEnd("ctx");
  426. }));
  427. return $1;
  428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  429. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},$globals.Environment)});
  430. //>>excludeEnd("ctx");
  431. },
  432. //>>excludeStart("ide", pragmas.excludeIdeData);
  433. args: [],
  434. source: "availablePackageNames\x0a\x09^ Smalltalk packages \x0a\x09\x09collect: [ :each | each name ]",
  435. referencedClasses: ["Smalltalk"],
  436. //>>excludeEnd("ide");
  437. messageSends: ["collect:", "packages", "name"]
  438. }),
  439. $globals.Environment);
  440. $core.addMethod(
  441. $core.method({
  442. selector: "availableProtocolsFor:",
  443. protocol: 'accessing',
  444. fn: function (aClass){
  445. var self=this;
  446. var protocols;
  447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  448. return $core.withContext(function($ctx1) {
  449. //>>excludeEnd("ctx");
  450. var $1,$2,$receiver;
  451. protocols=$recv(aClass)._protocols();
  452. $1=$recv(aClass)._superclass();
  453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  454. $ctx1.sendIdx["superclass"]=1;
  455. //>>excludeEnd("ctx");
  456. if(($receiver = $1) == null || $receiver.isNil){
  457. $1;
  458. } else {
  459. $recv(protocols)._addAll_(self._availableProtocolsFor_($recv(aClass)._superclass()));
  460. };
  461. $2=$recv($recv($recv(protocols)._asSet())._asArray())._sort();
  462. return $2;
  463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  464. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},$globals.Environment)});
  465. //>>excludeEnd("ctx");
  466. },
  467. //>>excludeStart("ide", pragmas.excludeIdeData);
  468. args: ["aClass"],
  469. source: "availableProtocolsFor: aClass\x0a\x09| protocols |\x0a\x09\x0a\x09protocols := aClass protocols.\x0a\x09aClass superclass ifNotNil: [ protocols addAll: (self availableProtocolsFor: aClass superclass) ].\x0a\x09^ protocols asSet asArray sort",
  470. referencedClasses: [],
  471. //>>excludeEnd("ide");
  472. messageSends: ["protocols", "ifNotNil:", "superclass", "addAll:", "availableProtocolsFor:", "sort", "asArray", "asSet"]
  473. }),
  474. $globals.Environment);
  475. $core.addMethod(
  476. $core.method({
  477. selector: "classBuilder",
  478. protocol: 'accessing',
  479. fn: function (){
  480. var self=this;
  481. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  483. return $core.withContext(function($ctx1) {
  484. //>>excludeEnd("ctx");
  485. var $1;
  486. $1=$recv($ClassBuilder())._new();
  487. return $1;
  488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  489. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},$globals.Environment)});
  490. //>>excludeEnd("ctx");
  491. },
  492. //>>excludeStart("ide", pragmas.excludeIdeData);
  493. args: [],
  494. source: "classBuilder\x0a\x09^ ClassBuilder new",
  495. referencedClasses: ["ClassBuilder"],
  496. //>>excludeEnd("ide");
  497. messageSends: ["new"]
  498. }),
  499. $globals.Environment);
  500. $core.addMethod(
  501. $core.method({
  502. selector: "classNamed:",
  503. protocol: 'accessing',
  504. fn: function (aString){
  505. var self=this;
  506. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  508. return $core.withContext(function($ctx1) {
  509. //>>excludeEnd("ctx");
  510. var $2,$1,$receiver;
  511. $2=$recv($recv($Smalltalk())._globals())._at_($recv(aString)._asSymbol());
  512. if(($receiver = $2) == null || $receiver.isNil){
  513. $1=self._error_("Invalid class name");
  514. } else {
  515. $1=$2;
  516. };
  517. return $1;
  518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  519. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},$globals.Environment)});
  520. //>>excludeEnd("ctx");
  521. },
  522. //>>excludeStart("ide", pragmas.excludeIdeData);
  523. args: ["aString"],
  524. source: "classNamed: aString\x0a\x09^ (Smalltalk globals at: aString asSymbol)\x0a\x09\x09ifNil: [ self error: 'Invalid class name' ]",
  525. referencedClasses: ["Smalltalk"],
  526. //>>excludeEnd("ide");
  527. messageSends: ["ifNil:", "at:", "globals", "asSymbol", "error:"]
  528. }),
  529. $globals.Environment);
  530. $core.addMethod(
  531. $core.method({
  532. selector: "classes",
  533. protocol: 'accessing',
  534. fn: function (){
  535. var self=this;
  536. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  538. return $core.withContext(function($ctx1) {
  539. //>>excludeEnd("ctx");
  540. var $1;
  541. $1=$recv($Smalltalk())._classes();
  542. return $1;
  543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  544. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.Environment)});
  545. //>>excludeEnd("ctx");
  546. },
  547. //>>excludeStart("ide", pragmas.excludeIdeData);
  548. args: [],
  549. source: "classes\x0a\x09^ Smalltalk classes",
  550. referencedClasses: ["Smalltalk"],
  551. //>>excludeEnd("ide");
  552. messageSends: ["classes"]
  553. }),
  554. $globals.Environment);
  555. $core.addMethod(
  556. $core.method({
  557. selector: "commitPackage:onSuccess:onError:",
  558. protocol: 'actions',
  559. fn: function (aPackage,aBlock,anotherBlock){
  560. var self=this;
  561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  562. return $core.withContext(function($ctx1) {
  563. //>>excludeEnd("ctx");
  564. $recv($recv(aPackage)._transport())._commitOnSuccess_onError_(aBlock,anotherBlock);
  565. return self;
  566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  567. }, function($ctx1) {$ctx1.fill(self,"commitPackage:onSuccess:onError:",{aPackage:aPackage,aBlock:aBlock,anotherBlock:anotherBlock},$globals.Environment)});
  568. //>>excludeEnd("ctx");
  569. },
  570. //>>excludeStart("ide", pragmas.excludeIdeData);
  571. args: ["aPackage", "aBlock", "anotherBlock"],
  572. source: "commitPackage: aPackage onSuccess: aBlock onError: anotherBlock\x0a\x09aPackage transport\x0a\x09\x09commitOnSuccess: aBlock\x0a\x09\x09onError: anotherBlock",
  573. referencedClasses: [],
  574. //>>excludeEnd("ide");
  575. messageSends: ["commitOnSuccess:onError:", "transport"]
  576. }),
  577. $globals.Environment);
  578. $core.addMethod(
  579. $core.method({
  580. selector: "compileClassComment:for:",
  581. protocol: 'compiling',
  582. fn: function (aString,aClass){
  583. var self=this;
  584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  585. return $core.withContext(function($ctx1) {
  586. //>>excludeEnd("ctx");
  587. $recv(aClass)._comment_(aString);
  588. return self;
  589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  590. }, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},$globals.Environment)});
  591. //>>excludeEnd("ctx");
  592. },
  593. //>>excludeStart("ide", pragmas.excludeIdeData);
  594. args: ["aString", "aClass"],
  595. source: "compileClassComment: aString for: aClass\x0a\x09aClass comment: aString",
  596. referencedClasses: [],
  597. //>>excludeEnd("ide");
  598. messageSends: ["comment:"]
  599. }),
  600. $globals.Environment);
  601. $core.addMethod(
  602. $core.method({
  603. selector: "compileClassDefinition:",
  604. protocol: 'compiling',
  605. fn: function (aString){
  606. var self=this;
  607. function $DoIt(){return $globals.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  608. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  610. return $core.withContext(function($ctx1) {
  611. //>>excludeEnd("ctx");
  612. $recv((function(){
  613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  614. return $core.withContext(function($ctx2) {
  615. //>>excludeEnd("ctx");
  616. return self._evaluate_for_(aString,$recv($DoIt())._new());
  617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  618. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  619. //>>excludeEnd("ctx");
  620. }))._on_do_($Error(),(function(error){
  621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  622. return $core.withContext(function($ctx2) {
  623. //>>excludeEnd("ctx");
  624. return self._alert_($recv(error)._messageText());
  625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  626. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  627. //>>excludeEnd("ctx");
  628. }));
  629. return self;
  630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  631. }, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},$globals.Environment)});
  632. //>>excludeEnd("ctx");
  633. },
  634. //>>excludeStart("ide", pragmas.excludeIdeData);
  635. args: ["aString"],
  636. source: "compileClassDefinition: aString\x0a\x09[ self evaluate: aString for: DoIt new ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error | self alert: error messageText ]",
  637. referencedClasses: ["DoIt", "Error"],
  638. //>>excludeEnd("ide");
  639. messageSends: ["on:do:", "evaluate:for:", "new", "alert:", "messageText"]
  640. }),
  641. $globals.Environment);
  642. $core.addMethod(
  643. $core.method({
  644. selector: "compileMethod:for:protocol:",
  645. protocol: 'compiling',
  646. fn: function (sourceCode,class_,protocol){
  647. var self=this;
  648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  649. return $core.withContext(function($ctx1) {
  650. //>>excludeEnd("ctx");
  651. var $1;
  652. $1=$recv(class_)._compile_protocol_(sourceCode,protocol);
  653. return $1;
  654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  655. }, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},$globals.Environment)});
  656. //>>excludeEnd("ctx");
  657. },
  658. //>>excludeStart("ide", pragmas.excludeIdeData);
  659. args: ["sourceCode", "class", "protocol"],
  660. source: "compileMethod: sourceCode for: class protocol: protocol\x0a\x09^ class\x0a\x09\x09compile: sourceCode\x0a\x09\x09protocol: protocol",
  661. referencedClasses: [],
  662. //>>excludeEnd("ide");
  663. messageSends: ["compile:protocol:"]
  664. }),
  665. $globals.Environment);
  666. $core.addMethod(
  667. $core.method({
  668. selector: "copyClass:to:",
  669. protocol: 'actions',
  670. fn: function (aClass,aClassName){
  671. var self=this;
  672. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  673. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  675. return $core.withContext(function($ctx1) {
  676. //>>excludeEnd("ctx");
  677. var $1,$2,$receiver;
  678. $1=$recv($recv($Smalltalk())._globals())._at_(aClassName);
  679. if(($receiver = $1) == null || $receiver.isNil){
  680. $1;
  681. } else {
  682. $2=$recv("A class named ".__comma(aClassName)).__comma(" already exists");
  683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  684. $ctx1.sendIdx[","]=1;
  685. //>>excludeEnd("ctx");
  686. self._error_($2);
  687. };
  688. $recv($recv($ClassBuilder())._new())._copyClass_named_(aClass,aClassName);
  689. return self;
  690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  691. }, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,aClassName:aClassName},$globals.Environment)});
  692. //>>excludeEnd("ctx");
  693. },
  694. //>>excludeStart("ide", pragmas.excludeIdeData);
  695. args: ["aClass", "aClassName"],
  696. source: "copyClass: aClass to: aClassName\x0a\x09(Smalltalk globals at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new copyClass: aClass named: aClassName",
  697. referencedClasses: ["Smalltalk", "ClassBuilder"],
  698. //>>excludeEnd("ide");
  699. messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "copyClass:named:", "new"]
  700. }),
  701. $globals.Environment);
  702. $core.addMethod(
  703. $core.method({
  704. selector: "doItReceiver",
  705. protocol: 'accessing',
  706. fn: function (){
  707. var self=this;
  708. function $DoIt(){return $globals.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  710. return $core.withContext(function($ctx1) {
  711. //>>excludeEnd("ctx");
  712. var $1;
  713. $1=$recv($DoIt())._new();
  714. return $1;
  715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  716. }, function($ctx1) {$ctx1.fill(self,"doItReceiver",{},$globals.Environment)});
  717. //>>excludeEnd("ctx");
  718. },
  719. //>>excludeStart("ide", pragmas.excludeIdeData);
  720. args: [],
  721. source: "doItReceiver\x0a\x09^ DoIt new",
  722. referencedClasses: ["DoIt"],
  723. //>>excludeEnd("ide");
  724. messageSends: ["new"]
  725. }),
  726. $globals.Environment);
  727. $core.addMethod(
  728. $core.method({
  729. selector: "evaluate:for:",
  730. protocol: 'evaluating',
  731. fn: function (aString,anObject){
  732. var self=this;
  733. function $Evaluator(){return $globals.Evaluator||(typeof Evaluator=="undefined"?nil:Evaluator)}
  734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  735. return $core.withContext(function($ctx1) {
  736. //>>excludeEnd("ctx");
  737. var $1;
  738. $1=$recv($Evaluator())._evaluate_for_(aString,anObject);
  739. return $1;
  740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  741. }, function($ctx1) {$ctx1.fill(self,"evaluate:for:",{aString:aString,anObject:anObject},$globals.Environment)});
  742. //>>excludeEnd("ctx");
  743. },
  744. //>>excludeStart("ide", pragmas.excludeIdeData);
  745. args: ["aString", "anObject"],
  746. source: "evaluate: aString for: anObject\x0a\x09^ Evaluator evaluate: aString for: anObject",
  747. referencedClasses: ["Evaluator"],
  748. //>>excludeEnd("ide");
  749. messageSends: ["evaluate:for:"]
  750. }),
  751. $globals.Environment);
  752. $core.addMethod(
  753. $core.method({
  754. selector: "evaluate:on:do:",
  755. protocol: 'error handling',
  756. fn: function (aBlock,anErrorClass,exceptionBlock){
  757. var self=this;
  758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  759. return $core.withContext(function($ctx1) {
  760. //>>excludeEnd("ctx");
  761. var $1;
  762. $recv(aBlock)._tryCatch_((function(exception){
  763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  764. return $core.withContext(function($ctx2) {
  765. //>>excludeEnd("ctx");
  766. $1=$recv(exception)._isKindOf_(self._classNamed_($recv(anErrorClass)._name()));
  767. if($core.assert($1)){
  768. return $recv(exceptionBlock)._value_(exception);
  769. } else {
  770. return $recv(exception)._signal();
  771. };
  772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  773. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,1)});
  774. //>>excludeEnd("ctx");
  775. }));
  776. return self;
  777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  778. }, function($ctx1) {$ctx1.fill(self,"evaluate:on:do:",{aBlock:aBlock,anErrorClass:anErrorClass,exceptionBlock:exceptionBlock},$globals.Environment)});
  779. //>>excludeEnd("ctx");
  780. },
  781. //>>excludeStart("ide", pragmas.excludeIdeData);
  782. args: ["aBlock", "anErrorClass", "exceptionBlock"],
  783. source: "evaluate: aBlock on: anErrorClass do: exceptionBlock\x0a\x09\x22Evaluate a block and catch exceptions happening on the environment stack\x22\x0a\x09\x0a\x09aBlock tryCatch: [ :exception | \x0a\x09\x09(exception isKindOf: (self classNamed: anErrorClass name))\x0a\x09\x09\x09ifTrue: [ exceptionBlock value: exception ]\x0a \x09\x09\x09ifFalse: [ exception signal ] ]",
  784. referencedClasses: [],
  785. //>>excludeEnd("ide");
  786. messageSends: ["tryCatch:", "ifTrue:ifFalse:", "isKindOf:", "classNamed:", "name", "value:", "signal"]
  787. }),
  788. $globals.Environment);
  789. $core.addMethod(
  790. $core.method({
  791. selector: "inspect:",
  792. protocol: 'actions',
  793. fn: function (anObject){
  794. var self=this;
  795. function $Inspector(){return $globals.Inspector||(typeof Inspector=="undefined"?nil:Inspector)}
  796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  797. return $core.withContext(function($ctx1) {
  798. //>>excludeEnd("ctx");
  799. $recv($Inspector())._inspect_(anObject);
  800. return self;
  801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  802. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Environment)});
  803. //>>excludeEnd("ctx");
  804. },
  805. //>>excludeStart("ide", pragmas.excludeIdeData);
  806. args: ["anObject"],
  807. source: "inspect: anObject\x0a\x09Inspector inspect: anObject",
  808. referencedClasses: ["Inspector"],
  809. //>>excludeEnd("ide");
  810. messageSends: ["inspect:"]
  811. }),
  812. $globals.Environment);
  813. $core.addMethod(
  814. $core.method({
  815. selector: "moveClass:toPackage:",
  816. protocol: 'actions',
  817. fn: function (aClass,aPackageName){
  818. var self=this;
  819. var package_;
  820. function $Package(){return $globals.Package||(typeof Package=="undefined"?nil:Package)}
  821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  822. return $core.withContext(function($ctx1) {
  823. //>>excludeEnd("ctx");
  824. var $1,$2,$receiver;
  825. package_=$recv($Package())._named_(aPackageName);
  826. $1=package_;
  827. if(($receiver = $1) == null || $receiver.isNil){
  828. self._error_("Invalid package name");
  829. } else {
  830. $1;
  831. };
  832. $2=$recv(package_).__eq_eq($recv(aClass)._package());
  833. if($core.assert($2)){
  834. return self;
  835. };
  836. $recv(aClass)._package_(package_);
  837. return self;
  838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  839. }, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName,package_:package_},$globals.Environment)});
  840. //>>excludeEnd("ctx");
  841. },
  842. //>>excludeStart("ide", pragmas.excludeIdeData);
  843. args: ["aClass", "aPackageName"],
  844. source: "moveClass: aClass toPackage: aPackageName\x0a\x09| package |\x0a\x09\x0a\x09package := Package named: aPackageName.\x0a\x09package ifNil: [ self error: 'Invalid package name' ].\x0a\x09package == aClass package ifTrue: [ ^ self ].\x0a\x09\x0a\x09aClass package: package",
  845. referencedClasses: ["Package"],
  846. //>>excludeEnd("ide");
  847. messageSends: ["named:", "ifNil:", "error:", "ifTrue:", "==", "package", "package:"]
  848. }),
  849. $globals.Environment);
  850. $core.addMethod(
  851. $core.method({
  852. selector: "moveMethod:toClass:",
  853. protocol: 'actions',
  854. fn: function (aMethod,aClassName){
  855. var self=this;
  856. var destinationClass;
  857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  858. return $core.withContext(function($ctx1) {
  859. //>>excludeEnd("ctx");
  860. var $2,$3,$1,$5,$4;
  861. destinationClass=self._classNamed_(aClassName);
  862. $2=destinationClass;
  863. $3=$recv(aMethod)._methodClass();
  864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  865. $ctx1.sendIdx["methodClass"]=1;
  866. //>>excludeEnd("ctx");
  867. $1=$recv($2).__eq_eq($3);
  868. if($core.assert($1)){
  869. return self;
  870. };
  871. $5=$recv(aMethod)._methodClass();
  872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  873. $ctx1.sendIdx["methodClass"]=2;
  874. //>>excludeEnd("ctx");
  875. $4=$recv($5)._isMetaclass();
  876. if($core.assert($4)){
  877. destinationClass=$recv(destinationClass)._class();
  878. destinationClass;
  879. };
  880. $recv(destinationClass)._compile_protocol_($recv(aMethod)._source(),$recv(aMethod)._protocol());
  881. $recv($recv(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  882. return self;
  883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  884. }, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},$globals.Environment)});
  885. //>>excludeEnd("ctx");
  886. },
  887. //>>excludeStart("ide", pragmas.excludeIdeData);
  888. args: ["aMethod", "aClassName"],
  889. source: "moveMethod: aMethod toClass: aClassName\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := self classNamed: aClassName.\x0a\x09destinationClass == aMethod methodClass ifTrue: [ ^ self ].\x0a\x09\x0a\x09aMethod methodClass isMetaclass ifTrue: [ \x0a\x09\x09destinationClass := destinationClass class ].\x0a\x09\x0a\x09destinationClass \x0a\x09\x09compile: aMethod source\x0a\x09\x09protocol: aMethod protocol.\x0a\x09aMethod methodClass \x0a\x09\x09removeCompiledMethod: aMethod",
  890. referencedClasses: [],
  891. //>>excludeEnd("ide");
  892. messageSends: ["classNamed:", "ifTrue:", "==", "methodClass", "isMetaclass", "class", "compile:protocol:", "source", "protocol", "removeCompiledMethod:"]
  893. }),
  894. $globals.Environment);
  895. $core.addMethod(
  896. $core.method({
  897. selector: "moveMethod:toProtocol:",
  898. protocol: 'actions',
  899. fn: function (aMethod,aProtocol){
  900. var self=this;
  901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  902. return $core.withContext(function($ctx1) {
  903. //>>excludeEnd("ctx");
  904. $recv(aMethod)._protocol_(aProtocol);
  905. return self;
  906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  907. }, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},$globals.Environment)});
  908. //>>excludeEnd("ctx");
  909. },
  910. //>>excludeStart("ide", pragmas.excludeIdeData);
  911. args: ["aMethod", "aProtocol"],
  912. source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09aMethod protocol: aProtocol",
  913. referencedClasses: [],
  914. //>>excludeEnd("ide");
  915. messageSends: ["protocol:"]
  916. }),
  917. $globals.Environment);
  918. $core.addMethod(
  919. $core.method({
  920. selector: "packages",
  921. protocol: 'accessing',
  922. fn: function (){
  923. var self=this;
  924. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  926. return $core.withContext(function($ctx1) {
  927. //>>excludeEnd("ctx");
  928. var $1;
  929. $1=$recv($Smalltalk())._packages();
  930. return $1;
  931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  932. }, function($ctx1) {$ctx1.fill(self,"packages",{},$globals.Environment)});
  933. //>>excludeEnd("ctx");
  934. },
  935. //>>excludeStart("ide", pragmas.excludeIdeData);
  936. args: [],
  937. source: "packages\x0a\x09^ Smalltalk packages",
  938. referencedClasses: ["Smalltalk"],
  939. //>>excludeEnd("ide");
  940. messageSends: ["packages"]
  941. }),
  942. $globals.Environment);
  943. $core.addMethod(
  944. $core.method({
  945. selector: "registerErrorHandler:",
  946. protocol: 'services',
  947. fn: function (anErrorHandler){
  948. var self=this;
  949. function $ErrorHandler(){return $globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  951. return $core.withContext(function($ctx1) {
  952. //>>excludeEnd("ctx");
  953. $recv($ErrorHandler())._register_(anErrorHandler);
  954. return self;
  955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  956. }, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},$globals.Environment)});
  957. //>>excludeEnd("ctx");
  958. },
  959. //>>excludeStart("ide", pragmas.excludeIdeData);
  960. args: ["anErrorHandler"],
  961. source: "registerErrorHandler: anErrorHandler\x0a\x09ErrorHandler register: anErrorHandler",
  962. referencedClasses: ["ErrorHandler"],
  963. //>>excludeEnd("ide");
  964. messageSends: ["register:"]
  965. }),
  966. $globals.Environment);
  967. $core.addMethod(
  968. $core.method({
  969. selector: "registerFinder:",
  970. protocol: 'services',
  971. fn: function (aFinder){
  972. var self=this;
  973. function $Finder(){return $globals.Finder||(typeof Finder=="undefined"?nil:Finder)}
  974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  975. return $core.withContext(function($ctx1) {
  976. //>>excludeEnd("ctx");
  977. $recv($Finder())._register_(aFinder);
  978. return self;
  979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  980. }, function($ctx1) {$ctx1.fill(self,"registerFinder:",{aFinder:aFinder},$globals.Environment)});
  981. //>>excludeEnd("ctx");
  982. },
  983. //>>excludeStart("ide", pragmas.excludeIdeData);
  984. args: ["aFinder"],
  985. source: "registerFinder: aFinder\x0a\x09Finder register: aFinder",
  986. referencedClasses: ["Finder"],
  987. //>>excludeEnd("ide");
  988. messageSends: ["register:"]
  989. }),
  990. $globals.Environment);
  991. $core.addMethod(
  992. $core.method({
  993. selector: "registerInspector:",
  994. protocol: 'services',
  995. fn: function (anInspector){
  996. var self=this;
  997. function $Inspector(){return $globals.Inspector||(typeof Inspector=="undefined"?nil:Inspector)}
  998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  999. return $core.withContext(function($ctx1) {
  1000. //>>excludeEnd("ctx");
  1001. $recv($Inspector())._register_(anInspector);
  1002. return self;
  1003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1004. }, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},$globals.Environment)});
  1005. //>>excludeEnd("ctx");
  1006. },
  1007. //>>excludeStart("ide", pragmas.excludeIdeData);
  1008. args: ["anInspector"],
  1009. source: "registerInspector: anInspector\x0a\x09Inspector register: anInspector",
  1010. referencedClasses: ["Inspector"],
  1011. //>>excludeEnd("ide");
  1012. messageSends: ["register:"]
  1013. }),
  1014. $globals.Environment);
  1015. $core.addMethod(
  1016. $core.method({
  1017. selector: "registerProgressHandler:",
  1018. protocol: 'services',
  1019. fn: function (aProgressHandler){
  1020. var self=this;
  1021. function $ProgressHandler(){return $globals.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1023. return $core.withContext(function($ctx1) {
  1024. //>>excludeEnd("ctx");
  1025. $recv($ProgressHandler())._register_(aProgressHandler);
  1026. return self;
  1027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1028. }, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},$globals.Environment)});
  1029. //>>excludeEnd("ctx");
  1030. },
  1031. //>>excludeStart("ide", pragmas.excludeIdeData);
  1032. args: ["aProgressHandler"],
  1033. source: "registerProgressHandler: aProgressHandler\x0a\x09ProgressHandler register: aProgressHandler",
  1034. referencedClasses: ["ProgressHandler"],
  1035. //>>excludeEnd("ide");
  1036. messageSends: ["register:"]
  1037. }),
  1038. $globals.Environment);
  1039. $core.addMethod(
  1040. $core.method({
  1041. selector: "registerTranscript:",
  1042. protocol: 'services',
  1043. fn: function (aTranscript){
  1044. var self=this;
  1045. function $Transcript(){return $globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  1046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1047. return $core.withContext(function($ctx1) {
  1048. //>>excludeEnd("ctx");
  1049. $recv($Transcript())._register_(aTranscript);
  1050. return self;
  1051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1052. }, function($ctx1) {$ctx1.fill(self,"registerTranscript:",{aTranscript:aTranscript},$globals.Environment)});
  1053. //>>excludeEnd("ctx");
  1054. },
  1055. //>>excludeStart("ide", pragmas.excludeIdeData);
  1056. args: ["aTranscript"],
  1057. source: "registerTranscript: aTranscript\x0a\x09Transcript register: aTranscript",
  1058. referencedClasses: ["Transcript"],
  1059. //>>excludeEnd("ide");
  1060. messageSends: ["register:"]
  1061. }),
  1062. $globals.Environment);
  1063. $core.addMethod(
  1064. $core.method({
  1065. selector: "removeClass:",
  1066. protocol: 'actions',
  1067. fn: function (aClass){
  1068. var self=this;
  1069. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1071. return $core.withContext(function($ctx1) {
  1072. //>>excludeEnd("ctx");
  1073. $recv($Smalltalk())._removeClass_(aClass);
  1074. return self;
  1075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1076. }, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},$globals.Environment)});
  1077. //>>excludeEnd("ctx");
  1078. },
  1079. //>>excludeStart("ide", pragmas.excludeIdeData);
  1080. args: ["aClass"],
  1081. source: "removeClass: aClass\x0a\x09Smalltalk removeClass: aClass",
  1082. referencedClasses: ["Smalltalk"],
  1083. //>>excludeEnd("ide");
  1084. messageSends: ["removeClass:"]
  1085. }),
  1086. $globals.Environment);
  1087. $core.addMethod(
  1088. $core.method({
  1089. selector: "removeMethod:",
  1090. protocol: 'actions',
  1091. fn: function (aMethod){
  1092. var self=this;
  1093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1094. return $core.withContext(function($ctx1) {
  1095. //>>excludeEnd("ctx");
  1096. $recv($recv(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  1097. return self;
  1098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1099. }, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},$globals.Environment)});
  1100. //>>excludeEnd("ctx");
  1101. },
  1102. //>>excludeStart("ide", pragmas.excludeIdeData);
  1103. args: ["aMethod"],
  1104. source: "removeMethod: aMethod\x0a\x09aMethod methodClass removeCompiledMethod: aMethod",
  1105. referencedClasses: [],
  1106. //>>excludeEnd("ide");
  1107. messageSends: ["removeCompiledMethod:", "methodClass"]
  1108. }),
  1109. $globals.Environment);
  1110. $core.addMethod(
  1111. $core.method({
  1112. selector: "removeProtocol:from:",
  1113. protocol: 'actions',
  1114. fn: function (aString,aClass){
  1115. var self=this;
  1116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1117. return $core.withContext(function($ctx1) {
  1118. //>>excludeEnd("ctx");
  1119. $recv($recv(aClass)._methodsInProtocol_(aString))._do_((function(each){
  1120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1121. return $core.withContext(function($ctx2) {
  1122. //>>excludeEnd("ctx");
  1123. return $recv(aClass)._removeCompiledMethod_(each);
  1124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1125. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1126. //>>excludeEnd("ctx");
  1127. }));
  1128. return self;
  1129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1130. }, function($ctx1) {$ctx1.fill(self,"removeProtocol:from:",{aString:aString,aClass:aClass},$globals.Environment)});
  1131. //>>excludeEnd("ctx");
  1132. },
  1133. //>>excludeStart("ide", pragmas.excludeIdeData);
  1134. args: ["aString", "aClass"],
  1135. source: "removeProtocol: aString from: aClass\x0a\x09(aClass methodsInProtocol: aString)\x0a\x09\x09do: [ :each | aClass removeCompiledMethod: each ]",
  1136. referencedClasses: [],
  1137. //>>excludeEnd("ide");
  1138. messageSends: ["do:", "methodsInProtocol:", "removeCompiledMethod:"]
  1139. }),
  1140. $globals.Environment);
  1141. $core.addMethod(
  1142. $core.method({
  1143. selector: "renameClass:to:",
  1144. protocol: 'actions',
  1145. fn: function (aClass,aClassName){
  1146. var self=this;
  1147. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1148. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1150. return $core.withContext(function($ctx1) {
  1151. //>>excludeEnd("ctx");
  1152. var $1,$2,$receiver;
  1153. $1=$recv($recv($Smalltalk())._globals())._at_(aClassName);
  1154. if(($receiver = $1) == null || $receiver.isNil){
  1155. $1;
  1156. } else {
  1157. $2=$recv("A class named ".__comma(aClassName)).__comma(" already exists");
  1158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1159. $ctx1.sendIdx[","]=1;
  1160. //>>excludeEnd("ctx");
  1161. self._error_($2);
  1162. };
  1163. $recv($recv($ClassBuilder())._new())._renameClass_to_(aClass,aClassName);
  1164. return self;
  1165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1166. }, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aClassName:aClassName},$globals.Environment)});
  1167. //>>excludeEnd("ctx");
  1168. },
  1169. //>>excludeStart("ide", pragmas.excludeIdeData);
  1170. args: ["aClass", "aClassName"],
  1171. source: "renameClass: aClass to: aClassName\x0a\x09(Smalltalk globals at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new renameClass: aClass to: aClassName",
  1172. referencedClasses: ["Smalltalk", "ClassBuilder"],
  1173. //>>excludeEnd("ide");
  1174. messageSends: ["ifNotNil:", "at:", "globals", "error:", ",", "renameClass:to:", "new"]
  1175. }),
  1176. $globals.Environment);
  1177. $core.addMethod(
  1178. $core.method({
  1179. selector: "renameProtocol:to:in:",
  1180. protocol: 'actions',
  1181. fn: function (aString,anotherString,aClass){
  1182. var self=this;
  1183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1184. return $core.withContext(function($ctx1) {
  1185. //>>excludeEnd("ctx");
  1186. $recv($recv(aClass)._methodsInProtocol_(aString))._do_((function(each){
  1187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1188. return $core.withContext(function($ctx2) {
  1189. //>>excludeEnd("ctx");
  1190. return $recv(each)._protocol_(anotherString);
  1191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1192. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1193. //>>excludeEnd("ctx");
  1194. }));
  1195. return self;
  1196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1197. }, function($ctx1) {$ctx1.fill(self,"renameProtocol:to:in:",{aString:aString,anotherString:anotherString,aClass:aClass},$globals.Environment)});
  1198. //>>excludeEnd("ctx");
  1199. },
  1200. //>>excludeStart("ide", pragmas.excludeIdeData);
  1201. args: ["aString", "anotherString", "aClass"],
  1202. source: "renameProtocol: aString to: anotherString in: aClass\x0a\x09(aClass methodsInProtocol: aString)\x0a\x09\x09do: [ :each | each protocol: anotherString ]",
  1203. referencedClasses: [],
  1204. //>>excludeEnd("ide");
  1205. messageSends: ["do:", "methodsInProtocol:", "protocol:"]
  1206. }),
  1207. $globals.Environment);
  1208. $core.addMethod(
  1209. $core.method({
  1210. selector: "setClassCommentOf:to:",
  1211. protocol: 'actions',
  1212. fn: function (aClass,aString){
  1213. var self=this;
  1214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1215. return $core.withContext(function($ctx1) {
  1216. //>>excludeEnd("ctx");
  1217. $recv(aClass)._comment_(aString);
  1218. return self;
  1219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1220. }, function($ctx1) {$ctx1.fill(self,"setClassCommentOf:to:",{aClass:aClass,aString:aString},$globals.Environment)});
  1221. //>>excludeEnd("ctx");
  1222. },
  1223. //>>excludeStart("ide", pragmas.excludeIdeData);
  1224. args: ["aClass", "aString"],
  1225. source: "setClassCommentOf: aClass to: aString\x0a\x09aClass comment: aString",
  1226. referencedClasses: [],
  1227. //>>excludeEnd("ide");
  1228. messageSends: ["comment:"]
  1229. }),
  1230. $globals.Environment);
  1231. $core.addMethod(
  1232. $core.method({
  1233. selector: "systemAnnouncer",
  1234. protocol: 'accessing',
  1235. fn: function (){
  1236. var self=this;
  1237. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1239. return $core.withContext(function($ctx1) {
  1240. //>>excludeEnd("ctx");
  1241. var $1;
  1242. $1=$recv($recv($recv($Smalltalk())._globals())._at_("SystemAnnouncer"))._current();
  1243. return $1;
  1244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1245. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},$globals.Environment)});
  1246. //>>excludeEnd("ctx");
  1247. },
  1248. //>>excludeStart("ide", pragmas.excludeIdeData);
  1249. args: [],
  1250. source: "systemAnnouncer\x0a\x09^ (Smalltalk globals at: #SystemAnnouncer) current",
  1251. referencedClasses: ["Smalltalk"],
  1252. //>>excludeEnd("ide");
  1253. messageSends: ["current", "at:", "globals"]
  1254. }),
  1255. $globals.Environment);
  1256. $core.addClass('JSObjectProxy', $globals.ProtoObject, ['jsObject'], 'Kernel-Infrastructure');
  1257. //>>excludeStart("ide", pragmas.excludeIdeData);
  1258. $globals.JSObjectProxy.comment="I handle sending messages to JavaScript objects, making JavaScript object accessing from Amber fully transparent.\x0aMy instances make intensive use of `#doesNotUnderstand:`.\x0a\x0aMy instances are automatically created by Amber whenever a message is sent to a JavaScript object.\x0a\x0a## Usage examples\x0a\x0aJSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.\x0a\x0a\x09window alert: 'hello world'.\x0a\x09window inspect.\x0a\x09(window jQuery: 'body') append: 'hello world'\x0a\x0aAmber messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown.\x0a\x0a## Message conversion rules\x0a\x0a- `someUser name` becomes `someUser.name`\x0a- `someUser name: 'John'` becomes `someUser name = \x22John\x22`\x0a- `console log: 'hello world'` becomes `console.log('hello world')`\x0a- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`\x0a\x0a__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`.";
  1259. //>>excludeEnd("ide");
  1260. $core.addMethod(
  1261. $core.method({
  1262. selector: "=",
  1263. protocol: 'comparing',
  1264. fn: function (anObject){
  1265. var self=this;
  1266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1267. return $core.withContext(function($ctx1) {
  1268. //>>excludeEnd("ctx");
  1269. var $2,$1,$3;
  1270. $2=$recv(anObject)._class();
  1271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1272. $ctx1.sendIdx["class"]=1;
  1273. //>>excludeEnd("ctx");
  1274. $1=$recv($2).__eq_eq(self._class());
  1275. if(!$core.assert($1)){
  1276. return false;
  1277. };
  1278. $3=self._compareJSObjectWith_($recv(anObject)._jsObject());
  1279. return $3;
  1280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1281. }, function($ctx1) {$ctx1.fill(self,"=",{anObject:anObject},$globals.JSObjectProxy)});
  1282. //>>excludeEnd("ctx");
  1283. },
  1284. //>>excludeStart("ide", pragmas.excludeIdeData);
  1285. args: ["anObject"],
  1286. source: "= anObject\x0a\x09anObject class == self class ifFalse: [ ^ false ].\x0a\x09^ self compareJSObjectWith: anObject jsObject",
  1287. referencedClasses: [],
  1288. //>>excludeEnd("ide");
  1289. messageSends: ["ifFalse:", "==", "class", "compareJSObjectWith:", "jsObject"]
  1290. }),
  1291. $globals.JSObjectProxy);
  1292. $core.addMethod(
  1293. $core.method({
  1294. selector: "addObjectVariablesTo:",
  1295. protocol: 'proxy',
  1296. fn: function (aDictionary){
  1297. var self=this;
  1298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1299. return $core.withContext(function($ctx1) {
  1300. //>>excludeEnd("ctx");
  1301. for(var i in self['@jsObject']) {
  1302. aDictionary._at_put_(i, self['@jsObject'][i]);
  1303. }
  1304. ;
  1305. return self;
  1306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1307. }, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:",{aDictionary:aDictionary},$globals.JSObjectProxy)});
  1308. //>>excludeEnd("ctx");
  1309. },
  1310. //>>excludeStart("ide", pragmas.excludeIdeData);
  1311. args: ["aDictionary"],
  1312. source: "addObjectVariablesTo: aDictionary\x0a\x09<\x0a\x09\x09for(var i in self['@jsObject']) {\x0a\x09\x09\x09aDictionary._at_put_(i, self['@jsObject'][i]);\x0a\x09\x09}\x0a\x09>",
  1313. referencedClasses: [],
  1314. //>>excludeEnd("ide");
  1315. messageSends: []
  1316. }),
  1317. $globals.JSObjectProxy);
  1318. $core.addMethod(
  1319. $core.method({
  1320. selector: "asJSON",
  1321. protocol: 'enumerating',
  1322. fn: function (){
  1323. var self=this;
  1324. var $1;
  1325. $1=self["@jsObject"];
  1326. return $1;
  1327. },
  1328. //>>excludeStart("ide", pragmas.excludeIdeData);
  1329. args: [],
  1330. source: "asJSON\x0a\x09\x22Answers the receiver in a stringyfy-friendly fashion\x22\x0a\x0a\x09^ jsObject",
  1331. referencedClasses: [],
  1332. //>>excludeEnd("ide");
  1333. messageSends: []
  1334. }),
  1335. $globals.JSObjectProxy);
  1336. $core.addMethod(
  1337. $core.method({
  1338. selector: "at:",
  1339. protocol: 'accessing',
  1340. fn: function (aString){
  1341. var self=this;
  1342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1343. return $core.withContext(function($ctx1) {
  1344. //>>excludeEnd("ctx");
  1345. return self['@jsObject'][aString];
  1346. return self;
  1347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1348. }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},$globals.JSObjectProxy)});
  1349. //>>excludeEnd("ctx");
  1350. },
  1351. //>>excludeStart("ide", pragmas.excludeIdeData);
  1352. args: ["aString"],
  1353. source: "at: aString\x0a\x09<return self['@jsObject'][aString]>",
  1354. referencedClasses: [],
  1355. //>>excludeEnd("ide");
  1356. messageSends: []
  1357. }),
  1358. $globals.JSObjectProxy);
  1359. $core.addMethod(
  1360. $core.method({
  1361. selector: "at:ifAbsent:",
  1362. protocol: 'accessing',
  1363. fn: function (aString,aBlock){
  1364. var self=this;
  1365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1366. return $core.withContext(function($ctx1) {
  1367. //>>excludeEnd("ctx");
  1368. var obj = self['@jsObject'];
  1369. return aString in obj ? obj[aString] : aBlock._value();
  1370. ;
  1371. return self;
  1372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1373. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},$globals.JSObjectProxy)});
  1374. //>>excludeEnd("ctx");
  1375. },
  1376. //>>excludeStart("ide", pragmas.excludeIdeData);
  1377. args: ["aString", "aBlock"],
  1378. source: "at: aString ifAbsent: aBlock\x0a\x09\x22return the aString property or evaluate aBlock if the property is not defined on the object\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? obj[aString] : aBlock._value();\x0a\x09>",
  1379. referencedClasses: [],
  1380. //>>excludeEnd("ide");
  1381. messageSends: []
  1382. }),
  1383. $globals.JSObjectProxy);
  1384. $core.addMethod(
  1385. $core.method({
  1386. selector: "at:ifPresent:",
  1387. protocol: 'accessing',
  1388. fn: function (aString,aBlock){
  1389. var self=this;
  1390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1391. return $core.withContext(function($ctx1) {
  1392. //>>excludeEnd("ctx");
  1393. var obj = self['@jsObject'];
  1394. return aString in obj ? aBlock._value_(obj[aString]) : nil;
  1395. ;
  1396. return self;
  1397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1398. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aString:aString,aBlock:aBlock},$globals.JSObjectProxy)});
  1399. //>>excludeEnd("ctx");
  1400. },
  1401. //>>excludeStart("ide", pragmas.excludeIdeData);
  1402. args: ["aString", "aBlock"],
  1403. source: "at: aString ifPresent: aBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined or return nil\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : nil;\x0a\x09>",
  1404. referencedClasses: [],
  1405. //>>excludeEnd("ide");
  1406. messageSends: []
  1407. }),
  1408. $globals.JSObjectProxy);
  1409. $core.addMethod(
  1410. $core.method({
  1411. selector: "at:ifPresent:ifAbsent:",
  1412. protocol: 'accessing',
  1413. fn: function (aString,aBlock,anotherBlock){
  1414. var self=this;
  1415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1416. return $core.withContext(function($ctx1) {
  1417. //>>excludeEnd("ctx");
  1418. var obj = self['@jsObject'];
  1419. return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
  1420. ;
  1421. return self;
  1422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1423. }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},$globals.JSObjectProxy)});
  1424. //>>excludeEnd("ctx");
  1425. },
  1426. //>>excludeStart("ide", pragmas.excludeIdeData);
  1427. args: ["aString", "aBlock", "anotherBlock"],
  1428. source: "at: aString ifPresent: aBlock ifAbsent: anotherBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined\x0a\x09or return value of anotherBlock\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();\x0a\x09>",
  1429. referencedClasses: [],
  1430. //>>excludeEnd("ide");
  1431. messageSends: []
  1432. }),
  1433. $globals.JSObjectProxy);
  1434. $core.addMethod(
  1435. $core.method({
  1436. selector: "at:put:",
  1437. protocol: 'accessing',
  1438. fn: function (aString,anObject){
  1439. var self=this;
  1440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1441. return $core.withContext(function($ctx1) {
  1442. //>>excludeEnd("ctx");
  1443. return self['@jsObject'][aString] = anObject;
  1444. return self;
  1445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1446. }, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},$globals.JSObjectProxy)});
  1447. //>>excludeEnd("ctx");
  1448. },
  1449. //>>excludeStart("ide", pragmas.excludeIdeData);
  1450. args: ["aString", "anObject"],
  1451. source: "at: aString put: anObject\x0a\x09<return self['@jsObject'][aString] = anObject>",
  1452. referencedClasses: [],
  1453. //>>excludeEnd("ide");
  1454. messageSends: []
  1455. }),
  1456. $globals.JSObjectProxy);
  1457. $core.addMethod(
  1458. $core.method({
  1459. selector: "compareJSObjectWith:",
  1460. protocol: 'private',
  1461. fn: function (aJSObject){
  1462. var self=this;
  1463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1464. return $core.withContext(function($ctx1) {
  1465. //>>excludeEnd("ctx");
  1466. return self["@jsObject"] === aJSObject;
  1467. return self;
  1468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1469. }, function($ctx1) {$ctx1.fill(self,"compareJSObjectWith:",{aJSObject:aJSObject},$globals.JSObjectProxy)});
  1470. //>>excludeEnd("ctx");
  1471. },
  1472. //>>excludeStart("ide", pragmas.excludeIdeData);
  1473. args: ["aJSObject"],
  1474. source: "compareJSObjectWith: aJSObject\x0a \x09<return self[\x22@jsObject\x22] === aJSObject>",
  1475. referencedClasses: [],
  1476. //>>excludeEnd("ide");
  1477. messageSends: []
  1478. }),
  1479. $globals.JSObjectProxy);
  1480. $core.addMethod(
  1481. $core.method({
  1482. selector: "doesNotUnderstand:",
  1483. protocol: 'proxy',
  1484. fn: function (aMessage){
  1485. var self=this;
  1486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1487. return $core.withContext(function($ctx1) {
  1488. //>>excludeEnd("ctx");
  1489. var $2,$1,$receiver;
  1490. $2=self._lookupProperty_($recv($recv(aMessage)._selector())._asJavaScriptPropertyName());
  1491. if(($receiver = $2) == null || $receiver.isNil){
  1492. $1=(
  1493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1494. $ctx1.supercall = true,
  1495. //>>excludeEnd("ctx");
  1496. $globals.JSObjectProxy.superclass.fn.prototype._doesNotUnderstand_.apply($recv(self), [aMessage]));
  1497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1498. $ctx1.supercall = false;
  1499. //>>excludeEnd("ctx");;
  1500. } else {
  1501. var jsSelector;
  1502. jsSelector=$receiver;
  1503. $1=self._forwardMessage_withArguments_(jsSelector,$recv(aMessage)._arguments());
  1504. };
  1505. return $1;
  1506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1507. }, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},$globals.JSObjectProxy)});
  1508. //>>excludeEnd("ctx");
  1509. },
  1510. //>>excludeStart("ide", pragmas.excludeIdeData);
  1511. args: ["aMessage"],
  1512. source: "doesNotUnderstand: aMessage\x0a\x09^ (self lookupProperty: aMessage selector asJavaScriptPropertyName)\x0a\x09\x09ifNil: [ super doesNotUnderstand: aMessage ]\x0a\x09\x09ifNotNil: [ :jsSelector | \x0a\x09\x09\x09self \x0a\x09\x09\x09\x09forwardMessage: jsSelector \x0a\x09\x09\x09\x09withArguments: aMessage arguments ]",
  1513. referencedClasses: [],
  1514. //>>excludeEnd("ide");
  1515. messageSends: ["ifNil:ifNotNil:", "lookupProperty:", "asJavaScriptPropertyName", "selector", "doesNotUnderstand:", "forwardMessage:withArguments:", "arguments"]
  1516. }),
  1517. $globals.JSObjectProxy);
  1518. $core.addMethod(
  1519. $core.method({
  1520. selector: "forwardMessage:withArguments:",
  1521. protocol: 'proxy',
  1522. fn: function (aString,anArray){
  1523. var self=this;
  1524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1525. return $core.withContext(function($ctx1) {
  1526. //>>excludeEnd("ctx");
  1527. return $core.accessJavaScript(self._jsObject(), aString, anArray);
  1528. ;
  1529. return self;
  1530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1531. }, function($ctx1) {$ctx1.fill(self,"forwardMessage:withArguments:",{aString:aString,anArray:anArray},$globals.JSObjectProxy)});
  1532. //>>excludeEnd("ctx");
  1533. },
  1534. //>>excludeStart("ide", pragmas.excludeIdeData);
  1535. args: ["aString", "anArray"],
  1536. source: "forwardMessage: aString withArguments: anArray\x0a\x09<\x0a\x09\x09return $core.accessJavaScript(self._jsObject(), aString, anArray);\x0a\x09>",
  1537. referencedClasses: [],
  1538. //>>excludeEnd("ide");
  1539. messageSends: []
  1540. }),
  1541. $globals.JSObjectProxy);
  1542. $core.addMethod(
  1543. $core.method({
  1544. selector: "inspectOn:",
  1545. protocol: 'proxy',
  1546. fn: function (anInspector){
  1547. var self=this;
  1548. var variables;
  1549. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1551. return $core.withContext(function($ctx1) {
  1552. //>>excludeEnd("ctx");
  1553. variables=$recv($Dictionary())._new();
  1554. $recv(variables)._at_put_("#self",self._jsObject());
  1555. $recv(anInspector)._setLabel_(self._printString());
  1556. self._addObjectVariablesTo_(variables);
  1557. $recv(anInspector)._setVariables_(variables);
  1558. return self;
  1559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1560. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},$globals.JSObjectProxy)});
  1561. //>>excludeEnd("ctx");
  1562. },
  1563. //>>excludeStart("ide", pragmas.excludeIdeData);
  1564. args: ["anInspector"],
  1565. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self jsObject.\x0a\x09anInspector setLabel: self printString.\x0a\x09self addObjectVariablesTo: variables.\x0a\x09anInspector setVariables: variables",
  1566. referencedClasses: ["Dictionary"],
  1567. //>>excludeEnd("ide");
  1568. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:", "setVariables:"]
  1569. }),
  1570. $globals.JSObjectProxy);
  1571. $core.addMethod(
  1572. $core.method({
  1573. selector: "jsObject",
  1574. protocol: 'accessing',
  1575. fn: function (){
  1576. var self=this;
  1577. var $1;
  1578. $1=self["@jsObject"];
  1579. return $1;
  1580. },
  1581. //>>excludeStart("ide", pragmas.excludeIdeData);
  1582. args: [],
  1583. source: "jsObject\x0a\x09^ jsObject",
  1584. referencedClasses: [],
  1585. //>>excludeEnd("ide");
  1586. messageSends: []
  1587. }),
  1588. $globals.JSObjectProxy);
  1589. $core.addMethod(
  1590. $core.method({
  1591. selector: "jsObject:",
  1592. protocol: 'accessing',
  1593. fn: function (aJSObject){
  1594. var self=this;
  1595. self["@jsObject"]=aJSObject;
  1596. return self;
  1597. },
  1598. //>>excludeStart("ide", pragmas.excludeIdeData);
  1599. args: ["aJSObject"],
  1600. source: "jsObject: aJSObject\x0a\x09jsObject := aJSObject",
  1601. referencedClasses: [],
  1602. //>>excludeEnd("ide");
  1603. messageSends: []
  1604. }),
  1605. $globals.JSObjectProxy);
  1606. $core.addMethod(
  1607. $core.method({
  1608. selector: "keysAndValuesDo:",
  1609. protocol: 'enumerating',
  1610. fn: function (aBlock){
  1611. var self=this;
  1612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1613. return $core.withContext(function($ctx1) {
  1614. //>>excludeEnd("ctx");
  1615. var o = self['@jsObject'];
  1616. for(var i in o) {
  1617. aBlock._value_value_(i, o[i]);
  1618. }
  1619. ;
  1620. return self;
  1621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1622. }, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},$globals.JSObjectProxy)});
  1623. //>>excludeEnd("ctx");
  1624. },
  1625. //>>excludeStart("ide", pragmas.excludeIdeData);
  1626. args: ["aBlock"],
  1627. source: "keysAndValuesDo: aBlock\x0a\x09<\x0a\x09\x09var o = self['@jsObject'];\x0a\x09\x09for(var i in o) {\x0a\x09\x09\x09aBlock._value_value_(i, o[i]);\x0a\x09\x09}\x0a\x09>",
  1628. referencedClasses: [],
  1629. //>>excludeEnd("ide");
  1630. messageSends: []
  1631. }),
  1632. $globals.JSObjectProxy);
  1633. $core.addMethod(
  1634. $core.method({
  1635. selector: "lookupProperty:",
  1636. protocol: 'accessing',
  1637. fn: function (aString){
  1638. var self=this;
  1639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1640. return $core.withContext(function($ctx1) {
  1641. //>>excludeEnd("ctx");
  1642. return aString in self._jsObject() ? aString : nil;
  1643. return self;
  1644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1645. }, function($ctx1) {$ctx1.fill(self,"lookupProperty:",{aString:aString},$globals.JSObjectProxy)});
  1646. //>>excludeEnd("ctx");
  1647. },
  1648. //>>excludeStart("ide", pragmas.excludeIdeData);
  1649. args: ["aString"],
  1650. source: "lookupProperty: aString\x0a\x09\x22Looks up a property in JS object.\x0a\x09Answer the property if it is present, or nil if it is not present.\x22\x0a\x09\x0a\x09<return aString in self._jsObject() ? aString : nil>",
  1651. referencedClasses: [],
  1652. //>>excludeEnd("ide");
  1653. messageSends: []
  1654. }),
  1655. $globals.JSObjectProxy);
  1656. $core.addMethod(
  1657. $core.method({
  1658. selector: "printOn:",
  1659. protocol: 'printing',
  1660. fn: function (aStream){
  1661. var self=this;
  1662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1663. return $core.withContext(function($ctx1) {
  1664. //>>excludeEnd("ctx");
  1665. $recv(aStream)._nextPutAll_(self._printString());
  1666. return self;
  1667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1668. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.JSObjectProxy)});
  1669. //>>excludeEnd("ctx");
  1670. },
  1671. //>>excludeStart("ide", pragmas.excludeIdeData);
  1672. args: ["aStream"],
  1673. source: "printOn: aStream\x0a\x09aStream nextPutAll: self printString",
  1674. referencedClasses: [],
  1675. //>>excludeEnd("ide");
  1676. messageSends: ["nextPutAll:", "printString"]
  1677. }),
  1678. $globals.JSObjectProxy);
  1679. $core.addMethod(
  1680. $core.method({
  1681. selector: "printString",
  1682. protocol: 'printing',
  1683. fn: function (){
  1684. var self=this;
  1685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1686. return $core.withContext(function($ctx1) {
  1687. //>>excludeEnd("ctx");
  1688. var js = self['@jsObject'];
  1689. return js.toString
  1690. ? js.toString()
  1691. : Object.prototype.toString.call(js)
  1692. ;
  1693. return self;
  1694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1695. }, function($ctx1) {$ctx1.fill(self,"printString",{},$globals.JSObjectProxy)});
  1696. //>>excludeEnd("ctx");
  1697. },
  1698. //>>excludeStart("ide", pragmas.excludeIdeData);
  1699. args: [],
  1700. source: "printString\x0a\x09<\x0a\x09\x09var js = self['@jsObject'];\x0a\x09\x09return js.toString\x0a\x09\x09\x09? js.toString()\x0a\x09\x09\x09: Object.prototype.toString.call(js)\x0a\x09>",
  1701. referencedClasses: [],
  1702. //>>excludeEnd("ide");
  1703. messageSends: []
  1704. }),
  1705. $globals.JSObjectProxy);
  1706. $core.addMethod(
  1707. $core.method({
  1708. selector: "on:",
  1709. protocol: 'instance creation',
  1710. fn: function (aJSObject){
  1711. var self=this;
  1712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1713. return $core.withContext(function($ctx1) {
  1714. //>>excludeEnd("ctx");
  1715. var $2,$3,$1;
  1716. $2=self._new();
  1717. $recv($2)._jsObject_(aJSObject);
  1718. $3=$recv($2)._yourself();
  1719. $1=$3;
  1720. return $1;
  1721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1722. }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject},$globals.JSObjectProxy.klass)});
  1723. //>>excludeEnd("ctx");
  1724. },
  1725. //>>excludeStart("ide", pragmas.excludeIdeData);
  1726. args: ["aJSObject"],
  1727. source: "on: aJSObject\x0a\x09^ self new\x0a\x09\x09jsObject: aJSObject;\x0a\x09\x09yourself",
  1728. referencedClasses: [],
  1729. //>>excludeEnd("ide");
  1730. messageSends: ["jsObject:", "new", "yourself"]
  1731. }),
  1732. $globals.JSObjectProxy.klass);
  1733. $core.addClass('NullProgressHandler', $globals.Object, [], 'Kernel-Infrastructure');
  1734. //>>excludeStart("ide", pragmas.excludeIdeData);
  1735. $globals.NullProgressHandler.comment="I am the default progress handler. I do not display any progress, and simply iterate over the collection.";
  1736. //>>excludeEnd("ide");
  1737. $core.addMethod(
  1738. $core.method({
  1739. selector: "do:on:displaying:",
  1740. protocol: 'progress handling',
  1741. fn: function (aBlock,aCollection,aString){
  1742. var self=this;
  1743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1744. return $core.withContext(function($ctx1) {
  1745. //>>excludeEnd("ctx");
  1746. $recv(aCollection)._do_(aBlock);
  1747. return self;
  1748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1749. }, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},$globals.NullProgressHandler)});
  1750. //>>excludeEnd("ctx");
  1751. },
  1752. //>>excludeStart("ide", pragmas.excludeIdeData);
  1753. args: ["aBlock", "aCollection", "aString"],
  1754. source: "do: aBlock on: aCollection displaying: aString\x0a\x09aCollection do: aBlock",
  1755. referencedClasses: [],
  1756. //>>excludeEnd("ide");
  1757. messageSends: ["do:"]
  1758. }),
  1759. $globals.NullProgressHandler);
  1760. $globals.NullProgressHandler.klass.iVarNames = ['current'];
  1761. $core.addMethod(
  1762. $core.method({
  1763. selector: "initialize",
  1764. protocol: 'initialization',
  1765. fn: function (){
  1766. var self=this;
  1767. function $ProgressHandler(){return $globals.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1769. return $core.withContext(function($ctx1) {
  1770. //>>excludeEnd("ctx");
  1771. $recv($ProgressHandler())._registerIfNone_(self._new());
  1772. return self;
  1773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1774. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.NullProgressHandler.klass)});
  1775. //>>excludeEnd("ctx");
  1776. },
  1777. //>>excludeStart("ide", pragmas.excludeIdeData);
  1778. args: [],
  1779. source: "initialize\x0a\x09ProgressHandler registerIfNone: self new",
  1780. referencedClasses: ["ProgressHandler"],
  1781. //>>excludeEnd("ide");
  1782. messageSends: ["registerIfNone:", "new"]
  1783. }),
  1784. $globals.NullProgressHandler.klass);
  1785. $core.addClass('Organizer', $globals.Object, [], 'Kernel-Infrastructure');
  1786. //>>excludeStart("ide", pragmas.excludeIdeData);
  1787. $globals.Organizer.comment="I represent categorization information. \x0a\x0a## API\x0a\x0aUse `#addElement:` and `#removeElement:` to manipulate instances.";
  1788. //>>excludeEnd("ide");
  1789. $core.addMethod(
  1790. $core.method({
  1791. selector: "addElement:",
  1792. protocol: 'accessing',
  1793. fn: function (anObject){
  1794. var self=this;
  1795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1796. return $core.withContext(function($ctx1) {
  1797. //>>excludeEnd("ctx");
  1798. self.elements.addElement(anObject);
  1799. return self;
  1800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1801. }, function($ctx1) {$ctx1.fill(self,"addElement:",{anObject:anObject},$globals.Organizer)});
  1802. //>>excludeEnd("ctx");
  1803. },
  1804. //>>excludeStart("ide", pragmas.excludeIdeData);
  1805. args: ["anObject"],
  1806. source: "addElement: anObject\x0a\x09<self.elements.addElement(anObject)>",
  1807. referencedClasses: [],
  1808. //>>excludeEnd("ide");
  1809. messageSends: []
  1810. }),
  1811. $globals.Organizer);
  1812. $core.addMethod(
  1813. $core.method({
  1814. selector: "elements",
  1815. protocol: 'accessing',
  1816. fn: function (){
  1817. var self=this;
  1818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1819. return $core.withContext(function($ctx1) {
  1820. //>>excludeEnd("ctx");
  1821. var $1;
  1822. $1=$recv(self._basicAt_("elements"))._copy();
  1823. return $1;
  1824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1825. }, function($ctx1) {$ctx1.fill(self,"elements",{},$globals.Organizer)});
  1826. //>>excludeEnd("ctx");
  1827. },
  1828. //>>excludeStart("ide", pragmas.excludeIdeData);
  1829. args: [],
  1830. source: "elements\x0a\x09^ (self basicAt: 'elements') copy",
  1831. referencedClasses: [],
  1832. //>>excludeEnd("ide");
  1833. messageSends: ["copy", "basicAt:"]
  1834. }),
  1835. $globals.Organizer);
  1836. $core.addMethod(
  1837. $core.method({
  1838. selector: "removeElement:",
  1839. protocol: 'accessing',
  1840. fn: function (anObject){
  1841. var self=this;
  1842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1843. return $core.withContext(function($ctx1) {
  1844. //>>excludeEnd("ctx");
  1845. self.elements.removeElement(anObject);
  1846. return self;
  1847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1848. }, function($ctx1) {$ctx1.fill(self,"removeElement:",{anObject:anObject},$globals.Organizer)});
  1849. //>>excludeEnd("ctx");
  1850. },
  1851. //>>excludeStart("ide", pragmas.excludeIdeData);
  1852. args: ["anObject"],
  1853. source: "removeElement: anObject\x0a\x09<self.elements.removeElement(anObject)>",
  1854. referencedClasses: [],
  1855. //>>excludeEnd("ide");
  1856. messageSends: []
  1857. }),
  1858. $globals.Organizer);
  1859. $core.addClass('ClassOrganizer', $globals.Organizer, [], 'Kernel-Infrastructure');
  1860. //>>excludeStart("ide", pragmas.excludeIdeData);
  1861. $globals.ClassOrganizer.comment="I am an organizer specific to classes. I hold method categorization information for classes.";
  1862. //>>excludeEnd("ide");
  1863. $core.addMethod(
  1864. $core.method({
  1865. selector: "addElement:",
  1866. protocol: 'accessing',
  1867. fn: function (aString){
  1868. var self=this;
  1869. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1870. function $ProtocolAdded(){return $globals.ProtocolAdded||(typeof ProtocolAdded=="undefined"?nil:ProtocolAdded)}
  1871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1872. return $core.withContext(function($ctx1) {
  1873. //>>excludeEnd("ctx");
  1874. var $1,$2;
  1875. (
  1876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1877. $ctx1.supercall = true,
  1878. //>>excludeEnd("ctx");
  1879. $globals.ClassOrganizer.superclass.fn.prototype._addElement_.apply($recv(self), [aString]));
  1880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1881. $ctx1.supercall = false;
  1882. //>>excludeEnd("ctx");;
  1883. $1=$recv($ProtocolAdded())._new();
  1884. $recv($1)._protocol_(aString);
  1885. $recv($1)._theClass_(self._theClass());
  1886. $2=$recv($1)._yourself();
  1887. $recv($recv($SystemAnnouncer())._current())._announce_($2);
  1888. return self;
  1889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1890. }, function($ctx1) {$ctx1.fill(self,"addElement:",{aString:aString},$globals.ClassOrganizer)});
  1891. //>>excludeEnd("ctx");
  1892. },
  1893. //>>excludeStart("ide", pragmas.excludeIdeData);
  1894. args: ["aString"],
  1895. source: "addElement: aString\x0a\x09super addElement: aString.\x0a\x0a\x09SystemAnnouncer current announce: (ProtocolAdded new\x0a\x09\x09protocol: aString;\x0a\x09\x09theClass: self theClass;\x0a\x09\x09yourself)",
  1896. referencedClasses: ["SystemAnnouncer", "ProtocolAdded"],
  1897. //>>excludeEnd("ide");
  1898. messageSends: ["addElement:", "announce:", "current", "protocol:", "new", "theClass:", "theClass", "yourself"]
  1899. }),
  1900. $globals.ClassOrganizer);
  1901. $core.addMethod(
  1902. $core.method({
  1903. selector: "removeElement:",
  1904. protocol: 'accessing',
  1905. fn: function (aString){
  1906. var self=this;
  1907. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1908. function $ProtocolRemoved(){return $globals.ProtocolRemoved||(typeof ProtocolRemoved=="undefined"?nil:ProtocolRemoved)}
  1909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1910. return $core.withContext(function($ctx1) {
  1911. //>>excludeEnd("ctx");
  1912. var $1,$2;
  1913. (
  1914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1915. $ctx1.supercall = true,
  1916. //>>excludeEnd("ctx");
  1917. $globals.ClassOrganizer.superclass.fn.prototype._removeElement_.apply($recv(self), [aString]));
  1918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1919. $ctx1.supercall = false;
  1920. //>>excludeEnd("ctx");;
  1921. $1=$recv($ProtocolRemoved())._new();
  1922. $recv($1)._protocol_(aString);
  1923. $recv($1)._theClass_(self._theClass());
  1924. $2=$recv($1)._yourself();
  1925. $recv($recv($SystemAnnouncer())._current())._announce_($2);
  1926. return self;
  1927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1928. }, function($ctx1) {$ctx1.fill(self,"removeElement:",{aString:aString},$globals.ClassOrganizer)});
  1929. //>>excludeEnd("ctx");
  1930. },
  1931. //>>excludeStart("ide", pragmas.excludeIdeData);
  1932. args: ["aString"],
  1933. source: "removeElement: aString\x0a\x09super removeElement: aString.\x0a\x0a\x09SystemAnnouncer current announce: (ProtocolRemoved new\x0a\x09\x09protocol: aString;\x0a\x09\x09theClass: self theClass;\x0a\x09\x09yourself)",
  1934. referencedClasses: ["SystemAnnouncer", "ProtocolRemoved"],
  1935. //>>excludeEnd("ide");
  1936. messageSends: ["removeElement:", "announce:", "current", "protocol:", "new", "theClass:", "theClass", "yourself"]
  1937. }),
  1938. $globals.ClassOrganizer);
  1939. $core.addMethod(
  1940. $core.method({
  1941. selector: "theClass",
  1942. protocol: 'accessing',
  1943. fn: function (){
  1944. var self=this;
  1945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1946. return $core.withContext(function($ctx1) {
  1947. //>>excludeEnd("ctx");
  1948. return self.theClass ;
  1949. return self;
  1950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1951. }, function($ctx1) {$ctx1.fill(self,"theClass",{},$globals.ClassOrganizer)});
  1952. //>>excludeEnd("ctx");
  1953. },
  1954. //>>excludeStart("ide", pragmas.excludeIdeData);
  1955. args: [],
  1956. source: "theClass\x0a\x09< return self.theClass >",
  1957. referencedClasses: [],
  1958. //>>excludeEnd("ide");
  1959. messageSends: []
  1960. }),
  1961. $globals.ClassOrganizer);
  1962. $core.addClass('PackageOrganizer', $globals.Organizer, [], 'Kernel-Infrastructure');
  1963. //>>excludeStart("ide", pragmas.excludeIdeData);
  1964. $globals.PackageOrganizer.comment="I am an organizer specific to packages. I hold classes categorization information.";
  1965. //>>excludeEnd("ide");
  1966. $core.addClass('Package', $globals.Object, ['transport', 'dirty'], 'Kernel-Infrastructure');
  1967. //>>excludeStart("ide", pragmas.excludeIdeData);
  1968. $globals.Package.comment="I am similar to a \x22class category\x22 typically found in other Smalltalks like Pharo or Squeak. Amber does not have class categories anymore, it had in the beginning but now each class in the system knows which package it belongs to.\x0a\x0aEach package has a name and can be queried for its classes, but it will then resort to a reverse scan of all classes to find them.\x0a\x0a## API\x0a\x0aPackages are manipulated through \x22Smalltalk current\x22, like for example finding one based on a name or with `Package class >> #name` directly:\x0a\x0a Smalltalk current packageAt: 'Kernel'\x0a Package named: 'Kernel'\x0a\x0aA package differs slightly from a Monticello package which can span multiple class categories using a naming convention based on hyphenation. But just as in Monticello a package supports \x22class extensions\x22 so a package can define behaviors in foreign classes using a naming convention for method categories where the category starts with an asterisk and then the name of the owning package follows.\x0a\x0aYou can fetch a package from the server:\x0a\x0a\x09Package load: 'Additional-Examples'";
  1969. //>>excludeEnd("ide");
  1970. $core.addMethod(
  1971. $core.method({
  1972. selector: "basicName:",
  1973. protocol: 'private',
  1974. fn: function (aString){
  1975. var self=this;
  1976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1977. return $core.withContext(function($ctx1) {
  1978. //>>excludeEnd("ctx");
  1979. self.pkgName = aString;
  1980. return self;
  1981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1982. }, function($ctx1) {$ctx1.fill(self,"basicName:",{aString:aString},$globals.Package)});
  1983. //>>excludeEnd("ctx");
  1984. },
  1985. //>>excludeStart("ide", pragmas.excludeIdeData);
  1986. args: ["aString"],
  1987. source: "basicName: aString\x0a\x09<self.pkgName = aString>",
  1988. referencedClasses: [],
  1989. //>>excludeEnd("ide");
  1990. messageSends: []
  1991. }),
  1992. $globals.Package);
  1993. $core.addMethod(
  1994. $core.method({
  1995. selector: "basicTransport",
  1996. protocol: 'private',
  1997. fn: function (){
  1998. var self=this;
  1999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2000. return $core.withContext(function($ctx1) {
  2001. //>>excludeEnd("ctx");
  2002. return self.transport;
  2003. return self;
  2004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2005. }, function($ctx1) {$ctx1.fill(self,"basicTransport",{},$globals.Package)});
  2006. //>>excludeEnd("ctx");
  2007. },
  2008. //>>excludeStart("ide", pragmas.excludeIdeData);
  2009. args: [],
  2010. source: "basicTransport\x0a\x09\x22Answer the transport literal JavaScript object as setup in the JavaScript file, if any\x22\x0a\x09\x0a\x09<return self.transport>",
  2011. referencedClasses: [],
  2012. //>>excludeEnd("ide");
  2013. messageSends: []
  2014. }),
  2015. $globals.Package);
  2016. $core.addMethod(
  2017. $core.method({
  2018. selector: "beClean",
  2019. protocol: 'accessing',
  2020. fn: function (){
  2021. var self=this;
  2022. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2023. function $PackageClean(){return $globals.PackageClean||(typeof PackageClean=="undefined"?nil:PackageClean)}
  2024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2025. return $core.withContext(function($ctx1) {
  2026. //>>excludeEnd("ctx");
  2027. var $1,$2;
  2028. self["@dirty"]=false;
  2029. $1=$recv($PackageClean())._new();
  2030. $recv($1)._package_(self);
  2031. $2=$recv($1)._yourself();
  2032. $recv($recv($SystemAnnouncer())._current())._announce_($2);
  2033. return self;
  2034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2035. }, function($ctx1) {$ctx1.fill(self,"beClean",{},$globals.Package)});
  2036. //>>excludeEnd("ctx");
  2037. },
  2038. //>>excludeStart("ide", pragmas.excludeIdeData);
  2039. args: [],
  2040. source: "beClean\x0a\x09dirty := false.\x0a\x09\x0a\x09SystemAnnouncer current announce: (PackageClean new\x0a\x09\x09package: self;\x0a\x09\x09yourself)",
  2041. referencedClasses: ["SystemAnnouncer", "PackageClean"],
  2042. //>>excludeEnd("ide");
  2043. messageSends: ["announce:", "current", "package:", "new", "yourself"]
  2044. }),
  2045. $globals.Package);
  2046. $core.addMethod(
  2047. $core.method({
  2048. selector: "beDirty",
  2049. protocol: 'accessing',
  2050. fn: function (){
  2051. var self=this;
  2052. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2053. function $PackageDirty(){return $globals.PackageDirty||(typeof PackageDirty=="undefined"?nil:PackageDirty)}
  2054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2055. return $core.withContext(function($ctx1) {
  2056. //>>excludeEnd("ctx");
  2057. var $1,$2;
  2058. self["@dirty"]=true;
  2059. $1=$recv($PackageDirty())._new();
  2060. $recv($1)._package_(self);
  2061. $2=$recv($1)._yourself();
  2062. $recv($recv($SystemAnnouncer())._current())._announce_($2);
  2063. return self;
  2064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2065. }, function($ctx1) {$ctx1.fill(self,"beDirty",{},$globals.Package)});
  2066. //>>excludeEnd("ctx");
  2067. },
  2068. //>>excludeStart("ide", pragmas.excludeIdeData);
  2069. args: [],
  2070. source: "beDirty\x0a\x09dirty := true.\x0a\x09\x0a\x09SystemAnnouncer current announce: (PackageDirty new\x0a\x09\x09package: self;\x0a\x09\x09yourself)",
  2071. referencedClasses: ["SystemAnnouncer", "PackageDirty"],
  2072. //>>excludeEnd("ide");
  2073. messageSends: ["announce:", "current", "package:", "new", "yourself"]
  2074. }),
  2075. $globals.Package);
  2076. $core.addMethod(
  2077. $core.method({
  2078. selector: "classTemplate",
  2079. protocol: 'accessing',
  2080. fn: function (){
  2081. var self=this;
  2082. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  2083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2084. return $core.withContext(function($ctx1) {
  2085. //>>excludeEnd("ctx");
  2086. var $3,$4,$2,$5,$6,$7,$1;
  2087. $1=$recv($String())._streamContents_((function(stream){
  2088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2089. return $core.withContext(function($ctx2) {
  2090. //>>excludeEnd("ctx");
  2091. $recv(stream)._nextPutAll_("Object");
  2092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2093. $ctx2.sendIdx["nextPutAll:"]=1;
  2094. //>>excludeEnd("ctx");
  2095. $recv(stream)._nextPutAll_(" subclass: #NameOfSubclass");
  2096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2097. $ctx2.sendIdx["nextPutAll:"]=2;
  2098. //>>excludeEnd("ctx");
  2099. $3=$recv($String())._lf();
  2100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2101. $ctx2.sendIdx["lf"]=1;
  2102. //>>excludeEnd("ctx");
  2103. $4=$recv($String())._tab();
  2104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2105. $ctx2.sendIdx["tab"]=1;
  2106. //>>excludeEnd("ctx");
  2107. $2=$recv($3).__comma($4);
  2108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2109. $ctx2.sendIdx[","]=1;
  2110. //>>excludeEnd("ctx");
  2111. $recv(stream)._nextPutAll_($2);
  2112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2113. $ctx2.sendIdx["nextPutAll:"]=3;
  2114. //>>excludeEnd("ctx");
  2115. $5=$recv(stream)._nextPutAll_("instanceVariableNames: ''");
  2116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2117. $ctx2.sendIdx["nextPutAll:"]=4;
  2118. //>>excludeEnd("ctx");
  2119. $5;
  2120. $6=$recv("'".__comma($recv($String())._lf())).__comma($recv($String())._tab());
  2121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2122. $ctx2.sendIdx[","]=2;
  2123. //>>excludeEnd("ctx");
  2124. $recv(stream)._nextPutAll_($6);
  2125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2126. $ctx2.sendIdx["nextPutAll:"]=5;
  2127. //>>excludeEnd("ctx");
  2128. $recv(stream)._nextPutAll_("package: '");
  2129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2130. $ctx2.sendIdx["nextPutAll:"]=6;
  2131. //>>excludeEnd("ctx");
  2132. $recv(stream)._nextPutAll_(self._name());
  2133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2134. $ctx2.sendIdx["nextPutAll:"]=7;
  2135. //>>excludeEnd("ctx");
  2136. $7=$recv(stream)._nextPutAll_("'");
  2137. return $7;
  2138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2139. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  2140. //>>excludeEnd("ctx");
  2141. }));
  2142. return $1;
  2143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2144. }, function($ctx1) {$ctx1.fill(self,"classTemplate",{},$globals.Package)});
  2145. //>>excludeEnd("ctx");
  2146. },
  2147. //>>excludeStart("ide", pragmas.excludeIdeData);
  2148. args: [],
  2149. source: "classTemplate\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: 'Object';\x0a\x09\x09\x09nextPutAll: ' subclass: #NameOfSubclass';\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'instanceVariableNames: '''''.\x0a\x09\x09stream\x0a\x09\x09\x09nextPutAll: '''', String lf, String tab;\x0a\x09\x09\x09nextPutAll: 'package: ''';\x0a\x09\x09\x09nextPutAll: self name;\x0a\x09\x09\x09nextPutAll: '''' ]",
  2150. referencedClasses: ["String"],
  2151. //>>excludeEnd("ide");
  2152. messageSends: ["streamContents:", "nextPutAll:", ",", "lf", "tab", "name"]
  2153. }),
  2154. $globals.Package);
  2155. $core.addMethod(
  2156. $core.method({
  2157. selector: "classes",
  2158. protocol: 'classes',
  2159. fn: function (){
  2160. var self=this;
  2161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2162. return $core.withContext(function($ctx1) {
  2163. //>>excludeEnd("ctx");
  2164. var $1;
  2165. $1=$recv(self._organization())._elements();
  2166. return $1;
  2167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2168. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.Package)});
  2169. //>>excludeEnd("ctx");
  2170. },
  2171. //>>excludeStart("ide", pragmas.excludeIdeData);
  2172. args: [],
  2173. source: "classes\x0a\x09^ self organization elements",
  2174. referencedClasses: [],
  2175. //>>excludeEnd("ide");
  2176. messageSends: ["elements", "organization"]
  2177. }),
  2178. $globals.Package);
  2179. $core.addMethod(
  2180. $core.method({
  2181. selector: "definition",
  2182. protocol: 'accessing',
  2183. fn: function (){
  2184. var self=this;
  2185. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  2186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2187. return $core.withContext(function($ctx1) {
  2188. //>>excludeEnd("ctx");
  2189. var $2,$4,$5,$3,$7,$6,$8,$9,$1;
  2190. $1=$recv($String())._streamContents_((function(stream){
  2191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2192. return $core.withContext(function($ctx2) {
  2193. //>>excludeEnd("ctx");
  2194. $2=$recv(self._class())._name();
  2195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2196. $ctx2.sendIdx["name"]=1;
  2197. //>>excludeEnd("ctx");
  2198. $recv(stream)._nextPutAll_($2);
  2199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2200. $ctx2.sendIdx["nextPutAll:"]=1;
  2201. //>>excludeEnd("ctx");
  2202. $4=$recv($String())._lf();
  2203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2204. $ctx2.sendIdx["lf"]=1;
  2205. //>>excludeEnd("ctx");
  2206. $5=$recv($String())._tab();
  2207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2208. $ctx2.sendIdx["tab"]=1;
  2209. //>>excludeEnd("ctx");
  2210. $3=$recv($4).__comma($5);
  2211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2212. $ctx2.sendIdx[","]=1;
  2213. //>>excludeEnd("ctx");
  2214. $recv(stream)._nextPutAll_($3);
  2215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2216. $ctx2.sendIdx["nextPutAll:"]=2;
  2217. //>>excludeEnd("ctx");
  2218. $recv(stream)._nextPutAll_(" named: ");
  2219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2220. $ctx2.sendIdx["nextPutAll:"]=3;
  2221. //>>excludeEnd("ctx");
  2222. $7="'".__comma(self._name());
  2223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2224. $ctx2.sendIdx[","]=3;
  2225. //>>excludeEnd("ctx");
  2226. $6=$recv($7).__comma("'");
  2227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2228. $ctx2.sendIdx[","]=2;
  2229. //>>excludeEnd("ctx");
  2230. $recv(stream)._nextPutAll_($6);
  2231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2232. $ctx2.sendIdx["nextPutAll:"]=4;
  2233. //>>excludeEnd("ctx");
  2234. $8=$recv($recv($String())._lf()).__comma($recv($String())._tab());
  2235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2236. $ctx2.sendIdx[","]=4;
  2237. //>>excludeEnd("ctx");
  2238. $recv(stream)._nextPutAll_($8);
  2239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2240. $ctx2.sendIdx["nextPutAll:"]=5;
  2241. //>>excludeEnd("ctx");
  2242. $recv(stream)._nextPutAll_(" transport: (");
  2243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2244. $ctx2.sendIdx["nextPutAll:"]=6;
  2245. //>>excludeEnd("ctx");
  2246. $9=$recv(stream)._nextPutAll_($recv($recv(self._transport())._definition()).__comma(")"));
  2247. return $9;
  2248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2249. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  2250. //>>excludeEnd("ctx");
  2251. }));
  2252. return $1;
  2253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2254. }, function($ctx1) {$ctx1.fill(self,"definition",{},$globals.Package)});
  2255. //>>excludeEnd("ctx");
  2256. },
  2257. //>>excludeStart("ide", pragmas.excludeIdeData);
  2258. args: [],
  2259. source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09nextPutAll: self class name;\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: ' named: ';\x0a\x09\x09\x09nextPutAll: '''', self name, '''';\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: ' transport: (';\x0a\x09\x09\x09nextPutAll: self transport definition, ')' ]",
  2260. referencedClasses: ["String"],
  2261. //>>excludeEnd("ide");
  2262. messageSends: ["streamContents:", "nextPutAll:", "name", "class", ",", "lf", "tab", "definition", "transport"]
  2263. }),
  2264. $globals.Package);
  2265. $core.addMethod(
  2266. $core.method({
  2267. selector: "isDirty",
  2268. protocol: 'testing',
  2269. fn: function (){
  2270. var self=this;
  2271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2272. return $core.withContext(function($ctx1) {
  2273. //>>excludeEnd("ctx");
  2274. var $2,$1,$receiver;
  2275. $2=self["@dirty"];
  2276. if(($receiver = $2) == null || $receiver.isNil){
  2277. $1=false;
  2278. } else {
  2279. $1=$2;
  2280. };
  2281. return $1;
  2282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2283. }, function($ctx1) {$ctx1.fill(self,"isDirty",{},$globals.Package)});
  2284. //>>excludeEnd("ctx");
  2285. },
  2286. //>>excludeStart("ide", pragmas.excludeIdeData);
  2287. args: [],
  2288. source: "isDirty\x0a\x09^ dirty ifNil: [ false ]",
  2289. referencedClasses: [],
  2290. //>>excludeEnd("ide");
  2291. messageSends: ["ifNil:"]
  2292. }),
  2293. $globals.Package);
  2294. $core.addMethod(
  2295. $core.method({
  2296. selector: "isPackage",
  2297. protocol: 'testing',
  2298. fn: function (){
  2299. var self=this;
  2300. return true;
  2301. },
  2302. //>>excludeStart("ide", pragmas.excludeIdeData);
  2303. args: [],
  2304. source: "isPackage\x0a\x09^ true",
  2305. referencedClasses: [],
  2306. //>>excludeEnd("ide");
  2307. messageSends: []
  2308. }),
  2309. $globals.Package);
  2310. $core.addMethod(
  2311. $core.method({
  2312. selector: "loadDependencies",
  2313. protocol: 'dependencies',
  2314. fn: function (){
  2315. var self=this;
  2316. var classes,packages;
  2317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2318. return $core.withContext(function($ctx1) {
  2319. //>>excludeEnd("ctx");
  2320. var $2,$3,$1;
  2321. classes=self._loadDependencyClasses();
  2322. $2=$recv($recv(classes)._collect_((function(each){
  2323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2324. return $core.withContext(function($ctx2) {
  2325. //>>excludeEnd("ctx");
  2326. return $recv(each)._package();
  2327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2328. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2329. //>>excludeEnd("ctx");
  2330. })))._asSet();
  2331. $recv($2)._remove_ifAbsent_(self,(function(){
  2332. }));
  2333. $3=$recv($2)._yourself();
  2334. $1=$3;
  2335. return $1;
  2336. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2337. }, function($ctx1) {$ctx1.fill(self,"loadDependencies",{classes:classes,packages:packages},$globals.Package)});
  2338. //>>excludeEnd("ctx");
  2339. },
  2340. //>>excludeStart("ide", pragmas.excludeIdeData);
  2341. args: [],
  2342. source: "loadDependencies\x0a\x09\x22Returns list of packages that need to be loaded\x0a\x09before loading this package.\x22\x0a\x09\x0a\x09| classes packages |\x0a\x09classes := self loadDependencyClasses.\x0a\x09^ (classes collect: [ :each | each package ]) asSet\x0a\x09\x09remove: self ifAbsent: [];\x0a\x09\x09yourself",
  2343. referencedClasses: [],
  2344. //>>excludeEnd("ide");
  2345. messageSends: ["loadDependencyClasses", "remove:ifAbsent:", "asSet", "collect:", "package", "yourself"]
  2346. }),
  2347. $globals.Package);
  2348. $core.addMethod(
  2349. $core.method({
  2350. selector: "loadDependencyClasses",
  2351. protocol: 'dependencies',
  2352. fn: function (){
  2353. var self=this;
  2354. var starCategoryName;
  2355. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2357. return $core.withContext(function($ctx1) {
  2358. //>>excludeEnd("ctx");
  2359. var $4,$3,$2,$6,$5,$7,$1;
  2360. starCategoryName="*".__comma(self._name());
  2361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2362. $ctx1.sendIdx[","]=1;
  2363. //>>excludeEnd("ctx");
  2364. $4=self._classes();
  2365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2366. $ctx1.sendIdx["classes"]=1;
  2367. //>>excludeEnd("ctx");
  2368. $3=$recv($4)._collect_((function(each){
  2369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2370. return $core.withContext(function($ctx2) {
  2371. //>>excludeEnd("ctx");
  2372. return $recv(each)._superclass();
  2373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2374. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2375. //>>excludeEnd("ctx");
  2376. }));
  2377. $2=$recv($3)._asSet();
  2378. $recv($2)._remove_ifAbsent_(nil,(function(){
  2379. }));
  2380. $recv($2)._addAll_($recv($recv($Smalltalk())._classes())._select_((function(each){
  2381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2382. return $core.withContext(function($ctx2) {
  2383. //>>excludeEnd("ctx");
  2384. $6=$recv(each)._protocols();
  2385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2386. $ctx2.sendIdx["protocols"]=1;
  2387. //>>excludeEnd("ctx");
  2388. $5=$recv($6).__comma($recv($recv(each)._class())._protocols());
  2389. return $recv($5)._includes_(starCategoryName);
  2390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2391. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  2392. //>>excludeEnd("ctx");
  2393. })));
  2394. $7=$recv($2)._yourself();
  2395. $1=$7;
  2396. return $1;
  2397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2398. }, function($ctx1) {$ctx1.fill(self,"loadDependencyClasses",{starCategoryName:starCategoryName},$globals.Package)});
  2399. //>>excludeEnd("ctx");
  2400. },
  2401. //>>excludeStart("ide", pragmas.excludeIdeData);
  2402. args: [],
  2403. source: "loadDependencyClasses\x0a\x09\x22Returns classes needed at the time of loading a package.\x0a\x09These are all that are used to subclass\x0a\x09and to define an extension method\x22\x0a\x09\x0a\x09| starCategoryName |\x0a\x09starCategoryName := '*', self name.\x0a\x09^ (self classes collect: [ :each | each superclass ]) asSet\x0a\x09\x09remove: nil ifAbsent: [];\x0a\x09\x09addAll: (Smalltalk classes select: [ :each | each protocols, each class protocols includes: starCategoryName ]);\x0a\x09\x09yourself",
  2404. referencedClasses: ["Smalltalk"],
  2405. //>>excludeEnd("ide");
  2406. messageSends: [",", "name", "remove:ifAbsent:", "asSet", "collect:", "classes", "superclass", "addAll:", "select:", "includes:", "protocols", "class", "yourself"]
  2407. }),
  2408. $globals.Package);
  2409. $core.addMethod(
  2410. $core.method({
  2411. selector: "name",
  2412. protocol: 'accessing',
  2413. fn: function (){
  2414. var self=this;
  2415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2416. return $core.withContext(function($ctx1) {
  2417. //>>excludeEnd("ctx");
  2418. return self.pkgName;
  2419. return self;
  2420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2421. }, function($ctx1) {$ctx1.fill(self,"name",{},$globals.Package)});
  2422. //>>excludeEnd("ctx");
  2423. },
  2424. //>>excludeStart("ide", pragmas.excludeIdeData);
  2425. args: [],
  2426. source: "name\x0a\x09<return self.pkgName>",
  2427. referencedClasses: [],
  2428. //>>excludeEnd("ide");
  2429. messageSends: []
  2430. }),
  2431. $globals.Package);
  2432. $core.addMethod(
  2433. $core.method({
  2434. selector: "name:",
  2435. protocol: 'accessing',
  2436. fn: function (aString){
  2437. var self=this;
  2438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2439. return $core.withContext(function($ctx1) {
  2440. //>>excludeEnd("ctx");
  2441. self._basicName_(aString);
  2442. self._beDirty();
  2443. return self;
  2444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2445. }, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},$globals.Package)});
  2446. //>>excludeEnd("ctx");
  2447. },
  2448. //>>excludeStart("ide", pragmas.excludeIdeData);
  2449. args: ["aString"],
  2450. source: "name: aString\x0a\x09self basicName: aString.\x0a\x09self beDirty",
  2451. referencedClasses: [],
  2452. //>>excludeEnd("ide");
  2453. messageSends: ["basicName:", "beDirty"]
  2454. }),
  2455. $globals.Package);
  2456. $core.addMethod(
  2457. $core.method({
  2458. selector: "organization",
  2459. protocol: 'accessing',
  2460. fn: function (){
  2461. var self=this;
  2462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2463. return $core.withContext(function($ctx1) {
  2464. //>>excludeEnd("ctx");
  2465. var $1;
  2466. $1=self._basicAt_("organization");
  2467. return $1;
  2468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2469. }, function($ctx1) {$ctx1.fill(self,"organization",{},$globals.Package)});
  2470. //>>excludeEnd("ctx");
  2471. },
  2472. //>>excludeStart("ide", pragmas.excludeIdeData);
  2473. args: [],
  2474. source: "organization\x0a\x09^ self basicAt: 'organization'",
  2475. referencedClasses: [],
  2476. //>>excludeEnd("ide");
  2477. messageSends: ["basicAt:"]
  2478. }),
  2479. $globals.Package);
  2480. $core.addMethod(
  2481. $core.method({
  2482. selector: "printOn:",
  2483. protocol: 'printing',
  2484. fn: function (aStream){
  2485. var self=this;
  2486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2487. return $core.withContext(function($ctx1) {
  2488. //>>excludeEnd("ctx");
  2489. var $1;
  2490. (
  2491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2492. $ctx1.supercall = true,
  2493. //>>excludeEnd("ctx");
  2494. $globals.Package.superclass.fn.prototype._printOn_.apply($recv(self), [aStream]));
  2495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2496. $ctx1.supercall = false;
  2497. //>>excludeEnd("ctx");;
  2498. $recv(aStream)._nextPutAll_(" (");
  2499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2500. $ctx1.sendIdx["nextPutAll:"]=1;
  2501. //>>excludeEnd("ctx");
  2502. $recv(aStream)._nextPutAll_(self._name());
  2503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2504. $ctx1.sendIdx["nextPutAll:"]=2;
  2505. //>>excludeEnd("ctx");
  2506. $1=$recv(aStream)._nextPutAll_(")");
  2507. return self;
  2508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2509. }, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},$globals.Package)});
  2510. //>>excludeEnd("ctx");
  2511. },
  2512. //>>excludeStart("ide", pragmas.excludeIdeData);
  2513. args: ["aStream"],
  2514. source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream \x0a\x09\x09nextPutAll: ' (';\x0a\x09\x09nextPutAll: self name;\x0a\x09\x09nextPutAll: ')'",
  2515. referencedClasses: [],
  2516. //>>excludeEnd("ide");
  2517. messageSends: ["printOn:", "nextPutAll:", "name"]
  2518. }),
  2519. $globals.Package);
  2520. $core.addMethod(
  2521. $core.method({
  2522. selector: "setupClasses",
  2523. protocol: 'classes',
  2524. fn: function (){
  2525. var self=this;
  2526. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  2527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2528. return $core.withContext(function($ctx1) {
  2529. //>>excludeEnd("ctx");
  2530. var $1,$2;
  2531. $1=self._classes();
  2532. $recv($1)._do_((function(each){
  2533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2534. return $core.withContext(function($ctx2) {
  2535. //>>excludeEnd("ctx");
  2536. return $recv($recv($ClassBuilder())._new())._setupClass_(each);
  2537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2538. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2539. //>>excludeEnd("ctx");
  2540. }));
  2541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2542. $ctx1.sendIdx["do:"]=1;
  2543. //>>excludeEnd("ctx");
  2544. $2=$recv($1)._do_((function(each){
  2545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2546. return $core.withContext(function($ctx2) {
  2547. //>>excludeEnd("ctx");
  2548. return $recv(each)._initialize();
  2549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2550. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2551. //>>excludeEnd("ctx");
  2552. }));
  2553. return self;
  2554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2555. }, function($ctx1) {$ctx1.fill(self,"setupClasses",{},$globals.Package)});
  2556. //>>excludeEnd("ctx");
  2557. },
  2558. //>>excludeStart("ide", pragmas.excludeIdeData);
  2559. args: [],
  2560. source: "setupClasses\x0a\x09self classes\x0a\x09\x09do: [ :each | ClassBuilder new setupClass: each ];\x0a\x09\x09do: [ :each | each initialize ]",
  2561. referencedClasses: ["ClassBuilder"],
  2562. //>>excludeEnd("ide");
  2563. messageSends: ["do:", "classes", "setupClass:", "new", "initialize"]
  2564. }),
  2565. $globals.Package);
  2566. $core.addMethod(
  2567. $core.method({
  2568. selector: "sortedClasses",
  2569. protocol: 'classes',
  2570. fn: function (){
  2571. var self=this;
  2572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2573. return $core.withContext(function($ctx1) {
  2574. //>>excludeEnd("ctx");
  2575. var $1;
  2576. $1=$recv(self._class())._sortedClasses_(self._classes());
  2577. return $1;
  2578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2579. }, function($ctx1) {$ctx1.fill(self,"sortedClasses",{},$globals.Package)});
  2580. //>>excludeEnd("ctx");
  2581. },
  2582. //>>excludeStart("ide", pragmas.excludeIdeData);
  2583. args: [],
  2584. source: "sortedClasses\x0a\x09\x22Answer all classes in the receiver, sorted by superclass/subclasses and by class name for common subclasses (Issue #143).\x22\x0a\x0a\x09^ self class sortedClasses: self classes",
  2585. referencedClasses: [],
  2586. //>>excludeEnd("ide");
  2587. messageSends: ["sortedClasses:", "class", "classes"]
  2588. }),
  2589. $globals.Package);
  2590. $core.addMethod(
  2591. $core.method({
  2592. selector: "transport",
  2593. protocol: 'accessing',
  2594. fn: function (){
  2595. var self=this;
  2596. function $PackageTransport(){return $globals.PackageTransport||(typeof PackageTransport=="undefined"?nil:PackageTransport)}
  2597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2598. return $core.withContext(function($ctx1) {
  2599. //>>excludeEnd("ctx");
  2600. var $2,$3,$4,$1,$receiver;
  2601. $2=self["@transport"];
  2602. if(($receiver = $2) == null || $receiver.isNil){
  2603. $3=$recv($PackageTransport())._fromJson_(self._basicTransport());
  2604. $recv($3)._package_(self);
  2605. $4=$recv($3)._yourself();
  2606. self["@transport"]=$4;
  2607. $1=self["@transport"];
  2608. } else {
  2609. $1=$2;
  2610. };
  2611. return $1;
  2612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2613. }, function($ctx1) {$ctx1.fill(self,"transport",{},$globals.Package)});
  2614. //>>excludeEnd("ctx");
  2615. },
  2616. //>>excludeStart("ide", pragmas.excludeIdeData);
  2617. args: [],
  2618. source: "transport\x0a\x09^ transport ifNil: [ \x0a\x09\x09transport := (PackageTransport fromJson: self basicTransport)\x0a\x09\x09\x09package: self;\x0a\x09\x09\x09yourself ]",
  2619. referencedClasses: ["PackageTransport"],
  2620. //>>excludeEnd("ide");
  2621. messageSends: ["ifNil:", "package:", "fromJson:", "basicTransport", "yourself"]
  2622. }),
  2623. $globals.Package);
  2624. $core.addMethod(
  2625. $core.method({
  2626. selector: "transport:",
  2627. protocol: 'accessing',
  2628. fn: function (aPackageTransport){
  2629. var self=this;
  2630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2631. return $core.withContext(function($ctx1) {
  2632. //>>excludeEnd("ctx");
  2633. self["@transport"]=aPackageTransport;
  2634. $recv(aPackageTransport)._package_(self);
  2635. return self;
  2636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2637. }, function($ctx1) {$ctx1.fill(self,"transport:",{aPackageTransport:aPackageTransport},$globals.Package)});
  2638. //>>excludeEnd("ctx");
  2639. },
  2640. //>>excludeStart("ide", pragmas.excludeIdeData);
  2641. args: ["aPackageTransport"],
  2642. source: "transport: aPackageTransport\x0a\x09transport := aPackageTransport.\x0a\x09aPackageTransport package: self",
  2643. referencedClasses: [],
  2644. //>>excludeEnd("ide");
  2645. messageSends: ["package:"]
  2646. }),
  2647. $globals.Package);
  2648. $globals.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  2649. $core.addMethod(
  2650. $core.method({
  2651. selector: "named:",
  2652. protocol: 'accessing',
  2653. fn: function (aPackageName){
  2654. var self=this;
  2655. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2657. return $core.withContext(function($ctx1) {
  2658. //>>excludeEnd("ctx");
  2659. var $1;
  2660. $1=$recv($Smalltalk())._packageAt_ifAbsent_(aPackageName,(function(){
  2661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2662. return $core.withContext(function($ctx2) {
  2663. //>>excludeEnd("ctx");
  2664. return $recv($Smalltalk())._createPackage_(aPackageName);
  2665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2666. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2667. //>>excludeEnd("ctx");
  2668. }));
  2669. return $1;
  2670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2671. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},$globals.Package.klass)});
  2672. //>>excludeEnd("ctx");
  2673. },
  2674. //>>excludeStart("ide", pragmas.excludeIdeData);
  2675. args: ["aPackageName"],
  2676. source: "named: aPackageName\x0a\x09^ Smalltalk \x0a\x09\x09packageAt: aPackageName\x0a\x09\x09ifAbsent: [ \x0a\x09\x09\x09Smalltalk createPackage: aPackageName ]",
  2677. referencedClasses: ["Smalltalk"],
  2678. //>>excludeEnd("ide");
  2679. messageSends: ["packageAt:ifAbsent:", "createPackage:"]
  2680. }),
  2681. $globals.Package.klass);
  2682. $core.addMethod(
  2683. $core.method({
  2684. selector: "named:ifAbsent:",
  2685. protocol: 'accessing',
  2686. fn: function (aPackageName,aBlock){
  2687. var self=this;
  2688. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2690. return $core.withContext(function($ctx1) {
  2691. //>>excludeEnd("ctx");
  2692. var $1;
  2693. $1=$recv($Smalltalk())._packageAt_ifAbsent_(aPackageName,aBlock);
  2694. return $1;
  2695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2696. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},$globals.Package.klass)});
  2697. //>>excludeEnd("ctx");
  2698. },
  2699. //>>excludeStart("ide", pragmas.excludeIdeData);
  2700. args: ["aPackageName", "aBlock"],
  2701. source: "named: aPackageName ifAbsent: aBlock\x0a\x09^ Smalltalk packageAt: aPackageName ifAbsent: aBlock",
  2702. referencedClasses: ["Smalltalk"],
  2703. //>>excludeEnd("ide");
  2704. messageSends: ["packageAt:ifAbsent:"]
  2705. }),
  2706. $globals.Package.klass);
  2707. $core.addMethod(
  2708. $core.method({
  2709. selector: "named:transport:",
  2710. protocol: 'accessing',
  2711. fn: function (aPackageName,aTransport){
  2712. var self=this;
  2713. var package_;
  2714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2715. return $core.withContext(function($ctx1) {
  2716. //>>excludeEnd("ctx");
  2717. var $1;
  2718. package_=self._named_(aPackageName);
  2719. $recv(package_)._transport_(aTransport);
  2720. $1=package_;
  2721. return $1;
  2722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2723. }, function($ctx1) {$ctx1.fill(self,"named:transport:",{aPackageName:aPackageName,aTransport:aTransport,package_:package_},$globals.Package.klass)});
  2724. //>>excludeEnd("ctx");
  2725. },
  2726. //>>excludeStart("ide", pragmas.excludeIdeData);
  2727. args: ["aPackageName", "aTransport"],
  2728. source: "named: aPackageName transport: aTransport\x0a\x09| package |\x0a\x09\x0a\x09package := self named: aPackageName.\x0a\x09package transport: aTransport.\x0a\x09\x0a\x09^ package",
  2729. referencedClasses: [],
  2730. //>>excludeEnd("ide");
  2731. messageSends: ["named:", "transport:"]
  2732. }),
  2733. $globals.Package.klass);
  2734. $core.addMethod(
  2735. $core.method({
  2736. selector: "sortedClasses:",
  2737. protocol: 'sorting',
  2738. fn: function (classes){
  2739. var self=this;
  2740. var children,others,nodes,expandedClasses;
  2741. function $ClassSorterNode(){return $globals.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  2742. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  2743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2744. return $core.withContext(function($ctx1) {
  2745. //>>excludeEnd("ctx");
  2746. var $1,$3,$2,$4;
  2747. children=[];
  2748. others=[];
  2749. $recv(classes)._do_((function(each){
  2750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2751. return $core.withContext(function($ctx2) {
  2752. //>>excludeEnd("ctx");
  2753. $1=$recv(classes)._includes_($recv(each)._superclass());
  2754. if($core.assert($1)){
  2755. return $recv(others)._add_(each);
  2756. } else {
  2757. return $recv(children)._add_(each);
  2758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2759. $ctx2.sendIdx["add:"]=1;
  2760. //>>excludeEnd("ctx");
  2761. };
  2762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2763. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2764. //>>excludeEnd("ctx");
  2765. }));
  2766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2767. $ctx1.sendIdx["do:"]=1;
  2768. //>>excludeEnd("ctx");
  2769. nodes=$recv(children)._collect_((function(each){
  2770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2771. return $core.withContext(function($ctx2) {
  2772. //>>excludeEnd("ctx");
  2773. return $recv($ClassSorterNode())._on_classes_level_(each,others,(0));
  2774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2775. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  2776. //>>excludeEnd("ctx");
  2777. }));
  2778. nodes=$recv(nodes)._sorted_((function(a,b){
  2779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2780. return $core.withContext(function($ctx2) {
  2781. //>>excludeEnd("ctx");
  2782. $3=$recv(a)._theClass();
  2783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2784. $ctx2.sendIdx["theClass"]=1;
  2785. //>>excludeEnd("ctx");
  2786. $2=$recv($3)._name();
  2787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2788. $ctx2.sendIdx["name"]=1;
  2789. //>>excludeEnd("ctx");
  2790. return $recv($2).__lt_eq($recv($recv(b)._theClass())._name());
  2791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2792. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,5)});
  2793. //>>excludeEnd("ctx");
  2794. }));
  2795. expandedClasses=$recv($Array())._new();
  2796. $recv(nodes)._do_((function(aNode){
  2797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2798. return $core.withContext(function($ctx2) {
  2799. //>>excludeEnd("ctx");
  2800. return $recv(aNode)._traverseClassesWith_(expandedClasses);
  2801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2802. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,6)});
  2803. //>>excludeEnd("ctx");
  2804. }));
  2805. $4=expandedClasses;
  2806. return $4;
  2807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2808. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},$globals.Package.klass)});
  2809. //>>excludeEnd("ctx");
  2810. },
  2811. //>>excludeStart("ide", pragmas.excludeIdeData);
  2812. args: ["classes"],
  2813. source: "sortedClasses: classes\x0a\x09\x22Answer classes, sorted by superclass/subclasses and by class name for common subclasses (Issue #143)\x22\x0a\x0a\x09| children others nodes expandedClasses |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09classes do: [ :each |\x0a\x09\x09(classes includes: each superclass)\x0a\x09\x09\x09ifFalse: [ children add: each ]\x0a\x09\x09\x09ifTrue: [ others add: each ]].\x0a\x09nodes := children collect: [ :each |\x0a\x09\x09ClassSorterNode on: each classes: others level: 0 ].\x0a\x09nodes := nodes sorted: [ :a :b | a theClass name <= b theClass name ].\x0a\x09expandedClasses := Array new.\x0a\x09nodes do: [ :aNode |\x0a\x09\x09aNode traverseClassesWith: expandedClasses ].\x0a\x09^ expandedClasses",
  2814. referencedClasses: ["ClassSorterNode", "Array"],
  2815. //>>excludeEnd("ide");
  2816. messageSends: ["do:", "ifFalse:ifTrue:", "includes:", "superclass", "add:", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"]
  2817. }),
  2818. $globals.Package.klass);
  2819. $core.addClass('PackageStateObserver', $globals.Object, [], 'Kernel-Infrastructure');
  2820. //>>excludeStart("ide", pragmas.excludeIdeData);
  2821. $globals.PackageStateObserver.comment="My current instance listens for any changes in the system that might affect the state of a package (being dirty).";
  2822. //>>excludeEnd("ide");
  2823. $core.addMethod(
  2824. $core.method({
  2825. selector: "announcer",
  2826. protocol: 'accessing',
  2827. fn: function (){
  2828. var self=this;
  2829. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  2830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2831. return $core.withContext(function($ctx1) {
  2832. //>>excludeEnd("ctx");
  2833. var $1;
  2834. $1=$recv($SystemAnnouncer())._current();
  2835. return $1;
  2836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2837. }, function($ctx1) {$ctx1.fill(self,"announcer",{},$globals.PackageStateObserver)});
  2838. //>>excludeEnd("ctx");
  2839. },
  2840. //>>excludeStart("ide", pragmas.excludeIdeData);
  2841. args: [],
  2842. source: "announcer\x0a\x09^ SystemAnnouncer current",
  2843. referencedClasses: ["SystemAnnouncer"],
  2844. //>>excludeEnd("ide");
  2845. messageSends: ["current"]
  2846. }),
  2847. $globals.PackageStateObserver);
  2848. $core.addMethod(
  2849. $core.method({
  2850. selector: "observeSystem",
  2851. protocol: 'actions',
  2852. fn: function (){
  2853. var self=this;
  2854. function $PackageAdded(){return $globals.PackageAdded||(typeof PackageAdded=="undefined"?nil:PackageAdded)}
  2855. function $ClassAnnouncement(){return $globals.ClassAnnouncement||(typeof ClassAnnouncement=="undefined"?nil:ClassAnnouncement)}
  2856. function $MethodAnnouncement(){return $globals.MethodAnnouncement||(typeof MethodAnnouncement=="undefined"?nil:MethodAnnouncement)}
  2857. function $ProtocolAnnouncement(){return $globals.ProtocolAnnouncement||(typeof ProtocolAnnouncement=="undefined"?nil:ProtocolAnnouncement)}
  2858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2859. return $core.withContext(function($ctx1) {
  2860. //>>excludeEnd("ctx");
  2861. var $1,$2;
  2862. $1=self._announcer();
  2863. $recv($1)._on_send_to_($PackageAdded(),"onPackageAdded:",self);
  2864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2865. $ctx1.sendIdx["on:send:to:"]=1;
  2866. //>>excludeEnd("ctx");
  2867. $recv($1)._on_send_to_($ClassAnnouncement(),"onClassModification:",self);
  2868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2869. $ctx1.sendIdx["on:send:to:"]=2;
  2870. //>>excludeEnd("ctx");
  2871. $recv($1)._on_send_to_($MethodAnnouncement(),"onMethodModification:",self);
  2872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2873. $ctx1.sendIdx["on:send:to:"]=3;
  2874. //>>excludeEnd("ctx");
  2875. $2=$recv($1)._on_send_to_($ProtocolAnnouncement(),"onProtocolModification:",self);
  2876. return self;
  2877. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2878. }, function($ctx1) {$ctx1.fill(self,"observeSystem",{},$globals.PackageStateObserver)});
  2879. //>>excludeEnd("ctx");
  2880. },
  2881. //>>excludeStart("ide", pragmas.excludeIdeData);
  2882. args: [],
  2883. source: "observeSystem\x0a\x09self announcer\x0a\x09\x09on: PackageAdded\x0a\x09\x09send: #onPackageAdded:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: ClassAnnouncement\x0a\x09\x09send: #onClassModification:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: MethodAnnouncement\x0a\x09\x09send: #onMethodModification:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: ProtocolAnnouncement\x0a\x09\x09send: #onProtocolModification:\x0a\x09\x09to: self",
  2884. referencedClasses: ["PackageAdded", "ClassAnnouncement", "MethodAnnouncement", "ProtocolAnnouncement"],
  2885. //>>excludeEnd("ide");
  2886. messageSends: ["on:send:to:", "announcer"]
  2887. }),
  2888. $globals.PackageStateObserver);
  2889. $core.addMethod(
  2890. $core.method({
  2891. selector: "onClassModification:",
  2892. protocol: 'reactions',
  2893. fn: function (anAnnouncement){
  2894. var self=this;
  2895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2896. return $core.withContext(function($ctx1) {
  2897. //>>excludeEnd("ctx");
  2898. var $1,$receiver;
  2899. $1=$recv(anAnnouncement)._theClass();
  2900. if(($receiver = $1) == null || $receiver.isNil){
  2901. $1;
  2902. } else {
  2903. var theClass;
  2904. theClass=$receiver;
  2905. $recv($recv(theClass)._package())._beDirty();
  2906. };
  2907. return self;
  2908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2909. }, function($ctx1) {$ctx1.fill(self,"onClassModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2910. //>>excludeEnd("ctx");
  2911. },
  2912. //>>excludeStart("ide", pragmas.excludeIdeData);
  2913. args: ["anAnnouncement"],
  2914. source: "onClassModification: anAnnouncement\x0a\x09anAnnouncement theClass ifNotNil: [ :theClass | theClass package beDirty ]",
  2915. referencedClasses: [],
  2916. //>>excludeEnd("ide");
  2917. messageSends: ["ifNotNil:", "theClass", "beDirty", "package"]
  2918. }),
  2919. $globals.PackageStateObserver);
  2920. $core.addMethod(
  2921. $core.method({
  2922. selector: "onMethodModification:",
  2923. protocol: 'reactions',
  2924. fn: function (anAnnouncement){
  2925. var self=this;
  2926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2927. return $core.withContext(function($ctx1) {
  2928. //>>excludeEnd("ctx");
  2929. var $1,$receiver;
  2930. $1=$recv($recv(anAnnouncement)._method())._package();
  2931. if(($receiver = $1) == null || $receiver.isNil){
  2932. $1;
  2933. } else {
  2934. var package_;
  2935. package_=$receiver;
  2936. $recv(package_)._beDirty();
  2937. };
  2938. return self;
  2939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2940. }, function($ctx1) {$ctx1.fill(self,"onMethodModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2941. //>>excludeEnd("ctx");
  2942. },
  2943. //>>excludeStart("ide", pragmas.excludeIdeData);
  2944. args: ["anAnnouncement"],
  2945. source: "onMethodModification: anAnnouncement\x0a\x09anAnnouncement method package ifNotNil: [ :package | package beDirty ]",
  2946. referencedClasses: [],
  2947. //>>excludeEnd("ide");
  2948. messageSends: ["ifNotNil:", "package", "method", "beDirty"]
  2949. }),
  2950. $globals.PackageStateObserver);
  2951. $core.addMethod(
  2952. $core.method({
  2953. selector: "onPackageAdded:",
  2954. protocol: 'reactions',
  2955. fn: function (anAnnouncement){
  2956. var self=this;
  2957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2958. return $core.withContext(function($ctx1) {
  2959. //>>excludeEnd("ctx");
  2960. $recv($recv(anAnnouncement)._package())._beDirty();
  2961. return self;
  2962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2963. }, function($ctx1) {$ctx1.fill(self,"onPackageAdded:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2964. //>>excludeEnd("ctx");
  2965. },
  2966. //>>excludeStart("ide", pragmas.excludeIdeData);
  2967. args: ["anAnnouncement"],
  2968. source: "onPackageAdded: anAnnouncement\x0a\x09anAnnouncement package beDirty",
  2969. referencedClasses: [],
  2970. //>>excludeEnd("ide");
  2971. messageSends: ["beDirty", "package"]
  2972. }),
  2973. $globals.PackageStateObserver);
  2974. $core.addMethod(
  2975. $core.method({
  2976. selector: "onProtocolModification:",
  2977. protocol: 'reactions',
  2978. fn: function (anAnnouncement){
  2979. var self=this;
  2980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2981. return $core.withContext(function($ctx1) {
  2982. //>>excludeEnd("ctx");
  2983. var $1,$receiver;
  2984. $1=$recv(anAnnouncement)._package();
  2985. if(($receiver = $1) == null || $receiver.isNil){
  2986. $1;
  2987. } else {
  2988. var package_;
  2989. package_=$receiver;
  2990. $recv(package_)._beDirty();
  2991. };
  2992. return self;
  2993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2994. }, function($ctx1) {$ctx1.fill(self,"onProtocolModification:",{anAnnouncement:anAnnouncement},$globals.PackageStateObserver)});
  2995. //>>excludeEnd("ctx");
  2996. },
  2997. //>>excludeStart("ide", pragmas.excludeIdeData);
  2998. args: ["anAnnouncement"],
  2999. source: "onProtocolModification: anAnnouncement\x0a\x09anAnnouncement package ifNotNil: [ :package | package beDirty ]",
  3000. referencedClasses: [],
  3001. //>>excludeEnd("ide");
  3002. messageSends: ["ifNotNil:", "package", "beDirty"]
  3003. }),
  3004. $globals.PackageStateObserver);
  3005. $globals.PackageStateObserver.klass.iVarNames = ['current'];
  3006. $core.addMethod(
  3007. $core.method({
  3008. selector: "current",
  3009. protocol: 'accessing',
  3010. fn: function (){
  3011. var self=this;
  3012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3013. return $core.withContext(function($ctx1) {
  3014. //>>excludeEnd("ctx");
  3015. var $2,$1,$receiver;
  3016. $2=self["@current"];
  3017. if(($receiver = $2) == null || $receiver.isNil){
  3018. self["@current"]=self._new();
  3019. $1=self["@current"];
  3020. } else {
  3021. $1=$2;
  3022. };
  3023. return $1;
  3024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3025. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.PackageStateObserver.klass)});
  3026. //>>excludeEnd("ctx");
  3027. },
  3028. //>>excludeStart("ide", pragmas.excludeIdeData);
  3029. args: [],
  3030. source: "current\x0a\x09^ current ifNil: [ current := self new ]",
  3031. referencedClasses: [],
  3032. //>>excludeEnd("ide");
  3033. messageSends: ["ifNil:", "new"]
  3034. }),
  3035. $globals.PackageStateObserver.klass);
  3036. $core.addMethod(
  3037. $core.method({
  3038. selector: "initialize",
  3039. protocol: 'initialization',
  3040. fn: function (){
  3041. var self=this;
  3042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3043. return $core.withContext(function($ctx1) {
  3044. //>>excludeEnd("ctx");
  3045. $recv(self._current())._observeSystem();
  3046. return self;
  3047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3048. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.PackageStateObserver.klass)});
  3049. //>>excludeEnd("ctx");
  3050. },
  3051. //>>excludeStart("ide", pragmas.excludeIdeData);
  3052. args: [],
  3053. source: "initialize\x0a\x09self current observeSystem",
  3054. referencedClasses: [],
  3055. //>>excludeEnd("ide");
  3056. messageSends: ["observeSystem", "current"]
  3057. }),
  3058. $globals.PackageStateObserver.klass);
  3059. $core.addClass('PlatformInterface', $globals.Object, [], 'Kernel-Infrastructure');
  3060. //>>excludeStart("ide", pragmas.excludeIdeData);
  3061. $globals.PlatformInterface.comment="I am single entry point to UI and environment interface.\x0aMy `initialize` tries several options (for now, browser environment only) to set myself up.\x0a\x0a## API\x0a\x0a PlatformInterface alert: 'Hey, there is a problem'.\x0a PlatformInterface confirm: 'Affirmative?'.\x0a PlatformInterface prompt: 'Your name:'.\x0a\x0a PlatformInterface ajax: #{\x0a 'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a }.";
  3062. //>>excludeEnd("ide");
  3063. $globals.PlatformInterface.klass.iVarNames = ['worker'];
  3064. $core.addMethod(
  3065. $core.method({
  3066. selector: "ajax:",
  3067. protocol: 'actions',
  3068. fn: function (anObject){
  3069. var self=this;
  3070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3071. return $core.withContext(function($ctx1) {
  3072. //>>excludeEnd("ctx");
  3073. var $2,$1,$receiver;
  3074. $2=self["@worker"];
  3075. if(($receiver = $2) == null || $receiver.isNil){
  3076. $1=self._error_("ajax: not available");
  3077. } else {
  3078. $1=$recv(self["@worker"])._ajax_(anObject);
  3079. };
  3080. return $1;
  3081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3082. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},$globals.PlatformInterface.klass)});
  3083. //>>excludeEnd("ctx");
  3084. },
  3085. //>>excludeStart("ide", pragmas.excludeIdeData);
  3086. args: ["anObject"],
  3087. source: "ajax: anObject\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker ajax: anObject ]\x0a\x09\x09ifNil: [ self error: 'ajax: not available' ]",
  3088. referencedClasses: [],
  3089. //>>excludeEnd("ide");
  3090. messageSends: ["ifNotNil:ifNil:", "ajax:", "error:"]
  3091. }),
  3092. $globals.PlatformInterface.klass);
  3093. $core.addMethod(
  3094. $core.method({
  3095. selector: "alert:",
  3096. protocol: 'actions',
  3097. fn: function (aString){
  3098. var self=this;
  3099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3100. return $core.withContext(function($ctx1) {
  3101. //>>excludeEnd("ctx");
  3102. var $2,$1,$receiver;
  3103. $2=self["@worker"];
  3104. if(($receiver = $2) == null || $receiver.isNil){
  3105. $1=self._error_("alert: not available");
  3106. } else {
  3107. $1=$recv(self["@worker"])._alert_(aString);
  3108. };
  3109. return $1;
  3110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3111. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},$globals.PlatformInterface.klass)});
  3112. //>>excludeEnd("ctx");
  3113. },
  3114. //>>excludeStart("ide", pragmas.excludeIdeData);
  3115. args: ["aString"],
  3116. source: "alert: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker alert: aString ]\x0a\x09\x09ifNil: [ self error: 'alert: not available' ]",
  3117. referencedClasses: [],
  3118. //>>excludeEnd("ide");
  3119. messageSends: ["ifNotNil:ifNil:", "alert:", "error:"]
  3120. }),
  3121. $globals.PlatformInterface.klass);
  3122. $core.addMethod(
  3123. $core.method({
  3124. selector: "confirm:",
  3125. protocol: 'actions',
  3126. fn: function (aString){
  3127. var self=this;
  3128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3129. return $core.withContext(function($ctx1) {
  3130. //>>excludeEnd("ctx");
  3131. var $2,$1,$receiver;
  3132. $2=self["@worker"];
  3133. if(($receiver = $2) == null || $receiver.isNil){
  3134. $1=self._error_("confirm: not available");
  3135. } else {
  3136. $1=$recv(self["@worker"])._confirm_(aString);
  3137. };
  3138. return $1;
  3139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3140. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},$globals.PlatformInterface.klass)});
  3141. //>>excludeEnd("ctx");
  3142. },
  3143. //>>excludeStart("ide", pragmas.excludeIdeData);
  3144. args: ["aString"],
  3145. source: "confirm: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker confirm: aString ]\x0a\x09\x09ifNil: [ self error: 'confirm: not available' ]",
  3146. referencedClasses: [],
  3147. //>>excludeEnd("ide");
  3148. messageSends: ["ifNotNil:ifNil:", "confirm:", "error:"]
  3149. }),
  3150. $globals.PlatformInterface.klass);
  3151. $core.addMethod(
  3152. $core.method({
  3153. selector: "existsGlobal:",
  3154. protocol: 'actions',
  3155. fn: function (aString){
  3156. var self=this;
  3157. function $PlatformInterface(){return $globals.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  3158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3159. return $core.withContext(function($ctx1) {
  3160. //>>excludeEnd("ctx");
  3161. var $1;
  3162. $1=$recv($recv($PlatformInterface())._globals())._at_ifPresent_ifAbsent_(aString,(function(){
  3163. return true;
  3164. }),(function(){
  3165. return false;
  3166. }));
  3167. return $1;
  3168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3169. }, function($ctx1) {$ctx1.fill(self,"existsGlobal:",{aString:aString},$globals.PlatformInterface.klass)});
  3170. //>>excludeEnd("ctx");
  3171. },
  3172. //>>excludeStart("ide", pragmas.excludeIdeData);
  3173. args: ["aString"],
  3174. source: "existsGlobal: aString\x0a\x09^ PlatformInterface globals \x0a\x09\x09at: aString \x0a\x09\x09ifPresent: [ true ] \x0a\x09\x09ifAbsent: [ false ]",
  3175. referencedClasses: ["PlatformInterface"],
  3176. //>>excludeEnd("ide");
  3177. messageSends: ["at:ifPresent:ifAbsent:", "globals"]
  3178. }),
  3179. $globals.PlatformInterface.klass);
  3180. $core.addMethod(
  3181. $core.method({
  3182. selector: "globals",
  3183. protocol: 'accessing',
  3184. fn: function (){
  3185. var self=this;
  3186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3187. return $core.withContext(function($ctx1) {
  3188. //>>excludeEnd("ctx");
  3189. return (new Function('return this'))();;
  3190. return self;
  3191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3192. }, function($ctx1) {$ctx1.fill(self,"globals",{},$globals.PlatformInterface.klass)});
  3193. //>>excludeEnd("ctx");
  3194. },
  3195. //>>excludeStart("ide", pragmas.excludeIdeData);
  3196. args: [],
  3197. source: "globals\x0a\x09<return (new Function('return this'))();>",
  3198. referencedClasses: [],
  3199. //>>excludeEnd("ide");
  3200. messageSends: []
  3201. }),
  3202. $globals.PlatformInterface.klass);
  3203. $core.addMethod(
  3204. $core.method({
  3205. selector: "initialize",
  3206. protocol: 'initialization',
  3207. fn: function (){
  3208. var self=this;
  3209. var candidate;
  3210. function $BrowserInterface(){return $globals.BrowserInterface||(typeof BrowserInterface=="undefined"?nil:BrowserInterface)}
  3211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3212. return $core.withContext(function($ctx1) {
  3213. //>>excludeEnd("ctx");
  3214. var $1,$receiver;
  3215. (
  3216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3217. $ctx1.supercall = true,
  3218. //>>excludeEnd("ctx");
  3219. $globals.PlatformInterface.klass.superclass.fn.prototype._initialize.apply($recv(self), []));
  3220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3221. $ctx1.supercall = false;
  3222. //>>excludeEnd("ctx");;
  3223. if(($receiver = $BrowserInterface()) == null || $receiver.isNil){
  3224. $BrowserInterface();
  3225. } else {
  3226. candidate=$recv($BrowserInterface())._new();
  3227. candidate;
  3228. $1=$recv(candidate)._isAvailable();
  3229. if($core.assert($1)){
  3230. self._setWorker_(candidate);
  3231. return self;
  3232. };
  3233. };
  3234. return self;
  3235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3236. }, function($ctx1) {$ctx1.fill(self,"initialize",{candidate:candidate},$globals.PlatformInterface.klass)});
  3237. //>>excludeEnd("ctx");
  3238. },
  3239. //>>excludeStart("ide", pragmas.excludeIdeData);
  3240. args: [],
  3241. source: "initialize\x0a\x09| candidate |\x0a\x09\x0a\x09super initialize.\x0a\x09\x0a\x09BrowserInterface ifNotNil: [\x0a\x09\x09candidate := BrowserInterface new.\x0a\x09\x09candidate isAvailable ifTrue: [ self setWorker: candidate. ^ self ]\x0a\x09]",
  3242. referencedClasses: ["BrowserInterface"],
  3243. //>>excludeEnd("ide");
  3244. messageSends: ["initialize", "ifNotNil:", "new", "ifTrue:", "isAvailable", "setWorker:"]
  3245. }),
  3246. $globals.PlatformInterface.klass);
  3247. $core.addMethod(
  3248. $core.method({
  3249. selector: "prompt:",
  3250. protocol: 'actions',
  3251. fn: function (aString){
  3252. var self=this;
  3253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3254. return $core.withContext(function($ctx1) {
  3255. //>>excludeEnd("ctx");
  3256. var $2,$1,$receiver;
  3257. $2=self["@worker"];
  3258. if(($receiver = $2) == null || $receiver.isNil){
  3259. $1=self._error_("prompt: not available");
  3260. } else {
  3261. $1=$recv(self["@worker"])._prompt_(aString);
  3262. };
  3263. return $1;
  3264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3265. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},$globals.PlatformInterface.klass)});
  3266. //>>excludeEnd("ctx");
  3267. },
  3268. //>>excludeStart("ide", pragmas.excludeIdeData);
  3269. args: ["aString"],
  3270. source: "prompt: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker prompt: aString ]\x0a\x09\x09ifNil: [ self error: 'prompt: not available' ]",
  3271. referencedClasses: [],
  3272. //>>excludeEnd("ide");
  3273. messageSends: ["ifNotNil:ifNil:", "prompt:", "error:"]
  3274. }),
  3275. $globals.PlatformInterface.klass);
  3276. $core.addMethod(
  3277. $core.method({
  3278. selector: "prompt:default:",
  3279. protocol: 'actions',
  3280. fn: function (aString,defaultString){
  3281. var self=this;
  3282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3283. return $core.withContext(function($ctx1) {
  3284. //>>excludeEnd("ctx");
  3285. var $2,$1,$receiver;
  3286. $2=self["@worker"];
  3287. if(($receiver = $2) == null || $receiver.isNil){
  3288. $1=self._error_("prompt: not available");
  3289. } else {
  3290. $1=$recv(self["@worker"])._prompt_default_(aString,defaultString);
  3291. };
  3292. return $1;
  3293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3294. }, function($ctx1) {$ctx1.fill(self,"prompt:default:",{aString:aString,defaultString:defaultString},$globals.PlatformInterface.klass)});
  3295. //>>excludeEnd("ctx");
  3296. },
  3297. //>>excludeStart("ide", pragmas.excludeIdeData);
  3298. args: ["aString", "defaultString"],
  3299. source: "prompt: aString default: defaultString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker prompt: aString default: defaultString ]\x0a\x09\x09ifNil: [ self error: 'prompt: not available' ]",
  3300. referencedClasses: [],
  3301. //>>excludeEnd("ide");
  3302. messageSends: ["ifNotNil:ifNil:", "prompt:default:", "error:"]
  3303. }),
  3304. $globals.PlatformInterface.klass);
  3305. $core.addMethod(
  3306. $core.method({
  3307. selector: "setWorker:",
  3308. protocol: 'accessing',
  3309. fn: function (anObject){
  3310. var self=this;
  3311. self["@worker"]=anObject;
  3312. return self;
  3313. },
  3314. //>>excludeStart("ide", pragmas.excludeIdeData);
  3315. args: ["anObject"],
  3316. source: "setWorker: anObject\x0a\x09worker := anObject",
  3317. referencedClasses: [],
  3318. //>>excludeEnd("ide");
  3319. messageSends: []
  3320. }),
  3321. $globals.PlatformInterface.klass);
  3322. $core.addClass('Service', $globals.Object, [], 'Kernel-Infrastructure');
  3323. //>>excludeStart("ide", pragmas.excludeIdeData);
  3324. $globals.Service.comment="I implement the basic behavior for class registration to a service.\x0a\x0aSee the `Transcript` class for a concrete service.\x0a\x0a## API\x0a\x0aUse class-side methods `#register:` and `#registerIfNone:` to register classes to a specific service.";
  3325. //>>excludeEnd("ide");
  3326. $globals.Service.klass.iVarNames = ['current'];
  3327. $core.addMethod(
  3328. $core.method({
  3329. selector: "current",
  3330. protocol: 'accessing',
  3331. fn: function (){
  3332. var self=this;
  3333. var $1;
  3334. $1=self["@current"];
  3335. return $1;
  3336. },
  3337. //>>excludeStart("ide", pragmas.excludeIdeData);
  3338. args: [],
  3339. source: "current\x0a\x09^ current",
  3340. referencedClasses: [],
  3341. //>>excludeEnd("ide");
  3342. messageSends: []
  3343. }),
  3344. $globals.Service.klass);
  3345. $core.addMethod(
  3346. $core.method({
  3347. selector: "new",
  3348. protocol: 'instance creation',
  3349. fn: function (){
  3350. var self=this;
  3351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3352. return $core.withContext(function($ctx1) {
  3353. //>>excludeEnd("ctx");
  3354. self._shouldNotImplement();
  3355. return self;
  3356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3357. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Service.klass)});
  3358. //>>excludeEnd("ctx");
  3359. },
  3360. //>>excludeStart("ide", pragmas.excludeIdeData);
  3361. args: [],
  3362. source: "new\x0a\x09self shouldNotImplement",
  3363. referencedClasses: [],
  3364. //>>excludeEnd("ide");
  3365. messageSends: ["shouldNotImplement"]
  3366. }),
  3367. $globals.Service.klass);
  3368. $core.addMethod(
  3369. $core.method({
  3370. selector: "register:",
  3371. protocol: 'registration',
  3372. fn: function (anObject){
  3373. var self=this;
  3374. self["@current"]=anObject;
  3375. return self;
  3376. },
  3377. //>>excludeStart("ide", pragmas.excludeIdeData);
  3378. args: ["anObject"],
  3379. source: "register: anObject\x0a\x09current := anObject",
  3380. referencedClasses: [],
  3381. //>>excludeEnd("ide");
  3382. messageSends: []
  3383. }),
  3384. $globals.Service.klass);
  3385. $core.addMethod(
  3386. $core.method({
  3387. selector: "registerIfNone:",
  3388. protocol: 'registration',
  3389. fn: function (anObject){
  3390. var self=this;
  3391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3392. return $core.withContext(function($ctx1) {
  3393. //>>excludeEnd("ctx");
  3394. var $1,$receiver;
  3395. $1=self._current();
  3396. if(($receiver = $1) == null || $receiver.isNil){
  3397. self._register_(anObject);
  3398. } else {
  3399. $1;
  3400. };
  3401. return self;
  3402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3403. }, function($ctx1) {$ctx1.fill(self,"registerIfNone:",{anObject:anObject},$globals.Service.klass)});
  3404. //>>excludeEnd("ctx");
  3405. },
  3406. //>>excludeStart("ide", pragmas.excludeIdeData);
  3407. args: ["anObject"],
  3408. source: "registerIfNone: anObject\x0a\x09self current ifNil: [ self register: anObject ]",
  3409. referencedClasses: [],
  3410. //>>excludeEnd("ide");
  3411. messageSends: ["ifNil:", "current", "register:"]
  3412. }),
  3413. $globals.Service.klass);
  3414. $core.addClass('ErrorHandler', $globals.Service, [], 'Kernel-Infrastructure');
  3415. //>>excludeStart("ide", pragmas.excludeIdeData);
  3416. $globals.ErrorHandler.comment="I am the service used to handle Smalltalk errors.\x0aSee `boot.js` `handleError()` function.\x0a\x0aRegistered service instances must implement `#handleError:` to perform an action on the thrown exception.";
  3417. //>>excludeEnd("ide");
  3418. $core.addMethod(
  3419. $core.method({
  3420. selector: "handleError:",
  3421. protocol: 'error handling',
  3422. fn: function (anError){
  3423. var self=this;
  3424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3425. return $core.withContext(function($ctx1) {
  3426. //>>excludeEnd("ctx");
  3427. self._handleUnhandledError_(anError);
  3428. return self;
  3429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3430. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},$globals.ErrorHandler.klass)});
  3431. //>>excludeEnd("ctx");
  3432. },
  3433. //>>excludeStart("ide", pragmas.excludeIdeData);
  3434. args: ["anError"],
  3435. source: "handleError: anError\x0a\x09self handleUnhandledError: anError",
  3436. referencedClasses: [],
  3437. //>>excludeEnd("ide");
  3438. messageSends: ["handleUnhandledError:"]
  3439. }),
  3440. $globals.ErrorHandler.klass);
  3441. $core.addMethod(
  3442. $core.method({
  3443. selector: "handleUnhandledError:",
  3444. protocol: 'error handling',
  3445. fn: function (anError){
  3446. var self=this;
  3447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3448. return $core.withContext(function($ctx1) {
  3449. //>>excludeEnd("ctx");
  3450. var $1,$2;
  3451. $1=$recv(anError)._wasHandled();
  3452. if($core.assert($1)){
  3453. return self;
  3454. };
  3455. $2=$recv(self._current())._handleError_(anError);
  3456. return $2;
  3457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3458. }, function($ctx1) {$ctx1.fill(self,"handleUnhandledError:",{anError:anError},$globals.ErrorHandler.klass)});
  3459. //>>excludeEnd("ctx");
  3460. },
  3461. //>>excludeStart("ide", pragmas.excludeIdeData);
  3462. args: ["anError"],
  3463. source: "handleUnhandledError: anError\x0a\x09anError wasHandled ifTrue: [ ^ self ].\x0a\x09\x0a\x09^ self current handleError: anError",
  3464. referencedClasses: [],
  3465. //>>excludeEnd("ide");
  3466. messageSends: ["ifTrue:", "wasHandled", "handleError:", "current"]
  3467. }),
  3468. $globals.ErrorHandler.klass);
  3469. $core.addClass('Finder', $globals.Service, [], 'Kernel-Infrastructure');
  3470. //>>excludeStart("ide", pragmas.excludeIdeData);
  3471. $globals.Finder.comment="I am the service responsible for finding classes/methods.\x0a__There is no default finder.__\x0a\x0a## API\x0a\x0aUse `#browse` on an object to find it.";
  3472. //>>excludeEnd("ide");
  3473. $core.addMethod(
  3474. $core.method({
  3475. selector: "findClass:",
  3476. protocol: 'finding',
  3477. fn: function (aClass){
  3478. var self=this;
  3479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3480. return $core.withContext(function($ctx1) {
  3481. //>>excludeEnd("ctx");
  3482. var $1;
  3483. $1=$recv(self._current())._findClass_(aClass);
  3484. return $1;
  3485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3486. }, function($ctx1) {$ctx1.fill(self,"findClass:",{aClass:aClass},$globals.Finder.klass)});
  3487. //>>excludeEnd("ctx");
  3488. },
  3489. //>>excludeStart("ide", pragmas.excludeIdeData);
  3490. args: ["aClass"],
  3491. source: "findClass: aClass\x0a\x09^ self current findClass: aClass",
  3492. referencedClasses: [],
  3493. //>>excludeEnd("ide");
  3494. messageSends: ["findClass:", "current"]
  3495. }),
  3496. $globals.Finder.klass);
  3497. $core.addMethod(
  3498. $core.method({
  3499. selector: "findMethod:",
  3500. protocol: 'finding',
  3501. fn: function (aCompiledMethod){
  3502. var self=this;
  3503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3504. return $core.withContext(function($ctx1) {
  3505. //>>excludeEnd("ctx");
  3506. var $1;
  3507. $1=$recv(self._current())._findMethod_(aCompiledMethod);
  3508. return $1;
  3509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3510. }, function($ctx1) {$ctx1.fill(self,"findMethod:",{aCompiledMethod:aCompiledMethod},$globals.Finder.klass)});
  3511. //>>excludeEnd("ctx");
  3512. },
  3513. //>>excludeStart("ide", pragmas.excludeIdeData);
  3514. args: ["aCompiledMethod"],
  3515. source: "findMethod: aCompiledMethod\x0a\x09^ self current findMethod: aCompiledMethod",
  3516. referencedClasses: [],
  3517. //>>excludeEnd("ide");
  3518. messageSends: ["findMethod:", "current"]
  3519. }),
  3520. $globals.Finder.klass);
  3521. $core.addMethod(
  3522. $core.method({
  3523. selector: "findString:",
  3524. protocol: 'finding',
  3525. fn: function (aString){
  3526. var self=this;
  3527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3528. return $core.withContext(function($ctx1) {
  3529. //>>excludeEnd("ctx");
  3530. var $1;
  3531. $1=$recv(self._current())._findString_(aString);
  3532. return $1;
  3533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3534. }, function($ctx1) {$ctx1.fill(self,"findString:",{aString:aString},$globals.Finder.klass)});
  3535. //>>excludeEnd("ctx");
  3536. },
  3537. //>>excludeStart("ide", pragmas.excludeIdeData);
  3538. args: ["aString"],
  3539. source: "findString: aString\x0a\x09^ self current findString: aString",
  3540. referencedClasses: [],
  3541. //>>excludeEnd("ide");
  3542. messageSends: ["findString:", "current"]
  3543. }),
  3544. $globals.Finder.klass);
  3545. $core.addClass('Inspector', $globals.Service, [], 'Kernel-Infrastructure');
  3546. //>>excludeStart("ide", pragmas.excludeIdeData);
  3547. $globals.Inspector.comment="I am the service responsible for inspecting objects.\x0a\x0aThe default inspector object is the transcript.";
  3548. //>>excludeEnd("ide");
  3549. $core.addMethod(
  3550. $core.method({
  3551. selector: "inspect:",
  3552. protocol: 'inspecting',
  3553. fn: function (anObject){
  3554. var self=this;
  3555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3556. return $core.withContext(function($ctx1) {
  3557. //>>excludeEnd("ctx");
  3558. var $1;
  3559. $1=$recv(self._current())._inspect_(anObject);
  3560. return $1;
  3561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3562. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Inspector.klass)});
  3563. //>>excludeEnd("ctx");
  3564. },
  3565. //>>excludeStart("ide", pragmas.excludeIdeData);
  3566. args: ["anObject"],
  3567. source: "inspect: anObject\x0a\x09^ self current inspect: anObject",
  3568. referencedClasses: [],
  3569. //>>excludeEnd("ide");
  3570. messageSends: ["inspect:", "current"]
  3571. }),
  3572. $globals.Inspector.klass);
  3573. $core.addClass('ProgressHandler', $globals.Service, [], 'Kernel-Infrastructure');
  3574. //>>excludeStart("ide", pragmas.excludeIdeData);
  3575. $globals.ProgressHandler.comment="I am used to manage progress in collection iterations, see `SequenceableCollection >> #do:displayingProgress:`.\x0a\x0aRegistered instances must implement `#do:on:displaying:`.\x0a\x0aThe default behavior is to simply iterate over the collection, using `NullProgressHandler`.";
  3576. //>>excludeEnd("ide");
  3577. $core.addMethod(
  3578. $core.method({
  3579. selector: "do:on:displaying:",
  3580. protocol: 'progress handling',
  3581. fn: function (aBlock,aCollection,aString){
  3582. var self=this;
  3583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3584. return $core.withContext(function($ctx1) {
  3585. //>>excludeEnd("ctx");
  3586. $recv(self._current())._do_on_displaying_(aBlock,aCollection,aString);
  3587. return self;
  3588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3589. }, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},$globals.ProgressHandler.klass)});
  3590. //>>excludeEnd("ctx");
  3591. },
  3592. //>>excludeStart("ide", pragmas.excludeIdeData);
  3593. args: ["aBlock", "aCollection", "aString"],
  3594. source: "do: aBlock on: aCollection displaying: aString\x0a\x09self current do: aBlock on: aCollection displaying: aString",
  3595. referencedClasses: [],
  3596. //>>excludeEnd("ide");
  3597. messageSends: ["do:on:displaying:", "current"]
  3598. }),
  3599. $globals.ProgressHandler.klass);
  3600. $core.addClass('Transcript', $globals.Service, [], 'Kernel-Infrastructure');
  3601. //>>excludeStart("ide", pragmas.excludeIdeData);
  3602. $globals.Transcript.comment="I am a facade for Transcript actions.\x0a\x0aI delegate actions to the currently registered transcript.\x0a\x0a## API\x0a\x0a Transcript \x0a show: 'hello world';\x0a cr;\x0a show: anObject.";
  3603. //>>excludeEnd("ide");
  3604. $core.addMethod(
  3605. $core.method({
  3606. selector: "clear",
  3607. protocol: 'printing',
  3608. fn: function (){
  3609. var self=this;
  3610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3611. return $core.withContext(function($ctx1) {
  3612. //>>excludeEnd("ctx");
  3613. $recv(self._current())._clear();
  3614. return self;
  3615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3616. }, function($ctx1) {$ctx1.fill(self,"clear",{},$globals.Transcript.klass)});
  3617. //>>excludeEnd("ctx");
  3618. },
  3619. //>>excludeStart("ide", pragmas.excludeIdeData);
  3620. args: [],
  3621. source: "clear\x0a\x09self current clear",
  3622. referencedClasses: [],
  3623. //>>excludeEnd("ide");
  3624. messageSends: ["clear", "current"]
  3625. }),
  3626. $globals.Transcript.klass);
  3627. $core.addMethod(
  3628. $core.method({
  3629. selector: "cr",
  3630. protocol: 'printing',
  3631. fn: function (){
  3632. var self=this;
  3633. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  3634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3635. return $core.withContext(function($ctx1) {
  3636. //>>excludeEnd("ctx");
  3637. $recv(self._current())._show_($recv($String())._cr());
  3638. return self;
  3639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3640. }, function($ctx1) {$ctx1.fill(self,"cr",{},$globals.Transcript.klass)});
  3641. //>>excludeEnd("ctx");
  3642. },
  3643. //>>excludeStart("ide", pragmas.excludeIdeData);
  3644. args: [],
  3645. source: "cr\x0a\x09self current show: String cr",
  3646. referencedClasses: ["String"],
  3647. //>>excludeEnd("ide");
  3648. messageSends: ["show:", "current", "cr"]
  3649. }),
  3650. $globals.Transcript.klass);
  3651. $core.addMethod(
  3652. $core.method({
  3653. selector: "inspect:",
  3654. protocol: 'printing',
  3655. fn: function (anObject){
  3656. var self=this;
  3657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3658. return $core.withContext(function($ctx1) {
  3659. //>>excludeEnd("ctx");
  3660. self._show_(anObject);
  3661. return self;
  3662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3663. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},$globals.Transcript.klass)});
  3664. //>>excludeEnd("ctx");
  3665. },
  3666. //>>excludeStart("ide", pragmas.excludeIdeData);
  3667. args: ["anObject"],
  3668. source: "inspect: anObject\x0a\x09self show: anObject",
  3669. referencedClasses: [],
  3670. //>>excludeEnd("ide");
  3671. messageSends: ["show:"]
  3672. }),
  3673. $globals.Transcript.klass);
  3674. $core.addMethod(
  3675. $core.method({
  3676. selector: "open",
  3677. protocol: 'instance creation',
  3678. fn: function (){
  3679. var self=this;
  3680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3681. return $core.withContext(function($ctx1) {
  3682. //>>excludeEnd("ctx");
  3683. $recv(self._current())._open();
  3684. return self;
  3685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3686. }, function($ctx1) {$ctx1.fill(self,"open",{},$globals.Transcript.klass)});
  3687. //>>excludeEnd("ctx");
  3688. },
  3689. //>>excludeStart("ide", pragmas.excludeIdeData);
  3690. args: [],
  3691. source: "open\x0a\x09self current open",
  3692. referencedClasses: [],
  3693. //>>excludeEnd("ide");
  3694. messageSends: ["open", "current"]
  3695. }),
  3696. $globals.Transcript.klass);
  3697. $core.addMethod(
  3698. $core.method({
  3699. selector: "show:",
  3700. protocol: 'printing',
  3701. fn: function (anObject){
  3702. var self=this;
  3703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3704. return $core.withContext(function($ctx1) {
  3705. //>>excludeEnd("ctx");
  3706. $recv(self._current())._show_(anObject);
  3707. return self;
  3708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3709. }, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},$globals.Transcript.klass)});
  3710. //>>excludeEnd("ctx");
  3711. },
  3712. //>>excludeStart("ide", pragmas.excludeIdeData);
  3713. args: ["anObject"],
  3714. source: "show: anObject\x0a\x09self current show: anObject",
  3715. referencedClasses: [],
  3716. //>>excludeEnd("ide");
  3717. messageSends: ["show:", "current"]
  3718. }),
  3719. $globals.Transcript.klass);
  3720. $core.addClass('Setting', $globals.Object, ['key', 'value', 'defaultValue'], 'Kernel-Infrastructure');
  3721. //>>excludeStart("ide", pragmas.excludeIdeData);
  3722. $globals.Setting.comment="I represent a setting accessible via `Smalltalk settings`.\x0a\x0a## API\x0a\x0aA `Setting` value can be read using `value` and set using `value:`.\x0a\x0aSettings are accessed with `'key' asSetting` or `'key' asSettingIfAbsent: 'defaultValue'`.";
  3723. //>>excludeEnd("ide");
  3724. $core.addMethod(
  3725. $core.method({
  3726. selector: "defaultValue",
  3727. protocol: 'accessing',
  3728. fn: function (){
  3729. var self=this;
  3730. var $1;
  3731. $1=self["@defaultValue"];
  3732. return $1;
  3733. },
  3734. //>>excludeStart("ide", pragmas.excludeIdeData);
  3735. args: [],
  3736. source: "defaultValue\x0a\x09^ defaultValue",
  3737. referencedClasses: [],
  3738. //>>excludeEnd("ide");
  3739. messageSends: []
  3740. }),
  3741. $globals.Setting);
  3742. $core.addMethod(
  3743. $core.method({
  3744. selector: "defaultValue:",
  3745. protocol: 'accessing',
  3746. fn: function (anObject){
  3747. var self=this;
  3748. self["@defaultValue"]=anObject;
  3749. return self;
  3750. },
  3751. //>>excludeStart("ide", pragmas.excludeIdeData);
  3752. args: ["anObject"],
  3753. source: "defaultValue: anObject\x0a\x09defaultValue := anObject",
  3754. referencedClasses: [],
  3755. //>>excludeEnd("ide");
  3756. messageSends: []
  3757. }),
  3758. $globals.Setting);
  3759. $core.addMethod(
  3760. $core.method({
  3761. selector: "key",
  3762. protocol: 'accessing',
  3763. fn: function (){
  3764. var self=this;
  3765. var $1;
  3766. $1=self["@key"];
  3767. return $1;
  3768. },
  3769. //>>excludeStart("ide", pragmas.excludeIdeData);
  3770. args: [],
  3771. source: "key\x0a\x09^ key",
  3772. referencedClasses: [],
  3773. //>>excludeEnd("ide");
  3774. messageSends: []
  3775. }),
  3776. $globals.Setting);
  3777. $core.addMethod(
  3778. $core.method({
  3779. selector: "key:",
  3780. protocol: 'accessing',
  3781. fn: function (anObject){
  3782. var self=this;
  3783. self["@key"]=anObject;
  3784. return self;
  3785. },
  3786. //>>excludeStart("ide", pragmas.excludeIdeData);
  3787. args: ["anObject"],
  3788. source: "key: anObject\x0a\x09key := anObject",
  3789. referencedClasses: [],
  3790. //>>excludeEnd("ide");
  3791. messageSends: []
  3792. }),
  3793. $globals.Setting);
  3794. $core.addMethod(
  3795. $core.method({
  3796. selector: "value",
  3797. protocol: 'accessing',
  3798. fn: function (){
  3799. var self=this;
  3800. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  3801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3802. return $core.withContext(function($ctx1) {
  3803. //>>excludeEnd("ctx");
  3804. var $1;
  3805. $1=$recv($recv($Smalltalk())._settings())._at_ifAbsent_(self._key(),(function(){
  3806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3807. return $core.withContext(function($ctx2) {
  3808. //>>excludeEnd("ctx");
  3809. return self._defaultValue();
  3810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3811. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3812. //>>excludeEnd("ctx");
  3813. }));
  3814. return $1;
  3815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3816. }, function($ctx1) {$ctx1.fill(self,"value",{},$globals.Setting)});
  3817. //>>excludeEnd("ctx");
  3818. },
  3819. //>>excludeStart("ide", pragmas.excludeIdeData);
  3820. args: [],
  3821. source: "value\x0a\x09^ Smalltalk settings at: self key ifAbsent: [ self defaultValue ]",
  3822. referencedClasses: ["Smalltalk"],
  3823. //>>excludeEnd("ide");
  3824. messageSends: ["at:ifAbsent:", "settings", "key", "defaultValue"]
  3825. }),
  3826. $globals.Setting);
  3827. $core.addMethod(
  3828. $core.method({
  3829. selector: "value:",
  3830. protocol: 'accessing',
  3831. fn: function (aString){
  3832. var self=this;
  3833. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  3834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3835. return $core.withContext(function($ctx1) {
  3836. //>>excludeEnd("ctx");
  3837. var $1;
  3838. $1=$recv($recv($Smalltalk())._settings())._at_put_(self._key(),aString);
  3839. return $1;
  3840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3841. }, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},$globals.Setting)});
  3842. //>>excludeEnd("ctx");
  3843. },
  3844. //>>excludeStart("ide", pragmas.excludeIdeData);
  3845. args: ["aString"],
  3846. source: "value: aString\x0a\x09^ Smalltalk settings at: self key put: aString",
  3847. referencedClasses: ["Smalltalk"],
  3848. //>>excludeEnd("ide");
  3849. messageSends: ["at:put:", "settings", "key"]
  3850. }),
  3851. $globals.Setting);
  3852. $core.addMethod(
  3853. $core.method({
  3854. selector: "at:ifAbsent:",
  3855. protocol: 'instance creation',
  3856. fn: function (aString,anotherString){
  3857. var self=this;
  3858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3859. return $core.withContext(function($ctx1) {
  3860. //>>excludeEnd("ctx");
  3861. var $2,$3,$1;
  3862. $2=(
  3863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3864. $ctx1.supercall = true,
  3865. //>>excludeEnd("ctx");
  3866. $globals.Setting.klass.superclass.fn.prototype._new.apply($recv(self), []));
  3867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3868. $ctx1.supercall = false;
  3869. //>>excludeEnd("ctx");;
  3870. $recv($2)._key_(aString);
  3871. $recv($2)._defaultValue_(anotherString);
  3872. $3=$recv($2)._yourself();
  3873. $1=$3;
  3874. return $1;
  3875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3876. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,anotherString:anotherString},$globals.Setting.klass)});
  3877. //>>excludeEnd("ctx");
  3878. },
  3879. //>>excludeStart("ide", pragmas.excludeIdeData);
  3880. args: ["aString", "anotherString"],
  3881. source: "at: aString ifAbsent: anotherString\x0a\x09^ super new\x0a\x09\x09key: aString;\x0a\x09\x09defaultValue: anotherString;\x0a\x09\x09yourself",
  3882. referencedClasses: [],
  3883. //>>excludeEnd("ide");
  3884. messageSends: ["key:", "new", "defaultValue:", "yourself"]
  3885. }),
  3886. $globals.Setting.klass);
  3887. $core.addMethod(
  3888. $core.method({
  3889. selector: "new",
  3890. protocol: 'instance creation',
  3891. fn: function (){
  3892. var self=this;
  3893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3894. return $core.withContext(function($ctx1) {
  3895. //>>excludeEnd("ctx");
  3896. self._shouldNotImplement();
  3897. return self;
  3898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3899. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.Setting.klass)});
  3900. //>>excludeEnd("ctx");
  3901. },
  3902. //>>excludeStart("ide", pragmas.excludeIdeData);
  3903. args: [],
  3904. source: "new\x0a\x09self shouldNotImplement",
  3905. referencedClasses: [],
  3906. //>>excludeEnd("ide");
  3907. messageSends: ["shouldNotImplement"]
  3908. }),
  3909. $globals.Setting.klass);
  3910. $core.addClass('SmalltalkImage', $globals.Object, [], 'Kernel-Infrastructure');
  3911. //>>excludeStart("ide", pragmas.excludeIdeData);
  3912. $globals.SmalltalkImage.comment="I represent the Smalltalk system, wrapping\x0aoperations of variable `$core` declared in `support/boot.js`.\x0a\x0a## API\x0a\x0aI have only one instance, accessed with global variable `Smalltalk`.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#globals #at:` answers a specific global (usually, a class) or `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific package or `nil`\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Amber source code.\x0aIt requires the `Compiler` package and the `support/parser.js` parser file in order to work.";
  3913. //>>excludeEnd("ide");
  3914. $core.addMethod(
  3915. $core.method({
  3916. selector: "addGlobalJsVariable:",
  3917. protocol: 'globals',
  3918. fn: function (aString){
  3919. var self=this;
  3920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3921. return $core.withContext(function($ctx1) {
  3922. //>>excludeEnd("ctx");
  3923. $recv(self._globalJsVariables())._add_(aString);
  3924. return self;
  3925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3926. }, function($ctx1) {$ctx1.fill(self,"addGlobalJsVariable:",{aString:aString},$globals.SmalltalkImage)});
  3927. //>>excludeEnd("ctx");
  3928. },
  3929. //>>excludeStart("ide", pragmas.excludeIdeData);
  3930. args: ["aString"],
  3931. source: "addGlobalJsVariable: aString\x0a\x09self globalJsVariables add: aString",
  3932. referencedClasses: [],
  3933. //>>excludeEnd("ide");
  3934. messageSends: ["add:", "globalJsVariables"]
  3935. }),
  3936. $globals.SmalltalkImage);
  3937. $core.addMethod(
  3938. $core.method({
  3939. selector: "amdRequire",
  3940. protocol: 'accessing amd',
  3941. fn: function (){
  3942. var self=this;
  3943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3944. return $core.withContext(function($ctx1) {
  3945. //>>excludeEnd("ctx");
  3946. var $1;
  3947. $1=$recv(self._core())._at_("amdRequire");
  3948. return $1;
  3949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3950. }, function($ctx1) {$ctx1.fill(self,"amdRequire",{},$globals.SmalltalkImage)});
  3951. //>>excludeEnd("ctx");
  3952. },
  3953. //>>excludeStart("ide", pragmas.excludeIdeData);
  3954. args: [],
  3955. source: "amdRequire\x0a\x09^ self core at: 'amdRequire'",
  3956. referencedClasses: [],
  3957. //>>excludeEnd("ide");
  3958. messageSends: ["at:", "core"]
  3959. }),
  3960. $globals.SmalltalkImage);
  3961. $core.addMethod(
  3962. $core.method({
  3963. selector: "asSmalltalkException:",
  3964. protocol: 'error handling',
  3965. fn: function (anObject){
  3966. var self=this;
  3967. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  3968. function $JavaScriptException(){return $globals.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  3969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3970. return $core.withContext(function($ctx1) {
  3971. //>>excludeEnd("ctx");
  3972. var $2,$1;
  3973. $2=$recv(self._isSmalltalkObject_(anObject))._and_((function(){
  3974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3975. return $core.withContext(function($ctx2) {
  3976. //>>excludeEnd("ctx");
  3977. return $recv(anObject)._isKindOf_($Error());
  3978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3979. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3980. //>>excludeEnd("ctx");
  3981. }));
  3982. if($core.assert($2)){
  3983. $1=anObject;
  3984. } else {
  3985. $1=$recv($JavaScriptException())._on_(anObject);
  3986. };
  3987. return $1;
  3988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3989. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},$globals.SmalltalkImage)});
  3990. //>>excludeEnd("ctx");
  3991. },
  3992. //>>excludeStart("ide", pragmas.excludeIdeData);
  3993. args: ["anObject"],
  3994. source: "asSmalltalkException: anObject\x0a\x09\x22A JavaScript exception may be thrown.\x0a\x09We then need to convert it back to a Smalltalk object\x22\x0a\x09\x0a\x09^ ((self isSmalltalkObject: anObject) and: [ anObject isKindOf: Error ])\x0a\x09\x09ifTrue: [ anObject ]\x0a\x09\x09ifFalse: [ JavaScriptException on: anObject ]",
  3995. referencedClasses: ["Error", "JavaScriptException"],
  3996. //>>excludeEnd("ide");
  3997. messageSends: ["ifTrue:ifFalse:", "and:", "isSmalltalkObject:", "isKindOf:", "on:"]
  3998. }),
  3999. $globals.SmalltalkImage);
  4000. $core.addMethod(
  4001. $core.method({
  4002. selector: "at:",
  4003. protocol: 'accessing',
  4004. fn: function (aString){
  4005. var self=this;
  4006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4007. return $core.withContext(function($ctx1) {
  4008. //>>excludeEnd("ctx");
  4009. var $1;
  4010. self._deprecatedAPI();
  4011. $1=$recv(self._globals())._at_(aString);
  4012. return $1;
  4013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4014. }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},$globals.SmalltalkImage)});
  4015. //>>excludeEnd("ctx");
  4016. },
  4017. //>>excludeStart("ide", pragmas.excludeIdeData);
  4018. args: ["aString"],
  4019. source: "at: aString\x0a\x09self deprecatedAPI.\x0a\x09^ self globals at: aString",
  4020. referencedClasses: [],
  4021. //>>excludeEnd("ide");
  4022. messageSends: ["deprecatedAPI", "at:", "globals"]
  4023. }),
  4024. $globals.SmalltalkImage);
  4025. $core.addMethod(
  4026. $core.method({
  4027. selector: "at:ifAbsent:",
  4028. protocol: 'accessing',
  4029. fn: function (aKey,aBlock){
  4030. var self=this;
  4031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4032. return $core.withContext(function($ctx1) {
  4033. //>>excludeEnd("ctx");
  4034. var $1;
  4035. self._deprecatedAPI();
  4036. $1=$recv(self._globals())._at_ifAbsent_(aKey,aBlock);
  4037. return $1;
  4038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4039. }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock},$globals.SmalltalkImage)});
  4040. //>>excludeEnd("ctx");
  4041. },
  4042. //>>excludeStart("ide", pragmas.excludeIdeData);
  4043. args: ["aKey", "aBlock"],
  4044. source: "at: aKey ifAbsent: aBlock\x0a\x09self deprecatedAPI.\x0a\x09^ self globals at: aKey ifAbsent: aBlock",
  4045. referencedClasses: [],
  4046. //>>excludeEnd("ide");
  4047. messageSends: ["deprecatedAPI", "at:ifAbsent:", "globals"]
  4048. }),
  4049. $globals.SmalltalkImage);
  4050. $core.addMethod(
  4051. $core.method({
  4052. selector: "at:put:",
  4053. protocol: 'accessing',
  4054. fn: function (aString,anObject){
  4055. var self=this;
  4056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4057. return $core.withContext(function($ctx1) {
  4058. //>>excludeEnd("ctx");
  4059. var $1;
  4060. self._deprecatedAPI();
  4061. $1=$recv(self._globals())._at_put_(aString,anObject);
  4062. return $1;
  4063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4064. }, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},$globals.SmalltalkImage)});
  4065. //>>excludeEnd("ctx");
  4066. },
  4067. //>>excludeStart("ide", pragmas.excludeIdeData);
  4068. args: ["aString", "anObject"],
  4069. source: "at: aString put: anObject\x0a\x09self deprecatedAPI.\x0a\x09^ self globals at: aString put: anObject",
  4070. referencedClasses: [],
  4071. //>>excludeEnd("ide");
  4072. messageSends: ["deprecatedAPI", "at:put:", "globals"]
  4073. }),
  4074. $globals.SmalltalkImage);
  4075. $core.addMethod(
  4076. $core.method({
  4077. selector: "basicCreatePackage:",
  4078. protocol: 'private',
  4079. fn: function (packageName){
  4080. var self=this;
  4081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4082. return $core.withContext(function($ctx1) {
  4083. //>>excludeEnd("ctx");
  4084. return $core.addPackage(packageName);
  4085. return self;
  4086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4087. }, function($ctx1) {$ctx1.fill(self,"basicCreatePackage:",{packageName:packageName},$globals.SmalltalkImage)});
  4088. //>>excludeEnd("ctx");
  4089. },
  4090. //>>excludeStart("ide", pragmas.excludeIdeData);
  4091. args: ["packageName"],
  4092. source: "basicCreatePackage: packageName\x0a\x09\x22Create and bind a new bare package with given name and return it.\x22\x0a\x09<return $core.addPackage(packageName)>",
  4093. referencedClasses: [],
  4094. //>>excludeEnd("ide");
  4095. messageSends: []
  4096. }),
  4097. $globals.SmalltalkImage);
  4098. $core.addMethod(
  4099. $core.method({
  4100. selector: "basicParse:",
  4101. protocol: 'private',
  4102. fn: function (aString){
  4103. var self=this;
  4104. function $SmalltalkParser(){return $globals.SmalltalkParser||(typeof SmalltalkParser=="undefined"?nil:SmalltalkParser)}
  4105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4106. return $core.withContext(function($ctx1) {
  4107. //>>excludeEnd("ctx");
  4108. var $1;
  4109. $1=$recv($SmalltalkParser())._parse_(aString);
  4110. return $1;
  4111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4112. }, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString},$globals.SmalltalkImage)});
  4113. //>>excludeEnd("ctx");
  4114. },
  4115. //>>excludeStart("ide", pragmas.excludeIdeData);
  4116. args: ["aString"],
  4117. source: "basicParse: aString\x0a\x09^ SmalltalkParser parse: aString",
  4118. referencedClasses: ["SmalltalkParser"],
  4119. //>>excludeEnd("ide");
  4120. messageSends: ["parse:"]
  4121. }),
  4122. $globals.SmalltalkImage);
  4123. $core.addMethod(
  4124. $core.method({
  4125. selector: "classes",
  4126. protocol: 'classes',
  4127. fn: function (){
  4128. var self=this;
  4129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4130. return $core.withContext(function($ctx1) {
  4131. //>>excludeEnd("ctx");
  4132. return $core.classes();
  4133. return self;
  4134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4135. }, function($ctx1) {$ctx1.fill(self,"classes",{},$globals.SmalltalkImage)});
  4136. //>>excludeEnd("ctx");
  4137. },
  4138. //>>excludeStart("ide", pragmas.excludeIdeData);
  4139. args: [],
  4140. source: "classes\x0a\x09<return $core.classes()>",
  4141. referencedClasses: [],
  4142. //>>excludeEnd("ide");
  4143. messageSends: []
  4144. }),
  4145. $globals.SmalltalkImage);
  4146. $core.addMethod(
  4147. $core.method({
  4148. selector: "core",
  4149. protocol: 'accessing',
  4150. fn: function (){
  4151. var self=this;
  4152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4153. return $core.withContext(function($ctx1) {
  4154. //>>excludeEnd("ctx");
  4155. return $core;
  4156. return self;
  4157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4158. }, function($ctx1) {$ctx1.fill(self,"core",{},$globals.SmalltalkImage)});
  4159. //>>excludeEnd("ctx");
  4160. },
  4161. //>>excludeStart("ide", pragmas.excludeIdeData);
  4162. args: [],
  4163. source: "core\x0a\x09<return $core>",
  4164. referencedClasses: [],
  4165. //>>excludeEnd("ide");
  4166. messageSends: []
  4167. }),
  4168. $globals.SmalltalkImage);
  4169. $core.addMethod(
  4170. $core.method({
  4171. selector: "createPackage:",
  4172. protocol: 'packages',
  4173. fn: function (packageName){
  4174. var self=this;
  4175. var package_,announcement;
  4176. function $PackageAdded(){return $globals.PackageAdded||(typeof PackageAdded=="undefined"?nil:PackageAdded)}
  4177. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  4178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4179. return $core.withContext(function($ctx1) {
  4180. //>>excludeEnd("ctx");
  4181. var $1,$2,$3;
  4182. package_=self._basicCreatePackage_(packageName);
  4183. $1=$recv($PackageAdded())._new();
  4184. $recv($1)._package_(package_);
  4185. $2=$recv($1)._yourself();
  4186. announcement=$2;
  4187. $recv($recv($SystemAnnouncer())._current())._announce_(announcement);
  4188. $3=package_;
  4189. return $3;
  4190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4191. }, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName,package_:package_,announcement:announcement},$globals.SmalltalkImage)});
  4192. //>>excludeEnd("ctx");
  4193. },
  4194. //>>excludeStart("ide", pragmas.excludeIdeData);
  4195. args: ["packageName"],
  4196. source: "createPackage: packageName\x0a\x09| package announcement |\x0a\x09\x0a\x09package := self basicCreatePackage: packageName.\x0a\x09\x0a\x09announcement := PackageAdded new\x0a\x09\x09package: package;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09SystemAnnouncer current announce: announcement.\x0a\x09\x0a\x09^ package",
  4197. referencedClasses: ["PackageAdded", "SystemAnnouncer"],
  4198. //>>excludeEnd("ide");
  4199. messageSends: ["basicCreatePackage:", "package:", "new", "yourself", "announce:", "current"]
  4200. }),
  4201. $globals.SmalltalkImage);
  4202. $core.addMethod(
  4203. $core.method({
  4204. selector: "createPackage:properties:",
  4205. protocol: 'private',
  4206. fn: function (packageName,aDict){
  4207. var self=this;
  4208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4209. return $core.withContext(function($ctx1) {
  4210. //>>excludeEnd("ctx");
  4211. var $1,$2;
  4212. self._deprecatedAPI();
  4213. $1=$recv(aDict)._isEmpty();
  4214. if(!$core.assert($1)){
  4215. self._error_("createPackage:properties: called with nonempty properties");
  4216. };
  4217. $2=self._createPackage_(packageName);
  4218. return $2;
  4219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4220. }, function($ctx1) {$ctx1.fill(self,"createPackage:properties:",{packageName:packageName,aDict:aDict},$globals.SmalltalkImage)});
  4221. //>>excludeEnd("ctx");
  4222. },
  4223. //>>excludeStart("ide", pragmas.excludeIdeData);
  4224. args: ["packageName", "aDict"],
  4225. source: "createPackage: packageName properties: aDict\x0a\x09\x22Needed to import .st files: they begin with this call.\x22\x0a\x09self deprecatedAPI.\x0a\x09\x0a\x09aDict isEmpty ifFalse: [ self error: 'createPackage:properties: called with nonempty properties' ].\x0a\x09^ self createPackage: packageName",
  4226. referencedClasses: [],
  4227. //>>excludeEnd("ide");
  4228. messageSends: ["deprecatedAPI", "ifFalse:", "isEmpty", "error:", "createPackage:"]
  4229. }),
  4230. $globals.SmalltalkImage);
  4231. $core.addMethod(
  4232. $core.method({
  4233. selector: "current",
  4234. protocol: 'accessing',
  4235. fn: function (){
  4236. var self=this;
  4237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4238. return $core.withContext(function($ctx1) {
  4239. //>>excludeEnd("ctx");
  4240. self._deprecatedAPI();
  4241. return self;
  4242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4243. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.SmalltalkImage)});
  4244. //>>excludeEnd("ctx");
  4245. },
  4246. //>>excludeStart("ide", pragmas.excludeIdeData);
  4247. args: [],
  4248. source: "current\x0a\x09\x22Backward compatibility for Smalltalk current ...\x22\x0a\x09self deprecatedAPI.\x0a\x09^ self",
  4249. referencedClasses: [],
  4250. //>>excludeEnd("ide");
  4251. messageSends: ["deprecatedAPI"]
  4252. }),
  4253. $globals.SmalltalkImage);
  4254. $core.addMethod(
  4255. $core.method({
  4256. selector: "defaultAmdNamespace",
  4257. protocol: 'accessing amd',
  4258. fn: function (){
  4259. var self=this;
  4260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4261. return $core.withContext(function($ctx1) {
  4262. //>>excludeEnd("ctx");
  4263. var $1;
  4264. $1="transport.defaultAmdNamespace"._settingValue();
  4265. return $1;
  4266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4267. }, function($ctx1) {$ctx1.fill(self,"defaultAmdNamespace",{},$globals.SmalltalkImage)});
  4268. //>>excludeEnd("ctx");
  4269. },
  4270. //>>excludeStart("ide", pragmas.excludeIdeData);
  4271. args: [],
  4272. source: "defaultAmdNamespace\x0a\x09^ 'transport.defaultAmdNamespace' settingValue",
  4273. referencedClasses: [],
  4274. //>>excludeEnd("ide");
  4275. messageSends: ["settingValue"]
  4276. }),
  4277. $globals.SmalltalkImage);
  4278. $core.addMethod(
  4279. $core.method({
  4280. selector: "defaultAmdNamespace:",
  4281. protocol: 'accessing amd',
  4282. fn: function (aString){
  4283. var self=this;
  4284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4285. return $core.withContext(function($ctx1) {
  4286. //>>excludeEnd("ctx");
  4287. "transport.defaultAmdNamespace"._settingValue_(aString);
  4288. return self;
  4289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4290. }, function($ctx1) {$ctx1.fill(self,"defaultAmdNamespace:",{aString:aString},$globals.SmalltalkImage)});
  4291. //>>excludeEnd("ctx");
  4292. },
  4293. //>>excludeStart("ide", pragmas.excludeIdeData);
  4294. args: ["aString"],
  4295. source: "defaultAmdNamespace: aString\x0a\x09'transport.defaultAmdNamespace' settingValue: aString",
  4296. referencedClasses: [],
  4297. //>>excludeEnd("ide");
  4298. messageSends: ["settingValue:"]
  4299. }),
  4300. $globals.SmalltalkImage);
  4301. $core.addMethod(
  4302. $core.method({
  4303. selector: "deleteClass:",
  4304. protocol: 'private',
  4305. fn: function (aClass){
  4306. var self=this;
  4307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4308. return $core.withContext(function($ctx1) {
  4309. //>>excludeEnd("ctx");
  4310. $core.removeClass(aClass);
  4311. return self;
  4312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4313. }, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass},$globals.SmalltalkImage)});
  4314. //>>excludeEnd("ctx");
  4315. },
  4316. //>>excludeStart("ide", pragmas.excludeIdeData);
  4317. args: ["aClass"],
  4318. source: "deleteClass: aClass\x0a\x09\x22Deletes a class by deleting its binding only. Use #removeClass instead\x22\x0a\x09\x0a\x09<$core.removeClass(aClass)>",
  4319. referencedClasses: [],
  4320. //>>excludeEnd("ide");
  4321. messageSends: []
  4322. }),
  4323. $globals.SmalltalkImage);
  4324. $core.addMethod(
  4325. $core.method({
  4326. selector: "deleteGlobalJsVariable:",
  4327. protocol: 'globals',
  4328. fn: function (aString){
  4329. var self=this;
  4330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4331. return $core.withContext(function($ctx1) {
  4332. //>>excludeEnd("ctx");
  4333. $recv(self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
  4334. }));
  4335. return self;
  4336. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4337. }, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},$globals.SmalltalkImage)});
  4338. //>>excludeEnd("ctx");
  4339. },
  4340. //>>excludeStart("ide", pragmas.excludeIdeData);
  4341. args: ["aString"],
  4342. source: "deleteGlobalJsVariable: aString\x0a\x09self globalJsVariables remove: aString ifAbsent:[]",
  4343. referencedClasses: [],
  4344. //>>excludeEnd("ide");
  4345. messageSends: ["remove:ifAbsent:", "globalJsVariables"]
  4346. }),
  4347. $globals.SmalltalkImage);
  4348. $core.addMethod(
  4349. $core.method({
  4350. selector: "deletePackage:",
  4351. protocol: 'private',
  4352. fn: function (packageName){
  4353. var self=this;
  4354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4355. return $core.withContext(function($ctx1) {
  4356. //>>excludeEnd("ctx");
  4357. delete $core.packages[packageName];
  4358. return self;
  4359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4360. }, function($ctx1) {$ctx1.fill(self,"deletePackage:",{packageName:packageName},$globals.SmalltalkImage)});
  4361. //>>excludeEnd("ctx");
  4362. },
  4363. //>>excludeStart("ide", pragmas.excludeIdeData);
  4364. args: ["packageName"],
  4365. source: "deletePackage: packageName\x0a\x09\x22Deletes a package by deleting its binding, but does not check if it contains classes etc.\x0a\x09To remove a package, use #removePackage instead.\x22\x0a\x0a\x09<delete $core.packages[packageName]>",
  4366. referencedClasses: [],
  4367. //>>excludeEnd("ide");
  4368. messageSends: []
  4369. }),
  4370. $globals.SmalltalkImage);
  4371. $core.addMethod(
  4372. $core.method({
  4373. selector: "globalJsVariables",
  4374. protocol: 'globals',
  4375. fn: function (){
  4376. var self=this;
  4377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4378. return $core.withContext(function($ctx1) {
  4379. //>>excludeEnd("ctx");
  4380. return $core.globalJsVariables;
  4381. return self;
  4382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4383. }, function($ctx1) {$ctx1.fill(self,"globalJsVariables",{},$globals.SmalltalkImage)});
  4384. //>>excludeEnd("ctx");
  4385. },
  4386. //>>excludeStart("ide", pragmas.excludeIdeData);
  4387. args: [],
  4388. source: "globalJsVariables\x0a\x09\x22Array of global JavaScript variables\x22\x0a\x09<return $core.globalJsVariables>",
  4389. referencedClasses: [],
  4390. //>>excludeEnd("ide");
  4391. messageSends: []
  4392. }),
  4393. $globals.SmalltalkImage);
  4394. $core.addMethod(
  4395. $core.method({
  4396. selector: "globals",
  4397. protocol: 'accessing',
  4398. fn: function (){
  4399. var self=this;
  4400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4401. return $core.withContext(function($ctx1) {
  4402. //>>excludeEnd("ctx");
  4403. return $globals;
  4404. return self;
  4405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4406. }, function($ctx1) {$ctx1.fill(self,"globals",{},$globals.SmalltalkImage)});
  4407. //>>excludeEnd("ctx");
  4408. },
  4409. //>>excludeStart("ide", pragmas.excludeIdeData);
  4410. args: [],
  4411. source: "globals\x0a\x09\x22Future compatibility to be able to use Smalltalk globals at: ...\x22\x0a\x09<return $globals>",
  4412. referencedClasses: [],
  4413. //>>excludeEnd("ide");
  4414. messageSends: []
  4415. }),
  4416. $globals.SmalltalkImage);
  4417. $core.addMethod(
  4418. $core.method({
  4419. selector: "includesKey:",
  4420. protocol: 'accessing',
  4421. fn: function (aKey){
  4422. var self=this;
  4423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4424. return $core.withContext(function($ctx1) {
  4425. //>>excludeEnd("ctx");
  4426. return $core.hasOwnProperty(aKey);
  4427. return self;
  4428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4429. }, function($ctx1) {$ctx1.fill(self,"includesKey:",{aKey:aKey},$globals.SmalltalkImage)});
  4430. //>>excludeEnd("ctx");
  4431. },
  4432. //>>excludeStart("ide", pragmas.excludeIdeData);
  4433. args: ["aKey"],
  4434. source: "includesKey: aKey\x0a\x09<return $core.hasOwnProperty(aKey)>",
  4435. referencedClasses: [],
  4436. //>>excludeEnd("ide");
  4437. messageSends: []
  4438. }),
  4439. $globals.SmalltalkImage);
  4440. $core.addMethod(
  4441. $core.method({
  4442. selector: "isSmalltalkObject:",
  4443. protocol: 'testing',
  4444. fn: function (anObject){
  4445. var self=this;
  4446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4447. return $core.withContext(function($ctx1) {
  4448. //>>excludeEnd("ctx");
  4449. return typeof anObject.klass !== 'undefined';
  4450. return self;
  4451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4452. }, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},$globals.SmalltalkImage)});
  4453. //>>excludeEnd("ctx");
  4454. },
  4455. //>>excludeStart("ide", pragmas.excludeIdeData);
  4456. args: ["anObject"],
  4457. source: "isSmalltalkObject: anObject\x0a\x09\x22Consider anObject a Smalltalk object if it has a 'klass' property.\x0a\x09Note that this may be unaccurate\x22\x0a\x09\x0a\x09<return typeof anObject.klass !== 'undefined'>",
  4458. referencedClasses: [],
  4459. //>>excludeEnd("ide");
  4460. messageSends: []
  4461. }),
  4462. $globals.SmalltalkImage);
  4463. $core.addMethod(
  4464. $core.method({
  4465. selector: "packageAt:",
  4466. protocol: 'packages',
  4467. fn: function (packageName){
  4468. var self=this;
  4469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4470. return $core.withContext(function($ctx1) {
  4471. //>>excludeEnd("ctx");
  4472. return $core.packages[packageName];
  4473. return self;
  4474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4475. }, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName},$globals.SmalltalkImage)});
  4476. //>>excludeEnd("ctx");
  4477. },
  4478. //>>excludeStart("ide", pragmas.excludeIdeData);
  4479. args: ["packageName"],
  4480. source: "packageAt: packageName\x0a\x09<return $core.packages[packageName]>",
  4481. referencedClasses: [],
  4482. //>>excludeEnd("ide");
  4483. messageSends: []
  4484. }),
  4485. $globals.SmalltalkImage);
  4486. $core.addMethod(
  4487. $core.method({
  4488. selector: "packageAt:ifAbsent:",
  4489. protocol: 'packages',
  4490. fn: function (packageName,aBlock){
  4491. var self=this;
  4492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4493. return $core.withContext(function($ctx1) {
  4494. //>>excludeEnd("ctx");
  4495. var $2,$1;
  4496. $2=self._packageAt_(packageName);
  4497. $1=$recv($2)._ifNil_(aBlock);
  4498. return $1;
  4499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4500. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},$globals.SmalltalkImage)});
  4501. //>>excludeEnd("ctx");
  4502. },
  4503. //>>excludeStart("ide", pragmas.excludeIdeData);
  4504. args: ["packageName", "aBlock"],
  4505. source: "packageAt: packageName ifAbsent: aBlock\x0a\x09^ (self packageAt: packageName) ifNil: aBlock",
  4506. referencedClasses: [],
  4507. //>>excludeEnd("ide");
  4508. messageSends: ["ifNil:", "packageAt:"]
  4509. }),
  4510. $globals.SmalltalkImage);
  4511. $core.addMethod(
  4512. $core.method({
  4513. selector: "packages",
  4514. protocol: 'packages',
  4515. fn: function (){
  4516. var self=this;
  4517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4518. return $core.withContext(function($ctx1) {
  4519. //>>excludeEnd("ctx");
  4520. return Object.keys($core.packages).map(function(k) {
  4521. return $core.packages[k];
  4522. })
  4523. ;
  4524. return self;
  4525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4526. }, function($ctx1) {$ctx1.fill(self,"packages",{},$globals.SmalltalkImage)});
  4527. //>>excludeEnd("ctx");
  4528. },
  4529. //>>excludeStart("ide", pragmas.excludeIdeData);
  4530. args: [],
  4531. source: "packages\x0a\x09\x22Return all Package instances in the system.\x22\x0a\x0a\x09<\x0a\x09\x09return Object.keys($core.packages).map(function(k) {\x0a\x09\x09\x09return $core.packages[k];\x0a\x09\x09})\x0a\x09>",
  4532. referencedClasses: [],
  4533. //>>excludeEnd("ide");
  4534. messageSends: []
  4535. }),
  4536. $globals.SmalltalkImage);
  4537. $core.addMethod(
  4538. $core.method({
  4539. selector: "parse:",
  4540. protocol: 'accessing',
  4541. fn: function (aString){
  4542. var self=this;
  4543. var result;
  4544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4545. return $core.withContext(function($ctx1) {
  4546. //>>excludeEnd("ctx");
  4547. var $2,$3,$1;
  4548. $recv((function(){
  4549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4550. return $core.withContext(function($ctx2) {
  4551. //>>excludeEnd("ctx");
  4552. result=self._basicParse_(aString);
  4553. return result;
  4554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4555. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4556. //>>excludeEnd("ctx");
  4557. }))._tryCatch_((function(ex){
  4558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4559. return $core.withContext(function($ctx2) {
  4560. //>>excludeEnd("ctx");
  4561. return $recv(self._parseError_parsing_(ex,aString))._signal();
  4562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4563. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)});
  4564. //>>excludeEnd("ctx");
  4565. }));
  4566. $2=result;
  4567. $recv($2)._source_(aString);
  4568. $3=$recv($2)._yourself();
  4569. $1=$3;
  4570. return $1;
  4571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4572. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},$globals.SmalltalkImage)});
  4573. //>>excludeEnd("ctx");
  4574. },
  4575. //>>excludeStart("ide", pragmas.excludeIdeData);
  4576. args: ["aString"],
  4577. source: "parse: aString\x0a\x09| result |\x0a\x09\x0a\x09[ result := self basicParse: aString ] \x0a\x09\x09tryCatch: [ :ex | (self parseError: ex parsing: aString) signal ].\x0a\x09\x09\x0a\x09^ result\x0a\x09\x09source: aString;\x0a\x09\x09yourself",
  4578. referencedClasses: [],
  4579. //>>excludeEnd("ide");
  4580. messageSends: ["tryCatch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]
  4581. }),
  4582. $globals.SmalltalkImage);
  4583. $core.addMethod(
  4584. $core.method({
  4585. selector: "parseError:parsing:",
  4586. protocol: 'error handling',
  4587. fn: function (anException,aString){
  4588. var self=this;
  4589. function $ParseError(){return $globals.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  4590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4591. return $core.withContext(function($ctx1) {
  4592. //>>excludeEnd("ctx");
  4593. var $2,$8,$7,$6,$9,$5,$4,$3,$1;
  4594. $2=$recv($ParseError())._new();
  4595. $8=$recv(anException)._basicAt_("line");
  4596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4597. $ctx1.sendIdx["basicAt:"]=1;
  4598. //>>excludeEnd("ctx");
  4599. $7="Parse error on line ".__comma($8);
  4600. $6=$recv($7).__comma(" column ");
  4601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4602. $ctx1.sendIdx[","]=4;
  4603. //>>excludeEnd("ctx");
  4604. $9=$recv(anException)._basicAt_("column");
  4605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4606. $ctx1.sendIdx["basicAt:"]=2;
  4607. //>>excludeEnd("ctx");
  4608. $5=$recv($6).__comma($9);
  4609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4610. $ctx1.sendIdx[","]=3;
  4611. //>>excludeEnd("ctx");
  4612. $4=$recv($5).__comma(" : Unexpected character ");
  4613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4614. $ctx1.sendIdx[","]=2;
  4615. //>>excludeEnd("ctx");
  4616. $3=$recv($4).__comma($recv(anException)._basicAt_("found"));
  4617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4618. $ctx1.sendIdx[","]=1;
  4619. //>>excludeEnd("ctx");
  4620. $1=$recv($2)._messageText_($3);
  4621. return $1;
  4622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4623. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString},$globals.SmalltalkImage)});
  4624. //>>excludeEnd("ctx");
  4625. },
  4626. //>>excludeStart("ide", pragmas.excludeIdeData);
  4627. args: ["anException", "aString"],
  4628. source: "parseError: anException parsing: aString\x0a\x09^ ParseError new messageText: 'Parse error on line ', (anException basicAt: 'line') ,' column ' , (anException basicAt: 'column') ,' : Unexpected character ', (anException basicAt: 'found')",
  4629. referencedClasses: ["ParseError"],
  4630. //>>excludeEnd("ide");
  4631. messageSends: ["messageText:", "new", ",", "basicAt:"]
  4632. }),
  4633. $globals.SmalltalkImage);
  4634. $core.addMethod(
  4635. $core.method({
  4636. selector: "pseudoVariableNames",
  4637. protocol: 'accessing',
  4638. fn: function (){
  4639. var self=this;
  4640. var $1;
  4641. $1=["self", "super", "nil", "true", "false", "thisContext"];
  4642. return $1;
  4643. },
  4644. //>>excludeStart("ide", pragmas.excludeIdeData);
  4645. args: [],
  4646. source: "pseudoVariableNames\x0a\x09^ #('self' 'super' 'nil' 'true' 'false' 'thisContext')",
  4647. referencedClasses: [],
  4648. //>>excludeEnd("ide");
  4649. messageSends: []
  4650. }),
  4651. $globals.SmalltalkImage);
  4652. $core.addMethod(
  4653. $core.method({
  4654. selector: "readJSObject:",
  4655. protocol: 'accessing',
  4656. fn: function (anObject){
  4657. var self=this;
  4658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4659. return $core.withContext(function($ctx1) {
  4660. //>>excludeEnd("ctx");
  4661. return $core.readJSObject(anObject);
  4662. return self;
  4663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4664. }, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject},$globals.SmalltalkImage)});
  4665. //>>excludeEnd("ctx");
  4666. },
  4667. //>>excludeStart("ide", pragmas.excludeIdeData);
  4668. args: ["anObject"],
  4669. source: "readJSObject: anObject\x0a\x09<return $core.readJSObject(anObject)>",
  4670. referencedClasses: [],
  4671. //>>excludeEnd("ide");
  4672. messageSends: []
  4673. }),
  4674. $globals.SmalltalkImage);
  4675. $core.addMethod(
  4676. $core.method({
  4677. selector: "removeClass:",
  4678. protocol: 'classes',
  4679. fn: function (aClass){
  4680. var self=this;
  4681. function $SystemAnnouncer(){return $globals.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  4682. function $ClassRemoved(){return $globals.ClassRemoved||(typeof ClassRemoved=="undefined"?nil:ClassRemoved)}
  4683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4684. return $core.withContext(function($ctx1) {
  4685. //>>excludeEnd("ctx");
  4686. var $1,$2,$3;
  4687. $1=$recv(aClass)._isMetaclass();
  4688. if($core.assert($1)){
  4689. self._error_($recv($recv(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!"));
  4690. };
  4691. self._deleteClass_(aClass);
  4692. $2=$recv($ClassRemoved())._new();
  4693. $recv($2)._theClass_(aClass);
  4694. $3=$recv($2)._yourself();
  4695. $recv($recv($SystemAnnouncer())._current())._announce_($3);
  4696. return self;
  4697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4698. }, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},$globals.SmalltalkImage)});
  4699. //>>excludeEnd("ctx");
  4700. },
  4701. //>>excludeStart("ide", pragmas.excludeIdeData);
  4702. args: ["aClass"],
  4703. source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [ self error: aClass asString, ' is a Metaclass and cannot be removed!' ].\x0a\x09\x0a\x09self deleteClass: aClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassRemoved new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
  4704. referencedClasses: ["SystemAnnouncer", "ClassRemoved"],
  4705. //>>excludeEnd("ide");
  4706. messageSends: ["ifTrue:", "isMetaclass", "error:", ",", "asString", "deleteClass:", "announce:", "current", "theClass:", "new", "yourself"]
  4707. }),
  4708. $globals.SmalltalkImage);
  4709. $core.addMethod(
  4710. $core.method({
  4711. selector: "removePackage:",
  4712. protocol: 'packages',
  4713. fn: function (packageName){
  4714. var self=this;
  4715. var pkg;
  4716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4717. return $core.withContext(function($ctx1) {
  4718. //>>excludeEnd("ctx");
  4719. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  4720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4721. return $core.withContext(function($ctx2) {
  4722. //>>excludeEnd("ctx");
  4723. return self._error_("Missing package: ".__comma(packageName));
  4724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4725. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4726. //>>excludeEnd("ctx");
  4727. }));
  4728. $recv($recv(pkg)._classes())._do_((function(each){
  4729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4730. return $core.withContext(function($ctx2) {
  4731. //>>excludeEnd("ctx");
  4732. return self._removeClass_(each);
  4733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4734. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  4735. //>>excludeEnd("ctx");
  4736. }));
  4737. self._deletePackage_(packageName);
  4738. return self;
  4739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4740. }, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},$globals.SmalltalkImage)});
  4741. //>>excludeEnd("ctx");
  4742. },
  4743. //>>excludeStart("ide", pragmas.excludeIdeData);
  4744. args: ["packageName"],
  4745. source: "removePackage: packageName\x0a\x09\x22Removes a package and all its classes.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [ self error: 'Missing package: ', packageName ].\x0a\x09pkg classes do: [ :each |\x0a\x09\x09\x09self removeClass: each ].\x0a\x09self deletePackage: packageName",
  4746. referencedClasses: [],
  4747. //>>excludeEnd("ide");
  4748. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "classes", "removeClass:", "deletePackage:"]
  4749. }),
  4750. $globals.SmalltalkImage);
  4751. $core.addMethod(
  4752. $core.method({
  4753. selector: "renamePackage:to:",
  4754. protocol: 'packages',
  4755. fn: function (packageName,newName){
  4756. var self=this;
  4757. var pkg;
  4758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4759. return $core.withContext(function($ctx1) {
  4760. //>>excludeEnd("ctx");
  4761. var $1,$2,$receiver;
  4762. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  4763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4764. return $core.withContext(function($ctx2) {
  4765. //>>excludeEnd("ctx");
  4766. $1="Missing package: ".__comma(packageName);
  4767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4768. $ctx2.sendIdx[","]=1;
  4769. //>>excludeEnd("ctx");
  4770. return self._error_($1);
  4771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4772. $ctx2.sendIdx["error:"]=1;
  4773. //>>excludeEnd("ctx");
  4774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4775. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4776. //>>excludeEnd("ctx");
  4777. }));
  4778. $2=self._packageAt_(newName);
  4779. if(($receiver = $2) == null || $receiver.isNil){
  4780. $2;
  4781. } else {
  4782. self._error_("Already exists a package called: ".__comma(newName));
  4783. };
  4784. $recv(self._at_("packages"))._at_put_(newName,pkg);
  4785. $recv(pkg)._name_(newName);
  4786. self._deletePackage_(packageName);
  4787. return self;
  4788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4789. }, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},$globals.SmalltalkImage)});
  4790. //>>excludeEnd("ctx");
  4791. },
  4792. //>>excludeStart("ide", pragmas.excludeIdeData);
  4793. args: ["packageName", "newName"],
  4794. source: "renamePackage: packageName to: newName\x0a\x09\x22Rename a package.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [ self error: 'Missing package: ', packageName ].\x0a\x09(self packageAt: newName) ifNotNil: [ self error: 'Already exists a package called: ', newName ].\x0a\x09(self at: 'packages') at: newName put: pkg.\x0a\x09pkg name: newName.\x0a\x09self deletePackage: packageName.",
  4795. referencedClasses: [],
  4796. //>>excludeEnd("ide");
  4797. messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "at:put:", "at:", "name:", "deletePackage:"]
  4798. }),
  4799. $globals.SmalltalkImage);
  4800. $core.addMethod(
  4801. $core.method({
  4802. selector: "reservedWords",
  4803. protocol: 'accessing',
  4804. fn: function (){
  4805. var self=this;
  4806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4807. return $core.withContext(function($ctx1) {
  4808. //>>excludeEnd("ctx");
  4809. return $core.reservedWords;
  4810. return self;
  4811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4812. }, function($ctx1) {$ctx1.fill(self,"reservedWords",{},$globals.SmalltalkImage)});
  4813. //>>excludeEnd("ctx");
  4814. },
  4815. //>>excludeStart("ide", pragmas.excludeIdeData);
  4816. args: [],
  4817. source: "reservedWords\x0a\x09\x22JavaScript reserved words\x22\x0a\x09<return $core.reservedWords>",
  4818. referencedClasses: [],
  4819. //>>excludeEnd("ide");
  4820. messageSends: []
  4821. }),
  4822. $globals.SmalltalkImage);
  4823. $core.addMethod(
  4824. $core.method({
  4825. selector: "settings",
  4826. protocol: 'accessing',
  4827. fn: function (){
  4828. var self=this;
  4829. function $SmalltalkSettings(){return $globals.SmalltalkSettings||(typeof SmalltalkSettings=="undefined"?nil:SmalltalkSettings)}
  4830. return $SmalltalkSettings();
  4831. },
  4832. //>>excludeStart("ide", pragmas.excludeIdeData);
  4833. args: [],
  4834. source: "settings\x0a\x09^ SmalltalkSettings",
  4835. referencedClasses: ["SmalltalkSettings"],
  4836. //>>excludeEnd("ide");
  4837. messageSends: []
  4838. }),
  4839. $globals.SmalltalkImage);
  4840. $core.addMethod(
  4841. $core.method({
  4842. selector: "version",
  4843. protocol: 'accessing',
  4844. fn: function (){
  4845. var self=this;
  4846. return "0.13.1";
  4847. },
  4848. //>>excludeStart("ide", pragmas.excludeIdeData);
  4849. args: [],
  4850. source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.13.1'",
  4851. referencedClasses: [],
  4852. //>>excludeEnd("ide");
  4853. messageSends: []
  4854. }),
  4855. $globals.SmalltalkImage);
  4856. $core.addMethod(
  4857. $core.method({
  4858. selector: "vm",
  4859. protocol: 'accessing',
  4860. fn: function (){
  4861. var self=this;
  4862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4863. return $core.withContext(function($ctx1) {
  4864. //>>excludeEnd("ctx");
  4865. var $1;
  4866. self._deprecatedAPI_("Use #core");
  4867. $1=self._core();
  4868. return $1;
  4869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4870. }, function($ctx1) {$ctx1.fill(self,"vm",{},$globals.SmalltalkImage)});
  4871. //>>excludeEnd("ctx");
  4872. },
  4873. //>>excludeStart("ide", pragmas.excludeIdeData);
  4874. args: [],
  4875. source: "vm\x0a\x09self deprecatedAPI: 'Use #core'.\x0a\x09^self core",
  4876. referencedClasses: [],
  4877. //>>excludeEnd("ide");
  4878. messageSends: ["deprecatedAPI:", "core"]
  4879. }),
  4880. $globals.SmalltalkImage);
  4881. $globals.SmalltalkImage.klass.iVarNames = ['current'];
  4882. $core.addMethod(
  4883. $core.method({
  4884. selector: "current",
  4885. protocol: 'instance creation',
  4886. fn: function (){
  4887. var self=this;
  4888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4889. return $core.withContext(function($ctx1) {
  4890. //>>excludeEnd("ctx");
  4891. var $2,$1,$receiver;
  4892. $2=self["@current"];
  4893. if(($receiver = $2) == null || $receiver.isNil){
  4894. self["@current"]=(
  4895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4896. $ctx1.supercall = true,
  4897. //>>excludeEnd("ctx");
  4898. $globals.SmalltalkImage.klass.superclass.fn.prototype._new.apply($recv(self), []));
  4899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4900. $ctx1.supercall = false;
  4901. //>>excludeEnd("ctx");;
  4902. $1=self["@current"];
  4903. } else {
  4904. self._deprecatedAPI();
  4905. $1=self["@current"];
  4906. };
  4907. return $1;
  4908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4909. }, function($ctx1) {$ctx1.fill(self,"current",{},$globals.SmalltalkImage.klass)});
  4910. //>>excludeEnd("ctx");
  4911. },
  4912. //>>excludeStart("ide", pragmas.excludeIdeData);
  4913. args: [],
  4914. source: "current\x0a\x09^ current ifNil: [ current := super new ] ifNotNil: [ self deprecatedAPI. current ]",
  4915. referencedClasses: [],
  4916. //>>excludeEnd("ide");
  4917. messageSends: ["ifNil:ifNotNil:", "new", "deprecatedAPI"]
  4918. }),
  4919. $globals.SmalltalkImage.klass);
  4920. $core.addMethod(
  4921. $core.method({
  4922. selector: "initialize",
  4923. protocol: 'initialization',
  4924. fn: function (){
  4925. var self=this;
  4926. var st;
  4927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4928. return $core.withContext(function($ctx1) {
  4929. //>>excludeEnd("ctx");
  4930. st=self._current();
  4931. $recv($recv(st)._globals())._at_put_("Smalltalk",st);
  4932. return self;
  4933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4934. }, function($ctx1) {$ctx1.fill(self,"initialize",{st:st},$globals.SmalltalkImage.klass)});
  4935. //>>excludeEnd("ctx");
  4936. },
  4937. //>>excludeStart("ide", pragmas.excludeIdeData);
  4938. args: [],
  4939. source: "initialize\x0a\x09| st |\x0a\x09st := self current.\x0a\x09st globals at: 'Smalltalk' put: st",
  4940. referencedClasses: [],
  4941. //>>excludeEnd("ide");
  4942. messageSends: ["current", "at:put:", "globals"]
  4943. }),
  4944. $globals.SmalltalkImage.klass);
  4945. $core.addMethod(
  4946. $core.method({
  4947. selector: "new",
  4948. protocol: 'instance creation',
  4949. fn: function (){
  4950. var self=this;
  4951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4952. return $core.withContext(function($ctx1) {
  4953. //>>excludeEnd("ctx");
  4954. self._shouldNotImplement();
  4955. return self;
  4956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4957. }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.SmalltalkImage.klass)});
  4958. //>>excludeEnd("ctx");
  4959. },
  4960. //>>excludeStart("ide", pragmas.excludeIdeData);
  4961. args: [],
  4962. source: "new\x0a\x09self shouldNotImplement",
  4963. referencedClasses: [],
  4964. //>>excludeEnd("ide");
  4965. messageSends: ["shouldNotImplement"]
  4966. }),
  4967. $globals.SmalltalkImage.klass);
  4968. $core.addMethod(
  4969. $core.method({
  4970. selector: "do:displayingProgress:",
  4971. protocol: '*Kernel-Infrastructure',
  4972. fn: function (aBlock,aString){
  4973. var self=this;
  4974. function $ProgressHandler(){return $globals.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  4975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4976. return $core.withContext(function($ctx1) {
  4977. //>>excludeEnd("ctx");
  4978. $recv($ProgressHandler())._do_on_displaying_(aBlock,self,aString);
  4979. return self;
  4980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4981. }, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},$globals.SequenceableCollection)});
  4982. //>>excludeEnd("ctx");
  4983. },
  4984. //>>excludeStart("ide", pragmas.excludeIdeData);
  4985. args: ["aBlock", "aString"],
  4986. source: "do: aBlock displayingProgress: aString\x0a\x09ProgressHandler \x0a\x09\x09do: aBlock \x0a\x09\x09on: self \x0a\x09\x09displaying: aString",
  4987. referencedClasses: ["ProgressHandler"],
  4988. //>>excludeEnd("ide");
  4989. messageSends: ["do:on:displaying:"]
  4990. }),
  4991. $globals.SequenceableCollection);
  4992. $core.addMethod(
  4993. $core.method({
  4994. selector: "asJavaScriptPropertyName",
  4995. protocol: '*Kernel-Infrastructure',
  4996. fn: function (){
  4997. var self=this;
  4998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4999. return $core.withContext(function($ctx1) {
  5000. //>>excludeEnd("ctx");
  5001. return $core.st2prop(self);
  5002. return self;
  5003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5004. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptPropertyName",{},$globals.String)});
  5005. //>>excludeEnd("ctx");
  5006. },
  5007. //>>excludeStart("ide", pragmas.excludeIdeData);
  5008. args: [],
  5009. source: "asJavaScriptPropertyName\x0a<return $core.st2prop(self)>",
  5010. referencedClasses: [],
  5011. //>>excludeEnd("ide");
  5012. messageSends: []
  5013. }),
  5014. $globals.String);
  5015. $core.addMethod(
  5016. $core.method({
  5017. selector: "asJavaScriptSelector",
  5018. protocol: '*Kernel-Infrastructure',
  5019. fn: function (){
  5020. var self=this;
  5021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5022. return $core.withContext(function($ctx1) {
  5023. //>>excludeEnd("ctx");
  5024. var $1;
  5025. $1=self._asJavaScriptPropertyName();
  5026. return $1;
  5027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5028. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSelector",{},$globals.String)});
  5029. //>>excludeEnd("ctx");
  5030. },
  5031. //>>excludeStart("ide", pragmas.excludeIdeData);
  5032. args: [],
  5033. source: "asJavaScriptSelector\x0a\x09\x22Cannot add next line as it breaks commit:\x0a\x09self deprecatedAPI: 'Use #asJavaScriptPropertyName'.\x22\x0a\x0a\x09^ self asJavaScriptPropertyName",
  5034. referencedClasses: [],
  5035. //>>excludeEnd("ide");
  5036. messageSends: ["asJavaScriptPropertyName"]
  5037. }),
  5038. $globals.String);
  5039. $core.addMethod(
  5040. $core.method({
  5041. selector: "asSetting",
  5042. protocol: '*Kernel-Infrastructure',
  5043. fn: function (){
  5044. var self=this;
  5045. function $Setting(){return $globals.Setting||(typeof Setting=="undefined"?nil:Setting)}
  5046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5047. return $core.withContext(function($ctx1) {
  5048. //>>excludeEnd("ctx");
  5049. var $1;
  5050. $1=$recv($Setting())._at_ifAbsent_(self,nil);
  5051. return $1;
  5052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5053. }, function($ctx1) {$ctx1.fill(self,"asSetting",{},$globals.String)});
  5054. //>>excludeEnd("ctx");
  5055. },
  5056. //>>excludeStart("ide", pragmas.excludeIdeData);
  5057. args: [],
  5058. source: "asSetting\x0a\x09^ Setting at: self ifAbsent: nil",
  5059. referencedClasses: ["Setting"],
  5060. //>>excludeEnd("ide");
  5061. messageSends: ["at:ifAbsent:"]
  5062. }),
  5063. $globals.String);
  5064. $core.addMethod(
  5065. $core.method({
  5066. selector: "asSettingIfAbsent:",
  5067. protocol: '*Kernel-Infrastructure',
  5068. fn: function (aString){
  5069. var self=this;
  5070. function $Setting(){return $globals.Setting||(typeof Setting=="undefined"?nil:Setting)}
  5071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5072. return $core.withContext(function($ctx1) {
  5073. //>>excludeEnd("ctx");
  5074. var $1;
  5075. $1=$recv($Setting())._at_ifAbsent_(self,aString);
  5076. return $1;
  5077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5078. }, function($ctx1) {$ctx1.fill(self,"asSettingIfAbsent:",{aString:aString},$globals.String)});
  5079. //>>excludeEnd("ctx");
  5080. },
  5081. //>>excludeStart("ide", pragmas.excludeIdeData);
  5082. args: ["aString"],
  5083. source: "asSettingIfAbsent: aString\x0a\x09^ Setting at: self ifAbsent: aString",
  5084. referencedClasses: ["Setting"],
  5085. //>>excludeEnd("ide");
  5086. messageSends: ["at:ifAbsent:"]
  5087. }),
  5088. $globals.String);
  5089. $core.addMethod(
  5090. $core.method({
  5091. selector: "settingValue",
  5092. protocol: '*Kernel-Infrastructure',
  5093. fn: function (){
  5094. var self=this;
  5095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5096. return $core.withContext(function($ctx1) {
  5097. //>>excludeEnd("ctx");
  5098. var $1;
  5099. $1=$recv(self._asSetting())._value();
  5100. return $1;
  5101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5102. }, function($ctx1) {$ctx1.fill(self,"settingValue",{},$globals.String)});
  5103. //>>excludeEnd("ctx");
  5104. },
  5105. //>>excludeStart("ide", pragmas.excludeIdeData);
  5106. args: [],
  5107. source: "settingValue\x0a\x09^ self asSetting value",
  5108. referencedClasses: [],
  5109. //>>excludeEnd("ide");
  5110. messageSends: ["value", "asSetting"]
  5111. }),
  5112. $globals.String);
  5113. $core.addMethod(
  5114. $core.method({
  5115. selector: "settingValue:",
  5116. protocol: '*Kernel-Infrastructure',
  5117. fn: function (aString){
  5118. var self=this;
  5119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5120. return $core.withContext(function($ctx1) {
  5121. //>>excludeEnd("ctx");
  5122. var $1;
  5123. $1=$recv(self._asSetting())._value_(aString);
  5124. return $1;
  5125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5126. }, function($ctx1) {$ctx1.fill(self,"settingValue:",{aString:aString},$globals.String)});
  5127. //>>excludeEnd("ctx");
  5128. },
  5129. //>>excludeStart("ide", pragmas.excludeIdeData);
  5130. args: ["aString"],
  5131. source: "settingValue: aString\x0a\x09^ self asSetting value: aString",
  5132. referencedClasses: [],
  5133. //>>excludeEnd("ide");
  5134. messageSends: ["value:", "asSetting"]
  5135. }),
  5136. $globals.String);
  5137. $core.addMethod(
  5138. $core.method({
  5139. selector: "settingValueIfAbsent:",
  5140. protocol: '*Kernel-Infrastructure',
  5141. fn: function (aString){
  5142. var self=this;
  5143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5144. return $core.withContext(function($ctx1) {
  5145. //>>excludeEnd("ctx");
  5146. var $1;
  5147. $1=$recv(self._asSettingIfAbsent_(aString))._value();
  5148. return $1;
  5149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5150. }, function($ctx1) {$ctx1.fill(self,"settingValueIfAbsent:",{aString:aString},$globals.String)});
  5151. //>>excludeEnd("ctx");
  5152. },
  5153. //>>excludeStart("ide", pragmas.excludeIdeData);
  5154. args: ["aString"],
  5155. source: "settingValueIfAbsent: aString\x0a\x09^ (self asSettingIfAbsent: aString) value",
  5156. referencedClasses: [],
  5157. //>>excludeEnd("ide");
  5158. messageSends: ["value", "asSettingIfAbsent:"]
  5159. }),
  5160. $globals.String);
  5161. });