2
0

Importer-Exporter.deploy.js 67 KB

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