Compiler.js 190 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625
  1. smalltalk.addPackage('Compiler', {});
  2. smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Compiler');
  3. smalltalk.addMethod(
  4. "_nextChunk",
  5. smalltalk.method({
  6. selector: "nextChunk",
  7. category: 'reading',
  8. fn: function (){
  9. var self=this;
  10. var $early={};
  11. try{var char_=nil;
  12. var result=nil;
  13. var chunk=nil;
  14. (result=smalltalk.send("", "_writeStream", []));
  15. (function(){while((function(){(char_=smalltalk.send(self['@stream'], "_next", []));return smalltalk.send(char_, "_notNil", []);})()) {(function(){((($receiver = smalltalk.send(char_, "__eq", ["!"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self['@stream'], "_peek", []), "__eq", ["!"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_next", []);})() : (function(){return (function(){throw $early=[smalltalk.send(smalltalk.send(result, "_contents", []), "_trimBoth", [])]})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_next", []);}), (function(){return (function(){throw $early=[smalltalk.send(smalltalk.send(result, "_contents", []), "_trimBoth", [])]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self['@stream'], "_peek", []), "__eq", ["!"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_next", []);})() : (function(){return (function(){throw $early=[smalltalk.send(smalltalk.send(result, "_contents", []), "_trimBoth", [])]})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_next", []);}), (function(){return (function(){throw $early=[smalltalk.send(smalltalk.send(result, "_contents", []), "_trimBoth", [])]})();})]));})]));return smalltalk.send(result, "_nextPut_", [char_]);})()}})();
  16. return nil;
  17. return self;
  18. } catch(e) {if(e===$early)return e[0]; throw e}},
  19. args: [],
  20. source: "nextChunk\x0a\x09\x22The chunk format (Smalltalk Interchange Format or Fileout format)\x0a\x09is a trivial format but can be a bit tricky to understand:\x0a\x09\x09- Uses the exclamation mark as delimiter of chunks.\x0a\x09\x09- Inside a chunk a normal exclamation mark must be doubled.\x0a\x09\x09- A non empty chunk must be a valid Smalltalk expression.\x0a\x09\x09- A chunk on top level with a preceding empty chunk is an instruction chunk:\x0a\x09\x09\x09- The object created by the expression then takes over reading chunks.\x0a\x0a\x09This metod returns next chunk as a String (trimmed), empty String (all whitespace) or nil.\x22\x0a\x0a\x09| char result chunk |\x0a\x09result := '' writeStream.\x0a [char := stream next.\x0a char notNil] whileTrue: [\x0a char = '!' ifTrue: [\x0a stream peek = '!'\x0a ifTrue: [stream next \x22skipping the escape double\x22]\x0a ifFalse: [^result contents trimBoth \x22chunk end marker found\x22]].\x0a result nextPut: char].\x0a\x09^nil \x22a chunk needs to end with !\x22",
  21. messageSends: ["writeStream", "whileTrue:", "next", "notNil", "ifTrue:", "=", "ifTrue:ifFalse:", "peek", "trimBoth", "contents", "nextPut:"],
  22. referencedClasses: []
  23. }),
  24. smalltalk.ChunkParser);
  25. smalltalk.addMethod(
  26. "_stream_",
  27. smalltalk.method({
  28. selector: "stream:",
  29. category: 'accessing',
  30. fn: function (aStream){
  31. var self=this;
  32. (self['@stream']=aStream);
  33. return self;},
  34. args: ["aStream"],
  35. source: "stream: aStream\x0a\x09stream := aStream",
  36. messageSends: [],
  37. referencedClasses: []
  38. }),
  39. smalltalk.ChunkParser);
  40. smalltalk.addMethod(
  41. "_on_",
  42. smalltalk.method({
  43. selector: "on:",
  44. category: 'not yet classified',
  45. fn: function (aStream){
  46. var self=this;
  47. return smalltalk.send(smalltalk.send(self, "_new", []), "_stream_", [aStream]);
  48. return self;},
  49. args: ["aStream"],
  50. source: "on: aStream\x0a\x09^self new stream: aStream",
  51. messageSends: ["stream:", "new"],
  52. referencedClasses: []
  53. }),
  54. smalltalk.ChunkParser.klass);
  55. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
  56. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Compiler');
  57. smalltalk.addMethod(
  58. "_classNameFor_",
  59. smalltalk.method({
  60. selector: "classNameFor:",
  61. category: 'private',
  62. fn: function (aClass){
  63. var self=this;
  64. return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
  65. return self;},
  66. args: ["aClass"],
  67. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  68. messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
  69. referencedClasses: []
  70. }),
  71. smalltalk.Exporter);
  72. smalltalk.addMethod(
  73. "_exportAll",
  74. smalltalk.method({
  75. selector: "exportAll",
  76. category: 'fileOut',
  77. fn: function (){
  78. var self=this;
  79. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packages", []), "_do_", [(function(pkg){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportPackage_", [smalltalk.send(pkg, "_name", [])])]);})]);})]);
  80. return self;},
  81. args: [],
  82. source: "exportAll\x0a \x22Export all packages in the system.\x22\x0a\x0a ^String streamContents: [:stream |\x0a \x09Smalltalk current packages do: [:pkg |\x0a\x09\x09stream nextPutAll: (self exportPackage: pkg name)]]",
  83. messageSends: ["streamContents:", "do:", "packages", "current", "nextPutAll:", "exportPackage:", "name"],
  84. referencedClasses: ["String", "Smalltalk"]
  85. }),
  86. smalltalk.Exporter);
  87. smalltalk.addMethod(
  88. "_exportClass_",
  89. smalltalk.method({
  90. selector: "exportClass:",
  91. category: 'fileOut',
  92. fn: function (aClass){
  93. var self=this;
  94. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){smalltalk.send(self, "_exportDefinitionOf_on_", [aClass, stream]);smalltalk.send(self, "_exportMethodsOf_on_", [aClass, stream]);smalltalk.send(self, "_exportMetaDefinitionOf_on_", [aClass, stream]);return smalltalk.send(self, "_exportMethodsOf_on_", [smalltalk.send(aClass, "_class", []), stream]);})]);
  95. return self;},
  96. args: ["aClass"],
  97. source: "exportClass: aClass\x0a\x09\x22Export a single class. Subclasses override these methods.\x22\x0a\x0a\x09^String streamContents: [:stream |\x0a\x09\x09self exportDefinitionOf: aClass on: stream.\x0a\x09\x09self exportMethodsOf: aClass on: stream.\x0a\x09\x09self exportMetaDefinitionOf: aClass on: stream.\x0a\x09\x09self exportMethodsOf: aClass class on: stream]",
  98. messageSends: ["streamContents:", "exportDefinitionOf:on:", "exportMethodsOf:on:", "exportMetaDefinitionOf:on:", "class"],
  99. referencedClasses: ["String"]
  100. }),
  101. smalltalk.Exporter);
  102. smalltalk.addMethod(
  103. "_exportDefinitionOf_on_",
  104. smalltalk.method({
  105. selector: "exportDefinitionOf:on:",
  106. category: 'private',
  107. fn: function (aClass, aStream){
  108. var self=this;
  109. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addClass("]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", ["', "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [", ["]);})(aStream);
  110. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [each]), "__comma", ["'"])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [", "]);})]);
  111. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["], '"]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_category", []), "__comma", ["'"])]);return smalltalk.send($rec, "_nextPutAll_", [");"]);})(aStream);
  112. ((($receiver = smalltalk.send(smalltalk.send(aClass, "_comment", []), "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk."]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [aClass])]);smalltalk.send($rec, "_nextPutAll_", [".comment="]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_comment", []), "_asJavascript", [])]);})(aStream);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk."]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [aClass])]);smalltalk.send($rec, "_nextPutAll_", [".comment="]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_comment", []), "_asJavascript", [])]);})(aStream);})]));
  113. smalltalk.send(aStream, "_lf", []);
  114. return self;},
  115. args: ["aClass", "aStream"],
  116. source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addClass(';\x0a\x09 nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09 nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09 nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames \x0a\x09 do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09 separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x09\x0a\x09 nextPutAll: '], ''';\x0a\x09 nextPutAll: aClass category, '''';\x0a\x09 nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09 aStream \x0a\x09 \x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.';\x0a\x09\x09nextPutAll: (self classNameFor: aClass);\x0a\x09\x09nextPutAll: '.comment=';\x0a\x09\x09nextPutAll: aClass comment asJavascript].\x0a\x09aStream lf",
  117. messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "lf", "asJavascript"],
  118. referencedClasses: []
  119. }),
  120. smalltalk.Exporter);
  121. smalltalk.addMethod(
  122. "_exportMetaDefinitionOf_on_",
  123. smalltalk.method({
  124. selector: "exportMetaDefinitionOf:on:",
  125. category: 'private',
  126. fn: function (aClass, aStream){
  127. var self=this;
  128. ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [".iVarNames = ["]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [each]), "__comma", ["'"])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [","]);})]);return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send("];", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [".iVarNames = ["]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [each]), "__comma", ["'"])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [","]);})]);return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send("];", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})]));
  129. return self;},
  130. args: ["aClass", "aStream"],
  131. source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09 aStream \x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09 aClass class instanceVariableNames\x0a\x09\x09do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09\x09separatedBy: [aStream nextPutAll: ','].\x0a\x09 aStream nextPutAll: '];', String lf]",
  132. messageSends: ["ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", ",", "classNameFor:", "do:separatedBy:", "lf"],
  133. referencedClasses: ["String"]
  134. }),
  135. smalltalk.Exporter);
  136. smalltalk.addMethod(
  137. "_exportMethod_of_on_",
  138. smalltalk.method({
  139. selector: "exportMethod:of:on:",
  140. category: 'private',
  141. fn: function (aMethod, aClass, aStream){
  142. var self=this;
  143. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addMethod("]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asSelector", []), "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("category: '", "__comma", [smalltalk.send(aMethod, "_category", [])]), "__comma", ["',"])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_arguments", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_source", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("messageSends: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_messageSends", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("referencedClasses: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_referencedClasses", []), "_asJavascript", [])])]);})(aStream);
  144. (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["}),"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_nextPutAll_", [");"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  145. return self;},
  146. args: ["aMethod", "aClass", "aStream"],
  147. source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'category: ''', aMethod category, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
  148. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:"],
  149. referencedClasses: []
  150. }),
  151. smalltalk.Exporter);
  152. smalltalk.addMethod(
  153. "_exportMethodsOf_on_",
  154. smalltalk.method({
  155. selector: "exportMethodsOf:on:",
  156. category: 'private',
  157. fn: function (aClass, aStream){
  158. var self=this;
  159. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(b, "_selector", [])]));})]), "_do_", [(function(each){return ((($receiver = smalltalk.send(smalltalk.send(each, "_category", []), "_match_", ["^\x5c*"])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]));})]);
  160. smalltalk.send(aStream, "_lf", []);
  161. return self;},
  162. args: ["aClass", "aStream"],
  163. source: "exportMethodsOf: aClass on: aStream\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:each |\x0a\x09\x09(each category match: '^\x5c*') ifFalse: [\x0a\x09\x09\x09self exportMethod: each of: aClass on: aStream]].\x0a\x09aStream lf",
  164. messageSends: ["do:", "sorted:", "values", "methodDictionary", "<=", "selector", "ifFalse:", "match:", "category", "exportMethod:of:on:", "lf"],
  165. referencedClasses: []
  166. }),
  167. smalltalk.Exporter);
  168. smalltalk.addMethod(
  169. "_exportPackage_",
  170. smalltalk.method({
  171. selector: "exportPackage:",
  172. category: 'fileOut',
  173. fn: function (packageName){
  174. var self=this;
  175. var package=nil;
  176. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){(package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [packageName]));smalltalk.send(self, "_exportPackageDefinitionOf_on_", [package, stream]);smalltalk.send(smalltalk.send(smalltalk.send(package, "_sortedClasses", []), "_asSet", []), "_do_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportClass_", [each])]);})]);return smalltalk.send(self, "_exportPackageExtensionsOf_on_", [package, stream]);})]);
  177. return self;},
  178. args: ["packageName"],
  179. source: "exportPackage: packageName\x0a\x09\x22Export a given package by name.\x22\x0a\x0a\x09| package |\x0a\x09^String streamContents: [:stream |\x0a package := Smalltalk current packageAt: packageName.\x0a self exportPackageDefinitionOf: package on: stream.\x0a\x0a\x09\x09\x22Export classes in dependency order.\x0a\x09\x09Update (issue #171): Remove duplicates for export\x22\x0a\x09 \x09package sortedClasses asSet do: [:each |\x0a stream nextPutAll: (self exportClass: each)].\x0a\x09\x09self exportPackageExtensionsOf: package on: stream]",
  180. messageSends: ["streamContents:", "packageAt:", "current", "exportPackageDefinitionOf:on:", "do:", "asSet", "sortedClasses", "nextPutAll:", "exportClass:", "exportPackageExtensionsOf:on:"],
  181. referencedClasses: ["String", "Smalltalk"]
  182. }),
  183. smalltalk.Exporter);
  184. smalltalk.addMethod(
  185. "_exportPackageDefinitionOf_on_",
  186. smalltalk.method({
  187. selector: "exportPackageDefinitionOf:on:",
  188. category: 'private',
  189. fn: function (package, aStream){
  190. var self=this;
  191. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addPackage("]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("'", "__comma", [smalltalk.send(package, "_name", [])]), "__comma", ["', "]), "__comma", [smalltalk.send(package, "_propertiesAsJSON", [])]), "__comma", [");"])]);})(aStream);
  192. smalltalk.send(aStream, "_lf", []);
  193. return self;},
  194. args: ["package", "aStream"],
  195. source: "exportPackageDefinitionOf: package on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addPackage(';\x0a\x09 nextPutAll: '''', package name, ''', ', package propertiesAsJSON , ');'.\x0a\x09aStream lf",
  196. messageSends: ["nextPutAll:", ",", "name", "propertiesAsJSON", "lf"],
  197. referencedClasses: []
  198. }),
  199. smalltalk.Exporter);
  200. smalltalk.addMethod(
  201. "_exportPackageExtensionsOf_on_",
  202. smalltalk.method({
  203. selector: "exportPackageExtensionsOf:on:",
  204. category: 'private',
  205. fn: function (package, aStream){
  206. var self=this;
  207. var name=nil;
  208. (name=smalltalk.send(package, "_name", []));
  209. smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_sortedClasses_", [smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", [])]), "_do_", [(function(each){return smalltalk.send([each,smalltalk.send(each, "_class", [])], "_do_", [(function(aClass){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(b, "_selector", [])]));})]), "_do_", [(function(method){return ((($receiver = smalltalk.send(smalltalk.send(method, "_category", []), "_match_", [smalltalk.send("^\x5c*", "__comma", [name])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_exportMethod_of_on_", [method, aClass, aStream]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_exportMethod_of_on_", [method, aClass, aStream]);})]));})]);})]);})]);
  210. return self;},
  211. args: ["package", "aStream"],
  212. source: "exportPackageExtensionsOf: package on: aStream\x0a\x09\x22Issue #143: sort classes and methods alphabetically\x22\x0a\x0a\x09| name |\x0a\x09name := package name.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass | \x0a\x09\x09\x09((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:method |\x0a\x09\x09\x09\x09(method category match: '^\x5c*', name) ifTrue: [\x0a\x09\x09\x09\x09\x09self exportMethod: method of: aClass on: aStream ]]]]",
  213. messageSends: ["name", "do:", "sortedClasses:", "classes", "current", "class", "sorted:", "values", "methodDictionary", "<=", "selector", "ifTrue:", "match:", "category", ",", "exportMethod:of:on:"],
  214. referencedClasses: ["Package", "Smalltalk"]
  215. }),
  216. smalltalk.Exporter);
  217. smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Compiler');
  218. smalltalk.addMethod(
  219. "_chunkEscape_",
  220. smalltalk.method({
  221. selector: "chunkEscape:",
  222. category: 'not yet classified',
  223. fn: function (aString){
  224. var self=this;
  225. return smalltalk.send(smalltalk.send(aString, "_replace_with_", ["!", "!!"]), "_trimBoth", []);
  226. return self;},
  227. args: ["aString"],
  228. source: "chunkEscape: aString\x0a\x09\x22Replace all occurrences of ! with !! and trim at both ends.\x22\x0a\x0a\x09^(aString replace: '!' with: '!!') trimBoth",
  229. messageSends: ["trimBoth", "replace:with:"],
  230. referencedClasses: []
  231. }),
  232. smalltalk.ChunkExporter);
  233. smalltalk.addMethod(
  234. "_classNameFor_",
  235. smalltalk.method({
  236. selector: "classNameFor:",
  237. category: 'not yet classified',
  238. fn: function (aClass){
  239. var self=this;
  240. return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [" class"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [" class"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
  241. return self;},
  242. args: ["aClass"],
  243. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, ' class']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  244. messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
  245. referencedClasses: []
  246. }),
  247. smalltalk.ChunkExporter);
  248. smalltalk.addMethod(
  249. "_exportDefinitionOf_on_",
  250. smalltalk.method({
  251. selector: "exportDefinitionOf:on:",
  252. category: 'not yet classified',
  253. fn: function (aClass, aStream){
  254. var self=this;
  255. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(" subclass: #", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["\x09instanceVariableNames: '"]);})(aStream);
  256. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);
  257. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["'"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("\x09package: '", "__comma", [smalltalk.send(aClass, "_category", [])]), "__comma", ["'!"])]);return smalltalk.send($rec, "_lf", []);})(aStream);
  258. ((($receiver = smalltalk.send(smalltalk.send(aClass, "_comment", []), "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("!", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [" commentStamp!"])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aClass, "_comment", [])]), "__comma", ["!"])]);return smalltalk.send($rec, "_lf", []);})(aStream);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("!", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [" commentStamp!"])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aClass, "_comment", [])]), "__comma", ["!"])]);return smalltalk.send($rec, "_lf", []);})(aStream);})]));
  259. smalltalk.send(aStream, "_lf", []);
  260. return self;},
  261. args: ["aClass", "aStream"],
  262. source: "exportDefinitionOf: aClass on: aStream\x0a \x22Chunk format.\x22\x0a\x0a aStream \x0a nextPutAll: (self classNameFor: aClass superclass);\x0a nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;\x0a nextPutAll: '\x09instanceVariableNames: '''.\x0a aClass instanceVariableNames \x0a do: [:each | aStream nextPutAll: each]\x0a separatedBy: [aStream nextPutAll: ' '].\x0a aStream \x0a nextPutAll: ''''; lf;\x0a nextPutAll: '\x09package: ''', aClass category, '''!'; lf.\x0a aClass comment notEmpty ifTrue: [\x0a aStream \x0a nextPutAll: '!', (self classNameFor: aClass), ' commentStamp!';lf;\x0a nextPutAll: (self chunkEscape: aClass comment), '!';lf].\x0a aStream lf",
  263. messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "chunkEscape:"],
  264. referencedClasses: []
  265. }),
  266. smalltalk.ChunkExporter);
  267. smalltalk.addMethod(
  268. "_exportMetaDefinitionOf_on_",
  269. smalltalk.method({
  270. selector: "exportMetaDefinitionOf:on:",
  271. category: 'not yet classified',
  272. fn: function (aClass, aStream){
  273. var self=this;
  274. ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])]);return smalltalk.send($rec, "_nextPutAll_", [" instanceVariableNames: '"]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["'!"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])]);return smalltalk.send($rec, "_nextPutAll_", [" instanceVariableNames: '"]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["'!"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);})]));
  275. return self;},
  276. args: ["aClass", "aStream"],
  277. source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream \x0a\x09\x09 nextPutAll: (self classNameFor: aClass class);\x0a\x09\x09 nextPutAll: ' instanceVariableNames: '''.\x0a\x09\x09aClass class instanceVariableNames \x0a\x09\x09 do: [:each | aStream nextPutAll: each]\x0a\x09\x09 separatedBy: [aStream nextPutAll: ' '].\x0a\x09\x09aStream\x09\x0a\x09\x09 nextPutAll: '''!'; lf; lf]",
  278. messageSends: ["ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", "classNameFor:", "do:separatedBy:", "lf"],
  279. referencedClasses: []
  280. }),
  281. smalltalk.ChunkExporter);
  282. smalltalk.addMethod(
  283. "_exportMethod_of_on_",
  284. smalltalk.method({
  285. selector: "exportMethod:of:on:",
  286. category: 'not yet classified',
  287. fn: function (aMethod, aClass, aStream){
  288. var self=this;
  289. (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aMethod, "_source", [])])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["!"]);})(aStream);
  290. return self;},
  291. args: ["aMethod", "aClass", "aStream"],
  292. source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;\x0a\x09\x09nextPutAll: '!'",
  293. messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"],
  294. referencedClasses: []
  295. }),
  296. smalltalk.ChunkExporter);
  297. smalltalk.addMethod(
  298. "_exportMethods_category_of_on_",
  299. smalltalk.method({
  300. selector: "exportMethods:category:of:on:",
  301. category: 'not yet classified',
  302. fn: function (methods, category, aClass, aStream){
  303. var self=this;
  304. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("!", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(" methodsFor: '", "__comma", [category]), "__comma", ["'!"])]);})(aStream);
  305. smalltalk.send(smalltalk.send(methods, "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(b, "_selector", [])]));})]), "_do_", [(function(each){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]);
  306. (function($rec){smalltalk.send($rec, "_nextPutAll_", [" !"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  307. return self;},
  308. args: ["methods", "category", "aClass", "aStream"],
  309. source: "exportMethods: methods category: category of: aClass on: aStream\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ' methodsFor: ''', category, '''!'.\x0a\x09\x09(methods sorted: [:a :b | a selector <= b selector]) do: [:each |\x0a\x09\x09\x09\x09self exportMethod: each of: aClass on: aStream].\x0a\x09aStream nextPutAll: ' !'; lf; lf",
  310. messageSends: ["nextPutAll:", ",", "classNameFor:", "do:", "sorted:", "<=", "selector", "exportMethod:of:on:", "lf"],
  311. referencedClasses: []
  312. }),
  313. smalltalk.ChunkExporter);
  314. smalltalk.addMethod(
  315. "_exportMethodsOf_on_",
  316. smalltalk.method({
  317. selector: "exportMethodsOf:on:",
  318. category: 'not yet classified',
  319. fn: function (aClass, aStream){
  320. var self=this;
  321. var map=nil;
  322. (map=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  323. smalltalk.send(aClass, "_protocolsDo_", [(function(category, methods){return ((($receiver = smalltalk.send(category, "_match_", ["^\x5c*"])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(map, "_at_put_", [category, methods]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(map, "_at_put_", [category, methods]);})]));})]);
  324. smalltalk.send(smalltalk.send(smalltalk.send(map, "_keys", []), "_sorted_", [(function(a, b){return ((($receiver = a).klass === smalltalk.Number) ? $receiver <=b : smalltalk.send($receiver, "__lt_eq", [b]));})]), "_do_", [(function(category){var methods=nil;
  325. (methods=smalltalk.send(map, "_at_", [category]));return smalltalk.send(self, "_exportMethods_category_of_on_", [methods, category, aClass, aStream]);})]);
  326. return self;},
  327. args: ["aClass", "aStream"],
  328. source: "exportMethodsOf: aClass on: aStream\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| map |\x0a\x09map := Dictionary new.\x0a\x09aClass protocolsDo: [:category :methods | \x0a\x09\x09(category match: '^\x5c*') ifFalse: [ map at: category put: methods ]].\x0a\x09(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |\x0a\x09\x09methods := map at: category.\x0a\x09\x09self\x0a\x09\x09\x09exportMethods: methods\x0a\x09\x09\x09category: category\x0a\x09\x09\x09of: aClass\x0a\x09\x09\x09on: aStream ]",
  329. messageSends: ["new", "protocolsDo:", "ifFalse:", "match:", "at:put:", "do:", "sorted:", "keys", "<=", "at:", "exportMethods:category:of:on:"],
  330. referencedClasses: ["Dictionary"]
  331. }),
  332. smalltalk.ChunkExporter);
  333. smalltalk.addMethod(
  334. "_exportPackageDefinitionOf_on_",
  335. smalltalk.method({
  336. selector: "exportPackageDefinitionOf:on:",
  337. category: 'not yet classified',
  338. fn: function (package, aStream){
  339. var self=this;
  340. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Smalltalk current createPackage: '", "__comma", [smalltalk.send(package, "_name", [])]), "__comma", ["' properties: "]), "__comma", [smalltalk.send(smalltalk.send(package, "_properties", []), "_storeString", [])]), "__comma", ["!"])]);return smalltalk.send($rec, "_lf", []);})(aStream);
  341. return self;},
  342. args: ["package", "aStream"],
  343. source: "exportPackageDefinitionOf: package on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream \x0a\x09 nextPutAll: 'Smalltalk current createPackage: ''', package name,\x0a\x09\x09''' properties: ', package properties storeString, '!'; lf.",
  344. messageSends: ["nextPutAll:", ",", "name", "storeString", "properties", "lf"],
  345. referencedClasses: []
  346. }),
  347. smalltalk.ChunkExporter);
  348. smalltalk.addMethod(
  349. "_exportPackageExtensionsOf_on_",
  350. smalltalk.method({
  351. selector: "exportPackageExtensionsOf:on:",
  352. category: 'not yet classified',
  353. fn: function (package, aStream){
  354. var self=this;
  355. var name=nil;
  356. var map=nil;
  357. (name=smalltalk.send(package, "_name", []));
  358. smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_sortedClasses_", [smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", [])]), "_do_", [(function(each){return smalltalk.send([each,smalltalk.send(each, "_class", [])], "_do_", [(function(aClass){(map=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));smalltalk.send(aClass, "_protocolsDo_", [(function(category, methods){return ((($receiver = smalltalk.send(category, "_match_", [smalltalk.send("^\x5c*", "__comma", [name])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(map, "_at_put_", [category, methods]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(map, "_at_put_", [category, methods]);})]));})]);return smalltalk.send(smalltalk.send(smalltalk.send(map, "_keys", []), "_sorted_", [(function(a, b){return ((($receiver = a).klass === smalltalk.Number) ? $receiver <=b : smalltalk.send($receiver, "__lt_eq", [b]));})]), "_do_", [(function(category){var methods=nil;
  359. (methods=smalltalk.send(map, "_at_", [category]));return smalltalk.send(self, "_exportMethods_category_of_on_", [methods, category, aClass, aStream]);})]);})]);})]);
  360. return self;},
  361. args: ["package", "aStream"],
  362. source: "exportPackageExtensionsOf: package on: aStream\x0a\x09\x22We need to override this one too since we need to group\x0a\x09all methods in a given protocol under a leading methodsFor: chunk\x0a\x09for that class.\x22\x0a\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| name map |\x0a\x09name := package name.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass |\x0a\x09\x09\x09map := Dictionary new.\x0a\x09\x09\x09aClass protocolsDo: [:category :methods | \x0a\x09\x09\x09\x09(category match: '^\x5c*', name) ifTrue: [ map at: category put: methods ]].\x0a\x09\x09\x09(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |\x0a\x09\x09\x09\x09methods := map at: category.\x09\x0a\x09\x09\x09\x09self exportMethods: methods category: category of: aClass on: aStream ]]]",
  363. messageSends: ["name", "do:", "sortedClasses:", "classes", "current", "class", "new", "protocolsDo:", "ifTrue:", "match:", ",", "at:put:", "sorted:", "keys", "<=", "at:", "exportMethods:category:of:on:"],
  364. referencedClasses: ["Package", "Smalltalk", "Dictionary"]
  365. }),
  366. smalltalk.ChunkExporter);
  367. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Compiler');
  368. smalltalk.addMethod(
  369. "_exportDefinitionOf_on_",
  370. smalltalk.method({
  371. selector: "exportDefinitionOf:on:",
  372. category: 'private',
  373. fn: function (aClass, aStream){
  374. var self=this;
  375. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addClass("]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", ["', "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [", ["]);})(aStream);
  376. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [each]), "__comma", ["'"])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [", "]);})]);
  377. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["], '"]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_category", []), "__comma", ["'"])]);return smalltalk.send($rec, "_nextPutAll_", [");"]);})(aStream);
  378. smalltalk.send(aStream, "_lf", []);
  379. return self;},
  380. args: ["aClass", "aStream"],
  381. source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addClass(';\x0a\x09 nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09 nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09 nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames \x0a\x09 do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09 separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x09\x0a\x09 nextPutAll: '], ''';\x0a\x09 nextPutAll: aClass category, '''';\x0a\x09 nextPutAll: ');'.\x0a\x09aStream lf",
  382. messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "lf"],
  383. referencedClasses: []
  384. }),
  385. smalltalk.StrippedExporter);
  386. smalltalk.addMethod(
  387. "_exportMethod_of_on_",
  388. smalltalk.method({
  389. selector: "exportMethod:of:on:",
  390. category: 'private',
  391. fn: function (aMethod, aClass, aStream){
  392. var self=this;
  393. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addMethod("]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asSelector", []), "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["}),"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_nextPutAll_", [");"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  394. return self;},
  395. args: ["aMethod", "aClass", "aStream"],
  396. source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource;lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
  397. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "compiledSource", "fn", "classNameFor:"],
  398. referencedClasses: []
  399. }),
  400. smalltalk.StrippedExporter);
  401. smalltalk.addClass('Importer', smalltalk.Object, [], 'Compiler');
  402. smalltalk.addMethod(
  403. "_import_",
  404. smalltalk.method({
  405. selector: "import:",
  406. category: 'fileIn',
  407. fn: function (aStream){
  408. var self=this;
  409. var chunk=nil;
  410. var result=nil;
  411. var parser=nil;
  412. var lastEmpty=nil;
  413. (parser=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_on_", [aStream]));
  414. (lastEmpty=false);
  415. (function(){while(!(function(){(chunk=smalltalk.send(parser, "_nextChunk", []));return smalltalk.send(chunk, "_isNil", []);})()) {(function(){return ((($receiver = smalltalk.send(chunk, "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (lastEmpty=true);})() : (function(){(result=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_evaluateExpression_", [chunk]));return ((($receiver = lastEmpty).klass === smalltalk.Boolean) ? ($receiver ? (function(){(lastEmpty=false);return smalltalk.send(result, "_scanFrom_", [parser]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){(lastEmpty=false);return smalltalk.send(result, "_scanFrom_", [parser]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (lastEmpty=true);}), (function(){(result=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_evaluateExpression_", [chunk]));return ((($receiver = lastEmpty).klass === smalltalk.Boolean) ? ($receiver ? (function(){(lastEmpty=false);return smalltalk.send(result, "_scanFrom_", [parser]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){(lastEmpty=false);return smalltalk.send(result, "_scanFrom_", [parser]);})]));})]));})()}})();
  416. return self;},
  417. args: ["aStream"],
  418. source: "import: aStream\x0a | chunk result parser lastEmpty |\x0a parser := ChunkParser on: aStream.\x0a lastEmpty := false.\x0a [chunk := parser nextChunk.\x0a chunk isNil] whileFalse: [\x0a chunk isEmpty\x0a \x09\x09ifTrue: [lastEmpty := true]\x0a \x09\x09ifFalse: [\x0a \x09\x09result := Compiler new evaluateExpression: chunk.\x0a \x09\x09lastEmpty \x0a \x09\x09\x09ifTrue: [\x0a \x09lastEmpty := false.\x0a \x09result scanFrom: parser]]]",
  419. messageSends: ["on:", "whileFalse:", "nextChunk", "isNil", "ifTrue:ifFalse:", "isEmpty", "evaluateExpression:", "new", "ifTrue:", "scanFrom:"],
  420. referencedClasses: ["ChunkParser", "Compiler"]
  421. }),
  422. smalltalk.Importer);
  423. smalltalk.addClass('Node', smalltalk.Object, ['nodes'], 'Compiler');
  424. smalltalk.addMethod(
  425. "_accept_",
  426. smalltalk.method({
  427. selector: "accept:",
  428. category: 'visiting',
  429. fn: function (aVisitor){
  430. var self=this;
  431. smalltalk.send(aVisitor, "_visitNode_", [self]);
  432. return self;},
  433. args: ["aVisitor"],
  434. source: "accept: aVisitor\x0a\x09aVisitor visitNode: self",
  435. messageSends: ["visitNode:"],
  436. referencedClasses: []
  437. }),
  438. smalltalk.Node);
  439. smalltalk.addMethod(
  440. "_addNode_",
  441. smalltalk.method({
  442. selector: "addNode:",
  443. category: 'accessing',
  444. fn: function (aNode){
  445. var self=this;
  446. smalltalk.send(smalltalk.send(self, "_nodes", []), "_add_", [aNode]);
  447. return self;},
  448. args: ["aNode"],
  449. source: "addNode: aNode\x0a\x09self nodes add: aNode",
  450. messageSends: ["add:", "nodes"],
  451. referencedClasses: []
  452. }),
  453. smalltalk.Node);
  454. smalltalk.addMethod(
  455. "_isBlockNode",
  456. smalltalk.method({
  457. selector: "isBlockNode",
  458. category: 'testing',
  459. fn: function (){
  460. var self=this;
  461. return false;
  462. return self;},
  463. args: [],
  464. source: "isBlockNode\x0a\x09^false",
  465. messageSends: [],
  466. referencedClasses: []
  467. }),
  468. smalltalk.Node);
  469. smalltalk.addMethod(
  470. "_isBlockSequenceNode",
  471. smalltalk.method({
  472. selector: "isBlockSequenceNode",
  473. category: 'testing',
  474. fn: function (){
  475. var self=this;
  476. return false;
  477. return self;},
  478. args: [],
  479. source: "isBlockSequenceNode\x0a\x09^false",
  480. messageSends: [],
  481. referencedClasses: []
  482. }),
  483. smalltalk.Node);
  484. smalltalk.addMethod(
  485. "_isValueNode",
  486. smalltalk.method({
  487. selector: "isValueNode",
  488. category: 'testing',
  489. fn: function (){
  490. var self=this;
  491. return false;
  492. return self;},
  493. args: [],
  494. source: "isValueNode\x0a\x09^false",
  495. messageSends: [],
  496. referencedClasses: []
  497. }),
  498. smalltalk.Node);
  499. smalltalk.addMethod(
  500. "_nodes",
  501. smalltalk.method({
  502. selector: "nodes",
  503. category: 'accessing',
  504. fn: function (){
  505. var self=this;
  506. return (($receiver = self['@nodes']) == nil || $receiver == undefined) ? (function(){return (self['@nodes']=smalltalk.send((smalltalk.Array || Array), "_new", []));})() : $receiver;
  507. return self;},
  508. args: [],
  509. source: "nodes\x0a\x09^nodes ifNil: [nodes := Array new]",
  510. messageSends: ["ifNil:", "new"],
  511. referencedClasses: ["Array"]
  512. }),
  513. smalltalk.Node);
  514. smalltalk.addMethod(
  515. "_nodes_",
  516. smalltalk.method({
  517. selector: "nodes:",
  518. category: 'building',
  519. fn: function (aCollection){
  520. var self=this;
  521. (self['@nodes']=aCollection);
  522. return self;},
  523. args: ["aCollection"],
  524. source: "nodes: aCollection\x0a\x09nodes := aCollection",
  525. messageSends: [],
  526. referencedClasses: []
  527. }),
  528. smalltalk.Node);
  529. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler');
  530. smalltalk.addMethod(
  531. "_accept_",
  532. smalltalk.method({
  533. selector: "accept:",
  534. category: 'visiting',
  535. fn: function (aVisitor){
  536. var self=this;
  537. smalltalk.send(aVisitor, "_visitAssignmentNode_", [self]);
  538. return self;},
  539. args: ["aVisitor"],
  540. source: "accept: aVisitor\x0a\x09aVisitor visitAssignmentNode: self",
  541. messageSends: ["visitAssignmentNode:"],
  542. referencedClasses: []
  543. }),
  544. smalltalk.AssignmentNode);
  545. smalltalk.addMethod(
  546. "_left",
  547. smalltalk.method({
  548. selector: "left",
  549. category: 'accessing',
  550. fn: function (){
  551. var self=this;
  552. return self['@left'];
  553. return self;},
  554. args: [],
  555. source: "left\x0a\x09^left",
  556. messageSends: [],
  557. referencedClasses: []
  558. }),
  559. smalltalk.AssignmentNode);
  560. smalltalk.addMethod(
  561. "_left_",
  562. smalltalk.method({
  563. selector: "left:",
  564. category: 'accessing',
  565. fn: function (aNode){
  566. var self=this;
  567. (self['@left']=aNode);
  568. smalltalk.send(self['@left'], "_assigned_", [true]);
  569. return self;},
  570. args: ["aNode"],
  571. source: "left: aNode\x0a\x09left := aNode.\x0a\x09left assigned: true",
  572. messageSends: ["assigned:"],
  573. referencedClasses: []
  574. }),
  575. smalltalk.AssignmentNode);
  576. smalltalk.addMethod(
  577. "_right",
  578. smalltalk.method({
  579. selector: "right",
  580. category: 'accessing',
  581. fn: function (){
  582. var self=this;
  583. return self['@right'];
  584. return self;},
  585. args: [],
  586. source: "right\x0a\x09^right",
  587. messageSends: [],
  588. referencedClasses: []
  589. }),
  590. smalltalk.AssignmentNode);
  591. smalltalk.addMethod(
  592. "_right_",
  593. smalltalk.method({
  594. selector: "right:",
  595. category: 'accessing',
  596. fn: function (aNode){
  597. var self=this;
  598. (self['@right']=aNode);
  599. return self;},
  600. args: ["aNode"],
  601. source: "right: aNode\x0a\x09right := aNode",
  602. messageSends: [],
  603. referencedClasses: []
  604. }),
  605. smalltalk.AssignmentNode);
  606. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters', 'inlined'], 'Compiler');
  607. smalltalk.addMethod(
  608. "_accept_",
  609. smalltalk.method({
  610. selector: "accept:",
  611. category: 'visiting',
  612. fn: function (aVisitor){
  613. var self=this;
  614. smalltalk.send(aVisitor, "_visitBlockNode_", [self]);
  615. return self;},
  616. args: ["aVisitor"],
  617. source: "accept: aVisitor\x0a\x09aVisitor visitBlockNode: self",
  618. messageSends: ["visitBlockNode:"],
  619. referencedClasses: []
  620. }),
  621. smalltalk.BlockNode);
  622. smalltalk.addMethod(
  623. "_inlined",
  624. smalltalk.method({
  625. selector: "inlined",
  626. category: 'accessing',
  627. fn: function (){
  628. var self=this;
  629. return (($receiver = self['@inlined']) == nil || $receiver == undefined) ? (function(){return false;})() : $receiver;
  630. return self;},
  631. args: [],
  632. source: "inlined\x0a\x09^inlined ifNil: [false]",
  633. messageSends: ["ifNil:"],
  634. referencedClasses: []
  635. }),
  636. smalltalk.BlockNode);
  637. smalltalk.addMethod(
  638. "_inlined_",
  639. smalltalk.method({
  640. selector: "inlined:",
  641. category: 'accessing',
  642. fn: function (aBoolean){
  643. var self=this;
  644. (self['@inlined']=aBoolean);
  645. return self;},
  646. args: ["aBoolean"],
  647. source: "inlined: aBoolean\x0a\x09inlined := aBoolean",
  648. messageSends: [],
  649. referencedClasses: []
  650. }),
  651. smalltalk.BlockNode);
  652. smalltalk.addMethod(
  653. "_isBlockNode",
  654. smalltalk.method({
  655. selector: "isBlockNode",
  656. category: 'testing',
  657. fn: function (){
  658. var self=this;
  659. return true;
  660. return self;},
  661. args: [],
  662. source: "isBlockNode\x0a\x09^true",
  663. messageSends: [],
  664. referencedClasses: []
  665. }),
  666. smalltalk.BlockNode);
  667. smalltalk.addMethod(
  668. "_parameters",
  669. smalltalk.method({
  670. selector: "parameters",
  671. category: 'accessing',
  672. fn: function (){
  673. var self=this;
  674. return (($receiver = self['@parameters']) == nil || $receiver == undefined) ? (function(){return (self['@parameters']=smalltalk.send((smalltalk.Array || Array), "_new", []));})() : $receiver;
  675. return self;},
  676. args: [],
  677. source: "parameters\x0a\x09^parameters ifNil: [parameters := Array new]",
  678. messageSends: ["ifNil:", "new"],
  679. referencedClasses: ["Array"]
  680. }),
  681. smalltalk.BlockNode);
  682. smalltalk.addMethod(
  683. "_parameters_",
  684. smalltalk.method({
  685. selector: "parameters:",
  686. category: 'accessing',
  687. fn: function (aCollection){
  688. var self=this;
  689. (self['@parameters']=aCollection);
  690. return self;},
  691. args: ["aCollection"],
  692. source: "parameters: aCollection\x0a\x09parameters := aCollection",
  693. messageSends: [],
  694. referencedClasses: []
  695. }),
  696. smalltalk.BlockNode);
  697. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler');
  698. smalltalk.addMethod(
  699. "_accept_",
  700. smalltalk.method({
  701. selector: "accept:",
  702. category: 'visiting',
  703. fn: function (aVisitor){
  704. var self=this;
  705. smalltalk.send(aVisitor, "_visitCascadeNode_", [self]);
  706. return self;},
  707. args: ["aVisitor"],
  708. source: "accept: aVisitor\x0a\x09aVisitor visitCascadeNode: self",
  709. messageSends: ["visitCascadeNode:"],
  710. referencedClasses: []
  711. }),
  712. smalltalk.CascadeNode);
  713. smalltalk.addMethod(
  714. "_receiver",
  715. smalltalk.method({
  716. selector: "receiver",
  717. category: 'accessing',
  718. fn: function (){
  719. var self=this;
  720. return self['@receiver'];
  721. return self;},
  722. args: [],
  723. source: "receiver\x0a\x09^receiver",
  724. messageSends: [],
  725. referencedClasses: []
  726. }),
  727. smalltalk.CascadeNode);
  728. smalltalk.addMethod(
  729. "_receiver_",
  730. smalltalk.method({
  731. selector: "receiver:",
  732. category: 'accessing',
  733. fn: function (aNode){
  734. var self=this;
  735. (self['@receiver']=aNode);
  736. return self;},
  737. args: ["aNode"],
  738. source: "receiver: aNode\x0a\x09receiver := aNode",
  739. messageSends: [],
  740. referencedClasses: []
  741. }),
  742. smalltalk.CascadeNode);
  743. smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler');
  744. smalltalk.addMethod(
  745. "_accept_",
  746. smalltalk.method({
  747. selector: "accept:",
  748. category: 'visiting',
  749. fn: function (aVisitor){
  750. var self=this;
  751. smalltalk.send(aVisitor, "_visitDynamicArrayNode_", [self]);
  752. return self;},
  753. args: ["aVisitor"],
  754. source: "accept: aVisitor\x0a\x09aVisitor visitDynamicArrayNode: self",
  755. messageSends: ["visitDynamicArrayNode:"],
  756. referencedClasses: []
  757. }),
  758. smalltalk.DynamicArrayNode);
  759. smalltalk.addClass('DynamicDictionaryNode', smalltalk.Node, [], 'Compiler');
  760. smalltalk.addMethod(
  761. "_accept_",
  762. smalltalk.method({
  763. selector: "accept:",
  764. category: 'visiting',
  765. fn: function (aVisitor){
  766. var self=this;
  767. smalltalk.send(aVisitor, "_visitDynamicDictionaryNode_", [self]);
  768. return self;},
  769. args: ["aVisitor"],
  770. source: "accept: aVisitor\x0a\x09aVisitor visitDynamicDictionaryNode: self",
  771. messageSends: ["visitDynamicDictionaryNode:"],
  772. referencedClasses: []
  773. }),
  774. smalltalk.DynamicDictionaryNode);
  775. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler');
  776. smalltalk.addMethod(
  777. "_accept_",
  778. smalltalk.method({
  779. selector: "accept:",
  780. category: 'visiting',
  781. fn: function (aVisitor){
  782. var self=this;
  783. smalltalk.send(aVisitor, "_visitJSStatementNode_", [self]);
  784. return self;},
  785. args: ["aVisitor"],
  786. source: "accept: aVisitor\x0a\x09aVisitor visitJSStatementNode: self",
  787. messageSends: ["visitJSStatementNode:"],
  788. referencedClasses: []
  789. }),
  790. smalltalk.JSStatementNode);
  791. smalltalk.addMethod(
  792. "_source",
  793. smalltalk.method({
  794. selector: "source",
  795. category: 'accessing',
  796. fn: function (){
  797. var self=this;
  798. return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  799. return self;},
  800. args: [],
  801. source: "source\x0a\x09^source ifNil: ['']",
  802. messageSends: ["ifNil:"],
  803. referencedClasses: []
  804. }),
  805. smalltalk.JSStatementNode);
  806. smalltalk.addMethod(
  807. "_source_",
  808. smalltalk.method({
  809. selector: "source:",
  810. category: 'accessing',
  811. fn: function (aString){
  812. var self=this;
  813. (self['@source']=aString);
  814. return self;},
  815. args: ["aString"],
  816. source: "source: aString\x0a\x09source := aString",
  817. messageSends: [],
  818. referencedClasses: []
  819. }),
  820. smalltalk.JSStatementNode);
  821. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source'], 'Compiler');
  822. smalltalk.addMethod(
  823. "_accept_",
  824. smalltalk.method({
  825. selector: "accept:",
  826. category: 'visiting',
  827. fn: function (aVisitor){
  828. var self=this;
  829. smalltalk.send(aVisitor, "_visitMethodNode_", [self]);
  830. return self;},
  831. args: ["aVisitor"],
  832. source: "accept: aVisitor\x0a\x09aVisitor visitMethodNode: self",
  833. messageSends: ["visitMethodNode:"],
  834. referencedClasses: []
  835. }),
  836. smalltalk.MethodNode);
  837. smalltalk.addMethod(
  838. "_arguments",
  839. smalltalk.method({
  840. selector: "arguments",
  841. category: 'accessing',
  842. fn: function (){
  843. var self=this;
  844. return (($receiver = self['@arguments']) == nil || $receiver == undefined) ? (function(){return [];})() : $receiver;
  845. return self;},
  846. args: [],
  847. source: "arguments\x0a\x09^arguments ifNil: [#()]",
  848. messageSends: ["ifNil:"],
  849. referencedClasses: []
  850. }),
  851. smalltalk.MethodNode);
  852. smalltalk.addMethod(
  853. "_arguments_",
  854. smalltalk.method({
  855. selector: "arguments:",
  856. category: 'accessing',
  857. fn: function (aCollection){
  858. var self=this;
  859. (self['@arguments']=aCollection);
  860. return self;},
  861. args: ["aCollection"],
  862. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  863. messageSends: [],
  864. referencedClasses: []
  865. }),
  866. smalltalk.MethodNode);
  867. smalltalk.addMethod(
  868. "_selector",
  869. smalltalk.method({
  870. selector: "selector",
  871. category: 'accessing',
  872. fn: function (){
  873. var self=this;
  874. return self['@selector'];
  875. return self;},
  876. args: [],
  877. source: "selector\x0a\x09^selector",
  878. messageSends: [],
  879. referencedClasses: []
  880. }),
  881. smalltalk.MethodNode);
  882. smalltalk.addMethod(
  883. "_selector_",
  884. smalltalk.method({
  885. selector: "selector:",
  886. category: 'accessing',
  887. fn: function (aString){
  888. var self=this;
  889. (self['@selector']=aString);
  890. return self;},
  891. args: ["aString"],
  892. source: "selector: aString\x0a\x09selector := aString",
  893. messageSends: [],
  894. referencedClasses: []
  895. }),
  896. smalltalk.MethodNode);
  897. smalltalk.addMethod(
  898. "_source",
  899. smalltalk.method({
  900. selector: "source",
  901. category: 'accessing',
  902. fn: function (){
  903. var self=this;
  904. return self['@source'];
  905. return self;},
  906. args: [],
  907. source: "source\x0a\x09^source",
  908. messageSends: [],
  909. referencedClasses: []
  910. }),
  911. smalltalk.MethodNode);
  912. smalltalk.addMethod(
  913. "_source_",
  914. smalltalk.method({
  915. selector: "source:",
  916. category: 'accessing',
  917. fn: function (aString){
  918. var self=this;
  919. (self['@source']=aString);
  920. return self;},
  921. args: ["aString"],
  922. source: "source: aString\x0a\x09source := aString",
  923. messageSends: [],
  924. referencedClasses: []
  925. }),
  926. smalltalk.MethodNode);
  927. smalltalk.addClass('ReturnNode', smalltalk.Node, [], 'Compiler');
  928. smalltalk.addMethod(
  929. "_accept_",
  930. smalltalk.method({
  931. selector: "accept:",
  932. category: 'visiting',
  933. fn: function (aVisitor){
  934. var self=this;
  935. smalltalk.send(aVisitor, "_visitReturnNode_", [self]);
  936. return self;},
  937. args: ["aVisitor"],
  938. source: "accept: aVisitor\x0a\x09aVisitor visitReturnNode: self",
  939. messageSends: ["visitReturnNode:"],
  940. referencedClasses: []
  941. }),
  942. smalltalk.ReturnNode);
  943. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver'], 'Compiler');
  944. smalltalk.addMethod(
  945. "_accept_",
  946. smalltalk.method({
  947. selector: "accept:",
  948. category: 'visiting',
  949. fn: function (aVisitor){
  950. var self=this;
  951. smalltalk.send(aVisitor, "_visitSendNode_", [self]);
  952. return self;},
  953. args: ["aVisitor"],
  954. source: "accept: aVisitor\x0a\x09aVisitor visitSendNode: self",
  955. messageSends: ["visitSendNode:"],
  956. referencedClasses: []
  957. }),
  958. smalltalk.SendNode);
  959. smalltalk.addMethod(
  960. "_arguments",
  961. smalltalk.method({
  962. selector: "arguments",
  963. category: 'accessing',
  964. fn: function (){
  965. var self=this;
  966. return (($receiver = self['@arguments']) == nil || $receiver == undefined) ? (function(){return (self['@arguments']=[]);})() : $receiver;
  967. return self;},
  968. args: [],
  969. source: "arguments\x0a\x09^arguments ifNil: [arguments := #()]",
  970. messageSends: ["ifNil:"],
  971. referencedClasses: []
  972. }),
  973. smalltalk.SendNode);
  974. smalltalk.addMethod(
  975. "_arguments_",
  976. smalltalk.method({
  977. selector: "arguments:",
  978. category: 'accessing',
  979. fn: function (aCollection){
  980. var self=this;
  981. (self['@arguments']=aCollection);
  982. return self;},
  983. args: ["aCollection"],
  984. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  985. messageSends: [],
  986. referencedClasses: []
  987. }),
  988. smalltalk.SendNode);
  989. smalltalk.addMethod(
  990. "_cascadeNodeWithMessages_",
  991. smalltalk.method({
  992. selector: "cascadeNodeWithMessages:",
  993. category: 'accessing',
  994. fn: function (aCollection){
  995. var self=this;
  996. var first=nil;
  997. (first=(function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(self, "_selector", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(self, "_arguments", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.SendNode || SendNode), "_new", [])));
  998. return (function($rec){smalltalk.send($rec, "_receiver_", [smalltalk.send(self, "_receiver", [])]);smalltalk.send($rec, "_nodes_", [smalltalk.send(smalltalk.send((smalltalk.Array || Array), "_with_", [first]), "__comma", [aCollection])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.CascadeNode || CascadeNode), "_new", []));
  999. return self;},
  1000. args: ["aCollection"],
  1001. source: "cascadeNodeWithMessages: aCollection\x0a\x09| first |\x0a\x09first := SendNode new\x0a\x09 selector: self selector;\x0a\x09 arguments: self arguments;\x0a\x09 yourself.\x0a\x09^CascadeNode new\x0a\x09 receiver: self receiver;\x0a\x09 nodes: (Array with: first), aCollection;\x0a\x09 yourself",
  1002. messageSends: ["selector:", "selector", "arguments:", "arguments", "yourself", "new", "receiver:", "receiver", "nodes:", ",", "with:"],
  1003. referencedClasses: ["SendNode", "Array", "CascadeNode"]
  1004. }),
  1005. smalltalk.SendNode);
  1006. smalltalk.addMethod(
  1007. "_receiver",
  1008. smalltalk.method({
  1009. selector: "receiver",
  1010. category: 'accessing',
  1011. fn: function (){
  1012. var self=this;
  1013. return self['@receiver'];
  1014. return self;},
  1015. args: [],
  1016. source: "receiver\x0a\x09^receiver",
  1017. messageSends: [],
  1018. referencedClasses: []
  1019. }),
  1020. smalltalk.SendNode);
  1021. smalltalk.addMethod(
  1022. "_receiver_",
  1023. smalltalk.method({
  1024. selector: "receiver:",
  1025. category: 'accessing',
  1026. fn: function (aNode){
  1027. var self=this;
  1028. (self['@receiver']=aNode);
  1029. return self;},
  1030. args: ["aNode"],
  1031. source: "receiver: aNode\x0a\x09receiver := aNode",
  1032. messageSends: [],
  1033. referencedClasses: []
  1034. }),
  1035. smalltalk.SendNode);
  1036. smalltalk.addMethod(
  1037. "_selector",
  1038. smalltalk.method({
  1039. selector: "selector",
  1040. category: 'accessing',
  1041. fn: function (){
  1042. var self=this;
  1043. return self['@selector'];
  1044. return self;},
  1045. args: [],
  1046. source: "selector\x0a\x09^selector",
  1047. messageSends: [],
  1048. referencedClasses: []
  1049. }),
  1050. smalltalk.SendNode);
  1051. smalltalk.addMethod(
  1052. "_selector_",
  1053. smalltalk.method({
  1054. selector: "selector:",
  1055. category: 'accessing',
  1056. fn: function (aString){
  1057. var self=this;
  1058. (self['@selector']=aString);
  1059. return self;},
  1060. args: ["aString"],
  1061. source: "selector: aString\x0a\x09selector := aString",
  1062. messageSends: [],
  1063. referencedClasses: []
  1064. }),
  1065. smalltalk.SendNode);
  1066. smalltalk.addMethod(
  1067. "_valueForReceiver_",
  1068. smalltalk.method({
  1069. selector: "valueForReceiver:",
  1070. category: 'accessing',
  1071. fn: function (anObject){
  1072. var self=this;
  1073. return (function($rec){smalltalk.send($rec, "_receiver_", [(($receiver = smalltalk.send(self, "_receiver", [])) == nil || $receiver == undefined) ? (function(){return anObject;})() : (function(){return smalltalk.send(smalltalk.send(self, "_receiver", []), "_valueForReceiver_", [anObject]);})()]);smalltalk.send($rec, "_selector_", [smalltalk.send(self, "_selector", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(self, "_arguments", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.SendNode || SendNode), "_new", []));
  1074. return self;},
  1075. args: ["anObject"],
  1076. source: "valueForReceiver: anObject\x0a\x09^SendNode new\x0a\x09 receiver: (self receiver \x0a\x09\x09ifNil: [anObject]\x0a\x09\x09ifNotNil: [self receiver valueForReceiver: anObject]);\x0a\x09 selector: self selector;\x0a\x09 arguments: self arguments;\x0a\x09 yourself",
  1077. messageSends: ["receiver:", "ifNil:ifNotNil:", "receiver", "valueForReceiver:", "selector:", "selector", "arguments:", "arguments", "yourself", "new"],
  1078. referencedClasses: ["SendNode"]
  1079. }),
  1080. smalltalk.SendNode);
  1081. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps'], 'Compiler');
  1082. smalltalk.addMethod(
  1083. "_accept_",
  1084. smalltalk.method({
  1085. selector: "accept:",
  1086. category: 'visiting',
  1087. fn: function (aVisitor){
  1088. var self=this;
  1089. smalltalk.send(aVisitor, "_visitSequenceNode_", [self]);
  1090. return self;},
  1091. args: ["aVisitor"],
  1092. source: "accept: aVisitor\x0a\x09aVisitor visitSequenceNode: self",
  1093. messageSends: ["visitSequenceNode:"],
  1094. referencedClasses: []
  1095. }),
  1096. smalltalk.SequenceNode);
  1097. smalltalk.addMethod(
  1098. "_asBlockSequenceNode",
  1099. smalltalk.method({
  1100. selector: "asBlockSequenceNode",
  1101. category: 'testing',
  1102. fn: function (){
  1103. var self=this;
  1104. return (function($rec){smalltalk.send($rec, "_nodes_", [smalltalk.send(self, "_nodes", [])]);smalltalk.send($rec, "_temps_", [smalltalk.send(self, "_temps", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.BlockSequenceNode || BlockSequenceNode), "_new", []));
  1105. return self;},
  1106. args: [],
  1107. source: "asBlockSequenceNode\x0a\x09^BlockSequenceNode new\x0a\x09 nodes: self nodes;\x0a\x09 temps: self temps;\x0a\x09 yourself",
  1108. messageSends: ["nodes:", "nodes", "temps:", "temps", "yourself", "new"],
  1109. referencedClasses: ["BlockSequenceNode"]
  1110. }),
  1111. smalltalk.SequenceNode);
  1112. smalltalk.addMethod(
  1113. "_temps",
  1114. smalltalk.method({
  1115. selector: "temps",
  1116. category: 'accessing',
  1117. fn: function (){
  1118. var self=this;
  1119. return (($receiver = self['@temps']) == nil || $receiver == undefined) ? (function(){return [];})() : $receiver;
  1120. return self;},
  1121. args: [],
  1122. source: "temps\x0a\x09^temps ifNil: [#()]",
  1123. messageSends: ["ifNil:"],
  1124. referencedClasses: []
  1125. }),
  1126. smalltalk.SequenceNode);
  1127. smalltalk.addMethod(
  1128. "_temps_",
  1129. smalltalk.method({
  1130. selector: "temps:",
  1131. category: 'accessing',
  1132. fn: function (aCollection){
  1133. var self=this;
  1134. (self['@temps']=aCollection);
  1135. return self;},
  1136. args: ["aCollection"],
  1137. source: "temps: aCollection\x0a\x09temps := aCollection",
  1138. messageSends: [],
  1139. referencedClasses: []
  1140. }),
  1141. smalltalk.SequenceNode);
  1142. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler');
  1143. smalltalk.addMethod(
  1144. "_accept_",
  1145. smalltalk.method({
  1146. selector: "accept:",
  1147. category: 'visiting',
  1148. fn: function (aVisitor){
  1149. var self=this;
  1150. smalltalk.send(aVisitor, "_visitBlockSequenceNode_", [self]);
  1151. return self;},
  1152. args: ["aVisitor"],
  1153. source: "accept: aVisitor\x0a\x09aVisitor visitBlockSequenceNode: self",
  1154. messageSends: ["visitBlockSequenceNode:"],
  1155. referencedClasses: []
  1156. }),
  1157. smalltalk.BlockSequenceNode);
  1158. smalltalk.addMethod(
  1159. "_isBlockSequenceNode",
  1160. smalltalk.method({
  1161. selector: "isBlockSequenceNode",
  1162. category: 'testing',
  1163. fn: function (){
  1164. var self=this;
  1165. return true;
  1166. return self;},
  1167. args: [],
  1168. source: "isBlockSequenceNode\x0a\x09^true",
  1169. messageSends: [],
  1170. referencedClasses: []
  1171. }),
  1172. smalltalk.BlockSequenceNode);
  1173. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler');
  1174. smalltalk.addMethod(
  1175. "_accept_",
  1176. smalltalk.method({
  1177. selector: "accept:",
  1178. category: 'visiting',
  1179. fn: function (aVisitor){
  1180. var self=this;
  1181. smalltalk.send(aVisitor, "_visitValueNode_", [self]);
  1182. return self;},
  1183. args: ["aVisitor"],
  1184. source: "accept: aVisitor\x0a\x09aVisitor visitValueNode: self",
  1185. messageSends: ["visitValueNode:"],
  1186. referencedClasses: []
  1187. }),
  1188. smalltalk.ValueNode);
  1189. smalltalk.addMethod(
  1190. "_isValueNode",
  1191. smalltalk.method({
  1192. selector: "isValueNode",
  1193. category: 'testing',
  1194. fn: function (){
  1195. var self=this;
  1196. return true;
  1197. return self;},
  1198. args: [],
  1199. source: "isValueNode\x0a\x09^true",
  1200. messageSends: [],
  1201. referencedClasses: []
  1202. }),
  1203. smalltalk.ValueNode);
  1204. smalltalk.addMethod(
  1205. "_value",
  1206. smalltalk.method({
  1207. selector: "value",
  1208. category: 'accessing',
  1209. fn: function (){
  1210. var self=this;
  1211. return self['@value'];
  1212. return self;},
  1213. args: [],
  1214. source: "value\x0a\x09^value",
  1215. messageSends: [],
  1216. referencedClasses: []
  1217. }),
  1218. smalltalk.ValueNode);
  1219. smalltalk.addMethod(
  1220. "_value_",
  1221. smalltalk.method({
  1222. selector: "value:",
  1223. category: 'accessing',
  1224. fn: function (anObject){
  1225. var self=this;
  1226. (self['@value']=anObject);
  1227. return self;},
  1228. args: ["anObject"],
  1229. source: "value: anObject\x0a\x09value := anObject",
  1230. messageSends: [],
  1231. referencedClasses: []
  1232. }),
  1233. smalltalk.ValueNode);
  1234. smalltalk.addClass('VariableNode', smalltalk.ValueNode, ['assigned'], 'Compiler');
  1235. smalltalk.addMethod(
  1236. "_accept_",
  1237. smalltalk.method({
  1238. selector: "accept:",
  1239. category: 'visiting',
  1240. fn: function (aVisitor){
  1241. var self=this;
  1242. smalltalk.send(aVisitor, "_visitVariableNode_", [self]);
  1243. return self;},
  1244. args: ["aVisitor"],
  1245. source: "accept: aVisitor\x0a\x09aVisitor visitVariableNode: self",
  1246. messageSends: ["visitVariableNode:"],
  1247. referencedClasses: []
  1248. }),
  1249. smalltalk.VariableNode);
  1250. smalltalk.addMethod(
  1251. "_assigned",
  1252. smalltalk.method({
  1253. selector: "assigned",
  1254. category: 'accessing',
  1255. fn: function (){
  1256. var self=this;
  1257. return (($receiver = self['@assigned']) == nil || $receiver == undefined) ? (function(){return false;})() : $receiver;
  1258. return self;},
  1259. args: [],
  1260. source: "assigned\x0a\x09^assigned ifNil: [false]",
  1261. messageSends: ["ifNil:"],
  1262. referencedClasses: []
  1263. }),
  1264. smalltalk.VariableNode);
  1265. smalltalk.addMethod(
  1266. "_assigned_",
  1267. smalltalk.method({
  1268. selector: "assigned:",
  1269. category: 'accessing',
  1270. fn: function (aBoolean){
  1271. var self=this;
  1272. (self['@assigned']=aBoolean);
  1273. return self;},
  1274. args: ["aBoolean"],
  1275. source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
  1276. messageSends: [],
  1277. referencedClasses: []
  1278. }),
  1279. smalltalk.VariableNode);
  1280. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler');
  1281. smalltalk.addMethod(
  1282. "_accept_",
  1283. smalltalk.method({
  1284. selector: "accept:",
  1285. category: 'visiting',
  1286. fn: function (aVisitor){
  1287. var self=this;
  1288. smalltalk.send(aVisitor, "_visitClassReferenceNode_", [self]);
  1289. return self;},
  1290. args: ["aVisitor"],
  1291. source: "accept: aVisitor\x0a\x09aVisitor visitClassReferenceNode: self",
  1292. messageSends: ["visitClassReferenceNode:"],
  1293. referencedClasses: []
  1294. }),
  1295. smalltalk.ClassReferenceNode);
  1296. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler');
  1297. smalltalk.addMethod(
  1298. "_visit_",
  1299. smalltalk.method({
  1300. selector: "visit:",
  1301. category: 'visiting',
  1302. fn: function (aNode){
  1303. var self=this;
  1304. smalltalk.send(aNode, "_accept_", [self]);
  1305. return self;},
  1306. args: ["aNode"],
  1307. source: "visit: aNode\x0a\x09aNode accept: self",
  1308. messageSends: ["accept:"],
  1309. referencedClasses: []
  1310. }),
  1311. smalltalk.NodeVisitor);
  1312. smalltalk.addMethod(
  1313. "_visitAssignmentNode_",
  1314. smalltalk.method({
  1315. selector: "visitAssignmentNode:",
  1316. category: 'visiting',
  1317. fn: function (aNode){
  1318. var self=this;
  1319. smalltalk.send(self, "_visitNode_", [aNode]);
  1320. return self;},
  1321. args: ["aNode"],
  1322. source: "visitAssignmentNode: aNode\x0a\x09self visitNode: aNode",
  1323. messageSends: ["visitNode:"],
  1324. referencedClasses: []
  1325. }),
  1326. smalltalk.NodeVisitor);
  1327. smalltalk.addMethod(
  1328. "_visitBlockNode_",
  1329. smalltalk.method({
  1330. selector: "visitBlockNode:",
  1331. category: 'visiting',
  1332. fn: function (aNode){
  1333. var self=this;
  1334. smalltalk.send(self, "_visitNode_", [aNode]);
  1335. return self;},
  1336. args: ["aNode"],
  1337. source: "visitBlockNode: aNode\x0a\x09self visitNode: aNode",
  1338. messageSends: ["visitNode:"],
  1339. referencedClasses: []
  1340. }),
  1341. smalltalk.NodeVisitor);
  1342. smalltalk.addMethod(
  1343. "_visitBlockSequenceNode_",
  1344. smalltalk.method({
  1345. selector: "visitBlockSequenceNode:",
  1346. category: 'visiting',
  1347. fn: function (aNode){
  1348. var self=this;
  1349. smalltalk.send(self, "_visitNode_", [aNode]);
  1350. return self;},
  1351. args: ["aNode"],
  1352. source: "visitBlockSequenceNode: aNode\x0a\x09self visitNode: aNode",
  1353. messageSends: ["visitNode:"],
  1354. referencedClasses: []
  1355. }),
  1356. smalltalk.NodeVisitor);
  1357. smalltalk.addMethod(
  1358. "_visitCascadeNode_",
  1359. smalltalk.method({
  1360. selector: "visitCascadeNode:",
  1361. category: 'visiting',
  1362. fn: function (aNode){
  1363. var self=this;
  1364. smalltalk.send(self, "_visitNode_", [aNode]);
  1365. return self;},
  1366. args: ["aNode"],
  1367. source: "visitCascadeNode: aNode\x0a\x09self visitNode: aNode",
  1368. messageSends: ["visitNode:"],
  1369. referencedClasses: []
  1370. }),
  1371. smalltalk.NodeVisitor);
  1372. smalltalk.addMethod(
  1373. "_visitClassReferenceNode_",
  1374. smalltalk.method({
  1375. selector: "visitClassReferenceNode:",
  1376. category: 'visiting',
  1377. fn: function (aNode){
  1378. var self=this;
  1379. smalltalk.send(self, "_visitNode_", [aNode]);
  1380. return self;},
  1381. args: ["aNode"],
  1382. source: "visitClassReferenceNode: aNode\x0a\x09self visitNode: aNode",
  1383. messageSends: ["visitNode:"],
  1384. referencedClasses: []
  1385. }),
  1386. smalltalk.NodeVisitor);
  1387. smalltalk.addMethod(
  1388. "_visitDynamicArrayNode_",
  1389. smalltalk.method({
  1390. selector: "visitDynamicArrayNode:",
  1391. category: 'visiting',
  1392. fn: function (aNode){
  1393. var self=this;
  1394. smalltalk.send(self, "_visitNode_", [aNode]);
  1395. return self;},
  1396. args: ["aNode"],
  1397. source: "visitDynamicArrayNode: aNode\x0a\x09self visitNode: aNode",
  1398. messageSends: ["visitNode:"],
  1399. referencedClasses: []
  1400. }),
  1401. smalltalk.NodeVisitor);
  1402. smalltalk.addMethod(
  1403. "_visitDynamicDictionaryNode_",
  1404. smalltalk.method({
  1405. selector: "visitDynamicDictionaryNode:",
  1406. category: 'visiting',
  1407. fn: function (aNode){
  1408. var self=this;
  1409. smalltalk.send(self, "_visitNode_", [aNode]);
  1410. return self;},
  1411. args: ["aNode"],
  1412. source: "visitDynamicDictionaryNode: aNode\x0a\x09self visitNode: aNode",
  1413. messageSends: ["visitNode:"],
  1414. referencedClasses: []
  1415. }),
  1416. smalltalk.NodeVisitor);
  1417. smalltalk.addMethod(
  1418. "_visitJSStatementNode_",
  1419. smalltalk.method({
  1420. selector: "visitJSStatementNode:",
  1421. category: 'visiting',
  1422. fn: function (aNode){
  1423. var self=this;
  1424. smalltalk.send(self, "_visitNode_", [aNode]);
  1425. return self;},
  1426. args: ["aNode"],
  1427. source: "visitJSStatementNode: aNode\x0a\x09self visitNode: aNode",
  1428. messageSends: ["visitNode:"],
  1429. referencedClasses: []
  1430. }),
  1431. smalltalk.NodeVisitor);
  1432. smalltalk.addMethod(
  1433. "_visitMethodNode_",
  1434. smalltalk.method({
  1435. selector: "visitMethodNode:",
  1436. category: 'visiting',
  1437. fn: function (aNode){
  1438. var self=this;
  1439. smalltalk.send(self, "_visitNode_", [aNode]);
  1440. return self;},
  1441. args: ["aNode"],
  1442. source: "visitMethodNode: aNode\x0a\x09self visitNode: aNode",
  1443. messageSends: ["visitNode:"],
  1444. referencedClasses: []
  1445. }),
  1446. smalltalk.NodeVisitor);
  1447. smalltalk.addMethod(
  1448. "_visitNode_",
  1449. smalltalk.method({
  1450. selector: "visitNode:",
  1451. category: 'visiting',
  1452. fn: function (aNode){
  1453. var self=this;
  1454. return self;},
  1455. args: ["aNode"],
  1456. source: "visitNode: aNode",
  1457. messageSends: [],
  1458. referencedClasses: []
  1459. }),
  1460. smalltalk.NodeVisitor);
  1461. smalltalk.addMethod(
  1462. "_visitReturnNode_",
  1463. smalltalk.method({
  1464. selector: "visitReturnNode:",
  1465. category: 'visiting',
  1466. fn: function (aNode){
  1467. var self=this;
  1468. smalltalk.send(self, "_visitNode_", [aNode]);
  1469. return self;},
  1470. args: ["aNode"],
  1471. source: "visitReturnNode: aNode\x0a\x09self visitNode: aNode",
  1472. messageSends: ["visitNode:"],
  1473. referencedClasses: []
  1474. }),
  1475. smalltalk.NodeVisitor);
  1476. smalltalk.addMethod(
  1477. "_visitSendNode_",
  1478. smalltalk.method({
  1479. selector: "visitSendNode:",
  1480. category: 'visiting',
  1481. fn: function (aNode){
  1482. var self=this;
  1483. smalltalk.send(self, "_visitNode_", [aNode]);
  1484. return self;},
  1485. args: ["aNode"],
  1486. source: "visitSendNode: aNode\x0a\x09self visitNode: aNode",
  1487. messageSends: ["visitNode:"],
  1488. referencedClasses: []
  1489. }),
  1490. smalltalk.NodeVisitor);
  1491. smalltalk.addMethod(
  1492. "_visitSequenceNode_",
  1493. smalltalk.method({
  1494. selector: "visitSequenceNode:",
  1495. category: 'visiting',
  1496. fn: function (aNode){
  1497. var self=this;
  1498. smalltalk.send(self, "_visitNode_", [aNode]);
  1499. return self;},
  1500. args: ["aNode"],
  1501. source: "visitSequenceNode: aNode\x0a\x09self visitNode: aNode",
  1502. messageSends: ["visitNode:"],
  1503. referencedClasses: []
  1504. }),
  1505. smalltalk.NodeVisitor);
  1506. smalltalk.addMethod(
  1507. "_visitValueNode_",
  1508. smalltalk.method({
  1509. selector: "visitValueNode:",
  1510. category: 'visiting',
  1511. fn: function (aNode){
  1512. var self=this;
  1513. smalltalk.send(self, "_visitNode_", [aNode]);
  1514. return self;},
  1515. args: ["aNode"],
  1516. source: "visitValueNode: aNode\x0a\x09self visitNode: aNode",
  1517. messageSends: ["visitNode:"],
  1518. referencedClasses: []
  1519. }),
  1520. smalltalk.NodeVisitor);
  1521. smalltalk.addMethod(
  1522. "_visitVariableNode_",
  1523. smalltalk.method({
  1524. selector: "visitVariableNode:",
  1525. category: 'visiting',
  1526. fn: function (aNode){
  1527. var self=this;
  1528. smalltalk.send(self, "_visitNode_", [aNode]);
  1529. return self;},
  1530. args: ["aNode"],
  1531. source: "visitVariableNode: aNode\x0a\x09self visitNode: aNode",
  1532. messageSends: ["visitNode:"],
  1533. referencedClasses: []
  1534. }),
  1535. smalltalk.NodeVisitor);
  1536. smalltalk.addClass('AbstractCompiler', smalltalk.NodeVisitor, ['currentClass', 'source'], 'Compiler');
  1537. smalltalk.addMethod(
  1538. "_classNameFor_",
  1539. smalltalk.method({
  1540. selector: "classNameFor:",
  1541. category: 'accessing',
  1542. fn: function (aClass){
  1543. var self=this;
  1544. return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
  1545. return self;},
  1546. args: ["aClass"],
  1547. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  1548. messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
  1549. referencedClasses: []
  1550. }),
  1551. smalltalk.AbstractCompiler);
  1552. smalltalk.addMethod(
  1553. "_compile_",
  1554. smalltalk.method({
  1555. selector: "compile:",
  1556. category: 'compiling',
  1557. fn: function (aString){
  1558. var self=this;
  1559. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [aString])]);
  1560. return self;},
  1561. args: ["aString"],
  1562. source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
  1563. messageSends: ["compileNode:", "parse:"],
  1564. referencedClasses: []
  1565. }),
  1566. smalltalk.AbstractCompiler);
  1567. smalltalk.addMethod(
  1568. "_compile_forClass_",
  1569. smalltalk.method({
  1570. selector: "compile:forClass:",
  1571. category: 'compiling',
  1572. fn: function (aString, aClass){
  1573. var self=this;
  1574. smalltalk.send(self, "_currentClass_", [aClass]);
  1575. smalltalk.send(self, "_source_", [aString]);
  1576. return smalltalk.send(self, "_compile_", [aString]);
  1577. return self;},
  1578. args: ["aString", "aClass"],
  1579. source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
  1580. messageSends: ["currentClass:", "source:", "compile:"],
  1581. referencedClasses: []
  1582. }),
  1583. smalltalk.AbstractCompiler);
  1584. smalltalk.addMethod(
  1585. "_compileExpression_",
  1586. smalltalk.method({
  1587. selector: "compileExpression:",
  1588. category: 'compiling',
  1589. fn: function (aString){
  1590. var self=this;
  1591. smalltalk.send(self, "_currentClass_", [(smalltalk.DoIt || DoIt)]);
  1592. smalltalk.send(self, "_source_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
  1593. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [smalltalk.send(self, "_source", [])])]);
  1594. return self;},
  1595. args: ["aString"],
  1596. source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  1597. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
  1598. referencedClasses: ["DoIt"]
  1599. }),
  1600. smalltalk.AbstractCompiler);
  1601. smalltalk.addMethod(
  1602. "_compileNode_",
  1603. smalltalk.method({
  1604. selector: "compileNode:",
  1605. category: 'compiling',
  1606. fn: function (aNode){
  1607. var self=this;
  1608. smalltalk.send(self, "_subclassResponsibility", []);
  1609. return self;},
  1610. args: ["aNode"],
  1611. source: "compileNode: aNode\x0a\x09self subclassResponsibility",
  1612. messageSends: ["subclassResponsibility"],
  1613. referencedClasses: []
  1614. }),
  1615. smalltalk.AbstractCompiler);
  1616. smalltalk.addMethod(
  1617. "_currentClass",
  1618. smalltalk.method({
  1619. selector: "currentClass",
  1620. category: 'accessing',
  1621. fn: function (){
  1622. var self=this;
  1623. return self['@currentClass'];
  1624. return self;},
  1625. args: [],
  1626. source: "currentClass\x0a\x09^currentClass",
  1627. messageSends: [],
  1628. referencedClasses: []
  1629. }),
  1630. smalltalk.AbstractCompiler);
  1631. smalltalk.addMethod(
  1632. "_currentClass_",
  1633. smalltalk.method({
  1634. selector: "currentClass:",
  1635. category: 'accessing',
  1636. fn: function (aClass){
  1637. var self=this;
  1638. (self['@currentClass']=aClass);
  1639. return self;},
  1640. args: ["aClass"],
  1641. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  1642. messageSends: [],
  1643. referencedClasses: []
  1644. }),
  1645. smalltalk.AbstractCompiler);
  1646. smalltalk.addMethod(
  1647. "_eval_",
  1648. smalltalk.method({
  1649. selector: "eval:",
  1650. category: 'compiling',
  1651. fn: function (aString){
  1652. var self=this;
  1653. return eval(aString);
  1654. return self;},
  1655. args: ["aString"],
  1656. source: "eval: aString\x0a\x09<return eval(aString)>",
  1657. messageSends: [],
  1658. referencedClasses: []
  1659. }),
  1660. smalltalk.AbstractCompiler);
  1661. smalltalk.addMethod(
  1662. "_evaluateExpression_",
  1663. smalltalk.method({
  1664. selector: "evaluateExpression:",
  1665. category: 'compiling',
  1666. fn: function (aString){
  1667. var self=this;
  1668. var result=nil;
  1669. smalltalk.send((smalltalk.DoIt || DoIt), "_addCompiledMethod_", [smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compileExpression_", [aString])])]);
  1670. (result=smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_new", []), "_doIt", []));
  1671. smalltalk.send((smalltalk.DoIt || DoIt), "_removeCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_methodDictionary", []), "_at_", ["doIt"])]);
  1672. return result;
  1673. return self;},
  1674. args: ["aString"],
  1675. source: "evaluateExpression: aString\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression and answer the returned object\x22\x0a\x09| result |\x0a\x09DoIt addCompiledMethod: (self eval: (self compileExpression: aString)).\x0a\x09result := DoIt new doIt.\x0a\x09DoIt removeCompiledMethod: (DoIt methodDictionary at: 'doIt').\x0a\x09^result",
  1676. messageSends: ["addCompiledMethod:", "eval:", "compileExpression:", "doIt", "new", "removeCompiledMethod:", "at:", "methodDictionary"],
  1677. referencedClasses: ["DoIt"]
  1678. }),
  1679. smalltalk.AbstractCompiler);
  1680. smalltalk.addMethod(
  1681. "_install_forClass_category_",
  1682. smalltalk.method({
  1683. selector: "install:forClass:category:",
  1684. category: 'compiling',
  1685. fn: function (aString, aBehavior, anotherString){
  1686. var self=this;
  1687. var compiled=nil;
  1688. (compiled=smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compile_forClass_", [aString, aBehavior])]));
  1689. smalltalk.send(compiled, "_category_", [anotherString]);
  1690. smalltalk.send(aBehavior, "_addCompiledMethod_", [compiled]);
  1691. return compiled;
  1692. return self;},
  1693. args: ["aString", "aBehavior", "anotherString"],
  1694. source: "install: aString forClass: aBehavior category: anotherString\x0a\x09| compiled |\x0a\x09compiled := self eval: (self compile: aString forClass: aBehavior).\x0a\x09compiled category: anotherString.\x0a\x09aBehavior addCompiledMethod: compiled.\x0a\x09^compiled",
  1695. messageSends: ["eval:", "compile:forClass:", "category:", "addCompiledMethod:"],
  1696. referencedClasses: []
  1697. }),
  1698. smalltalk.AbstractCompiler);
  1699. smalltalk.addMethod(
  1700. "_parse_",
  1701. smalltalk.method({
  1702. selector: "parse:",
  1703. category: 'compiling',
  1704. fn: function (aString){
  1705. var self=this;
  1706. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_parse_", [aString]);
  1707. return self;},
  1708. args: ["aString"],
  1709. source: "parse: aString\x0a ^Smalltalk current parse: aString",
  1710. messageSends: ["parse:", "current"],
  1711. referencedClasses: ["Smalltalk"]
  1712. }),
  1713. smalltalk.AbstractCompiler);
  1714. smalltalk.addMethod(
  1715. "_parseExpression_",
  1716. smalltalk.method({
  1717. selector: "parseExpression:",
  1718. category: 'compiling',
  1719. fn: function (aString){
  1720. var self=this;
  1721. return smalltalk.send(self, "_parse_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
  1722. return self;},
  1723. args: ["aString"],
  1724. source: "parseExpression: aString\x0a ^self parse: 'doIt ^[', aString, '] value'",
  1725. messageSends: ["parse:", ","],
  1726. referencedClasses: []
  1727. }),
  1728. smalltalk.AbstractCompiler);
  1729. smalltalk.addMethod(
  1730. "_pseudoVariables",
  1731. smalltalk.method({
  1732. selector: "pseudoVariables",
  1733. category: 'accessing',
  1734. fn: function (){
  1735. var self=this;
  1736. return ["self", "super", "true", "false", "nil", "thisContext"];
  1737. return self;},
  1738. args: [],
  1739. source: "pseudoVariables\x0a\x09^#('self' 'super' 'true' 'false' 'nil' 'thisContext')",
  1740. messageSends: [],
  1741. referencedClasses: []
  1742. }),
  1743. smalltalk.AbstractCompiler);
  1744. smalltalk.addMethod(
  1745. "_recompile_",
  1746. smalltalk.method({
  1747. selector: "recompile:",
  1748. category: 'compiling',
  1749. fn: function (aClass){
  1750. var self=this;
  1751. smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_do_", [(function(each){return smalltalk.send(self, "_install_forClass_category_", [smalltalk.send(each, "_source", []), aClass, smalltalk.send(each, "_category", [])]);})]);
  1752. smalltalk.send(self, "_setupClass_", [aClass]);
  1753. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})]));
  1754. return self;},
  1755. args: ["aClass"],
  1756. source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each |\x0a\x09\x09self install: each source forClass: aClass category: each category].\x0a\x09self setupClass: aClass.\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]",
  1757. messageSends: ["do:", "methodDictionary", "install:forClass:category:", "source", "category", "setupClass:", "ifFalse:", "isMetaclass", "recompile:", "class"],
  1758. referencedClasses: []
  1759. }),
  1760. smalltalk.AbstractCompiler);
  1761. smalltalk.addMethod(
  1762. "_recompileAll",
  1763. smalltalk.method({
  1764. selector: "recompileAll",
  1765. category: 'compiling',
  1766. fn: function (){
  1767. var self=this;
  1768. smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){(function($rec){smalltalk.send($rec, "_show_", [each]);return smalltalk.send($rec, "_cr", []);})((smalltalk.Transcript || Transcript));return smalltalk.send((function(){return smalltalk.send(self, "_recompile_", [each]);}), "_valueWithTimeout_", [(100)]);})]);
  1769. return self;},
  1770. args: [],
  1771. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]",
  1772. messageSends: ["do:", "classes", "current", "show:", "cr", "valueWithTimeout:", "recompile:"],
  1773. referencedClasses: ["Smalltalk", "Transcript"]
  1774. }),
  1775. smalltalk.AbstractCompiler);
  1776. smalltalk.addMethod(
  1777. "_safeVariableNameFor_",
  1778. smalltalk.method({
  1779. selector: "safeVariableNameFor:",
  1780. category: 'accessing',
  1781. fn: function (aString){
  1782. var self=this;
  1783. return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_reservedWords", []), "_includes_", [aString])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aString, "__comma", ["_"]);})() : (function(){return aString;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aString, "__comma", ["_"]);}), (function(){return aString;})]));
  1784. return self;},
  1785. args: ["aString"],
  1786. source: "safeVariableNameFor: aString\x0a\x09^(Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [aString, '_']\x0a\x09\x09ifFalse: [aString]",
  1787. messageSends: ["ifTrue:ifFalse:", "includes:", "reservedWords", "current", ","],
  1788. referencedClasses: ["Smalltalk"]
  1789. }),
  1790. smalltalk.AbstractCompiler);
  1791. smalltalk.addMethod(
  1792. "_setupClass_",
  1793. smalltalk.method({
  1794. selector: "setupClass:",
  1795. category: 'compiling',
  1796. fn: function (aClass){
  1797. var self=this;
  1798. smalltalk.init(aClass);
  1799. return self;},
  1800. args: ["aClass"],
  1801. source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass)>",
  1802. messageSends: [],
  1803. referencedClasses: []
  1804. }),
  1805. smalltalk.AbstractCompiler);
  1806. smalltalk.addMethod(
  1807. "_source",
  1808. smalltalk.method({
  1809. selector: "source",
  1810. category: 'accessing',
  1811. fn: function (){
  1812. var self=this;
  1813. return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  1814. return self;},
  1815. args: [],
  1816. source: "source\x0a\x09^source ifNil: ['']",
  1817. messageSends: ["ifNil:"],
  1818. referencedClasses: []
  1819. }),
  1820. smalltalk.AbstractCompiler);
  1821. smalltalk.addMethod(
  1822. "_source_",
  1823. smalltalk.method({
  1824. selector: "source:",
  1825. category: 'accessing',
  1826. fn: function (aString){
  1827. var self=this;
  1828. (self['@source']=aString);
  1829. return self;},
  1830. args: ["aString"],
  1831. source: "source: aString\x0a\x09source := aString",
  1832. messageSends: [],
  1833. referencedClasses: []
  1834. }),
  1835. smalltalk.AbstractCompiler);
  1836. smalltalk.addMethod(
  1837. "_recompile_",
  1838. smalltalk.method({
  1839. selector: "recompile:",
  1840. category: 'compiling',
  1841. fn: function (aClass){
  1842. var self=this;
  1843. smalltalk.send(smalltalk.send(self, "_new", []), "_recompile_", [aClass]);
  1844. return self;},
  1845. args: ["aClass"],
  1846. source: "recompile: aClass\x0a\x09self new recompile: aClass",
  1847. messageSends: ["recompile:", "new"],
  1848. referencedClasses: []
  1849. }),
  1850. smalltalk.AbstractCompiler.klass);
  1851. smalltalk.addMethod(
  1852. "_recompileAll",
  1853. smalltalk.method({
  1854. selector: "recompileAll",
  1855. category: 'compiling',
  1856. fn: function (){
  1857. var self=this;
  1858. smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_recompile_", [each]);})]);
  1859. return self;},
  1860. args: [],
  1861. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
  1862. messageSends: ["do:", "classes", "current", "recompile:"],
  1863. referencedClasses: ["Smalltalk"]
  1864. }),
  1865. smalltalk.AbstractCompiler.klass);
  1866. smalltalk.addClass('Compiler', smalltalk.AbstractCompiler, ['stream', 'nestedBlocks', 'earlyReturn', 'currentSelector', 'unknownVariables', 'tempVariables', 'messageSends', 'referencedClasses', 'classReferenced', 'argVariables'], 'Compiler');
  1867. smalltalk.addMethod(
  1868. "_argVariables",
  1869. smalltalk.method({
  1870. selector: "argVariables",
  1871. category: 'accessing',
  1872. fn: function (){
  1873. var self=this;
  1874. return smalltalk.send(self['@argVariables'], "_copy", []);
  1875. return self;},
  1876. args: [],
  1877. source: "argVariables\x0a\x09^argVariables copy",
  1878. messageSends: ["copy"],
  1879. referencedClasses: []
  1880. }),
  1881. smalltalk.Compiler);
  1882. smalltalk.addMethod(
  1883. "_checkClass_for_",
  1884. smalltalk.method({
  1885. selector: "checkClass:for:",
  1886. category: 'optimizations',
  1887. fn: function (aClassName, receiver){
  1888. var self=this;
  1889. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((($receiver = ", "__comma", [receiver]), "__comma", [").klass === smalltalk."]), "__comma", [aClassName]), "__comma", [") ? "])]);
  1890. return self;},
  1891. args: ["aClassName", "receiver"],
  1892. source: "checkClass: aClassName for: receiver\x0a stream nextPutAll: '((($receiver = ', receiver, ').klass === smalltalk.', aClassName, ') ? '",
  1893. messageSends: ["nextPutAll:", ","],
  1894. referencedClasses: []
  1895. }),
  1896. smalltalk.Compiler);
  1897. smalltalk.addMethod(
  1898. "_compileNode_",
  1899. smalltalk.method({
  1900. selector: "compileNode:",
  1901. category: 'compiling',
  1902. fn: function (aNode){
  1903. var self=this;
  1904. (self['@stream']=smalltalk.send("", "_writeStream", []));
  1905. smalltalk.send(self, "_visit_", [aNode]);
  1906. return smalltalk.send(self['@stream'], "_contents", []);
  1907. return self;},
  1908. args: ["aNode"],
  1909. source: "compileNode: aNode\x0a\x09stream := '' writeStream.\x0a\x09self visit: aNode.\x0a\x09^stream contents",
  1910. messageSends: ["writeStream", "visit:", "contents"],
  1911. referencedClasses: []
  1912. }),
  1913. smalltalk.Compiler);
  1914. smalltalk.addMethod(
  1915. "_initialize",
  1916. smalltalk.method({
  1917. selector: "initialize",
  1918. category: 'initialization',
  1919. fn: function (){
  1920. var self=this;
  1921. smalltalk.send(self, "_initialize", [], smalltalk.Compiler.superclass || nil);
  1922. (self['@stream']=smalltalk.send("", "_writeStream", []));
  1923. (self['@unknownVariables']=[]);
  1924. (self['@tempVariables']=[]);
  1925. (self['@argVariables']=[]);
  1926. (self['@messageSends']=[]);
  1927. (self['@classReferenced']=[]);
  1928. return self;},
  1929. args: [],
  1930. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream. \x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09messageSends := #().\x0a\x09classReferenced := #()",
  1931. messageSends: ["initialize", "writeStream"],
  1932. referencedClasses: []
  1933. }),
  1934. smalltalk.Compiler);
  1935. smalltalk.addMethod(
  1936. "_inline_receiver_argumentNodes_",
  1937. smalltalk.method({
  1938. selector: "inline:receiver:argumentNodes:",
  1939. category: 'optimizations',
  1940. fn: function (aSelector, receiver, aCollection){
  1941. var self=this;
  1942. var inlined=nil;
  1943. (inlined=false);
  1944. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})]));
  1945. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})]));
  1946. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})]));
  1947. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})]));
  1948. ((($receiver = smalltalk.send(aSelector, "__eq", ["<"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  1949. ((($receiver = smalltalk.send(aSelector, "__eq", ["<="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  1950. ((($receiver = smalltalk.send(aSelector, "__eq", [">"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  1951. ((($receiver = smalltalk.send(aSelector, "__eq", [">="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  1952. ((($receiver = smalltalk.send(aSelector, "__eq", ["+"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver +"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver +"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  1953. ((($receiver = smalltalk.send(aSelector, "__eq", ["-"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver -"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver -"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  1954. ((($receiver = smalltalk.send(aSelector, "__eq", ["*"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver *"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver *"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  1955. ((($receiver = smalltalk.send(aSelector, "__eq", ["/"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver /"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver /"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  1956. return inlined;
  1957. return self;},
  1958. args: ["aSelector", "receiver", "aCollection"],
  1959. source: "inline: aSelector receiver: receiver argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a\x0a\x09\x22-- Booleans --\x22\x0a\x0a\x09(aSelector = 'ifFalse:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '(! $receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : nil)'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifTrue:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '($receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : nil)'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifTrue:ifFalse:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '($receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : '.\x0a \x09\x09self visit: aCollection second.\x0a \x09\x09stream nextPutAll: '())'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifFalse:ifTrue:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '(! $receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : '.\x0a \x09\x09self visit: aCollection second.\x0a \x09\x09stream nextPutAll: '())'.\x0a \x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '<') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver <'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '<=') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver <='.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '>') ifTrue: [ \x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver >'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '>=') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver >='.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '+') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver +'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '-') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver -'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '*') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver *'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '/') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver /'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a ^inlined",
  1960. messageSends: ["ifTrue:", "=", "isBlockNode", "first", "checkClass:for:", "nextPutAll:", "visit:", "and:", "second"],
  1961. referencedClasses: []
  1962. }),
  1963. smalltalk.Compiler);
  1964. smalltalk.addMethod(
  1965. "_inlineLiteral_receiverNode_argumentNodes_",
  1966. smalltalk.method({
  1967. selector: "inlineLiteral:receiverNode:argumentNodes:",
  1968. category: 'optimizations',
  1969. fn: function (aSelector, anObject, aCollection){
  1970. var self=this;
  1971. var inlined=nil;
  1972. (inlined=false);
  1973. ((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})]));
  1974. ((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})]));
  1975. ((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})]));
  1976. ((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})]));
  1977. ((($receiver = smalltalk.send(aSelector, "__eq", ["+"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  1978. ((($receiver = smalltalk.send(aSelector, "__eq", ["-"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  1979. ((($receiver = smalltalk.send(aSelector, "__eq", ["*"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  1980. ((($receiver = smalltalk.send(aSelector, "__eq", ["/"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  1981. ((($receiver = smalltalk.send(aSelector, "__eq", ["<"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  1982. ((($receiver = smalltalk.send(aSelector, "__eq", ["<="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  1983. ((($receiver = smalltalk.send(aSelector, "__eq", [">"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  1984. ((($receiver = smalltalk.send(aSelector, "__eq", [">="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  1985. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})]));})]));
  1986. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})]));})]));
  1987. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})]));
  1988. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})]));
  1989. return inlined;
  1990. return self;},
  1991. args: ["aSelector", "anObject", "aCollection"],
  1992. source: "inlineLiteral: aSelector receiverNode: anObject argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a \x0a\x09\x22-- BlockClosures --\x22\x0a\x0a\x09(aSelector = 'whileTrue:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [\x0a \x09stream nextPutAll: '(function(){while('.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {'.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '()}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [\x0a \x09stream nextPutAll: '(function(){while(!'.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {'.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '()}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileTrue') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a \x09stream nextPutAll: '(function(){while('.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a \x09stream nextPutAll: '(function(){while(!'.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '+') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' + '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '-') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' - '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '*') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' * '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '/') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' / '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '<') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' < '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '<=') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' <= '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '>') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' > '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '>=') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' >= '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a \x09 \x0a\x09\x22-- UndefinedObject --\x22\x0a\x0a\x09(aSelector = 'ifNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : $receiver'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') != nil && $receiver != undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : nil'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNil:ifNotNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : '.\x0a \x09self visit: aCollection second.\x0a \x09stream nextPutAll: '()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:ifNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection second.\x0a \x09stream nextPutAll: '() : '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '()'.\x0a \x09inlined := true]].\x0a \x0a ^inlined",
  1993. messageSends: ["ifTrue:", "=", "and:", "isBlockNode", "first", "nextPutAll:", "visit:", "isNode:ofClass:", "second"],
  1994. referencedClasses: ["Number"]
  1995. }),
  1996. smalltalk.Compiler);
  1997. smalltalk.addMethod(
  1998. "_isNode_ofClass_",
  1999. smalltalk.method({
  2000. selector: "isNode:ofClass:",
  2001. category: 'optimizations',
  2002. fn: function (aNode, aClass){
  2003. var self=this;
  2004. return smalltalk.send(smalltalk.send(aNode, "_isValueNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "_class", []), "__eq", [aClass]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["self"]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_currentClass", []), "__eq", [aClass]);})]);})]);})]);
  2005. return self;},
  2006. args: ["aNode", "aClass"],
  2007. source: "isNode: aNode ofClass: aClass\x0a\x09^aNode isValueNode and: [\x0a \x09aNode value class = aClass or: [\x0a \x09\x09aNode value = 'self' and: [self currentClass = aClass]]]",
  2008. messageSends: ["and:", "isValueNode", "or:", "=", "class", "value", "currentClass"],
  2009. referencedClasses: []
  2010. }),
  2011. smalltalk.Compiler);
  2012. smalltalk.addMethod(
  2013. "_knownVariables",
  2014. smalltalk.method({
  2015. selector: "knownVariables",
  2016. category: 'accessing',
  2017. fn: function (){
  2018. var self=this;
  2019. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_tempVariables", [])]);smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_argVariables", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_pseudoVariables", []));
  2020. return self;},
  2021. args: [],
  2022. source: "knownVariables\x0a\x09^self pseudoVariables \x0a\x09\x09addAll: self tempVariables;\x0a\x09\x09addAll: self argVariables;\x0a\x09\x09yourself",
  2023. messageSends: ["addAll:", "tempVariables", "argVariables", "yourself", "pseudoVariables"],
  2024. referencedClasses: []
  2025. }),
  2026. smalltalk.Compiler);
  2027. smalltalk.addMethod(
  2028. "_performOptimizations",
  2029. smalltalk.method({
  2030. selector: "performOptimizations",
  2031. category: 'testing',
  2032. fn: function (){
  2033. var self=this;
  2034. return smalltalk.send(smalltalk.send(self, "_class", []), "_performOptimizations", []);
  2035. return self;},
  2036. args: [],
  2037. source: "performOptimizations\x0a\x09^self class performOptimizations",
  2038. messageSends: ["performOptimizations", "class"],
  2039. referencedClasses: []
  2040. }),
  2041. smalltalk.Compiler);
  2042. smalltalk.addMethod(
  2043. "_send_to_arguments_superSend_",
  2044. smalltalk.method({
  2045. selector: "send:to:arguments:superSend:",
  2046. category: 'visiting',
  2047. fn: function (aSelector, aReceiver, aCollection, aBoolean){
  2048. var self=this;
  2049. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){var tmp=nil;
  2050. (tmp=self['@stream']);smalltalk.send(str, "_nextPutAll_", ["smalltalk.send("]);smalltalk.send(str, "_nextPutAll_", [aReceiver]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", \x22", "__comma", [smalltalk.send(aSelector, "_asSelector", [])]), "__comma", ["\x22, ["])]);(self['@stream']=str);smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);(self['@stream']=tmp);smalltalk.send(str, "_nextPutAll_", ["]"]);((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(self, "_currentClass", [])])]), "__comma", [".superclass || nil"])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(self, "_currentClass", [])])]), "__comma", [".superclass || nil"])]);})]));return smalltalk.send(str, "_nextPutAll_", [")"]);})]);
  2051. return self;},
  2052. args: ["aSelector", "aReceiver", "aCollection", "aBoolean"],
  2053. source: "send: aSelector to: aReceiver arguments: aCollection superSend: aBoolean\x0a\x09^String streamContents: [:str || tmp |\x0a \x09tmp := stream.\x0a\x09\x09str nextPutAll: 'smalltalk.send('.\x0a\x09\x09str nextPutAll: aReceiver.\x0a\x09\x09str nextPutAll: ', \x22', aSelector asSelector, '\x22, ['.\x0a stream := str.\x0a\x09\x09aCollection\x0a\x09 \x09\x09do: [:each | self visit: each]\x0a\x09 \x09\x09separatedBy: [stream nextPutAll: ', '].\x0a stream := tmp.\x0a str nextPutAll: ']'.\x0a\x09\x09aBoolean ifTrue: [\x0a\x09\x09\x09str nextPutAll: ', smalltalk.', (self classNameFor: self currentClass), '.superclass || nil'].\x0a\x09\x09str nextPutAll: ')']",
  2054. messageSends: ["streamContents:", "nextPutAll:", ",", "asSelector", "do:separatedBy:", "visit:", "ifTrue:", "classNameFor:", "currentClass"],
  2055. referencedClasses: ["String"]
  2056. }),
  2057. smalltalk.Compiler);
  2058. smalltalk.addMethod(
  2059. "_tempVariables",
  2060. smalltalk.method({
  2061. selector: "tempVariables",
  2062. category: 'accessing',
  2063. fn: function (){
  2064. var self=this;
  2065. return smalltalk.send(self['@tempVariables'], "_copy", []);
  2066. return self;},
  2067. args: [],
  2068. source: "tempVariables\x0a\x09^tempVariables copy",
  2069. messageSends: ["copy"],
  2070. referencedClasses: []
  2071. }),
  2072. smalltalk.Compiler);
  2073. smalltalk.addMethod(
  2074. "_unknownVariables",
  2075. smalltalk.method({
  2076. selector: "unknownVariables",
  2077. category: 'accessing',
  2078. fn: function (){
  2079. var self=this;
  2080. return smalltalk.send(self['@unknownVariables'], "_copy", []);
  2081. return self;},
  2082. args: [],
  2083. source: "unknownVariables\x0a\x09^unknownVariables copy",
  2084. messageSends: ["copy"],
  2085. referencedClasses: []
  2086. }),
  2087. smalltalk.Compiler);
  2088. smalltalk.addMethod(
  2089. "_visit_",
  2090. smalltalk.method({
  2091. selector: "visit:",
  2092. category: 'visiting',
  2093. fn: function (aNode){
  2094. var self=this;
  2095. smalltalk.send(aNode, "_accept_", [self]);
  2096. return self;},
  2097. args: ["aNode"],
  2098. source: "visit: aNode\x0a\x09aNode accept: self",
  2099. messageSends: ["accept:"],
  2100. referencedClasses: []
  2101. }),
  2102. smalltalk.Compiler);
  2103. smalltalk.addMethod(
  2104. "_visitAssignmentNode_",
  2105. smalltalk.method({
  2106. selector: "visitAssignmentNode:",
  2107. category: 'visiting',
  2108. fn: function (aNode){
  2109. var self=this;
  2110. smalltalk.send(self['@stream'], "_nextPutAll_", ["("]);
  2111. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);
  2112. smalltalk.send(self['@stream'], "_nextPutAll_", ["="]);
  2113. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]);
  2114. smalltalk.send(self['@stream'], "_nextPutAll_", [")"]);
  2115. return self;},
  2116. args: ["aNode"],
  2117. source: "visitAssignmentNode: aNode\x0a\x09stream nextPutAll: '('.\x0a\x09self visit: aNode left.\x0a\x09stream nextPutAll: '='.\x0a\x09self visit: aNode right.\x0a\x09stream nextPutAll: ')'",
  2118. messageSends: ["nextPutAll:", "visit:", "left", "right"],
  2119. referencedClasses: []
  2120. }),
  2121. smalltalk.Compiler);
  2122. smalltalk.addMethod(
  2123. "_visitBlockNode_",
  2124. smalltalk.method({
  2125. selector: "visitBlockNode:",
  2126. category: 'visiting',
  2127. fn: function (aNode){
  2128. var self=this;
  2129. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
  2130. smalltalk.send(smalltalk.send(aNode, "_parameters", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
  2131. smalltalk.send(self['@stream'], "_nextPutAll_", ["){"]);
  2132. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  2133. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  2134. return self;},
  2135. args: ["aNode"],
  2136. source: "visitBlockNode: aNode\x0a\x09stream nextPutAll: '(function('.\x0a\x09aNode parameters \x0a\x09 do: [:each |\x0a\x09\x09tempVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream nextPutAll: '){'.\x0a\x09aNode nodes do: [:each | self visit: each].\x0a\x09stream nextPutAll: '})'",
  2137. messageSends: ["nextPutAll:", "do:separatedBy:", "parameters", "add:", "do:", "nodes", "visit:"],
  2138. referencedClasses: []
  2139. }),
  2140. smalltalk.Compiler);
  2141. smalltalk.addMethod(
  2142. "_visitBlockSequenceNode_",
  2143. smalltalk.method({
  2144. selector: "visitBlockSequenceNode:",
  2145. category: 'visiting',
  2146. fn: function (aNode){
  2147. var self=this;
  2148. var index=nil;
  2149. (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
  2150. ((($receiver = smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return nil;"]);})() : (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  2151. (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", ["=nil;"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);(index=(0));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return nil;"]);}), (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  2152. (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", ["=nil;"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);(index=(0));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);})]));
  2153. (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])));
  2154. return self;},
  2155. args: ["aNode"],
  2156. source: "visitBlockSequenceNode: aNode\x0a\x09| index |\x0a\x09nestedBlocks := nestedBlocks + 1.\x0a\x09aNode nodes isEmpty\x0a\x09 ifTrue: [\x0a\x09\x09stream nextPutAll: 'return nil;']\x0a\x09 ifFalse: [\x0a\x09\x09aNode temps do: [:each | | temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09\x09 tempVariables add: temp.\x0a\x09\x09 stream nextPutAll: 'var ', temp, '=nil;'; lf].\x0a\x09\x09index := 0.\x0a\x09\x09aNode nodes do: [:each |\x0a\x09\x09 index := index + 1.\x0a\x09\x09 index = aNode nodes size ifTrue: [\x0a\x09\x09\x09stream nextPutAll: 'return '].\x0a\x09\x09 self visit: each.\x0a\x09\x09 stream nextPutAll: ';']].\x0a\x09nestedBlocks := nestedBlocks - 1",
  2157. messageSends: ["+", "ifTrue:ifFalse:", "isEmpty", "nodes", "nextPutAll:", "do:", "temps", "safeVariableNameFor:", "add:", ",", "lf", "ifTrue:", "=", "size", "visit:", "-"],
  2158. referencedClasses: []
  2159. }),
  2160. smalltalk.Compiler);
  2161. smalltalk.addMethod(
  2162. "_visitCascadeNode_",
  2163. smalltalk.method({
  2164. selector: "visitCascadeNode:",
  2165. category: 'visiting',
  2166. fn: function (aNode){
  2167. var self=this;
  2168. var index=nil;
  2169. (index=(0));
  2170. ((($receiver = smalltalk.send(self['@tempVariables'], "_includes_", ["$rec"])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})]));
  2171. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function($rec){"]);
  2172. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send((smalltalk.VariableNode || VariableNode), "_new", []), "_value_", ["$rec"])]);smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);
  2173. smalltalk.send(self['@stream'], "_nextPutAll_", ["})("]);
  2174. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
  2175. smalltalk.send(self['@stream'], "_nextPutAll_", [")"]);
  2176. return self;},
  2177. args: ["aNode"],
  2178. source: "visitCascadeNode: aNode\x0a\x09| index |\x0a\x09index := 0.\x0a\x09(tempVariables includes: '$rec') ifFalse: [\x0a\x09\x09tempVariables add: '$rec'].\x0a\x09stream nextPutAll: '(function($rec){'.\x0a\x09aNode nodes do: [:each |\x0a\x09 index := index + 1.\x0a\x09 index = aNode nodes size ifTrue: [\x0a\x09\x09stream nextPutAll: 'return '].\x0a\x09 each receiver: (VariableNode new value: '$rec').\x0a\x09 self visit: each.\x0a\x09 stream nextPutAll: ';'].\x0a\x09stream nextPutAll: '})('.\x0a\x09self visit: aNode receiver.\x0a\x09stream nextPutAll: ')'",
  2179. messageSends: ["ifFalse:", "includes:", "add:", "nextPutAll:", "do:", "nodes", "+", "ifTrue:", "=", "size", "receiver:", "value:", "new", "visit:", "receiver"],
  2180. referencedClasses: ["VariableNode"]
  2181. }),
  2182. smalltalk.Compiler);
  2183. smalltalk.addMethod(
  2184. "_visitClassReferenceNode_",
  2185. smalltalk.method({
  2186. selector: "visitClassReferenceNode:",
  2187. category: 'visiting',
  2188. fn: function (aNode){
  2189. var self=this;
  2190. ((($receiver = smalltalk.send(self['@referencedClasses'], "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})]));
  2191. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(smalltalk.", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [" || "]), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [")"])]);
  2192. return self;},
  2193. args: ["aNode"],
  2194. source: "visitClassReferenceNode: aNode\x0a\x09(referencedClasses includes: aNode value) ifFalse: [\x0a\x09\x09referencedClasses add: aNode value].\x0a\x09stream nextPutAll: '(smalltalk.', aNode value, ' || ', aNode value, ')'",
  2195. messageSends: ["ifFalse:", "includes:", "value", "add:", "nextPutAll:", ","],
  2196. referencedClasses: []
  2197. }),
  2198. smalltalk.Compiler);
  2199. smalltalk.addMethod(
  2200. "_visitDynamicArrayNode_",
  2201. smalltalk.method({
  2202. selector: "visitDynamicArrayNode:",
  2203. category: 'visiting',
  2204. fn: function (aNode){
  2205. var self=this;
  2206. smalltalk.send(self['@stream'], "_nextPutAll_", ["["]);
  2207. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  2208. smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
  2209. return self;},
  2210. args: ["aNode"],
  2211. source: "visitDynamicArrayNode: aNode\x0a\x09stream nextPutAll: '['.\x0a\x09aNode nodes \x0a\x09\x09do: [:each | self visit: each]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'",
  2212. messageSends: ["nextPutAll:", "do:separatedBy:", "nodes", "visit:"],
  2213. referencedClasses: []
  2214. }),
  2215. smalltalk.Compiler);
  2216. smalltalk.addMethod(
  2217. "_visitDynamicDictionaryNode_",
  2218. smalltalk.method({
  2219. selector: "visitDynamicDictionaryNode:",
  2220. category: 'visiting',
  2221. fn: function (aNode){
  2222. var self=this;
  2223. smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.HashedCollection._fromPairs_(["]);
  2224. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  2225. smalltalk.send(self['@stream'], "_nextPutAll_", ["])"]);
  2226. return self;},
  2227. args: ["aNode"],
  2228. source: "visitDynamicDictionaryNode: aNode\x0a\x09stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.\x0a\x09\x09aNode nodes \x0a\x09\x09\x09do: [:each | self visit: each]\x0a\x09\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09\x09stream nextPutAll: '])'",
  2229. messageSends: ["nextPutAll:", "do:separatedBy:", "nodes", "visit:"],
  2230. referencedClasses: []
  2231. }),
  2232. smalltalk.Compiler);
  2233. smalltalk.addMethod(
  2234. "_visitFailure_",
  2235. smalltalk.method({
  2236. selector: "visitFailure:",
  2237. category: 'visiting',
  2238. fn: function (aFailure){
  2239. var self=this;
  2240. smalltalk.send(self, "_error_", [smalltalk.send(aFailure, "_asString", [])]);
  2241. return self;},
  2242. args: ["aFailure"],
  2243. source: "visitFailure: aFailure\x0a\x09self error: aFailure asString",
  2244. messageSends: ["error:", "asString"],
  2245. referencedClasses: []
  2246. }),
  2247. smalltalk.Compiler);
  2248. smalltalk.addMethod(
  2249. "_visitJSStatementNode_",
  2250. smalltalk.method({
  2251. selector: "visitJSStatementNode:",
  2252. category: 'visiting',
  2253. fn: function (aNode){
  2254. var self=this;
  2255. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(aNode, "_source", [])]);
  2256. return self;},
  2257. args: ["aNode"],
  2258. source: "visitJSStatementNode: aNode\x0a\x09stream nextPutAll: aNode source",
  2259. messageSends: ["nextPutAll:", "source"],
  2260. referencedClasses: []
  2261. }),
  2262. smalltalk.Compiler);
  2263. smalltalk.addMethod(
  2264. "_visitMethodNode_",
  2265. smalltalk.method({
  2266. selector: "visitMethodNode:",
  2267. category: 'visiting',
  2268. fn: function (aNode){
  2269. var self=this;
  2270. var str=nil;
  2271. var currentSelector=nil;
  2272. (self['@currentSelector']=smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", []));
  2273. (self['@nestedBlocks']=(0));
  2274. (self['@earlyReturn']=false);
  2275. (self['@messageSends']=[]);
  2276. (self['@referencedClasses']=[]);
  2277. (self['@unknownVariables']=[]);
  2278. (self['@tempVariables']=[]);
  2279. (self['@argVariables']=[]);
  2280. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: \x22", "__comma", [smalltalk.send(aNode, "_selector", [])]), "__comma", ["\x22,"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  2281. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(self, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  2282. smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
  2283. smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@argVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
  2284. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  2285. (str=self['@stream']);
  2286. (self['@stream']=smalltalk.send("", "_writeStream", []));
  2287. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  2288. ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})]));
  2289. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);
  2290. (self['@stream']=str);
  2291. (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["return self;"]);})(self['@stream']);
  2292. ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})]));
  2293. smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
  2294. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(",", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", ["messageSends: "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@messageSends'], "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(self['@argVariables'], "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']);
  2295. smalltalk.send(self['@referencedClasses'], "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  2296. smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
  2297. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  2298. return self;},
  2299. args: ["aNode"],
  2300. source: "visitMethodNode: aNode\x0a\x09| str currentSelector | \x0a\x09currentSelector := aNode selector asSelector.\x0a\x09nestedBlocks := 0.\x0a\x09earlyReturn := false.\x0a\x09messageSends := #().\x0a\x09referencedClasses := #().\x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09stream \x0a\x09 nextPutAll: 'smalltalk.method({'; lf;\x0a\x09 nextPutAll: 'selector: \x22', aNode selector, '\x22,'; lf.\x0a\x09stream nextPutAll: 'source: ', self source asJavascript, ',';lf.\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09aNode arguments \x0a\x09 do: [:each | \x0a\x09\x09argVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream \x0a\x09 nextPutAll: '){'; lf;\x0a\x09 nextPutAll: 'var self=this;'; lf.\x0a\x09str := stream.\x0a\x09stream := '' writeStream.\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each].\x0a\x09earlyReturn ifTrue: [\x0a\x09 str nextPutAll: 'var $early={};'; lf; nextPutAll: 'try{'].\x0a\x09str nextPutAll: stream contents.\x0a\x09stream := str.\x0a\x09stream \x0a\x09 lf; \x0a\x09 nextPutAll: 'return self;'.\x0a\x09earlyReturn ifTrue: [\x0a\x09 stream lf; nextPutAll: '} catch(e) {if(e===$early)return e[0]; throw e}'].\x0a\x09stream nextPutAll: '}'.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: messageSends asJavascript, ','; lf;\x0a \x09nextPutAll: 'args: ', argVariables asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09referencedClasses \x0a\x09\x09do: [:each | stream nextPutAll: each printString]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'.\x0a\x09stream nextPutAll: '})'",
  2301. messageSends: ["asSelector", "selector", "nextPutAll:", "lf", ",", "asJavascript", "source", "do:separatedBy:", "arguments", "add:", "writeStream", "do:", "nodes", "visit:", "ifTrue:", "contents", "printString"],
  2302. referencedClasses: ["String"]
  2303. }),
  2304. smalltalk.Compiler);
  2305. smalltalk.addMethod(
  2306. "_visitReturnNode_",
  2307. smalltalk.method({
  2308. selector: "visitReturnNode:",
  2309. category: 'visiting',
  2310. fn: function (aNode){
  2311. var self=this;
  2312. ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@earlyReturn']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@earlyReturn']=true);})]));
  2313. ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));
  2314. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  2315. ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})]));
  2316. return self;},
  2317. args: ["aNode"],
  2318. source: "visitReturnNode: aNode\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 earlyReturn := true].\x0a\x09nestedBlocks > 0\x0a\x09 ifTrue: [\x0a\x09\x09stream\x0a\x09\x09 nextPutAll: '(function(){throw $early=[']\x0a\x09 ifFalse: [stream nextPutAll: 'return '].\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each].\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 stream nextPutAll: ']})()']",
  2319. messageSends: ["ifTrue:", ">", "ifTrue:ifFalse:", "nextPutAll:", "do:", "nodes", "visit:"],
  2320. referencedClasses: []
  2321. }),
  2322. smalltalk.Compiler);
  2323. smalltalk.addMethod(
  2324. "_visitSendNode_",
  2325. smalltalk.method({
  2326. selector: "visitSendNode:",
  2327. category: 'visiting',
  2328. fn: function (aNode){
  2329. var self=this;
  2330. var str=nil;
  2331. var receiver=nil;
  2332. var superSend=nil;
  2333. var inlined=nil;
  2334. (str=self['@stream']);
  2335. ((($receiver = smalltalk.send(self['@messageSends'], "_includes_", [smalltalk.send(aNode, "_selector", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})]));
  2336. (self['@stream']=smalltalk.send("", "_writeStream", []));
  2337. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
  2338. (superSend=smalltalk.send(smalltalk.send(self['@stream'], "_contents", []), "__eq", ["super"]));
  2339. (receiver=((($receiver = superSend).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "self";})() : (function(){return smalltalk.send(self['@stream'], "_contents", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "self";}), (function(){return smalltalk.send(self['@stream'], "_contents", []);})])));
  2340. (self['@stream']=str);
  2341. ((($receiver = smalltalk.send(self, "_performOptimizations", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));
  2342. return self;},
  2343. args: ["aNode"],
  2344. source: "visitSendNode: aNode\x0a | str receiver superSend inlined |\x0a str := stream.\x0a (messageSends includes: aNode selector) ifFalse: [\x0a messageSends add: aNode selector].\x0a stream := '' writeStream.\x0a self visit: aNode receiver.\x0a superSend := stream contents = 'super'.\x0a receiver := superSend ifTrue: ['self'] ifFalse: [stream contents].\x0a stream := str.\x0a\x09\x0a\x09self performOptimizations \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09(self inlineLiteral: aNode selector receiverNode: aNode receiver argumentNodes: aNode arguments) ifFalse: [\x0a\x09\x09\x09\x09(self inline: aNode selector receiver: receiver argumentNodes: aNode arguments)\x0a \x09\x09\x09ifTrue: [stream nextPutAll: ' : ', (self send: aNode selector to: '$receiver' arguments: aNode arguments superSend: superSend), ')']\x0a \x09\x09\x09ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]]]\x0a\x09\x09ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]",
  2345. messageSends: ["ifFalse:", "includes:", "selector", "add:", "writeStream", "visit:", "receiver", "=", "contents", "ifTrue:ifFalse:", "performOptimizations", "inlineLiteral:receiverNode:argumentNodes:", "arguments", "inline:receiver:argumentNodes:", "nextPutAll:", ",", "send:to:arguments:superSend:"],
  2346. referencedClasses: []
  2347. }),
  2348. smalltalk.Compiler);
  2349. smalltalk.addMethod(
  2350. "_visitSequenceNode_",
  2351. smalltalk.method({
  2352. selector: "visitSequenceNode:",
  2353. category: 'visiting',
  2354. fn: function (aNode){
  2355. var self=this;
  2356. smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  2357. (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", ["=nil;"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);
  2358. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);}), (function(){return smalltalk.send(self['@stream'], "_lf", []);})]);
  2359. return self;},
  2360. args: ["aNode"],
  2361. source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [:each || temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09 tempVariables add: temp.\x0a\x09 stream nextPutAll: 'var ', temp, '=nil;'; lf].\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each.\x0a\x09 stream nextPutAll: ';']\x0a\x09 separatedBy: [stream lf]",
  2362. messageSends: ["do:", "temps", "safeVariableNameFor:", "add:", "nextPutAll:", ",", "lf", "do:separatedBy:", "nodes", "visit:"],
  2363. referencedClasses: []
  2364. }),
  2365. smalltalk.Compiler);
  2366. smalltalk.addMethod(
  2367. "_visitValueNode_",
  2368. smalltalk.method({
  2369. selector: "visitValueNode:",
  2370. category: 'visiting',
  2371. fn: function (aNode){
  2372. var self=this;
  2373. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
  2374. return self;},
  2375. args: ["aNode"],
  2376. source: "visitValueNode: aNode\x0a\x09stream nextPutAll: aNode value asJavascript",
  2377. messageSends: ["nextPutAll:", "asJavascript", "value"],
  2378. referencedClasses: []
  2379. }),
  2380. smalltalk.Compiler);
  2381. smalltalk.addMethod(
  2382. "_visitVariableNode_",
  2383. smalltalk.method({
  2384. selector: "visitVariableNode:",
  2385. category: 'visiting',
  2386. fn: function (aNode){
  2387. var self=this;
  2388. var varName=nil;
  2389. ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_currentClass", []), "_allInstanceVariableNames", []), "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send("self['@", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", ["']"])]);})() : (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send("self['@", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", ["']"])]);}), (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})]));})]));
  2390. return self;},
  2391. args: ["aNode"],
  2392. source: "visitVariableNode: aNode\x0a\x09| varName |\x0a\x09(self currentClass allInstanceVariableNames includes: aNode value) \x0a\x09\x09ifTrue: [stream nextPutAll: 'self[''@', aNode value, ''']']\x0a\x09\x09ifFalse: [\x0a \x09varName := self safeVariableNameFor: aNode value.\x0a\x09\x09\x09(self knownVariables includes: varName) \x0a \x09\x09ifFalse: [\x0a \x09unknownVariables add: aNode value.\x0a \x09aNode assigned \x0a \x09\x09ifTrue: [stream nextPutAll: varName]\x0a \x09\x09ifFalse: [stream nextPutAll: '(typeof ', varName, ' == ''undefined'' ? nil : ', varName, ')']]\x0a \x09\x09ifTrue: [\x0a \x09aNode value = 'thisContext'\x0a \x09\x09ifTrue: [stream nextPutAll: '(smalltalk.getThisContext())']\x0a \x09\x09\x09\x09ifFalse: [stream nextPutAll: varName]]]",
  2393. messageSends: ["ifTrue:ifFalse:", "includes:", "allInstanceVariableNames", "currentClass", "value", "nextPutAll:", ",", "safeVariableNameFor:", "ifFalse:ifTrue:", "knownVariables", "add:", "assigned", "="],
  2394. referencedClasses: []
  2395. }),
  2396. smalltalk.Compiler);
  2397. smalltalk.Compiler.klass.iVarNames = ['performOptimizations'];
  2398. smalltalk.addMethod(
  2399. "_performOptimizations",
  2400. smalltalk.method({
  2401. selector: "performOptimizations",
  2402. category: 'accessing',
  2403. fn: function (){
  2404. var self=this;
  2405. return (($receiver = self['@performOptimizations']) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver;
  2406. return self;},
  2407. args: [],
  2408. source: "performOptimizations\x0a\x09^performOptimizations ifNil: [true]",
  2409. messageSends: ["ifNil:"],
  2410. referencedClasses: []
  2411. }),
  2412. smalltalk.Compiler.klass);
  2413. smalltalk.addMethod(
  2414. "_performOptimizations_",
  2415. smalltalk.method({
  2416. selector: "performOptimizations:",
  2417. category: 'accessing',
  2418. fn: function (aBoolean){
  2419. var self=this;
  2420. (self['@performOptimizations']=aBoolean);
  2421. return self;},
  2422. args: ["aBoolean"],
  2423. source: "performOptimizations: aBoolean\x0a\x09performOptimizations := aBoolean",
  2424. messageSends: [],
  2425. referencedClasses: []
  2426. }),
  2427. smalltalk.Compiler.klass);