1
0

Importer-Exporter.deploy.js 51 KB

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