Importer-Exporter.deploy.js 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485
  1. (function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Importer-Exporter');
  3. smalltalk.addClass('AbstractExporter', smalltalk.Object, [], 'Importer-Exporter');
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "chunkEscape:",
  7. fn: function (aString){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) {
  10. var $1;
  11. $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
  12. return $1;
  13. }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString},smalltalk.AbstractExporter)})},
  14. messageSends: ["trimBoth", "replace:with:"]}),
  15. smalltalk.AbstractExporter);
  16. smalltalk.addMethod(
  17. smalltalk.method({
  18. selector: "classNameFor:",
  19. fn: function (aClass){
  20. var self=this;
  21. return smalltalk.withContext(function($ctx1) {
  22. var $2,$3,$1;
  23. $2=_st(aClass)._isMetaclass();
  24. if(smalltalk.assert($2)){
  25. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(" class");
  26. } else {
  27. $3=_st(aClass)._isNil();
  28. if(smalltalk.assert($3)){
  29. $1="nil";
  30. } else {
  31. $1=_st(aClass)._name();
  32. };
  33. };
  34. return $1;
  35. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.AbstractExporter)})},
  36. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"]}),
  37. smalltalk.AbstractExporter);
  38. smalltalk.addMethod(
  39. smalltalk.method({
  40. selector: "recipe",
  41. fn: function (){
  42. var self=this;
  43. return smalltalk.withContext(function($ctx1) {
  44. self._subclassResponsibility();
  45. return self}, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.AbstractExporter)})},
  46. messageSends: ["subclassResponsibility"]}),
  47. smalltalk.AbstractExporter);
  48. smalltalk.AbstractExporter.klass.iVarNames = ['default'];
  49. smalltalk.addMethod(
  50. smalltalk.method({
  51. selector: "default",
  52. fn: function (){
  53. var self=this;
  54. return smalltalk.withContext(function($ctx1) {
  55. var $2,$1;
  56. $2=self["@default"];
  57. if(($receiver = $2) == nil || $receiver == undefined){
  58. self["@default"]=self._new();
  59. $1=self["@default"];
  60. } else {
  61. $1=$2;
  62. };
  63. return $1;
  64. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.AbstractExporter.klass)})},
  65. messageSends: ["ifNil:", "new"]}),
  66. smalltalk.AbstractExporter.klass);
  67. smalltalk.addClass('ChunkExporter', smalltalk.AbstractExporter, [], 'Importer-Exporter');
  68. smalltalk.addMethod(
  69. smalltalk.method({
  70. selector: "exportCategoryEpilogueOf:on:",
  71. fn: function (aCategory,aStream){
  72. var self=this;
  73. return smalltalk.withContext(function($ctx1) {
  74. var $1,$2;
  75. $1=aStream;
  76. _st($1)._nextPutAll_(" !");
  77. _st($1)._lf();
  78. $2=_st($1)._lf();
  79. return self}, function($ctx1) {$ctx1.fill(self,"exportCategoryEpilogueOf:on:",{aCategory:aCategory,aStream:aStream},smalltalk.ChunkExporter)})},
  80. messageSends: ["nextPutAll:", "lf"]}),
  81. smalltalk.ChunkExporter);
  82. smalltalk.addMethod(
  83. smalltalk.method({
  84. selector: "exportCategoryPrologueOf:on:",
  85. fn: function (aCategory,aStream){
  86. var self=this;
  87. return smalltalk.withContext(function($ctx1) {
  88. var $1,$2;
  89. $1=aStream;
  90. _st($1)._nextPutAll_("!".__comma(self._classNameFor_(_st(aCategory)._theClass())));
  91. $2=_st($1)._nextPutAll_(_st(" methodsFor: '".__comma(_st(aCategory)._name())).__comma("'!"));
  92. return self}, function($ctx1) {$ctx1.fill(self,"exportCategoryPrologueOf:on:",{aCategory:aCategory,aStream:aStream},smalltalk.ChunkExporter)})},
  93. messageSends: ["nextPutAll:", ",", "classNameFor:", "theClass", "name"]}),
  94. smalltalk.ChunkExporter);
  95. smalltalk.addMethod(
  96. smalltalk.method({
  97. selector: "exportDefinitionOf:on:",
  98. fn: function (aClass,aStream){
  99. var self=this;
  100. return smalltalk.withContext(function($ctx1) {
  101. var $1,$2,$3,$4,$5,$6,$7;
  102. $1=aStream;
  103. _st($1)._nextPutAll_(self._classNameFor_(_st(aClass)._superclass()));
  104. _st($1)._nextPutAll_(" subclass: #".__comma(self._classNameFor_(aClass)));
  105. _st($1)._lf();
  106. _st($1)._tab();
  107. $2=_st($1)._nextPutAll_("instanceVariableNames: '");
  108. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  109. return smalltalk.withContext(function($ctx2) {
  110. return _st(aStream)._nextPutAll_(each);
  111. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  112. return smalltalk.withContext(function($ctx2) {
  113. return _st(aStream)._nextPutAll_(" ");
  114. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  115. $3=aStream;
  116. _st($3)._nextPutAll_("'");
  117. _st($3)._lf();
  118. _st($3)._tab();
  119. _st($3)._nextPutAll_(_st("package: '".__comma(_st(aClass)._category())).__comma("'!"));
  120. $4=_st($3)._lf();
  121. $5=_st(_st(aClass)._comment())._notEmpty();
  122. if(smalltalk.assert($5)){
  123. $6=aStream;
  124. _st($6)._nextPutAll_(_st("!".__comma(self._classNameFor_(aClass))).__comma(" commentStamp!"));
  125. _st($6)._lf();
  126. _st($6)._nextPutAll_(_st(self._chunkEscape_(_st(aClass)._comment())).__comma("!"));
  127. $7=_st($6)._lf();
  128. $7;
  129. };
  130. _st(aStream)._lf();
  131. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.ChunkExporter)})},
  132. messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "tab", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"]}),
  133. smalltalk.ChunkExporter);
  134. smalltalk.addMethod(
  135. smalltalk.method({
  136. selector: "exportMetaDefinitionOf:on:",
  137. fn: function (aClass,aStream){
  138. var self=this;
  139. return smalltalk.withContext(function($ctx1) {
  140. var $1,$2,$3,$4,$5;
  141. $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
  142. if(! smalltalk.assert($1)){
  143. $2=aStream;
  144. _st($2)._nextPutAll_(self._classNameFor_(_st(aClass)._class()));
  145. $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
  146. $3;
  147. _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
  148. return smalltalk.withContext(function($ctx2) {
  149. return _st(aStream)._nextPutAll_(each);
  150. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  151. return smalltalk.withContext(function($ctx2) {
  152. return _st(aStream)._nextPutAll_(" ");
  153. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  154. $4=aStream;
  155. _st($4)._nextPutAll_("'!");
  156. _st($4)._lf();
  157. $5=_st($4)._lf();
  158. $5;
  159. };
  160. return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.ChunkExporter)})},
  161. messageSends: ["ifFalse:", "nextPutAll:", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "lf", "isEmpty"]}),
  162. smalltalk.ChunkExporter);
  163. smalltalk.addMethod(
  164. smalltalk.method({
  165. selector: "exportMethod:on:",
  166. fn: function (aMethod,aStream){
  167. var self=this;
  168. return smalltalk.withContext(function($ctx1) {
  169. var $1,$2;
  170. $1=aStream;
  171. _st($1)._lf();
  172. _st($1)._lf();
  173. _st($1)._nextPutAll_(self._chunkEscape_(_st(aMethod)._source()));
  174. _st($1)._lf();
  175. $2=_st($1)._nextPutAll_("!");
  176. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.ChunkExporter)})},
  177. messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"]}),
  178. smalltalk.ChunkExporter);
  179. smalltalk.addMethod(
  180. smalltalk.method({
  181. selector: "exportPackageDefinitionOf:on:",
  182. fn: function (aPackage,aStream){
  183. var self=this;
  184. return smalltalk.withContext(function($ctx1) {
  185. var $1,$2;
  186. $1=aStream;
  187. _st($1)._nextPutAll_(_st("Smalltalk current createPackage: '".__comma(_st(aPackage)._name())).__comma("'!"));
  188. $2=_st($1)._lf();
  189. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.ChunkExporter)})},
  190. messageSends: ["nextPutAll:", ",", "name", "lf"]}),
  191. smalltalk.ChunkExporter);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "extensionCategoriesOfPackage:",
  195. fn: function (aPackage){
  196. var self=this;
  197. var name,map,result;
  198. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  199. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  200. function $MethodCategory(){return smalltalk.MethodCategory||(typeof MethodCategory=="undefined"?nil:MethodCategory)}
  201. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  202. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  203. return smalltalk.withContext(function($ctx1) {
  204. var $1,$2;
  205. name=_st(aPackage)._name();
  206. result=_st($OrderedCollection())._new();
  207. _st(_st($Package())._sortedClasses_(_st(_st($Smalltalk())._current())._classes()))._do_((function(each){
  208. return smalltalk.withContext(function($ctx2) {
  209. return _st([each,_st(each)._class()])._do_((function(aClass){
  210. return smalltalk.withContext(function($ctx3) {
  211. map=_st($Dictionary())._new();
  212. map;
  213. _st(aClass)._protocolsDo_((function(category,methods){
  214. return smalltalk.withContext(function($ctx4) {
  215. $1=_st(category).__eq("*".__comma(name));
  216. if(smalltalk.assert($1)){
  217. return _st(map)._at_put_(category,methods);
  218. };
  219. }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx3)})}));
  220. return _st(result)._addAll_(_st(_st(_st(map)._keys())._sorted_((function(a,b){
  221. return smalltalk.withContext(function($ctx4) {
  222. return _st(a).__lt_eq(b);
  223. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._collect_((function(category){
  224. return smalltalk.withContext(function($ctx4) {
  225. return _st($MethodCategory())._name_theClass_methods_(category,aClass,_st(map)._at_(category));
  226. }, function($ctx4) {$ctx4.fillBlock({category:category},$ctx3)})})));
  227. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
  228. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  229. $2=result;
  230. return $2;
  231. }, function($ctx1) {$ctx1.fill(self,"extensionCategoriesOfPackage:",{aPackage:aPackage,name:name,map:map,result:result},smalltalk.ChunkExporter)})},
  232. messageSends: ["name", "new", "do:", "protocolsDo:", "ifTrue:", "at:put:", "=", ",", "addAll:", "collect:", "name:theClass:methods:", "at:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"]}),
  233. smalltalk.ChunkExporter);
  234. smalltalk.addMethod(
  235. smalltalk.method({
  236. selector: "methodsOfCategory:",
  237. fn: function (aCategory){
  238. var self=this;
  239. return smalltalk.withContext(function($ctx1) {
  240. var $1;
  241. $1=_st(_st(aCategory)._methods())._sorted_((function(a,b){
  242. return smalltalk.withContext(function($ctx2) {
  243. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  244. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  245. return $1;
  246. }, function($ctx1) {$ctx1.fill(self,"methodsOfCategory:",{aCategory:aCategory},smalltalk.ChunkExporter)})},
  247. messageSends: ["sorted:", "<=", "selector", "methods"]}),
  248. smalltalk.ChunkExporter);
  249. smalltalk.addMethod(
  250. smalltalk.method({
  251. selector: "ownCategoriesOfClass:",
  252. fn: function (aClass){
  253. var self=this;
  254. var map;
  255. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  256. function $MethodCategory(){return smalltalk.MethodCategory||(typeof MethodCategory=="undefined"?nil:MethodCategory)}
  257. return smalltalk.withContext(function($ctx1) {
  258. var $1,$2;
  259. map=_st($Dictionary())._new();
  260. _st(aClass)._protocolsDo_((function(category,methods){
  261. return smalltalk.withContext(function($ctx2) {
  262. $1=_st(category)._match_("^\x5c*");
  263. if(! smalltalk.assert($1)){
  264. return _st(map)._at_put_(category,methods);
  265. };
  266. }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
  267. $2=_st(_st(_st(map)._keys())._sorted_((function(a,b){
  268. return smalltalk.withContext(function($ctx2) {
  269. return _st(a).__lt_eq(b);
  270. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._collect_((function(category){
  271. return smalltalk.withContext(function($ctx2) {
  272. return _st($MethodCategory())._name_theClass_methods_(category,aClass,_st(map)._at_(category));
  273. }, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1)})}));
  274. return $2;
  275. }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfClass:",{aClass:aClass,map:map},smalltalk.ChunkExporter)})},
  276. messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "collect:", "name:theClass:methods:", "at:", "sorted:", "<=", "keys"]}),
  277. smalltalk.ChunkExporter);
  278. smalltalk.addMethod(
  279. smalltalk.method({
  280. selector: "ownCategoriesOfMetaClass:",
  281. fn: function (aClass){
  282. var self=this;
  283. return smalltalk.withContext(function($ctx1) {
  284. var $1;
  285. $1=self._ownCategoriesOfClass_(_st(aClass)._class());
  286. return $1;
  287. }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfMetaClass:",{aClass:aClass},smalltalk.ChunkExporter)})},
  288. messageSends: ["ownCategoriesOfClass:", "class"]}),
  289. smalltalk.ChunkExporter);
  290. smalltalk.addMethod(
  291. smalltalk.method({
  292. selector: "recipe",
  293. fn: function (){
  294. var self=this;
  295. var exportCategoryRecipe;
  296. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  297. return smalltalk.withContext(function($ctx1) {
  298. var $1;
  299. exportCategoryRecipe=[self.__minus_gt("exportCategoryPrologueOf:on:"),[self.__minus_gt("methodsOfCategory:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportCategoryEpilogueOf:on:")];
  300. $1=[self.__minus_gt("exportPackageDefinitionOf:on:"),[_st($PluggableExporter()).__minus_gt("ownClassesOfPackage:"),self.__minus_gt("exportDefinitionOf:on:"),_st([self.__minus_gt("ownCategoriesOfClass:")]).__comma(exportCategoryRecipe),self.__minus_gt("exportMetaDefinitionOf:on:"),_st([self.__minus_gt("ownCategoriesOfMetaClass:")]).__comma(exportCategoryRecipe)],_st([self.__minus_gt("extensionCategoriesOfPackage:")]).__comma(exportCategoryRecipe)];
  301. return $1;
  302. }, function($ctx1) {$ctx1.fill(self,"recipe",{exportCategoryRecipe:exportCategoryRecipe},smalltalk.ChunkExporter)})},
  303. messageSends: ["->", ","]}),
  304. smalltalk.ChunkExporter);
  305. smalltalk.addClass('Exporter', smalltalk.AbstractExporter, [], 'Importer-Exporter');
  306. smalltalk.addMethod(
  307. smalltalk.method({
  308. selector: "classNameFor:",
  309. fn: function (aClass){
  310. var self=this;
  311. return smalltalk.withContext(function($ctx1) {
  312. var $2,$3,$1;
  313. $2=_st(aClass)._isMetaclass();
  314. if(smalltalk.assert($2)){
  315. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
  316. } else {
  317. $3=_st(aClass)._isNil();
  318. if(smalltalk.assert($3)){
  319. $1="nil";
  320. } else {
  321. $1=_st(aClass)._name();
  322. };
  323. };
  324. return $1;
  325. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.Exporter)})},
  326. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"]}),
  327. smalltalk.Exporter);
  328. smalltalk.addMethod(
  329. smalltalk.method({
  330. selector: "exportDefinitionOf:on:",
  331. fn: function (aClass,aStream){
  332. var self=this;
  333. return smalltalk.withContext(function($ctx1) {
  334. var $1,$2,$3,$4,$5,$6,$7;
  335. $1=aStream;
  336. _st($1)._lf();
  337. _st($1)._nextPutAll_("smalltalk.addClass(");
  338. _st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
  339. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
  340. $2=_st($1)._nextPutAll_(", [");
  341. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  342. return smalltalk.withContext(function($ctx2) {
  343. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  344. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  345. return smalltalk.withContext(function($ctx2) {
  346. return _st(aStream)._nextPutAll_(", ");
  347. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  348. $3=aStream;
  349. _st($3)._nextPutAll_("], '");
  350. _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
  351. $4=_st($3)._nextPutAll_(");");
  352. $5=_st(_st(aClass)._comment())._notEmpty();
  353. if(smalltalk.assert($5)){
  354. $6=aStream;
  355. _st($6)._lf();
  356. _st($6)._nextPutAll_("smalltalk.");
  357. _st($6)._nextPutAll_(self._classNameFor_(aClass));
  358. _st($6)._nextPutAll_(".comment=");
  359. _st($6)._nextPutAll_(_st(_st(aClass)._comment())._asJavascript());
  360. $7=_st($6)._nextPutAll_(";");
  361. $7;
  362. };
  363. _st(aStream)._lf();
  364. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.Exporter)})},
  365. messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "asJavascript", "comment", "notEmpty"]}),
  366. smalltalk.Exporter);
  367. smalltalk.addMethod(
  368. smalltalk.method({
  369. selector: "exportMetaDefinitionOf:on:",
  370. fn: function (aClass,aStream){
  371. var self=this;
  372. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  373. return smalltalk.withContext(function($ctx1) {
  374. var $1,$2,$3;
  375. _st(aStream)._lf();
  376. $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
  377. if(! smalltalk.assert($1)){
  378. $2=aStream;
  379. _st($2)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._class())));
  380. $3=_st($2)._nextPutAll_(".iVarNames = [");
  381. $3;
  382. _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
  383. return smalltalk.withContext(function($ctx2) {
  384. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  385. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  386. return smalltalk.withContext(function($ctx2) {
  387. return _st(aStream)._nextPutAll_(",");
  388. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  389. _st(aStream)._nextPutAll_("];".__comma(_st($String())._lf()));
  390. };
  391. return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.Exporter)})},
  392. messageSends: ["lf", "ifFalse:", "nextPutAll:", ",", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "isEmpty"]}),
  393. smalltalk.Exporter);
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "exportMethod:on:",
  397. fn: function (aMethod,aStream){
  398. var self=this;
  399. return smalltalk.withContext(function($ctx1) {
  400. var $1,$2,$3,$4;
  401. $1=aStream;
  402. _st($1)._nextPutAll_("smalltalk.addMethod(");
  403. _st($1)._lf();
  404. _st($1)._nextPutAll_("smalltalk.method({");
  405. _st($1)._lf();
  406. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  407. _st($1)._lf();
  408. _st($1)._nextPutAll_(_st("category: '".__comma(_st(aMethod)._category())).__comma("',"));
  409. _st($1)._lf();
  410. _st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
  411. _st($1)._lf();
  412. _st($1)._nextPutAll_(_st("args: ".__comma(_st(_st(aMethod)._arguments())._asJavascript())).__comma(","));
  413. _st($1)._lf();
  414. _st($1)._nextPutAll_(_st("source: ".__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  415. _st($1)._lf();
  416. _st($1)._nextPutAll_(_st("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript())).__comma(","));
  417. _st($1)._lf();
  418. $2=_st($1)._nextPutAll_("referencedClasses: ".__comma(_st(_st(aMethod)._referencedClasses())._asJavascript()));
  419. $3=aStream;
  420. _st($3)._lf();
  421. _st($3)._nextPutAll_("}),");
  422. _st($3)._lf();
  423. _st($3)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
  424. _st($3)._nextPutAll_(");");
  425. _st($3)._lf();
  426. $4=_st($3)._lf();
  427. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.Exporter)})},
  428. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:", "methodClass"]}),
  429. smalltalk.Exporter);
  430. smalltalk.addMethod(
  431. smalltalk.method({
  432. selector: "exportPackageDefinitionOf:on:",
  433. fn: function (aPackage,aStream){
  434. var self=this;
  435. return smalltalk.withContext(function($ctx1) {
  436. var $1,$2;
  437. $1=aStream;
  438. _st($1)._nextPutAll_("smalltalk.addPackage(");
  439. _st($1)._nextPutAll_(_st("'".__comma(_st(aPackage)._name())).__comma("');"));
  440. $2=_st($1)._lf();
  441. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter)})},
  442. messageSends: ["nextPutAll:", ",", "name", "lf"]}),
  443. smalltalk.Exporter);
  444. smalltalk.addMethod(
  445. smalltalk.method({
  446. selector: "exportPackageEpilogueOf:on:",
  447. fn: function (aPackage,aStream){
  448. var self=this;
  449. return smalltalk.withContext(function($ctx1) {
  450. var $1,$2;
  451. $1=aStream;
  452. _st($1)._nextPutAll_("})(global_smalltalk,global_nil,global__st);");
  453. $2=_st($1)._lf();
  454. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter)})},
  455. messageSends: ["nextPutAll:", "lf"]}),
  456. smalltalk.Exporter);
  457. smalltalk.addMethod(
  458. smalltalk.method({
  459. selector: "exportPackagePrologueOf:on:",
  460. fn: function (aPackage,aStream){
  461. var self=this;
  462. return smalltalk.withContext(function($ctx1) {
  463. var $1,$2;
  464. $1=aStream;
  465. _st($1)._nextPutAll_("(function(smalltalk,nil,_st){");
  466. $2=_st($1)._lf();
  467. return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter)})},
  468. messageSends: ["nextPutAll:", "lf"]}),
  469. smalltalk.Exporter);
  470. smalltalk.addMethod(
  471. smalltalk.method({
  472. selector: "exportPackageTransportOf:on:",
  473. fn: function (aPackage,aStream){
  474. var self=this;
  475. var json;
  476. return smalltalk.withContext(function($ctx1) {
  477. var $1,$2,$3;
  478. json=_st(aPackage)._transportJson();
  479. $1=_st(json).__eq("null");
  480. if(! smalltalk.assert($1)){
  481. $2=aStream;
  482. _st($2)._nextPutAll_("smalltalk.packages[");
  483. _st($2)._nextPutAll_(_st(_st(aPackage)._name())._asJavascript());
  484. _st($2)._nextPutAll_("].transport = ");
  485. _st($2)._nextPutAll_(json);
  486. _st($2)._nextPutAll_(";");
  487. $3=_st($2)._lf();
  488. $3;
  489. };
  490. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageTransportOf:on:",{aPackage:aPackage,aStream:aStream,json:json},smalltalk.Exporter)})},
  491. messageSends: ["transportJson", "ifFalse:", "nextPutAll:", "asJavascript", "name", "lf", "="]}),
  492. smalltalk.Exporter);
  493. smalltalk.addMethod(
  494. smalltalk.method({
  495. selector: "extensionMethodsOfPackage:",
  496. fn: function (aPackage){
  497. var self=this;
  498. var name,result;
  499. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  500. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  501. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  502. return smalltalk.withContext(function($ctx1) {
  503. var $1;
  504. name=_st(aPackage)._name();
  505. result=_st($OrderedCollection())._new();
  506. _st(_st($Package())._sortedClasses_(_st(_st($Smalltalk())._current())._classes()))._do_((function(each){
  507. return smalltalk.withContext(function($ctx2) {
  508. return _st([each,_st(each)._class()])._do_((function(aClass){
  509. return smalltalk.withContext(function($ctx3) {
  510. return _st(result)._addAll_(_st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  511. return smalltalk.withContext(function($ctx4) {
  512. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  513. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._select_((function(method){
  514. return smalltalk.withContext(function($ctx4) {
  515. return _st(_st(method)._category()).__eq("*".__comma(name));
  516. }, function($ctx4) {$ctx4.fillBlock({method:method},$ctx3)})})));
  517. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
  518. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  519. $1=result;
  520. return $1;
  521. }, function($ctx1) {$ctx1.fill(self,"extensionMethodsOfPackage:",{aPackage:aPackage,name:name,result:result},smalltalk.Exporter)})},
  522. messageSends: ["name", "new", "do:", "addAll:", "select:", "=", ",", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "class", "sortedClasses:", "classes", "current"]}),
  523. smalltalk.Exporter);
  524. smalltalk.addMethod(
  525. smalltalk.method({
  526. selector: "ownMethodsOfClass:",
  527. fn: function (aClass){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) {
  530. var $1;
  531. $1=_st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  532. return smalltalk.withContext(function($ctx2) {
  533. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  534. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._reject_((function(each){
  535. return smalltalk.withContext(function($ctx2) {
  536. return _st(_st(each)._category())._match_("^\x5c*");
  537. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  538. return $1;
  539. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfClass:",{aClass:aClass},smalltalk.Exporter)})},
  540. messageSends: ["reject:", "match:", "category", "sorted:", "<=", "selector", "values", "methodDictionary"]}),
  541. smalltalk.Exporter);
  542. smalltalk.addMethod(
  543. smalltalk.method({
  544. selector: "ownMethodsOfMetaClass:",
  545. fn: function (aClass){
  546. var self=this;
  547. return smalltalk.withContext(function($ctx1) {
  548. var $1;
  549. $1=self._ownMethodsOfClass_(_st(aClass)._class());
  550. return $1;
  551. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfMetaClass:",{aClass:aClass},smalltalk.Exporter)})},
  552. messageSends: ["ownMethodsOfClass:", "class"]}),
  553. smalltalk.Exporter);
  554. smalltalk.addMethod(
  555. smalltalk.method({
  556. selector: "recipe",
  557. fn: function (){
  558. var self=this;
  559. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  560. return smalltalk.withContext(function($ctx1) {
  561. var $1;
  562. $1=[self.__minus_gt("exportPackagePrologueOf:on:"),self.__minus_gt("exportPackageDefinitionOf:on:"),self.__minus_gt("exportPackageTransportOf:on:"),[_st($PluggableExporter()).__minus_gt("ownClassesOfPackage:"),self.__minus_gt("exportDefinitionOf:on:"),[self.__minus_gt("ownMethodsOfClass:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportMetaDefinitionOf:on:"),[self.__minus_gt("ownMethodsOfMetaClass:"),self.__minus_gt("exportMethod:on:")]],[self.__minus_gt("extensionMethodsOfPackage:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportPackageEpilogueOf:on:")];
  563. return $1;
  564. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.Exporter)})},
  565. messageSends: ["->"]}),
  566. smalltalk.Exporter);
  567. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
  568. smalltalk.addMethod(
  569. smalltalk.method({
  570. selector: "exportDefinitionOf:on:",
  571. fn: function (aClass,aStream){
  572. var self=this;
  573. return smalltalk.withContext(function($ctx1) {
  574. var $1,$2,$3,$4;
  575. $1=aStream;
  576. _st($1)._lf();
  577. _st($1)._nextPutAll_("smalltalk.addClass(");
  578. _st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
  579. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
  580. $2=_st($1)._nextPutAll_(", [");
  581. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  582. return smalltalk.withContext(function($ctx2) {
  583. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  584. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  585. return smalltalk.withContext(function($ctx2) {
  586. return _st(aStream)._nextPutAll_(", ");
  587. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  588. $3=aStream;
  589. _st($3)._nextPutAll_("], '");
  590. _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
  591. $4=_st($3)._nextPutAll_(");");
  592. _st(aStream)._lf();
  593. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)})},
  594. messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category"]}),
  595. smalltalk.StrippedExporter);
  596. smalltalk.addMethod(
  597. smalltalk.method({
  598. selector: "exportMethod:on:",
  599. fn: function (aMethod,aStream){
  600. var self=this;
  601. return smalltalk.withContext(function($ctx1) {
  602. var $1,$2;
  603. $1=aStream;
  604. _st($1)._nextPutAll_("smalltalk.addMethod(");
  605. _st($1)._lf();
  606. _st($1)._nextPutAll_("smalltalk.method({");
  607. _st($1)._lf();
  608. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  609. _st($1)._lf();
  610. _st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
  611. _st($1)._lf();
  612. _st($1)._nextPutAll_("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript()));
  613. _st($1)._nextPutAll_("}),");
  614. _st($1)._lf();
  615. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
  616. _st($1)._nextPutAll_(");");
  617. _st($1)._lf();
  618. $2=_st($1)._lf();
  619. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.StrippedExporter)})},
  620. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "compiledSource", "fn", "messageSends", "classNameFor:", "methodClass"]}),
  621. smalltalk.StrippedExporter);
  622. smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
  623. smalltalk.addMethod(
  624. smalltalk.method({
  625. selector: "nextChunk",
  626. fn: function (){
  627. var self=this;
  628. var char,result,chunk;
  629. return smalltalk.withContext(function($ctx1) {
  630. var $1,$2,$3;
  631. var $early={};
  632. try {
  633. result=""._writeStream();
  634. _st((function(){
  635. return smalltalk.withContext(function($ctx2) {
  636. char=_st(self["@stream"])._next();
  637. char;
  638. return _st(char)._notNil();
  639. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  640. return smalltalk.withContext(function($ctx2) {
  641. $1=_st(char).__eq("!");
  642. if(smalltalk.assert($1)){
  643. $2=_st(_st(self["@stream"])._peek()).__eq("!");
  644. if(smalltalk.assert($2)){
  645. _st(self["@stream"])._next();
  646. } else {
  647. $3=_st(_st(result)._contents())._trimBoth();
  648. throw $early=[$3];
  649. };
  650. };
  651. return _st(result)._nextPut_(char);
  652. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  653. return nil;
  654. }
  655. catch(e) {if(e===$early)return e[0]; throw e}
  656. }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk},smalltalk.ChunkParser)})},
  657. messageSends: ["writeStream", "whileTrue:", "ifTrue:", "ifTrue:ifFalse:", "next", "trimBoth", "contents", "=", "peek", "nextPut:", "notNil"]}),
  658. smalltalk.ChunkParser);
  659. smalltalk.addMethod(
  660. smalltalk.method({
  661. selector: "stream:",
  662. fn: function (aStream){
  663. var self=this;
  664. return smalltalk.withContext(function($ctx1) {
  665. self["@stream"]=aStream;
  666. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.ChunkParser)})},
  667. messageSends: []}),
  668. smalltalk.ChunkParser);
  669. smalltalk.addMethod(
  670. smalltalk.method({
  671. selector: "on:",
  672. fn: function (aStream){
  673. var self=this;
  674. return smalltalk.withContext(function($ctx1) {
  675. var $1;
  676. $1=_st(self._new())._stream_(aStream);
  677. return $1;
  678. }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream},smalltalk.ChunkParser.klass)})},
  679. messageSends: ["stream:", "new"]}),
  680. smalltalk.ChunkParser.klass);
  681. smalltalk.addClass('ExportRecipeInterpreter', smalltalk.Object, [], 'Importer-Exporter');
  682. smalltalk.addMethod(
  683. smalltalk.method({
  684. selector: "interpret:for:on:",
  685. fn: function (aRecipe,anObject,aStream){
  686. var self=this;
  687. var recipeStream;
  688. return smalltalk.withContext(function($ctx1) {
  689. recipeStream=_st(aRecipe)._readStream();
  690. _st((function(){
  691. return smalltalk.withContext(function($ctx2) {
  692. return _st(recipeStream)._atEnd();
  693. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  694. return smalltalk.withContext(function($ctx2) {
  695. return self._interpretStep_for_on_(_st(recipeStream)._next(),anObject,aStream);
  696. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  697. return self}, function($ctx1) {$ctx1.fill(self,"interpret:for:on:",{aRecipe:aRecipe,anObject:anObject,aStream:aStream,recipeStream:recipeStream},smalltalk.ExportRecipeInterpreter)})},
  698. messageSends: ["readStream", "whileFalse:", "interpretStep:for:on:", "next", "atEnd"]}),
  699. smalltalk.ExportRecipeInterpreter);
  700. smalltalk.addMethod(
  701. smalltalk.method({
  702. selector: "interpretStep:for:on:",
  703. fn: function (aRecipeStep,anObject,aStream){
  704. var self=this;
  705. return smalltalk.withContext(function($ctx1) {
  706. var $1,$2;
  707. $1=_st(_st(aRecipeStep)._value()).__eq_eq(aRecipeStep);
  708. if(smalltalk.assert($1)){
  709. $2=self._interpretSubRecipe_for_on_(aRecipeStep,anObject,aStream);
  710. return $2;
  711. };
  712. _st(_st(aRecipeStep)._key())._perform_withArguments_(_st(aRecipeStep)._value(),[anObject,aStream]);
  713. return self}, function($ctx1) {$ctx1.fill(self,"interpretStep:for:on:",{aRecipeStep:aRecipeStep,anObject:anObject,aStream:aStream},smalltalk.ExportRecipeInterpreter)})},
  714. messageSends: ["ifTrue:", "interpretSubRecipe:for:on:", "==", "value", "perform:withArguments:", "key"]}),
  715. smalltalk.ExportRecipeInterpreter);
  716. smalltalk.addMethod(
  717. smalltalk.method({
  718. selector: "interpretSubRecipe:for:on:",
  719. fn: function (aRecipe,anObject,aStream){
  720. var self=this;
  721. var selection;
  722. return smalltalk.withContext(function($ctx1) {
  723. selection=_st(_st(_st(aRecipe)._first())._key())._perform_withArguments_(_st(_st(aRecipe)._first())._value(),[anObject]);
  724. _st(selection)._do_((function(each){
  725. return smalltalk.withContext(function($ctx2) {
  726. return self._interpret_for_on_(_st(aRecipe)._allButFirst(),each,aStream);
  727. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  728. return self}, function($ctx1) {$ctx1.fill(self,"interpretSubRecipe:for:on:",{aRecipe:aRecipe,anObject:anObject,aStream:aStream,selection:selection},smalltalk.ExportRecipeInterpreter)})},
  729. messageSends: ["perform:withArguments:", "value", "first", "key", "do:", "interpret:for:on:", "allButFirst"]}),
  730. smalltalk.ExportRecipeInterpreter);
  731. smalltalk.addClass('Importer', smalltalk.Object, [], 'Importer-Exporter');
  732. smalltalk.addMethod(
  733. smalltalk.method({
  734. selector: "import:",
  735. fn: function (aStream){
  736. var self=this;
  737. var chunk,result,parser,lastEmpty;
  738. function $ChunkParser(){return smalltalk.ChunkParser||(typeof ChunkParser=="undefined"?nil:ChunkParser)}
  739. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  740. return smalltalk.withContext(function($ctx1) {
  741. var $1,$2;
  742. parser=_st($ChunkParser())._on_(aStream);
  743. lastEmpty=false;
  744. _st((function(){
  745. return smalltalk.withContext(function($ctx2) {
  746. chunk=_st(parser)._nextChunk();
  747. chunk;
  748. return _st(chunk)._isNil();
  749. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  750. return smalltalk.withContext(function($ctx2) {
  751. $1=_st(chunk)._isEmpty();
  752. if(smalltalk.assert($1)){
  753. lastEmpty=true;
  754. return lastEmpty;
  755. } else {
  756. result=_st(_st($Compiler())._new())._evaluateExpression_(chunk);
  757. result;
  758. $2=lastEmpty;
  759. if(smalltalk.assert($2)){
  760. lastEmpty=false;
  761. lastEmpty;
  762. return _st(result)._scanFrom_(parser);
  763. };
  764. };
  765. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  766. return self}, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty},smalltalk.Importer)})},
  767. messageSends: ["on:", "whileFalse:", "ifTrue:ifFalse:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "isEmpty", "nextChunk", "isNil"]}),
  768. smalltalk.Importer);
  769. smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'theClass'], 'Importer-Exporter');
  770. smalltalk.addMethod(
  771. smalltalk.method({
  772. selector: "methods",
  773. fn: function (){
  774. var self=this;
  775. return smalltalk.withContext(function($ctx1) {
  776. var $1;
  777. $1=self["@methods"];
  778. return $1;
  779. }, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
  780. messageSends: []}),
  781. smalltalk.MethodCategory);
  782. smalltalk.addMethod(
  783. smalltalk.method({
  784. selector: "methods:",
  785. fn: function (aCollection){
  786. var self=this;
  787. return smalltalk.withContext(function($ctx1) {
  788. self["@methods"]=aCollection;
  789. return self}, function($ctx1) {$ctx1.fill(self,"methods:",{aCollection:aCollection},smalltalk.MethodCategory)})},
  790. messageSends: []}),
  791. smalltalk.MethodCategory);
  792. smalltalk.addMethod(
  793. smalltalk.method({
  794. selector: "name",
  795. fn: function (){
  796. var self=this;
  797. return smalltalk.withContext(function($ctx1) {
  798. var $1;
  799. $1=self["@name"];
  800. return $1;
  801. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
  802. messageSends: []}),
  803. smalltalk.MethodCategory);
  804. smalltalk.addMethod(
  805. smalltalk.method({
  806. selector: "name:",
  807. fn: function (aString){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) {
  810. self["@name"]=aString;
  811. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
  812. messageSends: []}),
  813. smalltalk.MethodCategory);
  814. smalltalk.addMethod(
  815. smalltalk.method({
  816. selector: "theClass",
  817. fn: function (){
  818. var self=this;
  819. return smalltalk.withContext(function($ctx1) {
  820. var $1;
  821. $1=self["@theClass"];
  822. return $1;
  823. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.MethodCategory)})},
  824. messageSends: []}),
  825. smalltalk.MethodCategory);
  826. smalltalk.addMethod(
  827. smalltalk.method({
  828. selector: "theClass:",
  829. fn: function (aClass){
  830. var self=this;
  831. return smalltalk.withContext(function($ctx1) {
  832. self["@theClass"]=aClass;
  833. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.MethodCategory)})},
  834. messageSends: []}),
  835. smalltalk.MethodCategory);
  836. smalltalk.addMethod(
  837. smalltalk.method({
  838. selector: "name:theClass:methods:",
  839. fn: function (aString,aClass,anArray){
  840. var self=this;
  841. return smalltalk.withContext(function($ctx1) {
  842. var $2,$3,$1;
  843. $2=self._new();
  844. _st($2)._name_(aString);
  845. _st($2)._theClass_(aClass);
  846. _st($2)._methods_(anArray);
  847. $3=_st($2)._yourself();
  848. $1=$3;
  849. return $1;
  850. }, function($ctx1) {$ctx1.fill(self,"name:theClass:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
  851. messageSends: ["name:", "new", "theClass:", "methods:", "yourself"]}),
  852. smalltalk.MethodCategory.klass);
  853. smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
  854. smalltalk.addMethod(
  855. smalltalk.method({
  856. selector: "ajaxPutAt:data:",
  857. fn: function (aURL,aString){
  858. var self=this;
  859. return smalltalk.withContext(function($ctx1) {
  860. self._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(aURL),"type".__minus_gt("PUT"),"data".__minus_gt(aString),"contentType".__minus_gt("text/plain;charset=UTF-8"),"error".__minus_gt((function(xhr){
  861. return smalltalk.withContext(function($ctx2) {
  862. return self._error_(_st(_st(_st("Commiting ".__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
  863. }, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
  864. return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.PackageHandler)})},
  865. messageSends: ["ajax:", "->", "error:", ",", "responseText"]}),
  866. smalltalk.PackageHandler);
  867. smalltalk.addMethod(
  868. smalltalk.method({
  869. selector: "commit:",
  870. fn: function (aPackage){
  871. var self=this;
  872. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  873. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  874. return smalltalk.withContext(function($ctx1) {
  875. _st(self._commitChannels())._do_displayingProgress_((function(commitStrategyFactory){
  876. var fileContents,commitStrategy;
  877. return smalltalk.withContext(function($ctx2) {
  878. commitStrategy=_st(commitStrategyFactory)._value_(aPackage);
  879. commitStrategy;
  880. fileContents=_st($String())._streamContents_((function(stream){
  881. return smalltalk.withContext(function($ctx3) {
  882. return _st(_st($PluggableExporter())._forRecipe_(_st(commitStrategy)._key()))._exportPackage_on_(aPackage,stream);
  883. }, function($ctx3) {$ctx3.fillBlock({stream:stream},$ctx2)})}));
  884. fileContents;
  885. return self._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  886. }, function($ctx2) {$ctx2.fillBlock({commitStrategyFactory:commitStrategyFactory,fileContents:fileContents,commitStrategy:commitStrategy},$ctx1)})}),"Committing package ".__comma(_st(aPackage)._name()));
  887. return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)})},
  888. messageSends: ["do:displayingProgress:", "value:", "streamContents:", "exportPackage:on:", "forRecipe:", "key", "ajaxPutAt:data:", "value", ",", "name", "commitChannels"]}),
  889. smalltalk.PackageHandler);
  890. smalltalk.addMethod(
  891. smalltalk.method({
  892. selector: "commitChannels",
  893. fn: function (){
  894. var self=this;
  895. return smalltalk.withContext(function($ctx1) {
  896. self._subclassResponsibility();
  897. return self}, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.PackageHandler)})},
  898. messageSends: ["subclassResponsibility"]}),
  899. smalltalk.PackageHandler);
  900. smalltalk.PackageHandler.klass.iVarNames = ['registry'];
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "classRegisteredFor:",
  904. fn: function (aString){
  905. var self=this;
  906. return smalltalk.withContext(function($ctx1) {
  907. var $1;
  908. $1=_st(self["@registry"])._at_(aString);
  909. return $1;
  910. }, function($ctx1) {$ctx1.fill(self,"classRegisteredFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  911. messageSends: ["at:"]}),
  912. smalltalk.PackageHandler.klass);
  913. smalltalk.addMethod(
  914. smalltalk.method({
  915. selector: "for:",
  916. fn: function (aString){
  917. var self=this;
  918. return smalltalk.withContext(function($ctx1) {
  919. var $1;
  920. $1=_st(self._classRegisteredFor_(aString))._new();
  921. return $1;
  922. }, function($ctx1) {$ctx1.fill(self,"for:",{aString:aString},smalltalk.PackageHandler.klass)})},
  923. messageSends: ["new", "classRegisteredFor:"]}),
  924. smalltalk.PackageHandler.klass);
  925. smalltalk.addMethod(
  926. smalltalk.method({
  927. selector: "initialize",
  928. fn: function (){
  929. var self=this;
  930. return smalltalk.withContext(function($ctx1) {
  931. smalltalk.PackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  932. self["@registry"]=smalltalk.HashedCollection._from_([]);
  933. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.PackageHandler.klass)})},
  934. messageSends: ["initialize"]}),
  935. smalltalk.PackageHandler.klass);
  936. smalltalk.addMethod(
  937. smalltalk.method({
  938. selector: "register:for:",
  939. fn: function (aClass,aString){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) {
  942. _st(self["@registry"])._at_put_(aString,aClass);
  943. return self}, function($ctx1) {$ctx1.fill(self,"register:for:",{aClass:aClass,aString:aString},smalltalk.PackageHandler.klass)})},
  944. messageSends: ["at:put:"]}),
  945. smalltalk.PackageHandler.klass);
  946. smalltalk.addMethod(
  947. smalltalk.method({
  948. selector: "registerFor:",
  949. fn: function (aString){
  950. var self=this;
  951. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  952. return smalltalk.withContext(function($ctx1) {
  953. _st($PackageHandler())._register_for_(self,aString);
  954. return self}, function($ctx1) {$ctx1.fill(self,"registerFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  955. messageSends: ["register:for:"]}),
  956. smalltalk.PackageHandler.klass);
  957. smalltalk.addClass('LegacyPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  958. smalltalk.addMethod(
  959. smalltalk.method({
  960. selector: "commitChannels",
  961. fn: function (){
  962. var self=this;
  963. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  964. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  965. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  966. return smalltalk.withContext(function($ctx1) {
  967. var $1;
  968. $1=[(function(pkg){
  969. return smalltalk.withContext(function($ctx2) {
  970. return _st(_st(_st($Exporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  971. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  972. return smalltalk.withContext(function($ctx2) {
  973. return _st(_st(_st($StrippedExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  974. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  975. return smalltalk.withContext(function($ctx2) {
  976. return _st(_st(_st($ChunkExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  977. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  978. return $1;
  979. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.LegacyPackageHandler)})},
  980. messageSends: ["->", ",", "name", "commitPathJs", "recipe", "default", "commitPathSt"]}),
  981. smalltalk.LegacyPackageHandler);
  982. smalltalk.addMethod(
  983. smalltalk.method({
  984. selector: "commitPathJsFor:",
  985. fn: function (aPackage){
  986. var self=this;
  987. return smalltalk.withContext(function($ctx1) {
  988. var $1;
  989. $1=_st(self._class())._defaultCommitPathJs();
  990. return $1;
  991. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  992. messageSends: ["defaultCommitPathJs", "class"]}),
  993. smalltalk.LegacyPackageHandler);
  994. smalltalk.addMethod(
  995. smalltalk.method({
  996. selector: "commitPathStFor:",
  997. fn: function (aPackage){
  998. var self=this;
  999. return smalltalk.withContext(function($ctx1) {
  1000. var $1;
  1001. $1=_st(self._class())._defaultCommitPathSt();
  1002. return $1;
  1003. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  1004. messageSends: ["defaultCommitPathSt", "class"]}),
  1005. smalltalk.LegacyPackageHandler);
  1006. smalltalk.addMethod(
  1007. smalltalk.method({
  1008. selector: "loadPackage:prefix:",
  1009. fn: function (packageName,aString){
  1010. var self=this;
  1011. var url;
  1012. return smalltalk.withContext(function($ctx1) {
  1013. var $1;
  1014. url=_st(_st(_st("/".__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
  1015. self._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(url),"type".__minus_gt("GET"),"dataType".__minus_gt("script"),"complete".__minus_gt((function(jqXHR,textStatus){
  1016. return smalltalk.withContext(function($ctx2) {
  1017. $1=_st(_st(jqXHR)._readyState()).__eq((4));
  1018. if(smalltalk.assert($1)){
  1019. return self._setupPackageNamed_prefix_(packageName,aString);
  1020. };
  1021. }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),"error".__minus_gt((function(){
  1022. return smalltalk.withContext(function($ctx2) {
  1023. return self._alert_("Could not load package at: ".__comma(url));
  1024. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1025. return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url},smalltalk.LegacyPackageHandler)})},
  1026. messageSends: [",", "ajax:", "->", "ifTrue:", "setupPackageNamed:prefix:", "=", "readyState", "alert:"]}),
  1027. smalltalk.LegacyPackageHandler);
  1028. smalltalk.addMethod(
  1029. smalltalk.method({
  1030. selector: "loadPackages:prefix:",
  1031. fn: function (aCollection,aString){
  1032. var self=this;
  1033. return smalltalk.withContext(function($ctx1) {
  1034. _st(aCollection)._do_((function(each){
  1035. return smalltalk.withContext(function($ctx2) {
  1036. return self._loadPackage_prefix_(each,aString);
  1037. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1038. return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler)})},
  1039. messageSends: ["do:", "loadPackage:prefix:"]}),
  1040. smalltalk.LegacyPackageHandler);
  1041. smalltalk.addMethod(
  1042. smalltalk.method({
  1043. selector: "setupPackageNamed:prefix:",
  1044. fn: function (packageName,aString){
  1045. var self=this;
  1046. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1047. return smalltalk.withContext(function($ctx1) {
  1048. var $1,$2;
  1049. $1=_st($Package())._named_(packageName);
  1050. _st($1)._setupClasses();
  1051. _st($1)._commitPathJs_(_st("/".__comma(aString)).__comma("/js"));
  1052. $2=_st($1)._commitPathSt_(_st("/".__comma(aString)).__comma("/st"));
  1053. return self}, function($ctx1) {$ctx1.fill(self,"setupPackageNamed:prefix:",{packageName:packageName,aString:aString},smalltalk.LegacyPackageHandler)})},
  1054. messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"]}),
  1055. smalltalk.LegacyPackageHandler);
  1056. smalltalk.LegacyPackageHandler.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  1057. smalltalk.addMethod(
  1058. smalltalk.method({
  1059. selector: "commitPathsFromLoader",
  1060. fn: function (){
  1061. var self=this;
  1062. return smalltalk.withContext(function($ctx1) {
  1063. var commitPath = typeof amber !== 'undefined' && amber.commitPath;
  1064. if (!commitPath) return;
  1065. if (commitPath.js) self._defaultCommitPathJs_(commitPath.js);
  1066. if (commitPath.st) self._defaultCommitPathSt_(commitPath.st);
  1067. ;
  1068. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.LegacyPackageHandler.klass)})},
  1069. messageSends: []}),
  1070. smalltalk.LegacyPackageHandler.klass);
  1071. smalltalk.addMethod(
  1072. smalltalk.method({
  1073. selector: "defaultCommitPathJs",
  1074. fn: function (){
  1075. var self=this;
  1076. return smalltalk.withContext(function($ctx1) {
  1077. var $2,$1;
  1078. $2=self["@defaultCommitPathJs"];
  1079. if(($receiver = $2) == nil || $receiver == undefined){
  1080. self["@defaultCommitPathJs"]="js";
  1081. $1=self["@defaultCommitPathJs"];
  1082. } else {
  1083. $1=$2;
  1084. };
  1085. return $1;
  1086. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs",{},smalltalk.LegacyPackageHandler.klass)})},
  1087. messageSends: ["ifNil:"]}),
  1088. smalltalk.LegacyPackageHandler.klass);
  1089. smalltalk.addMethod(
  1090. smalltalk.method({
  1091. selector: "defaultCommitPathJs:",
  1092. fn: function (aString){
  1093. var self=this;
  1094. return smalltalk.withContext(function($ctx1) {
  1095. self["@defaultCommitPathJs"]=aString;
  1096. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1097. messageSends: []}),
  1098. smalltalk.LegacyPackageHandler.klass);
  1099. smalltalk.addMethod(
  1100. smalltalk.method({
  1101. selector: "defaultCommitPathSt",
  1102. fn: function (){
  1103. var self=this;
  1104. return smalltalk.withContext(function($ctx1) {
  1105. var $2,$1;
  1106. $2=self["@defaultCommitPathSt"];
  1107. if(($receiver = $2) == nil || $receiver == undefined){
  1108. self["@defaultCommitPathSt"]="st";
  1109. $1=self["@defaultCommitPathSt"];
  1110. } else {
  1111. $1=$2;
  1112. };
  1113. return $1;
  1114. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt",{},smalltalk.LegacyPackageHandler.klass)})},
  1115. messageSends: ["ifNil:"]}),
  1116. smalltalk.LegacyPackageHandler.klass);
  1117. smalltalk.addMethod(
  1118. smalltalk.method({
  1119. selector: "defaultCommitPathSt:",
  1120. fn: function (aString){
  1121. var self=this;
  1122. return smalltalk.withContext(function($ctx1) {
  1123. self["@defaultCommitPathSt"]=aString;
  1124. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1125. messageSends: []}),
  1126. smalltalk.LegacyPackageHandler.klass);
  1127. smalltalk.addMethod(
  1128. smalltalk.method({
  1129. selector: "initialize",
  1130. fn: function (){
  1131. var self=this;
  1132. return smalltalk.withContext(function($ctx1) {
  1133. smalltalk.LegacyPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1134. self._registerFor_("unknown");
  1135. self._commitPathsFromLoader();
  1136. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.LegacyPackageHandler.klass)})},
  1137. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  1138. smalltalk.LegacyPackageHandler.klass);
  1139. smalltalk.addMethod(
  1140. smalltalk.method({
  1141. selector: "loadPackages:prefix:",
  1142. fn: function (aCollection,aString){
  1143. var self=this;
  1144. return smalltalk.withContext(function($ctx1) {
  1145. var $1;
  1146. $1=_st(self._new())._loadPackages_prefix_(aCollection,aString);
  1147. return $1;
  1148. }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1149. messageSends: ["loadPackages:prefix:", "new"]}),
  1150. smalltalk.LegacyPackageHandler.klass);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "resetCommitPaths",
  1154. fn: function (){
  1155. var self=this;
  1156. return smalltalk.withContext(function($ctx1) {
  1157. self["@defaultCommitPathJs"]=nil;
  1158. self["@defaultCommitPathSt"]=nil;
  1159. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.LegacyPackageHandler.klass)})},
  1160. messageSends: []}),
  1161. smalltalk.LegacyPackageHandler.klass);
  1162. smalltalk.addClass('PluggableExporter', smalltalk.Object, ['recipe'], 'Importer-Exporter');
  1163. smalltalk.addMethod(
  1164. smalltalk.method({
  1165. selector: "exportAllPackages",
  1166. fn: function (){
  1167. var self=this;
  1168. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1169. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1170. return smalltalk.withContext(function($ctx1) {
  1171. var $1;
  1172. $1=_st($String())._streamContents_((function(stream){
  1173. return smalltalk.withContext(function($ctx2) {
  1174. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(pkg){
  1175. return smalltalk.withContext(function($ctx3) {
  1176. return self._exportPackage_on_(pkg,stream);
  1177. }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx2)})}));
  1178. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  1179. return $1;
  1180. }, function($ctx1) {$ctx1.fill(self,"exportAllPackages",{},smalltalk.PluggableExporter)})},
  1181. messageSends: ["streamContents:", "do:", "exportPackage:on:", "packages", "current"]}),
  1182. smalltalk.PluggableExporter);
  1183. smalltalk.addMethod(
  1184. smalltalk.method({
  1185. selector: "exportPackage:on:",
  1186. fn: function (aPackage,aStream){
  1187. var self=this;
  1188. return smalltalk.withContext(function($ctx1) {
  1189. _st(self._interpreter())._interpret_for_on_(self._recipe(),aPackage,aStream);
  1190. return self}, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},smalltalk.PluggableExporter)})},
  1191. messageSends: ["interpret:for:on:", "recipe", "interpreter"]}),
  1192. smalltalk.PluggableExporter);
  1193. smalltalk.addMethod(
  1194. smalltalk.method({
  1195. selector: "interpreter",
  1196. fn: function (){
  1197. var self=this;
  1198. function $ExportRecipeInterpreter(){return smalltalk.ExportRecipeInterpreter||(typeof ExportRecipeInterpreter=="undefined"?nil:ExportRecipeInterpreter)}
  1199. return smalltalk.withContext(function($ctx1) {
  1200. var $1;
  1201. $1=_st($ExportRecipeInterpreter())._new();
  1202. return $1;
  1203. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.PluggableExporter)})},
  1204. messageSends: ["new"]}),
  1205. smalltalk.PluggableExporter);
  1206. smalltalk.addMethod(
  1207. smalltalk.method({
  1208. selector: "recipe",
  1209. fn: function (){
  1210. var self=this;
  1211. return smalltalk.withContext(function($ctx1) {
  1212. var $1;
  1213. $1=self["@recipe"];
  1214. return $1;
  1215. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.PluggableExporter)})},
  1216. messageSends: []}),
  1217. smalltalk.PluggableExporter);
  1218. smalltalk.addMethod(
  1219. smalltalk.method({
  1220. selector: "recipe:",
  1221. fn: function (anArray){
  1222. var self=this;
  1223. return smalltalk.withContext(function($ctx1) {
  1224. self["@recipe"]=anArray;
  1225. return self}, function($ctx1) {$ctx1.fill(self,"recipe:",{anArray:anArray},smalltalk.PluggableExporter)})},
  1226. messageSends: []}),
  1227. smalltalk.PluggableExporter);
  1228. smalltalk.addMethod(
  1229. smalltalk.method({
  1230. selector: "forRecipe:",
  1231. fn: function (aRecipe){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. var $2,$3,$1;
  1235. $2=self._new();
  1236. _st($2)._recipe_(aRecipe);
  1237. $3=_st($2)._yourself();
  1238. $1=$3;
  1239. return $1;
  1240. }, function($ctx1) {$ctx1.fill(self,"forRecipe:",{aRecipe:aRecipe},smalltalk.PluggableExporter.klass)})},
  1241. messageSends: ["recipe:", "new", "yourself"]}),
  1242. smalltalk.PluggableExporter.klass);
  1243. smalltalk.addMethod(
  1244. smalltalk.method({
  1245. selector: "ownClassesOfPackage:",
  1246. fn: function (package_){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. var $1;
  1250. $1=_st(_st(package_)._sortedClasses())._asSet();
  1251. return $1;
  1252. }, function($ctx1) {$ctx1.fill(self,"ownClassesOfPackage:",{package_:package_},smalltalk.PluggableExporter.klass)})},
  1253. messageSends: ["asSet", "sortedClasses"]}),
  1254. smalltalk.PluggableExporter.klass);
  1255. smalltalk.addMethod(
  1256. smalltalk.method({
  1257. selector: "commit",
  1258. fn: function (){
  1259. var self=this;
  1260. return smalltalk.withContext(function($ctx1) {
  1261. var $1;
  1262. $1=_st(self._transport())._commit_(self);
  1263. return $1;
  1264. }, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
  1265. messageSends: ["commit:", "transport"]}),
  1266. smalltalk.Package);
  1267. smalltalk.addMethod(
  1268. smalltalk.method({
  1269. selector: "commitPathJs",
  1270. fn: function (){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) {
  1273. var $3,$2,$1;
  1274. $3=self["@extension"];
  1275. if(($receiver = $3) == nil || $receiver == undefined){
  1276. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1277. $2=self["@extension"];
  1278. } else {
  1279. $2=$3;
  1280. };
  1281. $1=_st($2)._at_ifAbsentPut_("commitPathJs",(function(){
  1282. return smalltalk.withContext(function($ctx2) {
  1283. return _st(self._transport())._commitPathJsFor_(self);
  1284. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1285. return $1;
  1286. }, function($ctx1) {$ctx1.fill(self,"commitPathJs",{},smalltalk.Package)})},
  1287. messageSends: ["at:ifAbsentPut:", "commitPathJsFor:", "transport", "ifNil:"]}),
  1288. smalltalk.Package);
  1289. smalltalk.addMethod(
  1290. smalltalk.method({
  1291. selector: "commitPathJs:",
  1292. fn: function (aString){
  1293. var self=this;
  1294. return smalltalk.withContext(function($ctx1) {
  1295. var $3,$2,$1;
  1296. $3=self["@extension"];
  1297. if(($receiver = $3) == nil || $receiver == undefined){
  1298. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1299. $2=self["@extension"];
  1300. } else {
  1301. $2=$3;
  1302. };
  1303. $1=_st($2)._at_put_("commitPathJs",aString);
  1304. return $1;
  1305. }, function($ctx1) {$ctx1.fill(self,"commitPathJs:",{aString:aString},smalltalk.Package)})},
  1306. messageSends: ["at:put:", "ifNil:"]}),
  1307. smalltalk.Package);
  1308. smalltalk.addMethod(
  1309. smalltalk.method({
  1310. selector: "commitPathSt",
  1311. fn: function (){
  1312. var self=this;
  1313. return smalltalk.withContext(function($ctx1) {
  1314. var $3,$2,$1;
  1315. $3=self["@extension"];
  1316. if(($receiver = $3) == nil || $receiver == undefined){
  1317. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1318. $2=self["@extension"];
  1319. } else {
  1320. $2=$3;
  1321. };
  1322. $1=_st($2)._at_ifAbsentPut_("commitPathSt",(function(){
  1323. return smalltalk.withContext(function($ctx2) {
  1324. return _st(self._transport())._commitPathStFor_(self);
  1325. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1326. return $1;
  1327. }, function($ctx1) {$ctx1.fill(self,"commitPathSt",{},smalltalk.Package)})},
  1328. messageSends: ["at:ifAbsentPut:", "commitPathStFor:", "transport", "ifNil:"]}),
  1329. smalltalk.Package);
  1330. smalltalk.addMethod(
  1331. smalltalk.method({
  1332. selector: "commitPathSt:",
  1333. fn: function (aString){
  1334. var self=this;
  1335. return smalltalk.withContext(function($ctx1) {
  1336. var $3,$2,$1;
  1337. $3=self["@extension"];
  1338. if(($receiver = $3) == nil || $receiver == undefined){
  1339. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1340. $2=self["@extension"];
  1341. } else {
  1342. $2=$3;
  1343. };
  1344. $1=_st($2)._at_put_("commitPathSt",aString);
  1345. return $1;
  1346. }, function($ctx1) {$ctx1.fill(self,"commitPathSt:",{aString:aString},smalltalk.Package)})},
  1347. messageSends: ["at:put:", "ifNil:"]}),
  1348. smalltalk.Package);
  1349. smalltalk.addMethod(
  1350. smalltalk.method({
  1351. selector: "transport",
  1352. fn: function (){
  1353. var self=this;
  1354. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  1355. return smalltalk.withContext(function($ctx1) {
  1356. var $1;
  1357. $1=_st($PackageHandler())._for_(self._transportType());
  1358. return $1;
  1359. }, function($ctx1) {$ctx1.fill(self,"transport",{},smalltalk.Package)})},
  1360. messageSends: ["for:", "transportType"]}),
  1361. smalltalk.Package);
  1362. smalltalk.addMethod(
  1363. smalltalk.method({
  1364. selector: "transportJson",
  1365. fn: function (){
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) {
  1368. return JSON.stringify(self.transport || null);;
  1369. return self}, function($ctx1) {$ctx1.fill(self,"transportJson",{},smalltalk.Package)})},
  1370. messageSends: []}),
  1371. smalltalk.Package);
  1372. smalltalk.addMethod(
  1373. smalltalk.method({
  1374. selector: "transportType",
  1375. fn: function (){
  1376. var self=this;
  1377. return smalltalk.withContext(function($ctx1) {
  1378. return (self.transport && self.transport.type) || 'unknown';;
  1379. return self}, function($ctx1) {$ctx1.fill(self,"transportType",{},smalltalk.Package)})},
  1380. messageSends: []}),
  1381. smalltalk.Package);
  1382. })(global_smalltalk,global_nil,global__st);