Importer-Exporter.deploy.js 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450
  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: "extensionMethodsOfPackage:",
  473. fn: function (aPackage){
  474. var self=this;
  475. var name,result;
  476. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  477. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  478. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  479. return smalltalk.withContext(function($ctx1) {
  480. var $1;
  481. name=_st(aPackage)._name();
  482. result=_st($OrderedCollection())._new();
  483. _st(_st($Package())._sortedClasses_(_st(_st($Smalltalk())._current())._classes()))._do_((function(each){
  484. return smalltalk.withContext(function($ctx2) {
  485. return _st([each,_st(each)._class()])._do_((function(aClass){
  486. return smalltalk.withContext(function($ctx3) {
  487. return _st(result)._addAll_(_st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  488. return smalltalk.withContext(function($ctx4) {
  489. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  490. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._select_((function(method){
  491. return smalltalk.withContext(function($ctx4) {
  492. return _st(_st(method)._category()).__eq("*".__comma(name));
  493. }, function($ctx4) {$ctx4.fillBlock({method:method},$ctx3)})})));
  494. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
  495. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  496. $1=result;
  497. return $1;
  498. }, function($ctx1) {$ctx1.fill(self,"extensionMethodsOfPackage:",{aPackage:aPackage,name:name,result:result},smalltalk.Exporter)})},
  499. messageSends: ["name", "new", "do:", "addAll:", "select:", "=", ",", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "class", "sortedClasses:", "classes", "current"]}),
  500. smalltalk.Exporter);
  501. smalltalk.addMethod(
  502. smalltalk.method({
  503. selector: "ownMethodsOfClass:",
  504. fn: function (aClass){
  505. var self=this;
  506. return smalltalk.withContext(function($ctx1) {
  507. var $1;
  508. $1=_st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  509. return smalltalk.withContext(function($ctx2) {
  510. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  511. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._reject_((function(each){
  512. return smalltalk.withContext(function($ctx2) {
  513. return _st(_st(each)._category())._match_("^\x5c*");
  514. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  515. return $1;
  516. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfClass:",{aClass:aClass},smalltalk.Exporter)})},
  517. messageSends: ["reject:", "match:", "category", "sorted:", "<=", "selector", "values", "methodDictionary"]}),
  518. smalltalk.Exporter);
  519. smalltalk.addMethod(
  520. smalltalk.method({
  521. selector: "ownMethodsOfMetaClass:",
  522. fn: function (aClass){
  523. var self=this;
  524. return smalltalk.withContext(function($ctx1) {
  525. var $1;
  526. $1=self._ownMethodsOfClass_(_st(aClass)._class());
  527. return $1;
  528. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfMetaClass:",{aClass:aClass},smalltalk.Exporter)})},
  529. messageSends: ["ownMethodsOfClass:", "class"]}),
  530. smalltalk.Exporter);
  531. smalltalk.addMethod(
  532. smalltalk.method({
  533. selector: "recipe",
  534. fn: function (){
  535. var self=this;
  536. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  537. return smalltalk.withContext(function($ctx1) {
  538. var $1;
  539. $1=[self.__minus_gt("exportPackagePrologueOf:on:"),self.__minus_gt("exportPackageDefinitionOf: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:")];
  540. return $1;
  541. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.Exporter)})},
  542. messageSends: ["->"]}),
  543. smalltalk.Exporter);
  544. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
  545. smalltalk.addMethod(
  546. smalltalk.method({
  547. selector: "exportDefinitionOf:on:",
  548. fn: function (aClass,aStream){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) {
  551. var $1,$2,$3,$4;
  552. $1=aStream;
  553. _st($1)._lf();
  554. _st($1)._nextPutAll_("smalltalk.addClass(");
  555. _st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
  556. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
  557. $2=_st($1)._nextPutAll_(", [");
  558. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  559. return smalltalk.withContext(function($ctx2) {
  560. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  561. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  562. return smalltalk.withContext(function($ctx2) {
  563. return _st(aStream)._nextPutAll_(", ");
  564. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  565. $3=aStream;
  566. _st($3)._nextPutAll_("], '");
  567. _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
  568. $4=_st($3)._nextPutAll_(");");
  569. _st(aStream)._lf();
  570. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)})},
  571. messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category"]}),
  572. smalltalk.StrippedExporter);
  573. smalltalk.addMethod(
  574. smalltalk.method({
  575. selector: "exportMethod:on:",
  576. fn: function (aMethod,aStream){
  577. var self=this;
  578. return smalltalk.withContext(function($ctx1) {
  579. var $1,$2;
  580. $1=aStream;
  581. _st($1)._nextPutAll_("smalltalk.addMethod(");
  582. _st($1)._lf();
  583. _st($1)._nextPutAll_("smalltalk.method({");
  584. _st($1)._lf();
  585. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  586. _st($1)._lf();
  587. _st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
  588. _st($1)._lf();
  589. _st($1)._nextPutAll_("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript()));
  590. _st($1)._nextPutAll_("}),");
  591. _st($1)._lf();
  592. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
  593. _st($1)._nextPutAll_(");");
  594. _st($1)._lf();
  595. $2=_st($1)._lf();
  596. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.StrippedExporter)})},
  597. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "compiledSource", "fn", "messageSends", "classNameFor:", "methodClass"]}),
  598. smalltalk.StrippedExporter);
  599. smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
  600. smalltalk.addMethod(
  601. smalltalk.method({
  602. selector: "nextChunk",
  603. fn: function (){
  604. var self=this;
  605. var char,result,chunk;
  606. return smalltalk.withContext(function($ctx1) {
  607. var $1,$2,$3;
  608. var $early={};
  609. try {
  610. result=""._writeStream();
  611. _st((function(){
  612. return smalltalk.withContext(function($ctx2) {
  613. char=_st(self["@stream"])._next();
  614. char;
  615. return _st(char)._notNil();
  616. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  617. return smalltalk.withContext(function($ctx2) {
  618. $1=_st(char).__eq("!");
  619. if(smalltalk.assert($1)){
  620. $2=_st(_st(self["@stream"])._peek()).__eq("!");
  621. if(smalltalk.assert($2)){
  622. _st(self["@stream"])._next();
  623. } else {
  624. $3=_st(_st(result)._contents())._trimBoth();
  625. throw $early=[$3];
  626. };
  627. };
  628. return _st(result)._nextPut_(char);
  629. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  630. return nil;
  631. }
  632. catch(e) {if(e===$early)return e[0]; throw e}
  633. }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk},smalltalk.ChunkParser)})},
  634. messageSends: ["writeStream", "whileTrue:", "ifTrue:", "ifTrue:ifFalse:", "next", "trimBoth", "contents", "=", "peek", "nextPut:", "notNil"]}),
  635. smalltalk.ChunkParser);
  636. smalltalk.addMethod(
  637. smalltalk.method({
  638. selector: "stream:",
  639. fn: function (aStream){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) {
  642. self["@stream"]=aStream;
  643. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.ChunkParser)})},
  644. messageSends: []}),
  645. smalltalk.ChunkParser);
  646. smalltalk.addMethod(
  647. smalltalk.method({
  648. selector: "on:",
  649. fn: function (aStream){
  650. var self=this;
  651. return smalltalk.withContext(function($ctx1) {
  652. var $1;
  653. $1=_st(self._new())._stream_(aStream);
  654. return $1;
  655. }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream},smalltalk.ChunkParser.klass)})},
  656. messageSends: ["stream:", "new"]}),
  657. smalltalk.ChunkParser.klass);
  658. smalltalk.addClass('ExportRecipeInterpreter', smalltalk.Object, [], 'Importer-Exporter');
  659. smalltalk.addMethod(
  660. smalltalk.method({
  661. selector: "interpret:for:on:",
  662. fn: function (aRecipe,anObject,aStream){
  663. var self=this;
  664. var recipeStream;
  665. return smalltalk.withContext(function($ctx1) {
  666. recipeStream=_st(aRecipe)._readStream();
  667. _st((function(){
  668. return smalltalk.withContext(function($ctx2) {
  669. return _st(recipeStream)._atEnd();
  670. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  671. return smalltalk.withContext(function($ctx2) {
  672. return self._interpretStep_for_on_(_st(recipeStream)._next(),anObject,aStream);
  673. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  674. return self}, function($ctx1) {$ctx1.fill(self,"interpret:for:on:",{aRecipe:aRecipe,anObject:anObject,aStream:aStream,recipeStream:recipeStream},smalltalk.ExportRecipeInterpreter)})},
  675. messageSends: ["readStream", "whileFalse:", "interpretStep:for:on:", "next", "atEnd"]}),
  676. smalltalk.ExportRecipeInterpreter);
  677. smalltalk.addMethod(
  678. smalltalk.method({
  679. selector: "interpretStep:for:on:",
  680. fn: function (aRecipeStep,anObject,aStream){
  681. var self=this;
  682. return smalltalk.withContext(function($ctx1) {
  683. var $1,$2;
  684. $1=_st(_st(aRecipeStep)._value()).__eq_eq(aRecipeStep);
  685. if(smalltalk.assert($1)){
  686. $2=self._interpretSubRecipe_for_on_(aRecipeStep,anObject,aStream);
  687. return $2;
  688. };
  689. _st(_st(aRecipeStep)._key())._perform_withArguments_(_st(aRecipeStep)._value(),[anObject,aStream]);
  690. return self}, function($ctx1) {$ctx1.fill(self,"interpretStep:for:on:",{aRecipeStep:aRecipeStep,anObject:anObject,aStream:aStream},smalltalk.ExportRecipeInterpreter)})},
  691. messageSends: ["ifTrue:", "interpretSubRecipe:for:on:", "==", "value", "perform:withArguments:", "key"]}),
  692. smalltalk.ExportRecipeInterpreter);
  693. smalltalk.addMethod(
  694. smalltalk.method({
  695. selector: "interpretSubRecipe:for:on:",
  696. fn: function (aRecipe,anObject,aStream){
  697. var self=this;
  698. var selection;
  699. return smalltalk.withContext(function($ctx1) {
  700. selection=_st(_st(_st(aRecipe)._first())._key())._perform_withArguments_(_st(_st(aRecipe)._first())._value(),[anObject]);
  701. _st(selection)._do_((function(each){
  702. return smalltalk.withContext(function($ctx2) {
  703. return self._interpret_for_on_(_st(aRecipe)._allButFirst(),each,aStream);
  704. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  705. return self}, function($ctx1) {$ctx1.fill(self,"interpretSubRecipe:for:on:",{aRecipe:aRecipe,anObject:anObject,aStream:aStream,selection:selection},smalltalk.ExportRecipeInterpreter)})},
  706. messageSends: ["perform:withArguments:", "value", "first", "key", "do:", "interpret:for:on:", "allButFirst"]}),
  707. smalltalk.ExportRecipeInterpreter);
  708. smalltalk.addClass('Importer', smalltalk.Object, [], 'Importer-Exporter');
  709. smalltalk.addMethod(
  710. smalltalk.method({
  711. selector: "import:",
  712. fn: function (aStream){
  713. var self=this;
  714. var chunk,result,parser,lastEmpty;
  715. function $ChunkParser(){return smalltalk.ChunkParser||(typeof ChunkParser=="undefined"?nil:ChunkParser)}
  716. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  717. return smalltalk.withContext(function($ctx1) {
  718. var $1,$2;
  719. parser=_st($ChunkParser())._on_(aStream);
  720. lastEmpty=false;
  721. _st((function(){
  722. return smalltalk.withContext(function($ctx2) {
  723. chunk=_st(parser)._nextChunk();
  724. chunk;
  725. return _st(chunk)._isNil();
  726. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  727. return smalltalk.withContext(function($ctx2) {
  728. $1=_st(chunk)._isEmpty();
  729. if(smalltalk.assert($1)){
  730. lastEmpty=true;
  731. return lastEmpty;
  732. } else {
  733. result=_st(_st($Compiler())._new())._evaluateExpression_(chunk);
  734. result;
  735. $2=lastEmpty;
  736. if(smalltalk.assert($2)){
  737. lastEmpty=false;
  738. lastEmpty;
  739. return _st(result)._scanFrom_(parser);
  740. };
  741. };
  742. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  743. return self}, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty},smalltalk.Importer)})},
  744. messageSends: ["on:", "whileFalse:", "ifTrue:ifFalse:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "isEmpty", "nextChunk", "isNil"]}),
  745. smalltalk.Importer);
  746. smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'theClass'], 'Importer-Exporter');
  747. smalltalk.addMethod(
  748. smalltalk.method({
  749. selector: "methods",
  750. fn: function (){
  751. var self=this;
  752. return smalltalk.withContext(function($ctx1) {
  753. var $1;
  754. $1=self["@methods"];
  755. return $1;
  756. }, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
  757. messageSends: []}),
  758. smalltalk.MethodCategory);
  759. smalltalk.addMethod(
  760. smalltalk.method({
  761. selector: "methods:",
  762. fn: function (aCollection){
  763. var self=this;
  764. return smalltalk.withContext(function($ctx1) {
  765. self["@methods"]=aCollection;
  766. return self}, function($ctx1) {$ctx1.fill(self,"methods:",{aCollection:aCollection},smalltalk.MethodCategory)})},
  767. messageSends: []}),
  768. smalltalk.MethodCategory);
  769. smalltalk.addMethod(
  770. smalltalk.method({
  771. selector: "name",
  772. fn: function (){
  773. var self=this;
  774. return smalltalk.withContext(function($ctx1) {
  775. var $1;
  776. $1=self["@name"];
  777. return $1;
  778. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
  779. messageSends: []}),
  780. smalltalk.MethodCategory);
  781. smalltalk.addMethod(
  782. smalltalk.method({
  783. selector: "name:",
  784. fn: function (aString){
  785. var self=this;
  786. return smalltalk.withContext(function($ctx1) {
  787. self["@name"]=aString;
  788. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
  789. messageSends: []}),
  790. smalltalk.MethodCategory);
  791. smalltalk.addMethod(
  792. smalltalk.method({
  793. selector: "theClass",
  794. fn: function (){
  795. var self=this;
  796. return smalltalk.withContext(function($ctx1) {
  797. var $1;
  798. $1=self["@theClass"];
  799. return $1;
  800. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.MethodCategory)})},
  801. messageSends: []}),
  802. smalltalk.MethodCategory);
  803. smalltalk.addMethod(
  804. smalltalk.method({
  805. selector: "theClass:",
  806. fn: function (aClass){
  807. var self=this;
  808. return smalltalk.withContext(function($ctx1) {
  809. self["@theClass"]=aClass;
  810. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.MethodCategory)})},
  811. messageSends: []}),
  812. smalltalk.MethodCategory);
  813. smalltalk.addMethod(
  814. smalltalk.method({
  815. selector: "name:theClass:methods:",
  816. fn: function (aString,aClass,anArray){
  817. var self=this;
  818. return smalltalk.withContext(function($ctx1) {
  819. var $2,$3,$1;
  820. $2=self._new();
  821. _st($2)._name_(aString);
  822. _st($2)._theClass_(aClass);
  823. _st($2)._methods_(anArray);
  824. $3=_st($2)._yourself();
  825. $1=$3;
  826. return $1;
  827. }, function($ctx1) {$ctx1.fill(self,"name:theClass:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
  828. messageSends: ["name:", "new", "theClass:", "methods:", "yourself"]}),
  829. smalltalk.MethodCategory.klass);
  830. smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
  831. smalltalk.addMethod(
  832. smalltalk.method({
  833. selector: "ajaxPutAt:data:",
  834. fn: function (aURL,aString){
  835. var self=this;
  836. return smalltalk.withContext(function($ctx1) {
  837. 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){
  838. return smalltalk.withContext(function($ctx2) {
  839. return self._error_(_st(_st(_st("Commiting ".__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
  840. }, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
  841. return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.PackageHandler)})},
  842. messageSends: ["ajax:", "->", "error:", ",", "responseText"]}),
  843. smalltalk.PackageHandler);
  844. smalltalk.addMethod(
  845. smalltalk.method({
  846. selector: "commit:",
  847. fn: function (aPackage){
  848. var self=this;
  849. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  850. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  851. return smalltalk.withContext(function($ctx1) {
  852. _st(self._commitChannels())._do_displayingProgress_((function(commitStrategyFactory){
  853. var fileContents,commitStrategy;
  854. return smalltalk.withContext(function($ctx2) {
  855. commitStrategy=_st(commitStrategyFactory)._value_(aPackage);
  856. commitStrategy;
  857. fileContents=_st($String())._streamContents_((function(stream){
  858. return smalltalk.withContext(function($ctx3) {
  859. return _st(_st($PluggableExporter())._forRecipe_(_st(commitStrategy)._key()))._exportPackage_on_(aPackage,stream);
  860. }, function($ctx3) {$ctx3.fillBlock({stream:stream},$ctx2)})}));
  861. fileContents;
  862. return self._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  863. }, function($ctx2) {$ctx2.fillBlock({commitStrategyFactory:commitStrategyFactory,fileContents:fileContents,commitStrategy:commitStrategy},$ctx1)})}),"Committing package ".__comma(_st(aPackage)._name()));
  864. return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)})},
  865. messageSends: ["do:displayingProgress:", "value:", "streamContents:", "exportPackage:on:", "forRecipe:", "key", "ajaxPutAt:data:", "value", ",", "name", "commitChannels"]}),
  866. smalltalk.PackageHandler);
  867. smalltalk.addMethod(
  868. smalltalk.method({
  869. selector: "commitChannels",
  870. fn: function (){
  871. var self=this;
  872. return smalltalk.withContext(function($ctx1) {
  873. self._subclassResponsibility();
  874. return self}, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.PackageHandler)})},
  875. messageSends: ["subclassResponsibility"]}),
  876. smalltalk.PackageHandler);
  877. smalltalk.PackageHandler.klass.iVarNames = ['registry'];
  878. smalltalk.addMethod(
  879. smalltalk.method({
  880. selector: "classRegisteredFor:",
  881. fn: function (aString){
  882. var self=this;
  883. return smalltalk.withContext(function($ctx1) {
  884. var $1;
  885. $1=_st(self["@registry"])._at_(aString);
  886. return $1;
  887. }, function($ctx1) {$ctx1.fill(self,"classRegisteredFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  888. messageSends: ["at:"]}),
  889. smalltalk.PackageHandler.klass);
  890. smalltalk.addMethod(
  891. smalltalk.method({
  892. selector: "for:",
  893. fn: function (aString){
  894. var self=this;
  895. return smalltalk.withContext(function($ctx1) {
  896. var $1;
  897. $1=_st(self._classRegisteredFor_(aString))._new();
  898. return $1;
  899. }, function($ctx1) {$ctx1.fill(self,"for:",{aString:aString},smalltalk.PackageHandler.klass)})},
  900. messageSends: ["new", "classRegisteredFor:"]}),
  901. smalltalk.PackageHandler.klass);
  902. smalltalk.addMethod(
  903. smalltalk.method({
  904. selector: "initialize",
  905. fn: function (){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) {
  908. smalltalk.PackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  909. self["@registry"]=smalltalk.HashedCollection._from_([]);
  910. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.PackageHandler.klass)})},
  911. messageSends: ["initialize"]}),
  912. smalltalk.PackageHandler.klass);
  913. smalltalk.addMethod(
  914. smalltalk.method({
  915. selector: "register:for:",
  916. fn: function (aClass,aString){
  917. var self=this;
  918. return smalltalk.withContext(function($ctx1) {
  919. _st(self["@registry"])._at_put_(aString,aClass);
  920. return self}, function($ctx1) {$ctx1.fill(self,"register:for:",{aClass:aClass,aString:aString},smalltalk.PackageHandler.klass)})},
  921. messageSends: ["at:put:"]}),
  922. smalltalk.PackageHandler.klass);
  923. smalltalk.addMethod(
  924. smalltalk.method({
  925. selector: "registerFor:",
  926. fn: function (aString){
  927. var self=this;
  928. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  929. return smalltalk.withContext(function($ctx1) {
  930. _st($PackageHandler())._register_for_(self,aString);
  931. return self}, function($ctx1) {$ctx1.fill(self,"registerFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  932. messageSends: ["register:for:"]}),
  933. smalltalk.PackageHandler.klass);
  934. smalltalk.addClass('LegacyPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "commitChannels",
  938. fn: function (){
  939. var self=this;
  940. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  941. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  942. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  943. return smalltalk.withContext(function($ctx1) {
  944. var $1;
  945. $1=[(function(pkg){
  946. return smalltalk.withContext(function($ctx2) {
  947. return _st(_st(_st($Exporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  948. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  949. return smalltalk.withContext(function($ctx2) {
  950. return _st(_st(_st($StrippedExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  951. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  952. return smalltalk.withContext(function($ctx2) {
  953. return _st(_st(_st($ChunkExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  954. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  955. return $1;
  956. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.LegacyPackageHandler)})},
  957. messageSends: ["->", ",", "name", "commitPathJs", "recipe", "default", "commitPathSt"]}),
  958. smalltalk.LegacyPackageHandler);
  959. smalltalk.addMethod(
  960. smalltalk.method({
  961. selector: "commitPathJsFor:",
  962. fn: function (aPackage){
  963. var self=this;
  964. return smalltalk.withContext(function($ctx1) {
  965. var $1;
  966. $1=_st(self._class())._defaultCommitPathJs();
  967. return $1;
  968. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  969. messageSends: ["defaultCommitPathJs", "class"]}),
  970. smalltalk.LegacyPackageHandler);
  971. smalltalk.addMethod(
  972. smalltalk.method({
  973. selector: "commitPathStFor:",
  974. fn: function (aPackage){
  975. var self=this;
  976. return smalltalk.withContext(function($ctx1) {
  977. var $1;
  978. $1=_st(self._class())._defaultCommitPathSt();
  979. return $1;
  980. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  981. messageSends: ["defaultCommitPathSt", "class"]}),
  982. smalltalk.LegacyPackageHandler);
  983. smalltalk.addMethod(
  984. smalltalk.method({
  985. selector: "loadPackage:prefix:",
  986. fn: function (packageName,aString){
  987. var self=this;
  988. var url;
  989. return smalltalk.withContext(function($ctx1) {
  990. var $1;
  991. url=_st(_st(_st("/".__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
  992. self._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(url),"type".__minus_gt("GET"),"dataType".__minus_gt("script"),"complete".__minus_gt((function(jqXHR,textStatus){
  993. return smalltalk.withContext(function($ctx2) {
  994. $1=_st(_st(jqXHR)._readyState()).__eq((4));
  995. if(smalltalk.assert($1)){
  996. return self._setupPackageNamed_prefix_(packageName,aString);
  997. };
  998. }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),"error".__minus_gt((function(){
  999. return smalltalk.withContext(function($ctx2) {
  1000. return self._alert_("Could not load package at: ".__comma(url));
  1001. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1002. return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url},smalltalk.LegacyPackageHandler)})},
  1003. messageSends: [",", "ajax:", "->", "ifTrue:", "setupPackageNamed:prefix:", "=", "readyState", "alert:"]}),
  1004. smalltalk.LegacyPackageHandler);
  1005. smalltalk.addMethod(
  1006. smalltalk.method({
  1007. selector: "loadPackages:prefix:",
  1008. fn: function (aCollection,aString){
  1009. var self=this;
  1010. return smalltalk.withContext(function($ctx1) {
  1011. _st(aCollection)._do_((function(each){
  1012. return smalltalk.withContext(function($ctx2) {
  1013. return self._loadPackage_prefix_(each,aString);
  1014. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1015. return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler)})},
  1016. messageSends: ["do:", "loadPackage:prefix:"]}),
  1017. smalltalk.LegacyPackageHandler);
  1018. smalltalk.addMethod(
  1019. smalltalk.method({
  1020. selector: "setupPackageNamed:prefix:",
  1021. fn: function (packageName,aString){
  1022. var self=this;
  1023. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1024. return smalltalk.withContext(function($ctx1) {
  1025. var $1,$2;
  1026. $1=_st($Package())._named_(packageName);
  1027. _st($1)._setupClasses();
  1028. _st($1)._commitPathJs_(_st("/".__comma(aString)).__comma("/js"));
  1029. $2=_st($1)._commitPathSt_(_st("/".__comma(aString)).__comma("/st"));
  1030. return self}, function($ctx1) {$ctx1.fill(self,"setupPackageNamed:prefix:",{packageName:packageName,aString:aString},smalltalk.LegacyPackageHandler)})},
  1031. messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"]}),
  1032. smalltalk.LegacyPackageHandler);
  1033. smalltalk.LegacyPackageHandler.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  1034. smalltalk.addMethod(
  1035. smalltalk.method({
  1036. selector: "commitPathsFromLoader",
  1037. fn: function (){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx1) {
  1040. var commitPath = typeof amber !== 'undefined' && amber.commitPath;
  1041. if (!commitPath) return;
  1042. if (commitPath.js) self._defaultCommitPathJs_(commitPath.js);
  1043. if (commitPath.st) self._defaultCommitPathSt_(commitPath.st);
  1044. ;
  1045. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.LegacyPackageHandler.klass)})},
  1046. messageSends: []}),
  1047. smalltalk.LegacyPackageHandler.klass);
  1048. smalltalk.addMethod(
  1049. smalltalk.method({
  1050. selector: "defaultCommitPathJs",
  1051. fn: function (){
  1052. var self=this;
  1053. return smalltalk.withContext(function($ctx1) {
  1054. var $2,$1;
  1055. $2=self["@defaultCommitPathJs"];
  1056. if(($receiver = $2) == nil || $receiver == undefined){
  1057. self["@defaultCommitPathJs"]="js";
  1058. $1=self["@defaultCommitPathJs"];
  1059. } else {
  1060. $1=$2;
  1061. };
  1062. return $1;
  1063. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs",{},smalltalk.LegacyPackageHandler.klass)})},
  1064. messageSends: ["ifNil:"]}),
  1065. smalltalk.LegacyPackageHandler.klass);
  1066. smalltalk.addMethod(
  1067. smalltalk.method({
  1068. selector: "defaultCommitPathJs:",
  1069. fn: function (aString){
  1070. var self=this;
  1071. return smalltalk.withContext(function($ctx1) {
  1072. self["@defaultCommitPathJs"]=aString;
  1073. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1074. messageSends: []}),
  1075. smalltalk.LegacyPackageHandler.klass);
  1076. smalltalk.addMethod(
  1077. smalltalk.method({
  1078. selector: "defaultCommitPathSt",
  1079. fn: function (){
  1080. var self=this;
  1081. return smalltalk.withContext(function($ctx1) {
  1082. var $2,$1;
  1083. $2=self["@defaultCommitPathSt"];
  1084. if(($receiver = $2) == nil || $receiver == undefined){
  1085. self["@defaultCommitPathSt"]="st";
  1086. $1=self["@defaultCommitPathSt"];
  1087. } else {
  1088. $1=$2;
  1089. };
  1090. return $1;
  1091. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt",{},smalltalk.LegacyPackageHandler.klass)})},
  1092. messageSends: ["ifNil:"]}),
  1093. smalltalk.LegacyPackageHandler.klass);
  1094. smalltalk.addMethod(
  1095. smalltalk.method({
  1096. selector: "defaultCommitPathSt:",
  1097. fn: function (aString){
  1098. var self=this;
  1099. return smalltalk.withContext(function($ctx1) {
  1100. self["@defaultCommitPathSt"]=aString;
  1101. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1102. messageSends: []}),
  1103. smalltalk.LegacyPackageHandler.klass);
  1104. smalltalk.addMethod(
  1105. smalltalk.method({
  1106. selector: "initialize",
  1107. fn: function (){
  1108. var self=this;
  1109. return smalltalk.withContext(function($ctx1) {
  1110. smalltalk.LegacyPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1111. self._registerFor_("unknown");
  1112. self._commitPathsFromLoader();
  1113. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.LegacyPackageHandler.klass)})},
  1114. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  1115. smalltalk.LegacyPackageHandler.klass);
  1116. smalltalk.addMethod(
  1117. smalltalk.method({
  1118. selector: "loadPackages:prefix:",
  1119. fn: function (aCollection,aString){
  1120. var self=this;
  1121. return smalltalk.withContext(function($ctx1) {
  1122. var $1;
  1123. $1=_st(self._new())._loadPackages_prefix_(aCollection,aString);
  1124. return $1;
  1125. }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1126. messageSends: ["loadPackages:prefix:", "new"]}),
  1127. smalltalk.LegacyPackageHandler.klass);
  1128. smalltalk.addMethod(
  1129. smalltalk.method({
  1130. selector: "resetCommitPaths",
  1131. fn: function (){
  1132. var self=this;
  1133. return smalltalk.withContext(function($ctx1) {
  1134. self["@defaultCommitPathJs"]=nil;
  1135. self["@defaultCommitPathSt"]=nil;
  1136. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.LegacyPackageHandler.klass)})},
  1137. messageSends: []}),
  1138. smalltalk.LegacyPackageHandler.klass);
  1139. smalltalk.addClass('PluggableExporter', smalltalk.Object, ['recipe'], 'Importer-Exporter');
  1140. smalltalk.addMethod(
  1141. smalltalk.method({
  1142. selector: "exportAllPackages",
  1143. fn: function (){
  1144. var self=this;
  1145. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1146. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1147. return smalltalk.withContext(function($ctx1) {
  1148. var $1;
  1149. $1=_st($String())._streamContents_((function(stream){
  1150. return smalltalk.withContext(function($ctx2) {
  1151. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(pkg){
  1152. return smalltalk.withContext(function($ctx3) {
  1153. return self._exportPackage_on_(pkg,stream);
  1154. }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx2)})}));
  1155. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  1156. return $1;
  1157. }, function($ctx1) {$ctx1.fill(self,"exportAllPackages",{},smalltalk.PluggableExporter)})},
  1158. messageSends: ["streamContents:", "do:", "exportPackage:on:", "packages", "current"]}),
  1159. smalltalk.PluggableExporter);
  1160. smalltalk.addMethod(
  1161. smalltalk.method({
  1162. selector: "exportPackage:on:",
  1163. fn: function (aPackage,aStream){
  1164. var self=this;
  1165. return smalltalk.withContext(function($ctx1) {
  1166. _st(self._interpreter())._interpret_for_on_(self._recipe(),aPackage,aStream);
  1167. return self}, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},smalltalk.PluggableExporter)})},
  1168. messageSends: ["interpret:for:on:", "recipe", "interpreter"]}),
  1169. smalltalk.PluggableExporter);
  1170. smalltalk.addMethod(
  1171. smalltalk.method({
  1172. selector: "interpreter",
  1173. fn: function (){
  1174. var self=this;
  1175. function $ExportRecipeInterpreter(){return smalltalk.ExportRecipeInterpreter||(typeof ExportRecipeInterpreter=="undefined"?nil:ExportRecipeInterpreter)}
  1176. return smalltalk.withContext(function($ctx1) {
  1177. var $1;
  1178. $1=_st($ExportRecipeInterpreter())._new();
  1179. return $1;
  1180. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.PluggableExporter)})},
  1181. messageSends: ["new"]}),
  1182. smalltalk.PluggableExporter);
  1183. smalltalk.addMethod(
  1184. smalltalk.method({
  1185. selector: "recipe",
  1186. fn: function (){
  1187. var self=this;
  1188. return smalltalk.withContext(function($ctx1) {
  1189. var $1;
  1190. $1=self["@recipe"];
  1191. return $1;
  1192. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.PluggableExporter)})},
  1193. messageSends: []}),
  1194. smalltalk.PluggableExporter);
  1195. smalltalk.addMethod(
  1196. smalltalk.method({
  1197. selector: "recipe:",
  1198. fn: function (anArray){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx1) {
  1201. self["@recipe"]=anArray;
  1202. return self}, function($ctx1) {$ctx1.fill(self,"recipe:",{anArray:anArray},smalltalk.PluggableExporter)})},
  1203. messageSends: []}),
  1204. smalltalk.PluggableExporter);
  1205. smalltalk.addMethod(
  1206. smalltalk.method({
  1207. selector: "forRecipe:",
  1208. fn: function (aRecipe){
  1209. var self=this;
  1210. return smalltalk.withContext(function($ctx1) {
  1211. var $2,$3,$1;
  1212. $2=self._new();
  1213. _st($2)._recipe_(aRecipe);
  1214. $3=_st($2)._yourself();
  1215. $1=$3;
  1216. return $1;
  1217. }, function($ctx1) {$ctx1.fill(self,"forRecipe:",{aRecipe:aRecipe},smalltalk.PluggableExporter.klass)})},
  1218. messageSends: ["recipe:", "new", "yourself"]}),
  1219. smalltalk.PluggableExporter.klass);
  1220. smalltalk.addMethod(
  1221. smalltalk.method({
  1222. selector: "ownClassesOfPackage:",
  1223. fn: function (package_){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx1) {
  1226. var $1;
  1227. $1=_st(_st(package_)._sortedClasses())._asSet();
  1228. return $1;
  1229. }, function($ctx1) {$ctx1.fill(self,"ownClassesOfPackage:",{package_:package_},smalltalk.PluggableExporter.klass)})},
  1230. messageSends: ["asSet", "sortedClasses"]}),
  1231. smalltalk.PluggableExporter.klass);
  1232. smalltalk.addMethod(
  1233. smalltalk.method({
  1234. selector: "commit",
  1235. fn: function (){
  1236. var self=this;
  1237. return smalltalk.withContext(function($ctx1) {
  1238. var $1;
  1239. $1=_st(self._transport())._commit_(self);
  1240. return $1;
  1241. }, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
  1242. messageSends: ["commit:", "transport"]}),
  1243. smalltalk.Package);
  1244. smalltalk.addMethod(
  1245. smalltalk.method({
  1246. selector: "commitPathJs",
  1247. fn: function (){
  1248. var self=this;
  1249. return smalltalk.withContext(function($ctx1) {
  1250. var $3,$2,$1;
  1251. $3=self["@extension"];
  1252. if(($receiver = $3) == nil || $receiver == undefined){
  1253. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1254. $2=self["@extension"];
  1255. } else {
  1256. $2=$3;
  1257. };
  1258. $1=_st($2)._at_ifAbsentPut_("commitPathJs",(function(){
  1259. return smalltalk.withContext(function($ctx2) {
  1260. return _st(self._transport())._commitPathJsFor_(self);
  1261. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1262. return $1;
  1263. }, function($ctx1) {$ctx1.fill(self,"commitPathJs",{},smalltalk.Package)})},
  1264. messageSends: ["at:ifAbsentPut:", "commitPathJsFor:", "transport", "ifNil:"]}),
  1265. smalltalk.Package);
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "commitPathJs:",
  1269. fn: function (aString){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) {
  1272. var $3,$2,$1;
  1273. $3=self["@extension"];
  1274. if(($receiver = $3) == nil || $receiver == undefined){
  1275. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1276. $2=self["@extension"];
  1277. } else {
  1278. $2=$3;
  1279. };
  1280. $1=_st($2)._at_put_("commitPathJs",aString);
  1281. return $1;
  1282. }, function($ctx1) {$ctx1.fill(self,"commitPathJs:",{aString:aString},smalltalk.Package)})},
  1283. messageSends: ["at:put:", "ifNil:"]}),
  1284. smalltalk.Package);
  1285. smalltalk.addMethod(
  1286. smalltalk.method({
  1287. selector: "commitPathSt",
  1288. fn: function (){
  1289. var self=this;
  1290. return smalltalk.withContext(function($ctx1) {
  1291. var $3,$2,$1;
  1292. $3=self["@extension"];
  1293. if(($receiver = $3) == nil || $receiver == undefined){
  1294. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1295. $2=self["@extension"];
  1296. } else {
  1297. $2=$3;
  1298. };
  1299. $1=_st($2)._at_ifAbsentPut_("commitPathSt",(function(){
  1300. return smalltalk.withContext(function($ctx2) {
  1301. return _st(self._transport())._commitPathStFor_(self);
  1302. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1303. return $1;
  1304. }, function($ctx1) {$ctx1.fill(self,"commitPathSt",{},smalltalk.Package)})},
  1305. messageSends: ["at:ifAbsentPut:", "commitPathStFor:", "transport", "ifNil:"]}),
  1306. smalltalk.Package);
  1307. smalltalk.addMethod(
  1308. smalltalk.method({
  1309. selector: "commitPathSt:",
  1310. fn: function (aString){
  1311. var self=this;
  1312. return smalltalk.withContext(function($ctx1) {
  1313. var $3,$2,$1;
  1314. $3=self["@extension"];
  1315. if(($receiver = $3) == nil || $receiver == undefined){
  1316. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1317. $2=self["@extension"];
  1318. } else {
  1319. $2=$3;
  1320. };
  1321. $1=_st($2)._at_put_("commitPathSt",aString);
  1322. return $1;
  1323. }, function($ctx1) {$ctx1.fill(self,"commitPathSt:",{aString:aString},smalltalk.Package)})},
  1324. messageSends: ["at:put:", "ifNil:"]}),
  1325. smalltalk.Package);
  1326. smalltalk.addMethod(
  1327. smalltalk.method({
  1328. selector: "transport",
  1329. fn: function (){
  1330. var self=this;
  1331. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  1332. return smalltalk.withContext(function($ctx1) {
  1333. var $1;
  1334. $1=_st($PackageHandler())._for_(self._transportType());
  1335. return $1;
  1336. }, function($ctx1) {$ctx1.fill(self,"transport",{},smalltalk.Package)})},
  1337. messageSends: ["for:", "transportType"]}),
  1338. smalltalk.Package);
  1339. smalltalk.addMethod(
  1340. smalltalk.method({
  1341. selector: "transportType",
  1342. fn: function (){
  1343. var self=this;
  1344. return smalltalk.withContext(function($ctx1) {
  1345. return (self.transport && self.transport.type) || 'unknown';;
  1346. return self}, function($ctx1) {$ctx1.fill(self,"transportType",{},smalltalk.Package)})},
  1347. messageSends: []}),
  1348. smalltalk.Package);
  1349. })(global_smalltalk,global_nil,global__st);