Importer-Exporter.deploy.js 68 KB

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