Importer-Exporter.deploy.js 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739
  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 $2,$1;
  1111. $2=_st(_st($Smalltalk())._current())._amdRequire();
  1112. if(($receiver = $2) == nil || $receiver == undefined){
  1113. $1=self._error_("AMD loader not present");
  1114. } else {
  1115. var require;
  1116. require=$receiver;
  1117. $1=_st(_st(require)._basicAt_("toUrl"))._value_(aString);
  1118. };
  1119. return $1;
  1120. }, function($ctx1) {$ctx1.fill(self,"toUrl:",{aString:aString},smalltalk.AmdPackageHandler)})},
  1121. messageSends: ["ifNil:ifNotNil:", "error:", "value:", "basicAt:", "amdRequire", "current"]}),
  1122. smalltalk.AmdPackageHandler);
  1123. smalltalk.addMethod(
  1124. smalltalk.method({
  1125. selector: "defaultNamespace",
  1126. fn: function (){
  1127. var self=this;
  1128. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1129. return smalltalk.withContext(function($ctx1) {
  1130. var $1;
  1131. $1=_st(_st($Smalltalk())._current())._defaultAMDNamespace();
  1132. return $1;
  1133. }, function($ctx1) {$ctx1.fill(self,"defaultNamespace",{},smalltalk.AmdPackageHandler.klass)})},
  1134. messageSends: ["defaultAMDNamespace", "current"]}),
  1135. smalltalk.AmdPackageHandler.klass);
  1136. smalltalk.addMethod(
  1137. smalltalk.method({
  1138. selector: "defaultNamespace:",
  1139. fn: function (aString){
  1140. var self=this;
  1141. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1142. return smalltalk.withContext(function($ctx1) {
  1143. _st(_st($Smalltalk())._current())._defaultAMDNamespace_(aString);
  1144. return self}, function($ctx1) {$ctx1.fill(self,"defaultNamespace:",{aString:aString},smalltalk.AmdPackageHandler.klass)})},
  1145. messageSends: ["defaultAMDNamespace:", "current"]}),
  1146. smalltalk.AmdPackageHandler.klass);
  1147. smalltalk.addMethod(
  1148. smalltalk.method({
  1149. selector: "initialize",
  1150. fn: function (){
  1151. var self=this;
  1152. return smalltalk.withContext(function($ctx1) {
  1153. smalltalk.AmdPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1154. self._registerFor_("amd");
  1155. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.AmdPackageHandler.klass)})},
  1156. messageSends: ["initialize", "registerFor:"]}),
  1157. smalltalk.AmdPackageHandler.klass);
  1158. smalltalk.addMethod(
  1159. smalltalk.method({
  1160. selector: "resetCommitPaths",
  1161. fn: function (){
  1162. var self=this;
  1163. return smalltalk.withContext(function($ctx1) {
  1164. self["@defaultNamespace"]=nil;
  1165. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.AmdPackageHandler.klass)})},
  1166. messageSends: []}),
  1167. smalltalk.AmdPackageHandler.klass);
  1168. smalltalk.addClass('LegacyPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  1169. smalltalk.addMethod(
  1170. smalltalk.method({
  1171. selector: "commitChannels",
  1172. fn: function (){
  1173. var self=this;
  1174. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  1175. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  1176. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  1177. return smalltalk.withContext(function($ctx1) {
  1178. var $1;
  1179. $1=[(function(pkg){
  1180. return smalltalk.withContext(function($ctx2) {
  1181. return _st(_st(_st($Exporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  1182. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  1183. return smalltalk.withContext(function($ctx2) {
  1184. return _st(_st(_st($StrippedExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  1185. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  1186. return smalltalk.withContext(function($ctx2) {
  1187. return _st(_st(_st($ChunkExporter())._default())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  1188. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  1189. return $1;
  1190. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.LegacyPackageHandler)})},
  1191. messageSends: ["->", ",", "name", "commitPathJs", "recipe", "default", "commitPathSt"]}),
  1192. smalltalk.LegacyPackageHandler);
  1193. smalltalk.addMethod(
  1194. smalltalk.method({
  1195. selector: "commitPathJsFor:",
  1196. fn: function (aPackage){
  1197. var self=this;
  1198. return smalltalk.withContext(function($ctx1) {
  1199. var $1;
  1200. $1=_st(self._class())._defaultCommitPathJs();
  1201. return $1;
  1202. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  1203. messageSends: ["defaultCommitPathJs", "class"]}),
  1204. smalltalk.LegacyPackageHandler);
  1205. smalltalk.addMethod(
  1206. smalltalk.method({
  1207. selector: "commitPathStFor:",
  1208. fn: function (aPackage){
  1209. var self=this;
  1210. return smalltalk.withContext(function($ctx1) {
  1211. var $1;
  1212. $1=_st(self._class())._defaultCommitPathSt();
  1213. return $1;
  1214. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  1215. messageSends: ["defaultCommitPathSt", "class"]}),
  1216. smalltalk.LegacyPackageHandler);
  1217. smalltalk.addMethod(
  1218. smalltalk.method({
  1219. selector: "loadPackage:prefix:",
  1220. fn: function (packageName,aString){
  1221. var self=this;
  1222. var url;
  1223. return smalltalk.withContext(function($ctx1) {
  1224. var $1;
  1225. url=_st(_st(_st("/".__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
  1226. self._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(url),"type".__minus_gt("GET"),"dataType".__minus_gt("script"),"complete".__minus_gt((function(jqXHR,textStatus){
  1227. return smalltalk.withContext(function($ctx2) {
  1228. $1=_st(_st(jqXHR)._readyState()).__eq((4));
  1229. if(smalltalk.assert($1)){
  1230. return self._setupPackageNamed_prefix_(packageName,aString);
  1231. };
  1232. }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),"error".__minus_gt((function(){
  1233. return smalltalk.withContext(function($ctx2) {
  1234. return self._alert_("Could not load package at: ".__comma(url));
  1235. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1236. return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url},smalltalk.LegacyPackageHandler)})},
  1237. messageSends: [",", "ajax:", "->", "ifTrue:", "setupPackageNamed:prefix:", "=", "readyState", "alert:"]}),
  1238. smalltalk.LegacyPackageHandler);
  1239. smalltalk.addMethod(
  1240. smalltalk.method({
  1241. selector: "loadPackages:prefix:",
  1242. fn: function (aCollection,aString){
  1243. var self=this;
  1244. return smalltalk.withContext(function($ctx1) {
  1245. _st(aCollection)._do_((function(each){
  1246. return smalltalk.withContext(function($ctx2) {
  1247. return self._loadPackage_prefix_(each,aString);
  1248. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1249. return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler)})},
  1250. messageSends: ["do:", "loadPackage:prefix:"]}),
  1251. smalltalk.LegacyPackageHandler);
  1252. smalltalk.addMethod(
  1253. smalltalk.method({
  1254. selector: "setupPackageNamed:prefix:",
  1255. fn: function (packageName,aString){
  1256. var self=this;
  1257. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1258. return smalltalk.withContext(function($ctx1) {
  1259. var $1,$2;
  1260. $1=_st($Package())._named_(packageName);
  1261. _st($1)._setupClasses();
  1262. _st($1)._commitPathJs_(_st("/".__comma(aString)).__comma("/js"));
  1263. $2=_st($1)._commitPathSt_(_st("/".__comma(aString)).__comma("/st"));
  1264. return self}, function($ctx1) {$ctx1.fill(self,"setupPackageNamed:prefix:",{packageName:packageName,aString:aString},smalltalk.LegacyPackageHandler)})},
  1265. messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"]}),
  1266. smalltalk.LegacyPackageHandler);
  1267. smalltalk.LegacyPackageHandler.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  1268. smalltalk.addMethod(
  1269. smalltalk.method({
  1270. selector: "commitPathsFromLoader",
  1271. fn: function (){
  1272. var self=this;
  1273. return smalltalk.withContext(function($ctx1) {
  1274. var commitPath = typeof amber !== 'undefined' && amber.commitPath;
  1275. if (!commitPath) return;
  1276. if (commitPath.js) self._defaultCommitPathJs_(commitPath.js);
  1277. if (commitPath.st) self._defaultCommitPathSt_(commitPath.st);
  1278. ;
  1279. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.LegacyPackageHandler.klass)})},
  1280. messageSends: []}),
  1281. smalltalk.LegacyPackageHandler.klass);
  1282. smalltalk.addMethod(
  1283. smalltalk.method({
  1284. selector: "defaultCommitPathJs",
  1285. fn: function (){
  1286. var self=this;
  1287. return smalltalk.withContext(function($ctx1) {
  1288. var $2,$1;
  1289. $2=self["@defaultCommitPathJs"];
  1290. if(($receiver = $2) == nil || $receiver == undefined){
  1291. self["@defaultCommitPathJs"]="js";
  1292. $1=self["@defaultCommitPathJs"];
  1293. } else {
  1294. $1=$2;
  1295. };
  1296. return $1;
  1297. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs",{},smalltalk.LegacyPackageHandler.klass)})},
  1298. messageSends: ["ifNil:"]}),
  1299. smalltalk.LegacyPackageHandler.klass);
  1300. smalltalk.addMethod(
  1301. smalltalk.method({
  1302. selector: "defaultCommitPathJs:",
  1303. fn: function (aString){
  1304. var self=this;
  1305. return smalltalk.withContext(function($ctx1) {
  1306. self["@defaultCommitPathJs"]=aString;
  1307. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1308. messageSends: []}),
  1309. smalltalk.LegacyPackageHandler.klass);
  1310. smalltalk.addMethod(
  1311. smalltalk.method({
  1312. selector: "defaultCommitPathSt",
  1313. fn: function (){
  1314. var self=this;
  1315. return smalltalk.withContext(function($ctx1) {
  1316. var $2,$1;
  1317. $2=self["@defaultCommitPathSt"];
  1318. if(($receiver = $2) == nil || $receiver == undefined){
  1319. self["@defaultCommitPathSt"]="st";
  1320. $1=self["@defaultCommitPathSt"];
  1321. } else {
  1322. $1=$2;
  1323. };
  1324. return $1;
  1325. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt",{},smalltalk.LegacyPackageHandler.klass)})},
  1326. messageSends: ["ifNil:"]}),
  1327. smalltalk.LegacyPackageHandler.klass);
  1328. smalltalk.addMethod(
  1329. smalltalk.method({
  1330. selector: "defaultCommitPathSt:",
  1331. fn: function (aString){
  1332. var self=this;
  1333. return smalltalk.withContext(function($ctx1) {
  1334. self["@defaultCommitPathSt"]=aString;
  1335. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1336. messageSends: []}),
  1337. smalltalk.LegacyPackageHandler.klass);
  1338. smalltalk.addMethod(
  1339. smalltalk.method({
  1340. selector: "initialize",
  1341. fn: function (){
  1342. var self=this;
  1343. return smalltalk.withContext(function($ctx1) {
  1344. smalltalk.LegacyPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1345. self._registerFor_("unknown");
  1346. self._commitPathsFromLoader();
  1347. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.LegacyPackageHandler.klass)})},
  1348. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  1349. smalltalk.LegacyPackageHandler.klass);
  1350. smalltalk.addMethod(
  1351. smalltalk.method({
  1352. selector: "loadPackages:prefix:",
  1353. fn: function (aCollection,aString){
  1354. var self=this;
  1355. return smalltalk.withContext(function($ctx1) {
  1356. var $1;
  1357. $1=_st(self._new())._loadPackages_prefix_(aCollection,aString);
  1358. return $1;
  1359. }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1360. messageSends: ["loadPackages:prefix:", "new"]}),
  1361. smalltalk.LegacyPackageHandler.klass);
  1362. smalltalk.addMethod(
  1363. smalltalk.method({
  1364. selector: "resetCommitPaths",
  1365. fn: function (){
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) {
  1368. self["@defaultCommitPathJs"]=nil;
  1369. self["@defaultCommitPathSt"]=nil;
  1370. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.LegacyPackageHandler.klass)})},
  1371. messageSends: []}),
  1372. smalltalk.LegacyPackageHandler.klass);
  1373. smalltalk.addClass('PluggableExporter', smalltalk.Object, ['recipe'], 'Importer-Exporter');
  1374. smalltalk.addMethod(
  1375. smalltalk.method({
  1376. selector: "exportAllPackages",
  1377. fn: function (){
  1378. var self=this;
  1379. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1380. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1381. return smalltalk.withContext(function($ctx1) {
  1382. var $1;
  1383. $1=_st($String())._streamContents_((function(stream){
  1384. return smalltalk.withContext(function($ctx2) {
  1385. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(pkg){
  1386. return smalltalk.withContext(function($ctx3) {
  1387. return self._exportPackage_on_(pkg,stream);
  1388. }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx2)})}));
  1389. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  1390. return $1;
  1391. }, function($ctx1) {$ctx1.fill(self,"exportAllPackages",{},smalltalk.PluggableExporter)})},
  1392. messageSends: ["streamContents:", "do:", "exportPackage:on:", "packages", "current"]}),
  1393. smalltalk.PluggableExporter);
  1394. smalltalk.addMethod(
  1395. smalltalk.method({
  1396. selector: "exportPackage:on:",
  1397. fn: function (aPackage,aStream){
  1398. var self=this;
  1399. return smalltalk.withContext(function($ctx1) {
  1400. _st(self._interpreter())._interpret_for_on_(self._recipe(),aPackage,aStream);
  1401. return self}, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},smalltalk.PluggableExporter)})},
  1402. messageSends: ["interpret:for:on:", "recipe", "interpreter"]}),
  1403. smalltalk.PluggableExporter);
  1404. smalltalk.addMethod(
  1405. smalltalk.method({
  1406. selector: "interpreter",
  1407. fn: function (){
  1408. var self=this;
  1409. function $ExportRecipeInterpreter(){return smalltalk.ExportRecipeInterpreter||(typeof ExportRecipeInterpreter=="undefined"?nil:ExportRecipeInterpreter)}
  1410. return smalltalk.withContext(function($ctx1) {
  1411. var $1;
  1412. $1=_st($ExportRecipeInterpreter())._new();
  1413. return $1;
  1414. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.PluggableExporter)})},
  1415. messageSends: ["new"]}),
  1416. smalltalk.PluggableExporter);
  1417. smalltalk.addMethod(
  1418. smalltalk.method({
  1419. selector: "recipe",
  1420. fn: function (){
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) {
  1423. var $1;
  1424. $1=self["@recipe"];
  1425. return $1;
  1426. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.PluggableExporter)})},
  1427. messageSends: []}),
  1428. smalltalk.PluggableExporter);
  1429. smalltalk.addMethod(
  1430. smalltalk.method({
  1431. selector: "recipe:",
  1432. fn: function (anArray){
  1433. var self=this;
  1434. return smalltalk.withContext(function($ctx1) {
  1435. self["@recipe"]=anArray;
  1436. return self}, function($ctx1) {$ctx1.fill(self,"recipe:",{anArray:anArray},smalltalk.PluggableExporter)})},
  1437. messageSends: []}),
  1438. smalltalk.PluggableExporter);
  1439. smalltalk.addMethod(
  1440. smalltalk.method({
  1441. selector: "forRecipe:",
  1442. fn: function (aRecipe){
  1443. var self=this;
  1444. return smalltalk.withContext(function($ctx1) {
  1445. var $2,$3,$1;
  1446. $2=self._new();
  1447. _st($2)._recipe_(aRecipe);
  1448. $3=_st($2)._yourself();
  1449. $1=$3;
  1450. return $1;
  1451. }, function($ctx1) {$ctx1.fill(self,"forRecipe:",{aRecipe:aRecipe},smalltalk.PluggableExporter.klass)})},
  1452. messageSends: ["recipe:", "new", "yourself"]}),
  1453. smalltalk.PluggableExporter.klass);
  1454. smalltalk.addMethod(
  1455. smalltalk.method({
  1456. selector: "ownClassesOfPackage:",
  1457. fn: function (package_){
  1458. var self=this;
  1459. return smalltalk.withContext(function($ctx1) {
  1460. var $1;
  1461. $1=_st(_st(package_)._sortedClasses())._asSet();
  1462. return $1;
  1463. }, function($ctx1) {$ctx1.fill(self,"ownClassesOfPackage:",{package_:package_},smalltalk.PluggableExporter.klass)})},
  1464. messageSends: ["asSet", "sortedClasses"]}),
  1465. smalltalk.PluggableExporter.klass);
  1466. smalltalk.addMethod(
  1467. smalltalk.method({
  1468. selector: "amdNamespace",
  1469. fn: function (){
  1470. var self=this;
  1471. return smalltalk.withContext(function($ctx1) {
  1472. return (self.transport && self.transport.amdNamespace) || nil;
  1473. return self}, function($ctx1) {$ctx1.fill(self,"amdNamespace",{},smalltalk.Package)})},
  1474. messageSends: []}),
  1475. smalltalk.Package);
  1476. smalltalk.addMethod(
  1477. smalltalk.method({
  1478. selector: "amdNamespace:",
  1479. fn: function (aString){
  1480. var self=this;
  1481. return smalltalk.withContext(function($ctx1) {
  1482. if (!self.transport) { self.transport = { type: 'amd' }; }
  1483. if (self.transport.type !== 'amd') { throw new Error('Package '+self._name()+' has transport type '+self.transport.type+', not "amd".'); }
  1484. self.transport.amdNamespace = aString;
  1485. ;
  1486. return self}, function($ctx1) {$ctx1.fill(self,"amdNamespace:",{aString:aString},smalltalk.Package)})},
  1487. messageSends: []}),
  1488. smalltalk.Package);
  1489. smalltalk.addMethod(
  1490. smalltalk.method({
  1491. selector: "commit",
  1492. fn: function (){
  1493. var self=this;
  1494. return smalltalk.withContext(function($ctx1) {
  1495. var $1;
  1496. $1=_st(self._handler())._commit_(self);
  1497. return $1;
  1498. }, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
  1499. messageSends: ["commit:", "handler"]}),
  1500. smalltalk.Package);
  1501. smalltalk.addMethod(
  1502. smalltalk.method({
  1503. selector: "commitPathJs",
  1504. fn: function (){
  1505. var self=this;
  1506. return smalltalk.withContext(function($ctx1) {
  1507. var $3,$2,$1;
  1508. $3=self["@extension"];
  1509. if(($receiver = $3) == nil || $receiver == undefined){
  1510. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1511. $2=self["@extension"];
  1512. } else {
  1513. $2=$3;
  1514. };
  1515. $1=_st($2)._at_ifAbsent_("commitPathJs",(function(){
  1516. return smalltalk.withContext(function($ctx2) {
  1517. return _st(self._handler())._commitPathJsFor_(self);
  1518. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1519. return $1;
  1520. }, function($ctx1) {$ctx1.fill(self,"commitPathJs",{},smalltalk.Package)})},
  1521. messageSends: ["at:ifAbsent:", "commitPathJsFor:", "handler", "ifNil:"]}),
  1522. smalltalk.Package);
  1523. smalltalk.addMethod(
  1524. smalltalk.method({
  1525. selector: "commitPathJs:",
  1526. fn: function (aString){
  1527. var self=this;
  1528. return smalltalk.withContext(function($ctx1) {
  1529. var $3,$2,$1;
  1530. $3=self["@extension"];
  1531. if(($receiver = $3) == nil || $receiver == undefined){
  1532. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1533. $2=self["@extension"];
  1534. } else {
  1535. $2=$3;
  1536. };
  1537. $1=_st($2)._at_put_("commitPathJs",aString);
  1538. return $1;
  1539. }, function($ctx1) {$ctx1.fill(self,"commitPathJs:",{aString:aString},smalltalk.Package)})},
  1540. messageSends: ["at:put:", "ifNil:"]}),
  1541. smalltalk.Package);
  1542. smalltalk.addMethod(
  1543. smalltalk.method({
  1544. selector: "commitPathSt",
  1545. fn: function (){
  1546. var self=this;
  1547. return smalltalk.withContext(function($ctx1) {
  1548. var $3,$2,$1;
  1549. $3=self["@extension"];
  1550. if(($receiver = $3) == nil || $receiver == undefined){
  1551. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1552. $2=self["@extension"];
  1553. } else {
  1554. $2=$3;
  1555. };
  1556. $1=_st($2)._at_ifAbsent_("commitPathSt",(function(){
  1557. return smalltalk.withContext(function($ctx2) {
  1558. return _st(self._handler())._commitPathStFor_(self);
  1559. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1560. return $1;
  1561. }, function($ctx1) {$ctx1.fill(self,"commitPathSt",{},smalltalk.Package)})},
  1562. messageSends: ["at:ifAbsent:", "commitPathStFor:", "handler", "ifNil:"]}),
  1563. smalltalk.Package);
  1564. smalltalk.addMethod(
  1565. smalltalk.method({
  1566. selector: "commitPathSt:",
  1567. fn: function (aString){
  1568. var self=this;
  1569. return smalltalk.withContext(function($ctx1) {
  1570. var $3,$2,$1;
  1571. $3=self["@extension"];
  1572. if(($receiver = $3) == nil || $receiver == undefined){
  1573. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1574. $2=self["@extension"];
  1575. } else {
  1576. $2=$3;
  1577. };
  1578. $1=_st($2)._at_put_("commitPathSt",aString);
  1579. return $1;
  1580. }, function($ctx1) {$ctx1.fill(self,"commitPathSt:",{aString:aString},smalltalk.Package)})},
  1581. messageSends: ["at:put:", "ifNil:"]}),
  1582. smalltalk.Package);
  1583. smalltalk.addMethod(
  1584. smalltalk.method({
  1585. selector: "handler",
  1586. fn: function (){
  1587. var self=this;
  1588. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  1589. return smalltalk.withContext(function($ctx1) {
  1590. var $1;
  1591. $1=_st($PackageHandler())._for_(self._transportType());
  1592. return $1;
  1593. }, function($ctx1) {$ctx1.fill(self,"handler",{},smalltalk.Package)})},
  1594. messageSends: ["for:", "transportType"]}),
  1595. smalltalk.Package);
  1596. smalltalk.addMethod(
  1597. smalltalk.method({
  1598. selector: "transportJson",
  1599. fn: function (){
  1600. var self=this;
  1601. return smalltalk.withContext(function($ctx1) {
  1602. return JSON.stringify(self.transport || null);;
  1603. return self}, function($ctx1) {$ctx1.fill(self,"transportJson",{},smalltalk.Package)})},
  1604. messageSends: []}),
  1605. smalltalk.Package);
  1606. smalltalk.addMethod(
  1607. smalltalk.method({
  1608. selector: "transportType",
  1609. fn: function (){
  1610. var self=this;
  1611. return smalltalk.withContext(function($ctx1) {
  1612. return (self.transport && self.transport.type) || 'unknown';;
  1613. return self}, function($ctx1) {$ctx1.fill(self,"transportType",{},smalltalk.Package)})},
  1614. messageSends: []}),
  1615. smalltalk.Package);
  1616. });