Importer-Exporter.deploy.js 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748
  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)._match_("^\x5c*".__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:", "match:", ",", "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())._match_("^\x5c*".__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:", "match:", ",", "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('Importer', smalltalk.Object, [], 'Importer-Exporter');
  754. smalltalk.addMethod(
  755. smalltalk.method({
  756. selector: "import:",
  757. fn: function (aStream){
  758. var self=this;
  759. var chunk,result,parser,lastEmpty;
  760. function $ChunkParser(){return smalltalk.ChunkParser||(typeof ChunkParser=="undefined"?nil:ChunkParser)}
  761. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  762. return smalltalk.withContext(function($ctx1) {
  763. var $1,$2;
  764. parser=_st($ChunkParser())._on_(aStream);
  765. lastEmpty=false;
  766. _st((function(){
  767. return smalltalk.withContext(function($ctx2) {
  768. chunk=_st(parser)._nextChunk();
  769. chunk;
  770. return _st(chunk)._isNil();
  771. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  772. return smalltalk.withContext(function($ctx2) {
  773. $1=_st(chunk)._isEmpty();
  774. if(smalltalk.assert($1)){
  775. lastEmpty=true;
  776. return lastEmpty;
  777. } else {
  778. result=_st(_st($Compiler())._new())._evaluateExpression_(chunk);
  779. result;
  780. $2=lastEmpty;
  781. if(smalltalk.assert($2)){
  782. lastEmpty=false;
  783. lastEmpty;
  784. return _st(result)._scanFrom_(parser);
  785. };
  786. };
  787. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  788. return self}, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty},smalltalk.Importer)})},
  789. messageSends: ["on:", "whileFalse:", "ifTrue:ifFalse:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "isEmpty", "nextChunk", "isNil"]}),
  790. smalltalk.Importer);
  791. smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'theClass'], 'Importer-Exporter');
  792. smalltalk.addMethod(
  793. smalltalk.method({
  794. selector: "methods",
  795. fn: function (){
  796. var self=this;
  797. return smalltalk.withContext(function($ctx1) {
  798. var $1;
  799. $1=self["@methods"];
  800. return $1;
  801. }, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
  802. messageSends: []}),
  803. smalltalk.MethodCategory);
  804. smalltalk.addMethod(
  805. smalltalk.method({
  806. selector: "methods:",
  807. fn: function (aCollection){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) {
  810. self["@methods"]=aCollection;
  811. return self}, function($ctx1) {$ctx1.fill(self,"methods:",{aCollection:aCollection},smalltalk.MethodCategory)})},
  812. messageSends: []}),
  813. smalltalk.MethodCategory);
  814. smalltalk.addMethod(
  815. smalltalk.method({
  816. selector: "name",
  817. fn: function (){
  818. var self=this;
  819. return smalltalk.withContext(function($ctx1) {
  820. var $1;
  821. $1=self["@name"];
  822. return $1;
  823. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
  824. messageSends: []}),
  825. smalltalk.MethodCategory);
  826. smalltalk.addMethod(
  827. smalltalk.method({
  828. selector: "name:",
  829. fn: function (aString){
  830. var self=this;
  831. return smalltalk.withContext(function($ctx1) {
  832. self["@name"]=aString;
  833. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
  834. messageSends: []}),
  835. smalltalk.MethodCategory);
  836. smalltalk.addMethod(
  837. smalltalk.method({
  838. selector: "theClass",
  839. fn: function (){
  840. var self=this;
  841. return smalltalk.withContext(function($ctx1) {
  842. var $1;
  843. $1=self["@theClass"];
  844. return $1;
  845. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.MethodCategory)})},
  846. messageSends: []}),
  847. smalltalk.MethodCategory);
  848. smalltalk.addMethod(
  849. smalltalk.method({
  850. selector: "theClass:",
  851. fn: function (aClass){
  852. var self=this;
  853. return smalltalk.withContext(function($ctx1) {
  854. self["@theClass"]=aClass;
  855. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.MethodCategory)})},
  856. messageSends: []}),
  857. smalltalk.MethodCategory);
  858. smalltalk.addMethod(
  859. smalltalk.method({
  860. selector: "name:theClass:methods:",
  861. fn: function (aString,aClass,anArray){
  862. var self=this;
  863. return smalltalk.withContext(function($ctx1) {
  864. var $2,$3,$1;
  865. $2=self._new();
  866. _st($2)._name_(aString);
  867. _st($2)._theClass_(aClass);
  868. _st($2)._methods_(anArray);
  869. $3=_st($2)._yourself();
  870. $1=$3;
  871. return $1;
  872. }, function($ctx1) {$ctx1.fill(self,"name:theClass:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
  873. messageSends: ["name:", "new", "theClass:", "methods:", "yourself"]}),
  874. smalltalk.MethodCategory.klass);
  875. smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
  876. smalltalk.addMethod(
  877. smalltalk.method({
  878. selector: "ajaxPutAt:data:",
  879. fn: function (aURL,aString){
  880. var self=this;
  881. return smalltalk.withContext(function($ctx1) {
  882. 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){
  883. return smalltalk.withContext(function($ctx2) {
  884. return self._error_(_st(_st(_st("Commiting ".__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
  885. }, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
  886. return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.PackageHandler)})},
  887. messageSends: ["ajax:", "->", "error:", ",", "responseText"]}),
  888. smalltalk.PackageHandler);
  889. smalltalk.addMethod(
  890. smalltalk.method({
  891. selector: "commit:",
  892. fn: function (aPackage){
  893. var self=this;
  894. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  895. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  896. return smalltalk.withContext(function($ctx1) {
  897. _st(self._commitChannels())._do_displayingProgress_((function(commitStrategyFactory){
  898. var fileContents,commitStrategy;
  899. return smalltalk.withContext(function($ctx2) {
  900. commitStrategy=_st(commitStrategyFactory)._value_(aPackage);
  901. commitStrategy;
  902. fileContents=_st($String())._streamContents_((function(stream){
  903. return smalltalk.withContext(function($ctx3) {
  904. return _st(_st($PluggableExporter())._forRecipe_(_st(commitStrategy)._key()))._exportPackage_on_(aPackage,stream);
  905. }, function($ctx3) {$ctx3.fillBlock({stream:stream},$ctx2)})}));
  906. fileContents;
  907. return self._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  908. }, function($ctx2) {$ctx2.fillBlock({commitStrategyFactory:commitStrategyFactory,fileContents:fileContents,commitStrategy:commitStrategy},$ctx1)})}),"Committing package ".__comma(_st(aPackage)._name()));
  909. return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)})},
  910. messageSends: ["do:displayingProgress:", "value:", "streamContents:", "exportPackage:on:", "forRecipe:", "key", "ajaxPutAt:data:", "value", ",", "name", "commitChannels"]}),
  911. smalltalk.PackageHandler);
  912. smalltalk.addMethod(
  913. smalltalk.method({
  914. selector: "commitChannels",
  915. fn: function (){
  916. var self=this;
  917. return smalltalk.withContext(function($ctx1) {
  918. self._subclassResponsibility();
  919. return self}, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.PackageHandler)})},
  920. messageSends: ["subclassResponsibility"]}),
  921. smalltalk.PackageHandler);
  922. smalltalk.PackageHandler.klass.iVarNames = ['registry'];
  923. smalltalk.addMethod(
  924. smalltalk.method({
  925. selector: "classRegisteredFor:",
  926. fn: function (aString){
  927. var self=this;
  928. return smalltalk.withContext(function($ctx1) {
  929. var $1;
  930. $1=_st(self["@registry"])._at_(aString);
  931. return $1;
  932. }, function($ctx1) {$ctx1.fill(self,"classRegisteredFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  933. messageSends: ["at:"]}),
  934. smalltalk.PackageHandler.klass);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "for:",
  938. fn: function (aString){
  939. var self=this;
  940. return smalltalk.withContext(function($ctx1) {
  941. var $1;
  942. $1=_st(self._classRegisteredFor_(aString))._new();
  943. return $1;
  944. }, function($ctx1) {$ctx1.fill(self,"for:",{aString:aString},smalltalk.PackageHandler.klass)})},
  945. messageSends: ["new", "classRegisteredFor:"]}),
  946. smalltalk.PackageHandler.klass);
  947. smalltalk.addMethod(
  948. smalltalk.method({
  949. selector: "initialize",
  950. fn: function (){
  951. var self=this;
  952. return smalltalk.withContext(function($ctx1) {
  953. smalltalk.PackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  954. self["@registry"]=smalltalk.HashedCollection._from_([]);
  955. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.PackageHandler.klass)})},
  956. messageSends: ["initialize"]}),
  957. smalltalk.PackageHandler.klass);
  958. smalltalk.addMethod(
  959. smalltalk.method({
  960. selector: "register:for:",
  961. fn: function (aClass,aString){
  962. var self=this;
  963. return smalltalk.withContext(function($ctx1) {
  964. _st(self["@registry"])._at_put_(aString,aClass);
  965. return self}, function($ctx1) {$ctx1.fill(self,"register:for:",{aClass:aClass,aString:aString},smalltalk.PackageHandler.klass)})},
  966. messageSends: ["at:put:"]}),
  967. smalltalk.PackageHandler.klass);
  968. smalltalk.addMethod(
  969. smalltalk.method({
  970. selector: "registerFor:",
  971. fn: function (aString){
  972. var self=this;
  973. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  974. return smalltalk.withContext(function($ctx1) {
  975. _st($PackageHandler())._register_for_(self,aString);
  976. return self}, function($ctx1) {$ctx1.fill(self,"registerFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  977. messageSends: ["register:for:"]}),
  978. smalltalk.PackageHandler.klass);
  979. smalltalk.addClass('AmdPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  980. smalltalk.addMethod(
  981. smalltalk.method({
  982. selector: "commitChannels",
  983. fn: function (){
  984. var self=this;
  985. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  986. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  987. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  988. return smalltalk.withContext(function($ctx1) {
  989. var $1;
  990. $1=[(function(pkg){
  991. return smalltalk.withContext(function($ctx2) {
  992. return _st(_st(_st($Exporter())._default())._amdRecipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  993. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  994. return smalltalk.withContext(function($ctx2) {
  995. return _st(_st(_st($StrippedExporter())._default())._amdRecipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  996. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  997. return smalltalk.withContext(function($ctx2) {
  998. return _st(_st(_st($ChunkExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  999. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  1000. return $1;
  1001. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.AmdPackageHandler)})},
  1002. messageSends: ["->", ",", "name", "commitPathJs", "amdRecipe", "default", "commitPathSt", "recipe"]}),
  1003. smalltalk.AmdPackageHandler);
  1004. smalltalk.addMethod(
  1005. smalltalk.method({
  1006. selector: "commitPathJsFor:",
  1007. fn: function (aPackage){
  1008. var self=this;
  1009. return smalltalk.withContext(function($ctx1) {
  1010. var $1;
  1011. $1=self._toUrl_(self._namespaceFor_(aPackage));
  1012. return $1;
  1013. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.AmdPackageHandler)})},
  1014. messageSends: ["toUrl:", "namespaceFor:"]}),
  1015. smalltalk.AmdPackageHandler);
  1016. smalltalk.addMethod(
  1017. smalltalk.method({
  1018. selector: "commitPathStFor:",
  1019. fn: function (aPackage){
  1020. var self=this;
  1021. return smalltalk.withContext(function($ctx1) {
  1022. var $1;
  1023. $1=self._toUrl_(_st(self._namespaceFor_(aPackage)).__comma("/_source"));
  1024. return $1;
  1025. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.AmdPackageHandler)})},
  1026. messageSends: ["toUrl:", ",", "namespaceFor:"]}),
  1027. smalltalk.AmdPackageHandler);
  1028. smalltalk.addMethod(
  1029. smalltalk.method({
  1030. selector: "namespaceFor:",
  1031. fn: function (aPackage){
  1032. var self=this;
  1033. return smalltalk.withContext(function($ctx1) {
  1034. var $2,$3,$4,$1;
  1035. $2=_st(aPackage)._amdNamespace();
  1036. if(($receiver = $2) == nil || $receiver == undefined){
  1037. $3=aPackage;
  1038. _st($3)._amdNamespace_(_st(self._class())._defaultNamespace());
  1039. $4=_st($3)._amdNamespace();
  1040. $1=$4;
  1041. } else {
  1042. $1=$2;
  1043. };
  1044. return $1;
  1045. }, function($ctx1) {$ctx1.fill(self,"namespaceFor:",{aPackage:aPackage},smalltalk.AmdPackageHandler)})},
  1046. messageSends: ["ifNil:", "amdNamespace:", "defaultNamespace", "class", "amdNamespace"]}),
  1047. smalltalk.AmdPackageHandler);
  1048. smalltalk.addMethod(
  1049. smalltalk.method({
  1050. selector: "toUrl:",
  1051. fn: function (aString){
  1052. var self=this;
  1053. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1054. return smalltalk.withContext(function($ctx1) {
  1055. var $1,$2;
  1056. $1=_st(_st($Smalltalk())._current())._at_("_amd_require");
  1057. if(($receiver = $1) == nil || $receiver == undefined){
  1058. self._error_("AMD loader not present");
  1059. } else {
  1060. var require;
  1061. require=$receiver;
  1062. $2=_st(_st(require)._basicAt_("toUrl"))._value_(aString);
  1063. return $2;
  1064. };
  1065. return self}, function($ctx1) {$ctx1.fill(self,"toUrl:",{aString:aString},smalltalk.AmdPackageHandler)})},
  1066. messageSends: ["ifNil:ifNotNil:", "error:", "value:", "basicAt:", "at:", "current"]}),
  1067. smalltalk.AmdPackageHandler);
  1068. smalltalk.AmdPackageHandler.klass.iVarNames = ['defaultNamespace'];
  1069. smalltalk.addMethod(
  1070. smalltalk.method({
  1071. selector: "commitPathsFromLoader",
  1072. fn: function (){
  1073. var self=this;
  1074. return smalltalk.withContext(function($ctx1) {
  1075. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.AmdPackageHandler.klass)})},
  1076. messageSends: []}),
  1077. smalltalk.AmdPackageHandler.klass);
  1078. smalltalk.addMethod(
  1079. smalltalk.method({
  1080. selector: "defaultNamespace",
  1081. fn: function (){
  1082. var self=this;
  1083. return smalltalk.withContext(function($ctx1) {
  1084. var $2,$1;
  1085. $2=self["@defaultNamespace"];
  1086. if(($receiver = $2) == nil || $receiver == undefined){
  1087. $1=self._error_("AMD default namespace not set.");
  1088. } else {
  1089. $1=$2;
  1090. };
  1091. return $1;
  1092. }, function($ctx1) {$ctx1.fill(self,"defaultNamespace",{},smalltalk.AmdPackageHandler.klass)})},
  1093. messageSends: ["ifNil:", "error:"]}),
  1094. smalltalk.AmdPackageHandler.klass);
  1095. smalltalk.addMethod(
  1096. smalltalk.method({
  1097. selector: "defaultNamespace:",
  1098. fn: function (aString){
  1099. var self=this;
  1100. return smalltalk.withContext(function($ctx1) {
  1101. self["@defaultNamespace"]=aString;
  1102. return self}, function($ctx1) {$ctx1.fill(self,"defaultNamespace:",{aString:aString},smalltalk.AmdPackageHandler.klass)})},
  1103. messageSends: []}),
  1104. smalltalk.AmdPackageHandler.klass);
  1105. smalltalk.addMethod(
  1106. smalltalk.method({
  1107. selector: "initialize",
  1108. fn: function (){
  1109. var self=this;
  1110. return smalltalk.withContext(function($ctx1) {
  1111. smalltalk.AmdPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1112. self._registerFor_("amd");
  1113. self._commitPathsFromLoader();
  1114. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.AmdPackageHandler.klass)})},
  1115. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  1116. smalltalk.AmdPackageHandler.klass);
  1117. smalltalk.addMethod(
  1118. smalltalk.method({
  1119. selector: "resetCommitPaths",
  1120. fn: function (){
  1121. var self=this;
  1122. return smalltalk.withContext(function($ctx1) {
  1123. self["@defaultNamespace"]=nil;
  1124. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.AmdPackageHandler.klass)})},
  1125. messageSends: []}),
  1126. smalltalk.AmdPackageHandler.klass);
  1127. smalltalk.addClass('LegacyPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  1128. smalltalk.addMethod(
  1129. smalltalk.method({
  1130. selector: "commitChannels",
  1131. fn: function (){
  1132. var self=this;
  1133. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  1134. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  1135. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  1136. return smalltalk.withContext(function($ctx1) {
  1137. var $1;
  1138. $1=[(function(pkg){
  1139. return smalltalk.withContext(function($ctx2) {
  1140. return _st(_st(_st($Exporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  1141. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  1142. return smalltalk.withContext(function($ctx2) {
  1143. return _st(_st(_st($StrippedExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  1144. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  1145. return smalltalk.withContext(function($ctx2) {
  1146. return _st(_st(_st($ChunkExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  1147. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  1148. return $1;
  1149. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.LegacyPackageHandler)})},
  1150. messageSends: ["->", ",", "name", "commitPathJs", "recipe", "default", "commitPathSt"]}),
  1151. smalltalk.LegacyPackageHandler);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "commitPathJsFor:",
  1155. fn: function (aPackage){
  1156. var self=this;
  1157. return smalltalk.withContext(function($ctx1) {
  1158. var $1;
  1159. $1=_st(self._class())._defaultCommitPathJs();
  1160. return $1;
  1161. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  1162. messageSends: ["defaultCommitPathJs", "class"]}),
  1163. smalltalk.LegacyPackageHandler);
  1164. smalltalk.addMethod(
  1165. smalltalk.method({
  1166. selector: "commitPathStFor:",
  1167. fn: function (aPackage){
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) {
  1170. var $1;
  1171. $1=_st(self._class())._defaultCommitPathSt();
  1172. return $1;
  1173. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  1174. messageSends: ["defaultCommitPathSt", "class"]}),
  1175. smalltalk.LegacyPackageHandler);
  1176. smalltalk.addMethod(
  1177. smalltalk.method({
  1178. selector: "loadPackage:prefix:",
  1179. fn: function (packageName,aString){
  1180. var self=this;
  1181. var url;
  1182. return smalltalk.withContext(function($ctx1) {
  1183. var $1;
  1184. url=_st(_st(_st("/".__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
  1185. self._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(url),"type".__minus_gt("GET"),"dataType".__minus_gt("script"),"complete".__minus_gt((function(jqXHR,textStatus){
  1186. return smalltalk.withContext(function($ctx2) {
  1187. $1=_st(_st(jqXHR)._readyState()).__eq((4));
  1188. if(smalltalk.assert($1)){
  1189. return self._setupPackageNamed_prefix_(packageName,aString);
  1190. };
  1191. }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),"error".__minus_gt((function(){
  1192. return smalltalk.withContext(function($ctx2) {
  1193. return self._alert_("Could not load package at: ".__comma(url));
  1194. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1195. return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url},smalltalk.LegacyPackageHandler)})},
  1196. messageSends: [",", "ajax:", "->", "ifTrue:", "setupPackageNamed:prefix:", "=", "readyState", "alert:"]}),
  1197. smalltalk.LegacyPackageHandler);
  1198. smalltalk.addMethod(
  1199. smalltalk.method({
  1200. selector: "loadPackages:prefix:",
  1201. fn: function (aCollection,aString){
  1202. var self=this;
  1203. return smalltalk.withContext(function($ctx1) {
  1204. _st(aCollection)._do_((function(each){
  1205. return smalltalk.withContext(function($ctx2) {
  1206. return self._loadPackage_prefix_(each,aString);
  1207. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1208. return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler)})},
  1209. messageSends: ["do:", "loadPackage:prefix:"]}),
  1210. smalltalk.LegacyPackageHandler);
  1211. smalltalk.addMethod(
  1212. smalltalk.method({
  1213. selector: "setupPackageNamed:prefix:",
  1214. fn: function (packageName,aString){
  1215. var self=this;
  1216. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1217. return smalltalk.withContext(function($ctx1) {
  1218. var $1,$2;
  1219. $1=_st($Package())._named_(packageName);
  1220. _st($1)._setupClasses();
  1221. _st($1)._commitPathJs_(_st("/".__comma(aString)).__comma("/js"));
  1222. $2=_st($1)._commitPathSt_(_st("/".__comma(aString)).__comma("/st"));
  1223. return self}, function($ctx1) {$ctx1.fill(self,"setupPackageNamed:prefix:",{packageName:packageName,aString:aString},smalltalk.LegacyPackageHandler)})},
  1224. messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"]}),
  1225. smalltalk.LegacyPackageHandler);
  1226. smalltalk.LegacyPackageHandler.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "commitPathsFromLoader",
  1230. fn: function (){
  1231. var self=this;
  1232. return smalltalk.withContext(function($ctx1) {
  1233. var commitPath = typeof amber !== 'undefined' && amber.commitPath;
  1234. if (!commitPath) return;
  1235. if (commitPath.js) self._defaultCommitPathJs_(commitPath.js);
  1236. if (commitPath.st) self._defaultCommitPathSt_(commitPath.st);
  1237. ;
  1238. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.LegacyPackageHandler.klass)})},
  1239. messageSends: []}),
  1240. smalltalk.LegacyPackageHandler.klass);
  1241. smalltalk.addMethod(
  1242. smalltalk.method({
  1243. selector: "defaultCommitPathJs",
  1244. fn: function (){
  1245. var self=this;
  1246. return smalltalk.withContext(function($ctx1) {
  1247. var $2,$1;
  1248. $2=self["@defaultCommitPathJs"];
  1249. if(($receiver = $2) == nil || $receiver == undefined){
  1250. self["@defaultCommitPathJs"]="js";
  1251. $1=self["@defaultCommitPathJs"];
  1252. } else {
  1253. $1=$2;
  1254. };
  1255. return $1;
  1256. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs",{},smalltalk.LegacyPackageHandler.klass)})},
  1257. messageSends: ["ifNil:"]}),
  1258. smalltalk.LegacyPackageHandler.klass);
  1259. smalltalk.addMethod(
  1260. smalltalk.method({
  1261. selector: "defaultCommitPathJs:",
  1262. fn: function (aString){
  1263. var self=this;
  1264. return smalltalk.withContext(function($ctx1) {
  1265. self["@defaultCommitPathJs"]=aString;
  1266. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1267. messageSends: []}),
  1268. smalltalk.LegacyPackageHandler.klass);
  1269. smalltalk.addMethod(
  1270. smalltalk.method({
  1271. selector: "defaultCommitPathSt",
  1272. fn: function (){
  1273. var self=this;
  1274. return smalltalk.withContext(function($ctx1) {
  1275. var $2,$1;
  1276. $2=self["@defaultCommitPathSt"];
  1277. if(($receiver = $2) == nil || $receiver == undefined){
  1278. self["@defaultCommitPathSt"]="st";
  1279. $1=self["@defaultCommitPathSt"];
  1280. } else {
  1281. $1=$2;
  1282. };
  1283. return $1;
  1284. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt",{},smalltalk.LegacyPackageHandler.klass)})},
  1285. messageSends: ["ifNil:"]}),
  1286. smalltalk.LegacyPackageHandler.klass);
  1287. smalltalk.addMethod(
  1288. smalltalk.method({
  1289. selector: "defaultCommitPathSt:",
  1290. fn: function (aString){
  1291. var self=this;
  1292. return smalltalk.withContext(function($ctx1) {
  1293. self["@defaultCommitPathSt"]=aString;
  1294. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1295. messageSends: []}),
  1296. smalltalk.LegacyPackageHandler.klass);
  1297. smalltalk.addMethod(
  1298. smalltalk.method({
  1299. selector: "initialize",
  1300. fn: function (){
  1301. var self=this;
  1302. return smalltalk.withContext(function($ctx1) {
  1303. smalltalk.LegacyPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1304. self._registerFor_("unknown");
  1305. self._commitPathsFromLoader();
  1306. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.LegacyPackageHandler.klass)})},
  1307. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  1308. smalltalk.LegacyPackageHandler.klass);
  1309. smalltalk.addMethod(
  1310. smalltalk.method({
  1311. selector: "loadPackages:prefix:",
  1312. fn: function (aCollection,aString){
  1313. var self=this;
  1314. return smalltalk.withContext(function($ctx1) {
  1315. var $1;
  1316. $1=_st(self._new())._loadPackages_prefix_(aCollection,aString);
  1317. return $1;
  1318. }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1319. messageSends: ["loadPackages:prefix:", "new"]}),
  1320. smalltalk.LegacyPackageHandler.klass);
  1321. smalltalk.addMethod(
  1322. smalltalk.method({
  1323. selector: "resetCommitPaths",
  1324. fn: function (){
  1325. var self=this;
  1326. return smalltalk.withContext(function($ctx1) {
  1327. self["@defaultCommitPathJs"]=nil;
  1328. self["@defaultCommitPathSt"]=nil;
  1329. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.LegacyPackageHandler.klass)})},
  1330. messageSends: []}),
  1331. smalltalk.LegacyPackageHandler.klass);
  1332. smalltalk.addClass('PluggableExporter', smalltalk.Object, ['recipe'], 'Importer-Exporter');
  1333. smalltalk.addMethod(
  1334. smalltalk.method({
  1335. selector: "exportAllPackages",
  1336. fn: function (){
  1337. var self=this;
  1338. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1339. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1340. return smalltalk.withContext(function($ctx1) {
  1341. var $1;
  1342. $1=_st($String())._streamContents_((function(stream){
  1343. return smalltalk.withContext(function($ctx2) {
  1344. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(pkg){
  1345. return smalltalk.withContext(function($ctx3) {
  1346. return self._exportPackage_on_(pkg,stream);
  1347. }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx2)})}));
  1348. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  1349. return $1;
  1350. }, function($ctx1) {$ctx1.fill(self,"exportAllPackages",{},smalltalk.PluggableExporter)})},
  1351. messageSends: ["streamContents:", "do:", "exportPackage:on:", "packages", "current"]}),
  1352. smalltalk.PluggableExporter);
  1353. smalltalk.addMethod(
  1354. smalltalk.method({
  1355. selector: "exportPackage:on:",
  1356. fn: function (aPackage,aStream){
  1357. var self=this;
  1358. return smalltalk.withContext(function($ctx1) {
  1359. _st(self._interpreter())._interpret_for_on_(self._recipe(),aPackage,aStream);
  1360. return self}, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},smalltalk.PluggableExporter)})},
  1361. messageSends: ["interpret:for:on:", "recipe", "interpreter"]}),
  1362. smalltalk.PluggableExporter);
  1363. smalltalk.addMethod(
  1364. smalltalk.method({
  1365. selector: "interpreter",
  1366. fn: function (){
  1367. var self=this;
  1368. function $RecipeInterpreter(){return smalltalk.RecipeInterpreter||(typeof RecipeInterpreter=="undefined"?nil:RecipeInterpreter)}
  1369. return smalltalk.withContext(function($ctx1) {
  1370. var $1;
  1371. $1=_st($RecipeInterpreter())._new();
  1372. return $1;
  1373. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.PluggableExporter)})},
  1374. messageSends: ["new"]}),
  1375. smalltalk.PluggableExporter);
  1376. smalltalk.addMethod(
  1377. smalltalk.method({
  1378. selector: "recipe",
  1379. fn: function (){
  1380. var self=this;
  1381. return smalltalk.withContext(function($ctx1) {
  1382. var $1;
  1383. $1=self["@recipe"];
  1384. return $1;
  1385. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.PluggableExporter)})},
  1386. messageSends: []}),
  1387. smalltalk.PluggableExporter);
  1388. smalltalk.addMethod(
  1389. smalltalk.method({
  1390. selector: "recipe:",
  1391. fn: function (anArray){
  1392. var self=this;
  1393. return smalltalk.withContext(function($ctx1) {
  1394. self["@recipe"]=anArray;
  1395. return self}, function($ctx1) {$ctx1.fill(self,"recipe:",{anArray:anArray},smalltalk.PluggableExporter)})},
  1396. messageSends: []}),
  1397. smalltalk.PluggableExporter);
  1398. smalltalk.addMethod(
  1399. smalltalk.method({
  1400. selector: "forRecipe:",
  1401. fn: function (aRecipe){
  1402. var self=this;
  1403. return smalltalk.withContext(function($ctx1) {
  1404. var $2,$3,$1;
  1405. $2=self._new();
  1406. _st($2)._recipe_(aRecipe);
  1407. $3=_st($2)._yourself();
  1408. $1=$3;
  1409. return $1;
  1410. }, function($ctx1) {$ctx1.fill(self,"forRecipe:",{aRecipe:aRecipe},smalltalk.PluggableExporter.klass)})},
  1411. messageSends: ["recipe:", "new", "yourself"]}),
  1412. smalltalk.PluggableExporter.klass);
  1413. smalltalk.addMethod(
  1414. smalltalk.method({
  1415. selector: "ownClassesOfPackage:",
  1416. fn: function (package_){
  1417. var self=this;
  1418. return smalltalk.withContext(function($ctx1) {
  1419. var $1;
  1420. $1=_st(_st(package_)._sortedClasses())._asSet();
  1421. return $1;
  1422. }, function($ctx1) {$ctx1.fill(self,"ownClassesOfPackage:",{package_:package_},smalltalk.PluggableExporter.klass)})},
  1423. messageSends: ["asSet", "sortedClasses"]}),
  1424. smalltalk.PluggableExporter.klass);
  1425. smalltalk.addClass('RecipeInterpreter', smalltalk.Object, [], 'Importer-Exporter');
  1426. smalltalk.addMethod(
  1427. smalltalk.method({
  1428. selector: "interpret:for:on:",
  1429. fn: function (aRecipe,anObject,aStream){
  1430. var self=this;
  1431. var recipeStream;
  1432. return smalltalk.withContext(function($ctx1) {
  1433. recipeStream=_st(aRecipe)._readStream();
  1434. _st((function(){
  1435. return smalltalk.withContext(function($ctx2) {
  1436. return _st(recipeStream)._atEnd();
  1437. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  1438. return smalltalk.withContext(function($ctx2) {
  1439. return self._interpretStep_for_on_(_st(recipeStream)._next(),anObject,aStream);
  1440. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1441. return self}, function($ctx1) {$ctx1.fill(self,"interpret:for:on:",{aRecipe:aRecipe,anObject:anObject,aStream:aStream,recipeStream:recipeStream},smalltalk.RecipeInterpreter)})},
  1442. messageSends: ["readStream", "whileFalse:", "interpretStep:for:on:", "next", "atEnd"]}),
  1443. smalltalk.RecipeInterpreter);
  1444. smalltalk.addMethod(
  1445. smalltalk.method({
  1446. selector: "interpretStep:for:on:",
  1447. fn: function (aRecipeStep,anObject,aStream){
  1448. var self=this;
  1449. return smalltalk.withContext(function($ctx1) {
  1450. var $1,$2;
  1451. $1=_st(_st(aRecipeStep)._value()).__eq_eq(aRecipeStep);
  1452. if(smalltalk.assert($1)){
  1453. $2=self._interpretSubRecipe_for_on_(aRecipeStep,anObject,aStream);
  1454. return $2;
  1455. };
  1456. _st(_st(aRecipeStep)._key())._perform_withArguments_(_st(aRecipeStep)._value(),[anObject,aStream]);
  1457. return self}, function($ctx1) {$ctx1.fill(self,"interpretStep:for:on:",{aRecipeStep:aRecipeStep,anObject:anObject,aStream:aStream},smalltalk.RecipeInterpreter)})},
  1458. messageSends: ["ifTrue:", "interpretSubRecipe:for:on:", "==", "value", "perform:withArguments:", "key"]}),
  1459. smalltalk.RecipeInterpreter);
  1460. smalltalk.addMethod(
  1461. smalltalk.method({
  1462. selector: "interpretSubRecipe:for:on:",
  1463. fn: function (aRecipe,anObject,aStream){
  1464. var self=this;
  1465. var selection;
  1466. return smalltalk.withContext(function($ctx1) {
  1467. selection=_st(_st(_st(aRecipe)._first())._key())._perform_withArguments_(_st(_st(aRecipe)._first())._value(),[anObject]);
  1468. _st(selection)._do_((function(each){
  1469. return smalltalk.withContext(function($ctx2) {
  1470. return self._interpret_for_on_(_st(aRecipe)._allButFirst(),each,aStream);
  1471. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1472. return self}, function($ctx1) {$ctx1.fill(self,"interpretSubRecipe:for:on:",{aRecipe:aRecipe,anObject:anObject,aStream:aStream,selection:selection},smalltalk.RecipeInterpreter)})},
  1473. messageSends: ["perform:withArguments:", "value", "first", "key", "do:", "interpret:for:on:", "allButFirst"]}),
  1474. smalltalk.RecipeInterpreter);
  1475. smalltalk.addMethod(
  1476. smalltalk.method({
  1477. selector: "amdNamespace",
  1478. fn: function (){
  1479. var self=this;
  1480. return smalltalk.withContext(function($ctx1) {
  1481. return (self.transport && self.transport.amdNamespace) || nil;
  1482. return self}, function($ctx1) {$ctx1.fill(self,"amdNamespace",{},smalltalk.Package)})},
  1483. messageSends: []}),
  1484. smalltalk.Package);
  1485. smalltalk.addMethod(
  1486. smalltalk.method({
  1487. selector: "amdNamespace:",
  1488. fn: function (aString){
  1489. var self=this;
  1490. return smalltalk.withContext(function($ctx1) {
  1491. if (!self.transport) { self.transport = { type: 'amd' }; }
  1492. if (self.transport.type !== 'amd') { throw new Error('Package '+self._name()+' has transport type '+self.transport.type+', not "amd".'); }
  1493. self.transport.amdNamespace = aString;;
  1494. return self}, function($ctx1) {$ctx1.fill(self,"amdNamespace:",{aString:aString},smalltalk.Package)})},
  1495. messageSends: []}),
  1496. smalltalk.Package);
  1497. smalltalk.addMethod(
  1498. smalltalk.method({
  1499. selector: "commit",
  1500. fn: function (){
  1501. var self=this;
  1502. return smalltalk.withContext(function($ctx1) {
  1503. var $1;
  1504. $1=_st(self._transport())._commit_(self);
  1505. return $1;
  1506. }, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
  1507. messageSends: ["commit:", "transport"]}),
  1508. smalltalk.Package);
  1509. smalltalk.addMethod(
  1510. smalltalk.method({
  1511. selector: "commitPathJs",
  1512. fn: function (){
  1513. var self=this;
  1514. return smalltalk.withContext(function($ctx1) {
  1515. var $3,$2,$1;
  1516. $3=self["@extension"];
  1517. if(($receiver = $3) == nil || $receiver == undefined){
  1518. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1519. $2=self["@extension"];
  1520. } else {
  1521. $2=$3;
  1522. };
  1523. $1=_st($2)._at_ifAbsent_("commitPathJs",(function(){
  1524. return smalltalk.withContext(function($ctx2) {
  1525. return _st(self._transport())._commitPathJsFor_(self);
  1526. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1527. return $1;
  1528. }, function($ctx1) {$ctx1.fill(self,"commitPathJs",{},smalltalk.Package)})},
  1529. messageSends: ["at:ifAbsent:", "commitPathJsFor:", "transport", "ifNil:"]}),
  1530. smalltalk.Package);
  1531. smalltalk.addMethod(
  1532. smalltalk.method({
  1533. selector: "commitPathJs:",
  1534. fn: function (aString){
  1535. var self=this;
  1536. return smalltalk.withContext(function($ctx1) {
  1537. var $3,$2,$1;
  1538. $3=self["@extension"];
  1539. if(($receiver = $3) == nil || $receiver == undefined){
  1540. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1541. $2=self["@extension"];
  1542. } else {
  1543. $2=$3;
  1544. };
  1545. $1=_st($2)._at_put_("commitPathJs",aString);
  1546. return $1;
  1547. }, function($ctx1) {$ctx1.fill(self,"commitPathJs:",{aString:aString},smalltalk.Package)})},
  1548. messageSends: ["at:put:", "ifNil:"]}),
  1549. smalltalk.Package);
  1550. smalltalk.addMethod(
  1551. smalltalk.method({
  1552. selector: "commitPathSt",
  1553. fn: function (){
  1554. var self=this;
  1555. return smalltalk.withContext(function($ctx1) {
  1556. var $3,$2,$1;
  1557. $3=self["@extension"];
  1558. if(($receiver = $3) == nil || $receiver == undefined){
  1559. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1560. $2=self["@extension"];
  1561. } else {
  1562. $2=$3;
  1563. };
  1564. $1=_st($2)._at_ifAbsent_("commitPathSt",(function(){
  1565. return smalltalk.withContext(function($ctx2) {
  1566. return _st(self._transport())._commitPathStFor_(self);
  1567. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1568. return $1;
  1569. }, function($ctx1) {$ctx1.fill(self,"commitPathSt",{},smalltalk.Package)})},
  1570. messageSends: ["at:ifAbsent:", "commitPathStFor:", "transport", "ifNil:"]}),
  1571. smalltalk.Package);
  1572. smalltalk.addMethod(
  1573. smalltalk.method({
  1574. selector: "commitPathSt:",
  1575. fn: function (aString){
  1576. var self=this;
  1577. return smalltalk.withContext(function($ctx1) {
  1578. var $3,$2,$1;
  1579. $3=self["@extension"];
  1580. if(($receiver = $3) == nil || $receiver == undefined){
  1581. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1582. $2=self["@extension"];
  1583. } else {
  1584. $2=$3;
  1585. };
  1586. $1=_st($2)._at_put_("commitPathSt",aString);
  1587. return $1;
  1588. }, function($ctx1) {$ctx1.fill(self,"commitPathSt:",{aString:aString},smalltalk.Package)})},
  1589. messageSends: ["at:put:", "ifNil:"]}),
  1590. smalltalk.Package);
  1591. smalltalk.addMethod(
  1592. smalltalk.method({
  1593. selector: "transport",
  1594. fn: function (){
  1595. var self=this;
  1596. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  1597. return smalltalk.withContext(function($ctx1) {
  1598. var $1;
  1599. $1=_st($PackageHandler())._for_(self._transportType());
  1600. return $1;
  1601. }, function($ctx1) {$ctx1.fill(self,"transport",{},smalltalk.Package)})},
  1602. messageSends: ["for:", "transportType"]}),
  1603. smalltalk.Package);
  1604. smalltalk.addMethod(
  1605. smalltalk.method({
  1606. selector: "transportJson",
  1607. fn: function (){
  1608. var self=this;
  1609. return smalltalk.withContext(function($ctx1) {
  1610. return JSON.stringify(self.transport || null);;
  1611. return self}, function($ctx1) {$ctx1.fill(self,"transportJson",{},smalltalk.Package)})},
  1612. messageSends: []}),
  1613. smalltalk.Package);
  1614. smalltalk.addMethod(
  1615. smalltalk.method({
  1616. selector: "transportType",
  1617. fn: function (){
  1618. var self=this;
  1619. return smalltalk.withContext(function($ctx1) {
  1620. return (self.transport && self.transport.type) || 'unknown';;
  1621. return self}, function($ctx1) {$ctx1.fill(self,"transportType",{},smalltalk.Package)})},
  1622. messageSends: []}),
  1623. smalltalk.Package);
  1624. });