Importer-Exporter.deploy.js 51 KB

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