Importer-Exporter.deploy.js 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758
  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: "extensionMethodsOfPackage:",
  492. fn: function (aPackage){
  493. var self=this;
  494. var name,result;
  495. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  496. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  497. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  498. return smalltalk.withContext(function($ctx1) {
  499. var $1;
  500. name=_st(aPackage)._name();
  501. result=_st($OrderedCollection())._new();
  502. _st(_st($Package())._sortedClasses_(_st(_st($Smalltalk())._current())._classes()))._do_((function(each){
  503. return smalltalk.withContext(function($ctx2) {
  504. return _st([each,_st(each)._class()])._do_((function(aClass){
  505. return smalltalk.withContext(function($ctx3) {
  506. return _st(result)._addAll_(_st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  507. return smalltalk.withContext(function($ctx4) {
  508. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  509. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._select_((function(method){
  510. return smalltalk.withContext(function($ctx4) {
  511. return _st(_st(method)._category()).__eq("*".__comma(name));
  512. }, function($ctx4) {$ctx4.fillBlock({method:method},$ctx3)})})));
  513. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
  514. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  515. $1=result;
  516. return $1;
  517. }, function($ctx1) {$ctx1.fill(self,"extensionMethodsOfPackage:",{aPackage:aPackage,name:name,result:result},smalltalk.Exporter)})},
  518. messageSends: ["name", "new", "do:", "addAll:", "select:", "=", ",", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "class", "sortedClasses:", "classes", "current"]}),
  519. smalltalk.Exporter);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "ownMethodsOfClass:",
  523. fn: function (aClass){
  524. var self=this;
  525. return smalltalk.withContext(function($ctx1) {
  526. var $1;
  527. $1=_st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  528. return smalltalk.withContext(function($ctx2) {
  529. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  530. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._reject_((function(each){
  531. return smalltalk.withContext(function($ctx2) {
  532. return _st(_st(each)._category())._match_("^\x5c*");
  533. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  534. return $1;
  535. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfClass:",{aClass:aClass},smalltalk.Exporter)})},
  536. messageSends: ["reject:", "match:", "category", "sorted:", "<=", "selector", "values", "methodDictionary"]}),
  537. smalltalk.Exporter);
  538. smalltalk.addMethod(
  539. smalltalk.method({
  540. selector: "ownMethodsOfMetaClass:",
  541. fn: function (aClass){
  542. var self=this;
  543. return smalltalk.withContext(function($ctx1) {
  544. var $1;
  545. $1=self._ownMethodsOfClass_(_st(aClass)._class());
  546. return $1;
  547. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfMetaClass:",{aClass:aClass},smalltalk.Exporter)})},
  548. messageSends: ["ownMethodsOfClass:", "class"]}),
  549. smalltalk.Exporter);
  550. smalltalk.addMethod(
  551. smalltalk.method({
  552. selector: "recipe",
  553. fn: function (){
  554. var self=this;
  555. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  556. return smalltalk.withContext(function($ctx1) {
  557. var $1;
  558. $1=[self.__minus_gt("exportPackagePrologueOf:on:"),self.__minus_gt("exportPackageDefinitionOf:on:"),[_st($PluggableExporter()).__minus_gt("ownClassesOfPackage:"),self.__minus_gt("exportDefinitionOf:on:"),[self.__minus_gt("ownMethodsOfClass:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportMetaDefinitionOf:on:"),[self.__minus_gt("ownMethodsOfMetaClass:"),self.__minus_gt("exportMethod:on:")]],[self.__minus_gt("extensionMethodsOfPackage:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportPackageEpilogueOf:on:")];
  559. return $1;
  560. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.Exporter)})},
  561. messageSends: ["->"]}),
  562. smalltalk.Exporter);
  563. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
  564. smalltalk.addMethod(
  565. smalltalk.method({
  566. selector: "exportDefinitionOf:on:",
  567. fn: function (aClass,aStream){
  568. var self=this;
  569. return smalltalk.withContext(function($ctx1) {
  570. var $1,$2,$3,$4;
  571. $1=aStream;
  572. _st($1)._lf();
  573. _st($1)._nextPutAll_("smalltalk.addClass(");
  574. _st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
  575. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
  576. $2=_st($1)._nextPutAll_(", [");
  577. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  578. return smalltalk.withContext(function($ctx2) {
  579. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  580. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  581. return smalltalk.withContext(function($ctx2) {
  582. return _st(aStream)._nextPutAll_(", ");
  583. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  584. $3=aStream;
  585. _st($3)._nextPutAll_("], '");
  586. _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
  587. $4=_st($3)._nextPutAll_(");");
  588. _st(aStream)._lf();
  589. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)})},
  590. messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category"]}),
  591. smalltalk.StrippedExporter);
  592. smalltalk.addMethod(
  593. smalltalk.method({
  594. selector: "exportMethod:on:",
  595. fn: function (aMethod,aStream){
  596. var self=this;
  597. return smalltalk.withContext(function($ctx1) {
  598. var $1,$2;
  599. $1=aStream;
  600. _st($1)._nextPutAll_("smalltalk.addMethod(");
  601. _st($1)._lf();
  602. _st($1)._nextPutAll_("smalltalk.method({");
  603. _st($1)._lf();
  604. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  605. _st($1)._lf();
  606. _st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
  607. _st($1)._lf();
  608. _st($1)._nextPutAll_("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript()));
  609. _st($1)._nextPutAll_("}),");
  610. _st($1)._lf();
  611. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
  612. _st($1)._nextPutAll_(");");
  613. _st($1)._lf();
  614. $2=_st($1)._lf();
  615. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.StrippedExporter)})},
  616. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "compiledSource", "fn", "messageSends", "classNameFor:", "methodClass"]}),
  617. smalltalk.StrippedExporter);
  618. smalltalk.addClass('AmdExporter', smalltalk.Object, [], 'Importer-Exporter');
  619. smalltalk.addMethod(
  620. smalltalk.method({
  621. selector: "amdNamesOfPackages:",
  622. fn: function (anArray){
  623. var self=this;
  624. var deps,depNames;
  625. return smalltalk.withContext(function($ctx1) {
  626. var $1;
  627. $1=_st(_st(anArray)._select_((function(each){
  628. return smalltalk.withContext(function($ctx2) {
  629. return _st(_st(each)._amdNamespace())._notNil();
  630. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
  631. return smalltalk.withContext(function($ctx2) {
  632. return _st(_st(_st(each)._amdNamespace()).__comma("/")).__comma(_st(each)._name());
  633. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  634. return $1;
  635. }, function($ctx1) {$ctx1.fill(self,"amdNamesOfPackages:",{anArray:anArray,deps:deps,depNames:depNames},smalltalk.AmdExporter.klass)})},
  636. messageSends: ["collect:", ",", "name", "amdNamespace", "select:", "notNil"]}),
  637. smalltalk.AmdExporter.klass);
  638. smalltalk.addMethod(
  639. smalltalk.method({
  640. selector: "exportPackageEpilogueOf:on:",
  641. fn: function (aPackage,aStream){
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) {
  644. var $1,$2;
  645. $1=aStream;
  646. _st($1)._nextPutAll_("});");
  647. $2=_st($1)._lf();
  648. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.AmdExporter.klass)})},
  649. messageSends: ["nextPutAll:", "lf"]}),
  650. smalltalk.AmdExporter.klass);
  651. smalltalk.addMethod(
  652. smalltalk.method({
  653. selector: "exportPackagePrologueOf:on:",
  654. fn: function (aPackage,aStream){
  655. var self=this;
  656. return smalltalk.withContext(function($ctx1) {
  657. var $1,$2,$4,$3,$5;
  658. $1=aStream;
  659. _st($1)._nextPutAll_("define(\x22");
  660. $2=$1;
  661. $4=_st(aPackage)._amdNamespace();
  662. if(($receiver = $4) == nil || $receiver == undefined){
  663. $3="amber";
  664. } else {
  665. $3=$4;
  666. };
  667. _st($2)._nextPutAll_($3);
  668. _st($1)._nextPutAll_("/");
  669. _st($1)._nextPutAll_(_st(aPackage)._name());
  670. _st($1)._nextPutAll_("\x22, ");
  671. _st($1)._nextPutAll_(_st(["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st"].__comma(self._amdNamesOfPackages_(_st(aPackage)._loadDependencies())))._asJavascript());
  672. _st($1)._nextPutAll_(", function(smalltalk,nil,_st){");
  673. $5=_st($1)._lf();
  674. return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.AmdExporter.klass)})},
  675. messageSends: ["nextPutAll:", "ifNil:", "amdNamespace", "name", "asJavascript", ",", "amdNamesOfPackages:", "loadDependencies", "lf"]}),
  676. smalltalk.AmdExporter.klass);
  677. smalltalk.addMethod(
  678. smalltalk.method({
  679. selector: "exportPackageTransportOf:on:",
  680. fn: function (aPackage,aStream){
  681. var self=this;
  682. return smalltalk.withContext(function($ctx1) {
  683. var $1,$2;
  684. $1=aStream;
  685. _st($1)._nextPutAll_("smalltalk.packages[");
  686. _st($1)._nextPutAll_(_st(_st(aPackage)._name())._asJavascript());
  687. _st($1)._nextPutAll_("].transport = ");
  688. _st($1)._nextPutAll_(_st(aPackage)._transportJson());
  689. _st($1)._nextPutAll_(";");
  690. $2=_st($1)._lf();
  691. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageTransportOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.AmdExporter.klass)})},
  692. messageSends: ["nextPutAll:", "asJavascript", "name", "transportJson", "lf"]}),
  693. smalltalk.AmdExporter.klass);
  694. smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
  695. smalltalk.addMethod(
  696. smalltalk.method({
  697. selector: "nextChunk",
  698. fn: function (){
  699. var self=this;
  700. var char,result,chunk;
  701. return smalltalk.withContext(function($ctx1) {
  702. var $1,$2,$3;
  703. var $early={};
  704. try {
  705. result=""._writeStream();
  706. _st((function(){
  707. return smalltalk.withContext(function($ctx2) {
  708. char=_st(self["@stream"])._next();
  709. char;
  710. return _st(char)._notNil();
  711. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  712. return smalltalk.withContext(function($ctx2) {
  713. $1=_st(char).__eq("!");
  714. if(smalltalk.assert($1)){
  715. $2=_st(_st(self["@stream"])._peek()).__eq("!");
  716. if(smalltalk.assert($2)){
  717. _st(self["@stream"])._next();
  718. } else {
  719. $3=_st(_st(result)._contents())._trimBoth();
  720. throw $early=[$3];
  721. };
  722. };
  723. return _st(result)._nextPut_(char);
  724. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  725. return nil;
  726. }
  727. catch(e) {if(e===$early)return e[0]; throw e}
  728. }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk},smalltalk.ChunkParser)})},
  729. messageSends: ["writeStream", "whileTrue:", "ifTrue:", "ifTrue:ifFalse:", "next", "trimBoth", "contents", "=", "peek", "nextPut:", "notNil"]}),
  730. smalltalk.ChunkParser);
  731. smalltalk.addMethod(
  732. smalltalk.method({
  733. selector: "stream:",
  734. fn: function (aStream){
  735. var self=this;
  736. return smalltalk.withContext(function($ctx1) {
  737. self["@stream"]=aStream;
  738. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.ChunkParser)})},
  739. messageSends: []}),
  740. smalltalk.ChunkParser);
  741. smalltalk.addMethod(
  742. smalltalk.method({
  743. selector: "on:",
  744. fn: function (aStream){
  745. var self=this;
  746. return smalltalk.withContext(function($ctx1) {
  747. var $1;
  748. $1=_st(self._new())._stream_(aStream);
  749. return $1;
  750. }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream},smalltalk.ChunkParser.klass)})},
  751. messageSends: ["stream:", "new"]}),
  752. smalltalk.ChunkParser.klass);
  753. smalltalk.addClass('ExportRecipeInterpreter', smalltalk.Object, [], 'Importer-Exporter');
  754. smalltalk.addMethod(
  755. smalltalk.method({
  756. selector: "interpret:for:on:",
  757. fn: function (aRecipe,anObject,aStream){
  758. var self=this;
  759. var recipeStream;
  760. return smalltalk.withContext(function($ctx1) {
  761. recipeStream=_st(aRecipe)._readStream();
  762. _st((function(){
  763. return smalltalk.withContext(function($ctx2) {
  764. return _st(recipeStream)._atEnd();
  765. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  766. return smalltalk.withContext(function($ctx2) {
  767. return self._interpretStep_for_on_(_st(recipeStream)._next(),anObject,aStream);
  768. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  769. return self}, function($ctx1) {$ctx1.fill(self,"interpret:for:on:",{aRecipe:aRecipe,anObject:anObject,aStream:aStream,recipeStream:recipeStream},smalltalk.ExportRecipeInterpreter)})},
  770. messageSends: ["readStream", "whileFalse:", "interpretStep:for:on:", "next", "atEnd"]}),
  771. smalltalk.ExportRecipeInterpreter);
  772. smalltalk.addMethod(
  773. smalltalk.method({
  774. selector: "interpretStep:for:on:",
  775. fn: function (aRecipeStep,anObject,aStream){
  776. var self=this;
  777. return smalltalk.withContext(function($ctx1) {
  778. var $1,$2;
  779. $1=_st(_st(aRecipeStep)._value()).__eq_eq(aRecipeStep);
  780. if(smalltalk.assert($1)){
  781. $2=self._interpretSubRecipe_for_on_(aRecipeStep,anObject,aStream);
  782. return $2;
  783. };
  784. _st(_st(aRecipeStep)._key())._perform_withArguments_(_st(aRecipeStep)._value(),[anObject,aStream]);
  785. return self}, function($ctx1) {$ctx1.fill(self,"interpretStep:for:on:",{aRecipeStep:aRecipeStep,anObject:anObject,aStream:aStream},smalltalk.ExportRecipeInterpreter)})},
  786. messageSends: ["ifTrue:", "interpretSubRecipe:for:on:", "==", "value", "perform:withArguments:", "key"]}),
  787. smalltalk.ExportRecipeInterpreter);
  788. smalltalk.addMethod(
  789. smalltalk.method({
  790. selector: "interpretSubRecipe:for:on:",
  791. fn: function (aRecipe,anObject,aStream){
  792. var self=this;
  793. var selection;
  794. return smalltalk.withContext(function($ctx1) {
  795. selection=_st(_st(_st(aRecipe)._first())._key())._perform_withArguments_(_st(_st(aRecipe)._first())._value(),[anObject]);
  796. _st(selection)._do_((function(each){
  797. return smalltalk.withContext(function($ctx2) {
  798. return self._interpret_for_on_(_st(aRecipe)._allButFirst(),each,aStream);
  799. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  800. return self}, function($ctx1) {$ctx1.fill(self,"interpretSubRecipe:for:on:",{aRecipe:aRecipe,anObject:anObject,aStream:aStream,selection:selection},smalltalk.ExportRecipeInterpreter)})},
  801. messageSends: ["perform:withArguments:", "value", "first", "key", "do:", "interpret:for:on:", "allButFirst"]}),
  802. smalltalk.ExportRecipeInterpreter);
  803. smalltalk.addClass('Importer', smalltalk.Object, [], 'Importer-Exporter');
  804. smalltalk.addMethod(
  805. smalltalk.method({
  806. selector: "import:",
  807. fn: function (aStream){
  808. var self=this;
  809. var chunk,result,parser,lastEmpty;
  810. function $ChunkParser(){return smalltalk.ChunkParser||(typeof ChunkParser=="undefined"?nil:ChunkParser)}
  811. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  812. return smalltalk.withContext(function($ctx1) {
  813. var $1,$2;
  814. parser=_st($ChunkParser())._on_(aStream);
  815. lastEmpty=false;
  816. _st((function(){
  817. return smalltalk.withContext(function($ctx2) {
  818. chunk=_st(parser)._nextChunk();
  819. chunk;
  820. return _st(chunk)._isNil();
  821. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  822. return smalltalk.withContext(function($ctx2) {
  823. $1=_st(chunk)._isEmpty();
  824. if(smalltalk.assert($1)){
  825. lastEmpty=true;
  826. return lastEmpty;
  827. } else {
  828. result=_st(_st($Compiler())._new())._evaluateExpression_(chunk);
  829. result;
  830. $2=lastEmpty;
  831. if(smalltalk.assert($2)){
  832. lastEmpty=false;
  833. lastEmpty;
  834. return _st(result)._scanFrom_(parser);
  835. };
  836. };
  837. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  838. return self}, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty},smalltalk.Importer)})},
  839. messageSends: ["on:", "whileFalse:", "ifTrue:ifFalse:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "isEmpty", "nextChunk", "isNil"]}),
  840. smalltalk.Importer);
  841. smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'theClass'], 'Importer-Exporter');
  842. smalltalk.addMethod(
  843. smalltalk.method({
  844. selector: "methods",
  845. fn: function (){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx1) {
  848. var $1;
  849. $1=self["@methods"];
  850. return $1;
  851. }, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
  852. messageSends: []}),
  853. smalltalk.MethodCategory);
  854. smalltalk.addMethod(
  855. smalltalk.method({
  856. selector: "methods:",
  857. fn: function (aCollection){
  858. var self=this;
  859. return smalltalk.withContext(function($ctx1) {
  860. self["@methods"]=aCollection;
  861. return self}, function($ctx1) {$ctx1.fill(self,"methods:",{aCollection:aCollection},smalltalk.MethodCategory)})},
  862. messageSends: []}),
  863. smalltalk.MethodCategory);
  864. smalltalk.addMethod(
  865. smalltalk.method({
  866. selector: "name",
  867. fn: function (){
  868. var self=this;
  869. return smalltalk.withContext(function($ctx1) {
  870. var $1;
  871. $1=self["@name"];
  872. return $1;
  873. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
  874. messageSends: []}),
  875. smalltalk.MethodCategory);
  876. smalltalk.addMethod(
  877. smalltalk.method({
  878. selector: "name:",
  879. fn: function (aString){
  880. var self=this;
  881. return smalltalk.withContext(function($ctx1) {
  882. self["@name"]=aString;
  883. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
  884. messageSends: []}),
  885. smalltalk.MethodCategory);
  886. smalltalk.addMethod(
  887. smalltalk.method({
  888. selector: "theClass",
  889. fn: function (){
  890. var self=this;
  891. return smalltalk.withContext(function($ctx1) {
  892. var $1;
  893. $1=self["@theClass"];
  894. return $1;
  895. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.MethodCategory)})},
  896. messageSends: []}),
  897. smalltalk.MethodCategory);
  898. smalltalk.addMethod(
  899. smalltalk.method({
  900. selector: "theClass:",
  901. fn: function (aClass){
  902. var self=this;
  903. return smalltalk.withContext(function($ctx1) {
  904. self["@theClass"]=aClass;
  905. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.MethodCategory)})},
  906. messageSends: []}),
  907. smalltalk.MethodCategory);
  908. smalltalk.addMethod(
  909. smalltalk.method({
  910. selector: "name:theClass:methods:",
  911. fn: function (aString,aClass,anArray){
  912. var self=this;
  913. return smalltalk.withContext(function($ctx1) {
  914. var $2,$3,$1;
  915. $2=self._new();
  916. _st($2)._name_(aString);
  917. _st($2)._theClass_(aClass);
  918. _st($2)._methods_(anArray);
  919. $3=_st($2)._yourself();
  920. $1=$3;
  921. return $1;
  922. }, function($ctx1) {$ctx1.fill(self,"name:theClass:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
  923. messageSends: ["name:", "new", "theClass:", "methods:", "yourself"]}),
  924. smalltalk.MethodCategory.klass);
  925. smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
  926. smalltalk.addMethod(
  927. smalltalk.method({
  928. selector: "ajaxPutAt:data:",
  929. fn: function (aURL,aString){
  930. var self=this;
  931. return smalltalk.withContext(function($ctx1) {
  932. 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){
  933. return smalltalk.withContext(function($ctx2) {
  934. return self._error_(_st(_st(_st("Commiting ".__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
  935. }, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
  936. return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.PackageHandler)})},
  937. messageSends: ["ajax:", "->", "error:", ",", "responseText"]}),
  938. smalltalk.PackageHandler);
  939. smalltalk.addMethod(
  940. smalltalk.method({
  941. selector: "commit:",
  942. fn: function (aPackage){
  943. var self=this;
  944. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  945. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  946. return smalltalk.withContext(function($ctx1) {
  947. _st(self._commitChannels())._do_displayingProgress_((function(commitStrategyFactory){
  948. var fileContents,commitStrategy;
  949. return smalltalk.withContext(function($ctx2) {
  950. commitStrategy=_st(commitStrategyFactory)._value_(aPackage);
  951. commitStrategy;
  952. fileContents=_st($String())._streamContents_((function(stream){
  953. return smalltalk.withContext(function($ctx3) {
  954. return _st(_st($PluggableExporter())._forRecipe_(_st(commitStrategy)._key()))._exportPackage_on_(aPackage,stream);
  955. }, function($ctx3) {$ctx3.fillBlock({stream:stream},$ctx2)})}));
  956. fileContents;
  957. return self._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  958. }, function($ctx2) {$ctx2.fillBlock({commitStrategyFactory:commitStrategyFactory,fileContents:fileContents,commitStrategy:commitStrategy},$ctx1)})}),"Committing package ".__comma(_st(aPackage)._name()));
  959. return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)})},
  960. messageSends: ["do:displayingProgress:", "value:", "streamContents:", "exportPackage:on:", "forRecipe:", "key", "ajaxPutAt:data:", "value", ",", "name", "commitChannels"]}),
  961. smalltalk.PackageHandler);
  962. smalltalk.addMethod(
  963. smalltalk.method({
  964. selector: "commitChannels",
  965. fn: function (){
  966. var self=this;
  967. return smalltalk.withContext(function($ctx1) {
  968. self._subclassResponsibility();
  969. return self}, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.PackageHandler)})},
  970. messageSends: ["subclassResponsibility"]}),
  971. smalltalk.PackageHandler);
  972. smalltalk.PackageHandler.klass.iVarNames = ['registry'];
  973. smalltalk.addMethod(
  974. smalltalk.method({
  975. selector: "classRegisteredFor:",
  976. fn: function (aString){
  977. var self=this;
  978. return smalltalk.withContext(function($ctx1) {
  979. var $1;
  980. $1=_st(self["@registry"])._at_(aString);
  981. return $1;
  982. }, function($ctx1) {$ctx1.fill(self,"classRegisteredFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  983. messageSends: ["at:"]}),
  984. smalltalk.PackageHandler.klass);
  985. smalltalk.addMethod(
  986. smalltalk.method({
  987. selector: "for:",
  988. fn: function (aString){
  989. var self=this;
  990. return smalltalk.withContext(function($ctx1) {
  991. var $1;
  992. $1=_st(self._classRegisteredFor_(aString))._new();
  993. return $1;
  994. }, function($ctx1) {$ctx1.fill(self,"for:",{aString:aString},smalltalk.PackageHandler.klass)})},
  995. messageSends: ["new", "classRegisteredFor:"]}),
  996. smalltalk.PackageHandler.klass);
  997. smalltalk.addMethod(
  998. smalltalk.method({
  999. selector: "initialize",
  1000. fn: function (){
  1001. var self=this;
  1002. return smalltalk.withContext(function($ctx1) {
  1003. smalltalk.PackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1004. self["@registry"]=smalltalk.HashedCollection._from_([]);
  1005. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.PackageHandler.klass)})},
  1006. messageSends: ["initialize"]}),
  1007. smalltalk.PackageHandler.klass);
  1008. smalltalk.addMethod(
  1009. smalltalk.method({
  1010. selector: "register:for:",
  1011. fn: function (aClass,aString){
  1012. var self=this;
  1013. return smalltalk.withContext(function($ctx1) {
  1014. _st(self["@registry"])._at_put_(aString,aClass);
  1015. return self}, function($ctx1) {$ctx1.fill(self,"register:for:",{aClass:aClass,aString:aString},smalltalk.PackageHandler.klass)})},
  1016. messageSends: ["at:put:"]}),
  1017. smalltalk.PackageHandler.klass);
  1018. smalltalk.addMethod(
  1019. smalltalk.method({
  1020. selector: "registerFor:",
  1021. fn: function (aString){
  1022. var self=this;
  1023. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  1024. return smalltalk.withContext(function($ctx1) {
  1025. _st($PackageHandler())._register_for_(self,aString);
  1026. return self}, function($ctx1) {$ctx1.fill(self,"registerFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  1027. messageSends: ["register:for:"]}),
  1028. smalltalk.PackageHandler.klass);
  1029. smalltalk.addClass('AmdPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  1030. smalltalk.addMethod(
  1031. smalltalk.method({
  1032. selector: "commitChannels",
  1033. fn: function (){
  1034. var self=this;
  1035. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  1036. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  1037. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  1038. return smalltalk.withContext(function($ctx1) {
  1039. var $1;
  1040. $1=[(function(pkg){
  1041. return smalltalk.withContext(function($ctx2) {
  1042. return _st(_st(_st($Exporter())._default())._amdRecipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  1043. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  1044. return smalltalk.withContext(function($ctx2) {
  1045. return _st(_st(_st($StrippedExporter())._default())._amdRecipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  1046. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  1047. return smalltalk.withContext(function($ctx2) {
  1048. return _st(_st(_st($ChunkExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  1049. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  1050. return $1;
  1051. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.AmdPackageHandler)})},
  1052. messageSends: ["->", ",", "name", "commitPathJs", "amdRecipe", "default", "commitPathSt", "recipe"]}),
  1053. smalltalk.AmdPackageHandler);
  1054. smalltalk.addMethod(
  1055. smalltalk.method({
  1056. selector: "commitPathJsFor:",
  1057. fn: function (aPackage){
  1058. var self=this;
  1059. return smalltalk.withContext(function($ctx1) {
  1060. var $1;
  1061. $1=self._toUrl_(self._namespaceFor_(aPackage));
  1062. return $1;
  1063. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.AmdPackageHandler)})},
  1064. messageSends: ["toUrl:", "namespaceFor:"]}),
  1065. smalltalk.AmdPackageHandler);
  1066. smalltalk.addMethod(
  1067. smalltalk.method({
  1068. selector: "commitPathStFor:",
  1069. fn: function (aPackage){
  1070. var self=this;
  1071. return smalltalk.withContext(function($ctx1) {
  1072. var $1;
  1073. $1=self._toUrl_(_st(self._namespaceFor_(aPackage)).__comma("/_source"));
  1074. return $1;
  1075. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.AmdPackageHandler)})},
  1076. messageSends: ["toUrl:", ",", "namespaceFor:"]}),
  1077. smalltalk.AmdPackageHandler);
  1078. smalltalk.addMethod(
  1079. smalltalk.method({
  1080. selector: "namespaceFor:",
  1081. fn: function (aPackage){
  1082. var self=this;
  1083. return smalltalk.withContext(function($ctx1) {
  1084. var $2,$3,$4,$1;
  1085. $2=_st(aPackage)._amdNamespace();
  1086. if(($receiver = $2) == nil || $receiver == undefined){
  1087. $3=aPackage;
  1088. _st($3)._amdNamespace_(_st(self._class())._defaultNamespace());
  1089. $4=_st($3)._amdNamespace();
  1090. $1=$4;
  1091. } else {
  1092. $1=$2;
  1093. };
  1094. return $1;
  1095. }, function($ctx1) {$ctx1.fill(self,"namespaceFor:",{aPackage:aPackage},smalltalk.AmdPackageHandler)})},
  1096. messageSends: ["ifNil:", "amdNamespace:", "defaultNamespace", "class", "amdNamespace"]}),
  1097. smalltalk.AmdPackageHandler);
  1098. smalltalk.addMethod(
  1099. smalltalk.method({
  1100. selector: "toUrl:",
  1101. fn: function (aString){
  1102. var self=this;
  1103. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1104. return smalltalk.withContext(function($ctx1) {
  1105. var $1,$2;
  1106. $1=_st(_st($Smalltalk())._current())._at_("_amd_require");
  1107. if(($receiver = $1) == nil || $receiver == undefined){
  1108. self._error_("AMD loader not present");
  1109. } else {
  1110. var require;
  1111. require=$receiver;
  1112. $2=_st(_st(require)._basicAt_("toUrl"))._value_(aString);
  1113. return $2;
  1114. };
  1115. return self}, function($ctx1) {$ctx1.fill(self,"toUrl:",{aString:aString},smalltalk.AmdPackageHandler)})},
  1116. messageSends: ["ifNil:ifNotNil:", "error:", "value:", "basicAt:", "at:", "current"]}),
  1117. smalltalk.AmdPackageHandler);
  1118. smalltalk.AmdPackageHandler.klass.iVarNames = ['defaultNamespace'];
  1119. smalltalk.addMethod(
  1120. smalltalk.method({
  1121. selector: "commitPathsFromLoader",
  1122. fn: function (){
  1123. var self=this;
  1124. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1125. return smalltalk.withContext(function($ctx1) {
  1126. var $1;
  1127. $1=_st(_st($Smalltalk())._current())._at_("_amd_defaultNamespace");
  1128. if(($receiver = $1) == nil || $receiver == undefined){
  1129. $1;
  1130. } else {
  1131. var namespace;
  1132. namespace=$receiver;
  1133. self._defaultNamespace_(namespace);
  1134. };
  1135. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.AmdPackageHandler.klass)})},
  1136. messageSends: ["ifNotNil:", "defaultNamespace:", "at:", "current"]}),
  1137. smalltalk.AmdPackageHandler.klass);
  1138. smalltalk.addMethod(
  1139. smalltalk.method({
  1140. selector: "defaultNamespace",
  1141. fn: function (){
  1142. var self=this;
  1143. return smalltalk.withContext(function($ctx1) {
  1144. var $2,$1;
  1145. $2=self["@defaultNamespace"];
  1146. if(($receiver = $2) == nil || $receiver == undefined){
  1147. $1=self._error_("AMD default namespace not set.");
  1148. } else {
  1149. $1=$2;
  1150. };
  1151. return $1;
  1152. }, function($ctx1) {$ctx1.fill(self,"defaultNamespace",{},smalltalk.AmdPackageHandler.klass)})},
  1153. messageSends: ["ifNil:", "error:"]}),
  1154. smalltalk.AmdPackageHandler.klass);
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "defaultNamespace:",
  1158. fn: function (aString){
  1159. var self=this;
  1160. return smalltalk.withContext(function($ctx1) {
  1161. self["@defaultNamespace"]=aString;
  1162. return self}, function($ctx1) {$ctx1.fill(self,"defaultNamespace:",{aString:aString},smalltalk.AmdPackageHandler.klass)})},
  1163. messageSends: []}),
  1164. smalltalk.AmdPackageHandler.klass);
  1165. smalltalk.addMethod(
  1166. smalltalk.method({
  1167. selector: "initialize",
  1168. fn: function (){
  1169. var self=this;
  1170. return smalltalk.withContext(function($ctx1) {
  1171. smalltalk.AmdPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1172. self._registerFor_("amd");
  1173. self._commitPathsFromLoader();
  1174. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.AmdPackageHandler.klass)})},
  1175. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  1176. smalltalk.AmdPackageHandler.klass);
  1177. smalltalk.addMethod(
  1178. smalltalk.method({
  1179. selector: "resetCommitPaths",
  1180. fn: function (){
  1181. var self=this;
  1182. return smalltalk.withContext(function($ctx1) {
  1183. self["@defaultNamespace"]=nil;
  1184. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.AmdPackageHandler.klass)})},
  1185. messageSends: []}),
  1186. smalltalk.AmdPackageHandler.klass);
  1187. smalltalk.addClass('LegacyPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  1188. smalltalk.addMethod(
  1189. smalltalk.method({
  1190. selector: "commitChannels",
  1191. fn: function (){
  1192. var self=this;
  1193. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  1194. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  1195. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  1196. return smalltalk.withContext(function($ctx1) {
  1197. var $1;
  1198. $1=[(function(pkg){
  1199. return smalltalk.withContext(function($ctx2) {
  1200. return _st(_st(_st($Exporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  1201. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  1202. return smalltalk.withContext(function($ctx2) {
  1203. return _st(_st(_st($StrippedExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  1204. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  1205. return smalltalk.withContext(function($ctx2) {
  1206. return _st(_st(_st($ChunkExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  1207. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  1208. return $1;
  1209. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.LegacyPackageHandler)})},
  1210. messageSends: ["->", ",", "name", "commitPathJs", "recipe", "default", "commitPathSt"]}),
  1211. smalltalk.LegacyPackageHandler);
  1212. smalltalk.addMethod(
  1213. smalltalk.method({
  1214. selector: "commitPathJsFor:",
  1215. fn: function (aPackage){
  1216. var self=this;
  1217. return smalltalk.withContext(function($ctx1) {
  1218. var $1;
  1219. $1=_st(self._class())._defaultCommitPathJs();
  1220. return $1;
  1221. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  1222. messageSends: ["defaultCommitPathJs", "class"]}),
  1223. smalltalk.LegacyPackageHandler);
  1224. smalltalk.addMethod(
  1225. smalltalk.method({
  1226. selector: "commitPathStFor:",
  1227. fn: function (aPackage){
  1228. var self=this;
  1229. return smalltalk.withContext(function($ctx1) {
  1230. var $1;
  1231. $1=_st(self._class())._defaultCommitPathSt();
  1232. return $1;
  1233. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  1234. messageSends: ["defaultCommitPathSt", "class"]}),
  1235. smalltalk.LegacyPackageHandler);
  1236. smalltalk.addMethod(
  1237. smalltalk.method({
  1238. selector: "loadPackage:prefix:",
  1239. fn: function (packageName,aString){
  1240. var self=this;
  1241. var url;
  1242. return smalltalk.withContext(function($ctx1) {
  1243. var $1;
  1244. url=_st(_st(_st("/".__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
  1245. self._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(url),"type".__minus_gt("GET"),"dataType".__minus_gt("script"),"complete".__minus_gt((function(jqXHR,textStatus){
  1246. return smalltalk.withContext(function($ctx2) {
  1247. $1=_st(_st(jqXHR)._readyState()).__eq((4));
  1248. if(smalltalk.assert($1)){
  1249. return self._setupPackageNamed_prefix_(packageName,aString);
  1250. };
  1251. }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),"error".__minus_gt((function(){
  1252. return smalltalk.withContext(function($ctx2) {
  1253. return self._alert_("Could not load package at: ".__comma(url));
  1254. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1255. return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url},smalltalk.LegacyPackageHandler)})},
  1256. messageSends: [",", "ajax:", "->", "ifTrue:", "setupPackageNamed:prefix:", "=", "readyState", "alert:"]}),
  1257. smalltalk.LegacyPackageHandler);
  1258. smalltalk.addMethod(
  1259. smalltalk.method({
  1260. selector: "loadPackages:prefix:",
  1261. fn: function (aCollection,aString){
  1262. var self=this;
  1263. return smalltalk.withContext(function($ctx1) {
  1264. _st(aCollection)._do_((function(each){
  1265. return smalltalk.withContext(function($ctx2) {
  1266. return self._loadPackage_prefix_(each,aString);
  1267. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1268. return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler)})},
  1269. messageSends: ["do:", "loadPackage:prefix:"]}),
  1270. smalltalk.LegacyPackageHandler);
  1271. smalltalk.addMethod(
  1272. smalltalk.method({
  1273. selector: "setupPackageNamed:prefix:",
  1274. fn: function (packageName,aString){
  1275. var self=this;
  1276. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1277. return smalltalk.withContext(function($ctx1) {
  1278. var $1,$2;
  1279. $1=_st($Package())._named_(packageName);
  1280. _st($1)._setupClasses();
  1281. _st($1)._commitPathJs_(_st("/".__comma(aString)).__comma("/js"));
  1282. $2=_st($1)._commitPathSt_(_st("/".__comma(aString)).__comma("/st"));
  1283. return self}, function($ctx1) {$ctx1.fill(self,"setupPackageNamed:prefix:",{packageName:packageName,aString:aString},smalltalk.LegacyPackageHandler)})},
  1284. messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"]}),
  1285. smalltalk.LegacyPackageHandler);
  1286. smalltalk.LegacyPackageHandler.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  1287. smalltalk.addMethod(
  1288. smalltalk.method({
  1289. selector: "commitPathsFromLoader",
  1290. fn: function (){
  1291. var self=this;
  1292. return smalltalk.withContext(function($ctx1) {
  1293. var commitPath = typeof amber !== 'undefined' && amber.commitPath;
  1294. if (!commitPath) return;
  1295. if (commitPath.js) self._defaultCommitPathJs_(commitPath.js);
  1296. if (commitPath.st) self._defaultCommitPathSt_(commitPath.st);
  1297. ;
  1298. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.LegacyPackageHandler.klass)})},
  1299. messageSends: []}),
  1300. smalltalk.LegacyPackageHandler.klass);
  1301. smalltalk.addMethod(
  1302. smalltalk.method({
  1303. selector: "defaultCommitPathJs",
  1304. fn: function (){
  1305. var self=this;
  1306. return smalltalk.withContext(function($ctx1) {
  1307. var $2,$1;
  1308. $2=self["@defaultCommitPathJs"];
  1309. if(($receiver = $2) == nil || $receiver == undefined){
  1310. self["@defaultCommitPathJs"]="js";
  1311. $1=self["@defaultCommitPathJs"];
  1312. } else {
  1313. $1=$2;
  1314. };
  1315. return $1;
  1316. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs",{},smalltalk.LegacyPackageHandler.klass)})},
  1317. messageSends: ["ifNil:"]}),
  1318. smalltalk.LegacyPackageHandler.klass);
  1319. smalltalk.addMethod(
  1320. smalltalk.method({
  1321. selector: "defaultCommitPathJs:",
  1322. fn: function (aString){
  1323. var self=this;
  1324. return smalltalk.withContext(function($ctx1) {
  1325. self["@defaultCommitPathJs"]=aString;
  1326. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1327. messageSends: []}),
  1328. smalltalk.LegacyPackageHandler.klass);
  1329. smalltalk.addMethod(
  1330. smalltalk.method({
  1331. selector: "defaultCommitPathSt",
  1332. fn: function (){
  1333. var self=this;
  1334. return smalltalk.withContext(function($ctx1) {
  1335. var $2,$1;
  1336. $2=self["@defaultCommitPathSt"];
  1337. if(($receiver = $2) == nil || $receiver == undefined){
  1338. self["@defaultCommitPathSt"]="st";
  1339. $1=self["@defaultCommitPathSt"];
  1340. } else {
  1341. $1=$2;
  1342. };
  1343. return $1;
  1344. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt",{},smalltalk.LegacyPackageHandler.klass)})},
  1345. messageSends: ["ifNil:"]}),
  1346. smalltalk.LegacyPackageHandler.klass);
  1347. smalltalk.addMethod(
  1348. smalltalk.method({
  1349. selector: "defaultCommitPathSt:",
  1350. fn: function (aString){
  1351. var self=this;
  1352. return smalltalk.withContext(function($ctx1) {
  1353. self["@defaultCommitPathSt"]=aString;
  1354. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1355. messageSends: []}),
  1356. smalltalk.LegacyPackageHandler.klass);
  1357. smalltalk.addMethod(
  1358. smalltalk.method({
  1359. selector: "initialize",
  1360. fn: function (){
  1361. var self=this;
  1362. return smalltalk.withContext(function($ctx1) {
  1363. smalltalk.LegacyPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1364. self._registerFor_("unknown");
  1365. self._commitPathsFromLoader();
  1366. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.LegacyPackageHandler.klass)})},
  1367. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  1368. smalltalk.LegacyPackageHandler.klass);
  1369. smalltalk.addMethod(
  1370. smalltalk.method({
  1371. selector: "loadPackages:prefix:",
  1372. fn: function (aCollection,aString){
  1373. var self=this;
  1374. return smalltalk.withContext(function($ctx1) {
  1375. var $1;
  1376. $1=_st(self._new())._loadPackages_prefix_(aCollection,aString);
  1377. return $1;
  1378. }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1379. messageSends: ["loadPackages:prefix:", "new"]}),
  1380. smalltalk.LegacyPackageHandler.klass);
  1381. smalltalk.addMethod(
  1382. smalltalk.method({
  1383. selector: "resetCommitPaths",
  1384. fn: function (){
  1385. var self=this;
  1386. return smalltalk.withContext(function($ctx1) {
  1387. self["@defaultCommitPathJs"]=nil;
  1388. self["@defaultCommitPathSt"]=nil;
  1389. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.LegacyPackageHandler.klass)})},
  1390. messageSends: []}),
  1391. smalltalk.LegacyPackageHandler.klass);
  1392. smalltalk.addClass('PluggableExporter', smalltalk.Object, ['recipe'], 'Importer-Exporter');
  1393. smalltalk.addMethod(
  1394. smalltalk.method({
  1395. selector: "exportAllPackages",
  1396. fn: function (){
  1397. var self=this;
  1398. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1399. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1400. return smalltalk.withContext(function($ctx1) {
  1401. var $1;
  1402. $1=_st($String())._streamContents_((function(stream){
  1403. return smalltalk.withContext(function($ctx2) {
  1404. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(pkg){
  1405. return smalltalk.withContext(function($ctx3) {
  1406. return self._exportPackage_on_(pkg,stream);
  1407. }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx2)})}));
  1408. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  1409. return $1;
  1410. }, function($ctx1) {$ctx1.fill(self,"exportAllPackages",{},smalltalk.PluggableExporter)})},
  1411. messageSends: ["streamContents:", "do:", "exportPackage:on:", "packages", "current"]}),
  1412. smalltalk.PluggableExporter);
  1413. smalltalk.addMethod(
  1414. smalltalk.method({
  1415. selector: "exportPackage:on:",
  1416. fn: function (aPackage,aStream){
  1417. var self=this;
  1418. return smalltalk.withContext(function($ctx1) {
  1419. _st(self._interpreter())._interpret_for_on_(self._recipe(),aPackage,aStream);
  1420. return self}, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},smalltalk.PluggableExporter)})},
  1421. messageSends: ["interpret:for:on:", "recipe", "interpreter"]}),
  1422. smalltalk.PluggableExporter);
  1423. smalltalk.addMethod(
  1424. smalltalk.method({
  1425. selector: "interpreter",
  1426. fn: function (){
  1427. var self=this;
  1428. function $ExportRecipeInterpreter(){return smalltalk.ExportRecipeInterpreter||(typeof ExportRecipeInterpreter=="undefined"?nil:ExportRecipeInterpreter)}
  1429. return smalltalk.withContext(function($ctx1) {
  1430. var $1;
  1431. $1=_st($ExportRecipeInterpreter())._new();
  1432. return $1;
  1433. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.PluggableExporter)})},
  1434. messageSends: ["new"]}),
  1435. smalltalk.PluggableExporter);
  1436. smalltalk.addMethod(
  1437. smalltalk.method({
  1438. selector: "recipe",
  1439. fn: function (){
  1440. var self=this;
  1441. return smalltalk.withContext(function($ctx1) {
  1442. var $1;
  1443. $1=self["@recipe"];
  1444. return $1;
  1445. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.PluggableExporter)})},
  1446. messageSends: []}),
  1447. smalltalk.PluggableExporter);
  1448. smalltalk.addMethod(
  1449. smalltalk.method({
  1450. selector: "recipe:",
  1451. fn: function (anArray){
  1452. var self=this;
  1453. return smalltalk.withContext(function($ctx1) {
  1454. self["@recipe"]=anArray;
  1455. return self}, function($ctx1) {$ctx1.fill(self,"recipe:",{anArray:anArray},smalltalk.PluggableExporter)})},
  1456. messageSends: []}),
  1457. smalltalk.PluggableExporter);
  1458. smalltalk.addMethod(
  1459. smalltalk.method({
  1460. selector: "forRecipe:",
  1461. fn: function (aRecipe){
  1462. var self=this;
  1463. return smalltalk.withContext(function($ctx1) {
  1464. var $2,$3,$1;
  1465. $2=self._new();
  1466. _st($2)._recipe_(aRecipe);
  1467. $3=_st($2)._yourself();
  1468. $1=$3;
  1469. return $1;
  1470. }, function($ctx1) {$ctx1.fill(self,"forRecipe:",{aRecipe:aRecipe},smalltalk.PluggableExporter.klass)})},
  1471. messageSends: ["recipe:", "new", "yourself"]}),
  1472. smalltalk.PluggableExporter.klass);
  1473. smalltalk.addMethod(
  1474. smalltalk.method({
  1475. selector: "ownClassesOfPackage:",
  1476. fn: function (package_){
  1477. var self=this;
  1478. return smalltalk.withContext(function($ctx1) {
  1479. var $1;
  1480. $1=_st(_st(package_)._sortedClasses())._asSet();
  1481. return $1;
  1482. }, function($ctx1) {$ctx1.fill(self,"ownClassesOfPackage:",{package_:package_},smalltalk.PluggableExporter.klass)})},
  1483. messageSends: ["asSet", "sortedClasses"]}),
  1484. smalltalk.PluggableExporter.klass);
  1485. smalltalk.addMethod(
  1486. smalltalk.method({
  1487. selector: "amdNamespace",
  1488. fn: function (){
  1489. var self=this;
  1490. return smalltalk.withContext(function($ctx1) {
  1491. return (self.transport && self.transport.amdNamespace) || nil;
  1492. return self}, function($ctx1) {$ctx1.fill(self,"amdNamespace",{},smalltalk.Package)})},
  1493. messageSends: []}),
  1494. smalltalk.Package);
  1495. smalltalk.addMethod(
  1496. smalltalk.method({
  1497. selector: "amdNamespace:",
  1498. fn: function (aString){
  1499. var self=this;
  1500. return smalltalk.withContext(function($ctx1) {
  1501. if (!self.transport) { self.transport = { type: 'amd' }; }
  1502. if (self.transport.type !== 'amd') { throw new Error('Package '+self._name()+' has transport type '+self.transport.type+', not "amd".'); }
  1503. self.transport.amdNamespace = aString;;
  1504. return self}, function($ctx1) {$ctx1.fill(self,"amdNamespace:",{aString:aString},smalltalk.Package)})},
  1505. messageSends: []}),
  1506. smalltalk.Package);
  1507. smalltalk.addMethod(
  1508. smalltalk.method({
  1509. selector: "commit",
  1510. fn: function (){
  1511. var self=this;
  1512. return smalltalk.withContext(function($ctx1) {
  1513. var $1;
  1514. $1=_st(self._transport())._commit_(self);
  1515. return $1;
  1516. }, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
  1517. messageSends: ["commit:", "transport"]}),
  1518. smalltalk.Package);
  1519. smalltalk.addMethod(
  1520. smalltalk.method({
  1521. selector: "commitPathJs",
  1522. fn: function (){
  1523. var self=this;
  1524. return smalltalk.withContext(function($ctx1) {
  1525. var $3,$2,$1;
  1526. $3=self["@extension"];
  1527. if(($receiver = $3) == nil || $receiver == undefined){
  1528. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1529. $2=self["@extension"];
  1530. } else {
  1531. $2=$3;
  1532. };
  1533. $1=_st($2)._at_ifAbsent_("commitPathJs",(function(){
  1534. return smalltalk.withContext(function($ctx2) {
  1535. return _st(self._transport())._commitPathJsFor_(self);
  1536. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1537. return $1;
  1538. }, function($ctx1) {$ctx1.fill(self,"commitPathJs",{},smalltalk.Package)})},
  1539. messageSends: ["at:ifAbsent:", "commitPathJsFor:", "transport", "ifNil:"]}),
  1540. smalltalk.Package);
  1541. smalltalk.addMethod(
  1542. smalltalk.method({
  1543. selector: "commitPathJs:",
  1544. fn: function (aString){
  1545. var self=this;
  1546. return smalltalk.withContext(function($ctx1) {
  1547. var $3,$2,$1;
  1548. $3=self["@extension"];
  1549. if(($receiver = $3) == nil || $receiver == undefined){
  1550. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1551. $2=self["@extension"];
  1552. } else {
  1553. $2=$3;
  1554. };
  1555. $1=_st($2)._at_put_("commitPathJs",aString);
  1556. return $1;
  1557. }, function($ctx1) {$ctx1.fill(self,"commitPathJs:",{aString:aString},smalltalk.Package)})},
  1558. messageSends: ["at:put:", "ifNil:"]}),
  1559. smalltalk.Package);
  1560. smalltalk.addMethod(
  1561. smalltalk.method({
  1562. selector: "commitPathSt",
  1563. fn: function (){
  1564. var self=this;
  1565. return smalltalk.withContext(function($ctx1) {
  1566. var $3,$2,$1;
  1567. $3=self["@extension"];
  1568. if(($receiver = $3) == nil || $receiver == undefined){
  1569. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1570. $2=self["@extension"];
  1571. } else {
  1572. $2=$3;
  1573. };
  1574. $1=_st($2)._at_ifAbsent_("commitPathSt",(function(){
  1575. return smalltalk.withContext(function($ctx2) {
  1576. return _st(self._transport())._commitPathStFor_(self);
  1577. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1578. return $1;
  1579. }, function($ctx1) {$ctx1.fill(self,"commitPathSt",{},smalltalk.Package)})},
  1580. messageSends: ["at:ifAbsent:", "commitPathStFor:", "transport", "ifNil:"]}),
  1581. smalltalk.Package);
  1582. smalltalk.addMethod(
  1583. smalltalk.method({
  1584. selector: "commitPathSt:",
  1585. fn: function (aString){
  1586. var self=this;
  1587. return smalltalk.withContext(function($ctx1) {
  1588. var $3,$2,$1;
  1589. $3=self["@extension"];
  1590. if(($receiver = $3) == nil || $receiver == undefined){
  1591. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1592. $2=self["@extension"];
  1593. } else {
  1594. $2=$3;
  1595. };
  1596. $1=_st($2)._at_put_("commitPathSt",aString);
  1597. return $1;
  1598. }, function($ctx1) {$ctx1.fill(self,"commitPathSt:",{aString:aString},smalltalk.Package)})},
  1599. messageSends: ["at:put:", "ifNil:"]}),
  1600. smalltalk.Package);
  1601. smalltalk.addMethod(
  1602. smalltalk.method({
  1603. selector: "transport",
  1604. fn: function (){
  1605. var self=this;
  1606. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  1607. return smalltalk.withContext(function($ctx1) {
  1608. var $1;
  1609. $1=_st($PackageHandler())._for_(self._transportType());
  1610. return $1;
  1611. }, function($ctx1) {$ctx1.fill(self,"transport",{},smalltalk.Package)})},
  1612. messageSends: ["for:", "transportType"]}),
  1613. smalltalk.Package);
  1614. smalltalk.addMethod(
  1615. smalltalk.method({
  1616. selector: "transportJson",
  1617. fn: function (){
  1618. var self=this;
  1619. return smalltalk.withContext(function($ctx1) {
  1620. return JSON.stringify(self.transport || null);;
  1621. return self}, function($ctx1) {$ctx1.fill(self,"transportJson",{},smalltalk.Package)})},
  1622. messageSends: []}),
  1623. smalltalk.Package);
  1624. smalltalk.addMethod(
  1625. smalltalk.method({
  1626. selector: "transportType",
  1627. fn: function (){
  1628. var self=this;
  1629. return smalltalk.withContext(function($ctx1) {
  1630. return (self.transport && self.transport.type) || 'unknown';;
  1631. return self}, function($ctx1) {$ctx1.fill(self,"transportType",{},smalltalk.Package)})},
  1632. messageSends: []}),
  1633. smalltalk.Package);
  1634. });