Importer-Exporter.deploy.js 53 KB

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