1
0

Importer-Exporter.deploy.js 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376
  1. (function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Importer-Exporter');
  3. smalltalk.addClass('ChunkExporter', smalltalk.Object, [], 'Importer-Exporter');
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "chunkEscape:",
  7. fn: function (aString){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) {
  10. var $1;
  11. $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
  12. return $1;
  13. }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString},smalltalk.ChunkExporter.klass)})},
  14. messageSends: ["trimBoth", "replace:with:"]}),
  15. smalltalk.ChunkExporter.klass);
  16. smalltalk.addMethod(
  17. smalltalk.method({
  18. selector: "classNameFor:",
  19. fn: function (aClass){
  20. var self=this;
  21. return smalltalk.withContext(function($ctx1) {
  22. var $2,$3,$1;
  23. $2=_st(aClass)._isMetaclass();
  24. if(smalltalk.assert($2)){
  25. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(" class");
  26. } else {
  27. $3=_st(aClass)._isNil();
  28. if(smalltalk.assert($3)){
  29. $1="nil";
  30. } else {
  31. $1=_st(aClass)._name();
  32. };
  33. };
  34. return $1;
  35. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.ChunkExporter.klass)})},
  36. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"]}),
  37. smalltalk.ChunkExporter.klass);
  38. smalltalk.addMethod(
  39. smalltalk.method({
  40. selector: "exportCategoryEpilogueOf:on:",
  41. fn: function (category,aStream){
  42. var self=this;
  43. return smalltalk.withContext(function($ctx1) {
  44. var $1,$2;
  45. $1=aStream;
  46. _st($1)._nextPutAll_(" !");
  47. _st($1)._lf();
  48. $2=_st($1)._lf();
  49. return self}, function($ctx1) {$ctx1.fill(self,"exportCategoryEpilogueOf:on:",{category:category,aStream:aStream},smalltalk.ChunkExporter.klass)})},
  50. messageSends: ["nextPutAll:", "lf"]}),
  51. smalltalk.ChunkExporter.klass);
  52. smalltalk.addMethod(
  53. smalltalk.method({
  54. selector: "exportCategoryPrologueOf:on:",
  55. fn: function (category,aStream){
  56. var self=this;
  57. return smalltalk.withContext(function($ctx1) {
  58. var $1,$2;
  59. $1=aStream;
  60. _st($1)._nextPutAll_("!".__comma(self._classNameFor_(_st(category)._at_("class"))));
  61. $2=_st($1)._nextPutAll_(_st(" methodsFor: '".__comma(_st(category)._at_("name"))).__comma("'!"));
  62. return self}, function($ctx1) {$ctx1.fill(self,"exportCategoryPrologueOf:on:",{category:category,aStream:aStream},smalltalk.ChunkExporter.klass)})},
  63. messageSends: ["nextPutAll:", ",", "classNameFor:", "at:"]}),
  64. smalltalk.ChunkExporter.klass);
  65. smalltalk.addMethod(
  66. smalltalk.method({
  67. selector: "exportDefinitionOf:on:",
  68. fn: function (aClass,aStream){
  69. var self=this;
  70. return smalltalk.withContext(function($ctx1) {
  71. var $1,$2,$3,$4,$5,$6,$7;
  72. $1=aStream;
  73. _st($1)._nextPutAll_(self._classNameFor_(_st(aClass)._superclass()));
  74. _st($1)._nextPutAll_(" subclass: #".__comma(self._classNameFor_(aClass)));
  75. _st($1)._lf();
  76. _st($1)._tab();
  77. $2=_st($1)._nextPutAll_("instanceVariableNames: '");
  78. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  79. return smalltalk.withContext(function($ctx2) {
  80. return _st(aStream)._nextPutAll_(each);
  81. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  82. return smalltalk.withContext(function($ctx2) {
  83. return _st(aStream)._nextPutAll_(" ");
  84. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  85. $3=aStream;
  86. _st($3)._nextPutAll_("'");
  87. _st($3)._lf();
  88. _st($3)._tab();
  89. _st($3)._nextPutAll_(_st("package: '".__comma(_st(aClass)._category())).__comma("'!"));
  90. $4=_st($3)._lf();
  91. $5=_st(_st(aClass)._comment())._notEmpty();
  92. if(smalltalk.assert($5)){
  93. $6=aStream;
  94. _st($6)._nextPutAll_(_st("!".__comma(self._classNameFor_(aClass))).__comma(" commentStamp!"));
  95. _st($6)._lf();
  96. _st($6)._nextPutAll_(_st(self._chunkEscape_(_st(aClass)._comment())).__comma("!"));
  97. $7=_st($6)._lf();
  98. $7;
  99. };
  100. _st(aStream)._lf();
  101. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.ChunkExporter.klass)})},
  102. messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "tab", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"]}),
  103. smalltalk.ChunkExporter.klass);
  104. smalltalk.addMethod(
  105. smalltalk.method({
  106. selector: "exportMetaDefinitionOf:on:",
  107. fn: function (aClass,aStream){
  108. var self=this;
  109. return smalltalk.withContext(function($ctx1) {
  110. var $1,$2,$3,$4,$5;
  111. $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
  112. if(! smalltalk.assert($1)){
  113. $2=aStream;
  114. _st($2)._nextPutAll_(self._classNameFor_(_st(aClass)._class()));
  115. $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
  116. $3;
  117. _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
  118. return smalltalk.withContext(function($ctx2) {
  119. return _st(aStream)._nextPutAll_(each);
  120. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  121. return smalltalk.withContext(function($ctx2) {
  122. return _st(aStream)._nextPutAll_(" ");
  123. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  124. $4=aStream;
  125. _st($4)._nextPutAll_("'!");
  126. _st($4)._lf();
  127. $5=_st($4)._lf();
  128. $5;
  129. };
  130. return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.ChunkExporter.klass)})},
  131. messageSends: ["ifFalse:", "nextPutAll:", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "lf", "isEmpty"]}),
  132. smalltalk.ChunkExporter.klass);
  133. smalltalk.addMethod(
  134. smalltalk.method({
  135. selector: "exportMethod:on:",
  136. fn: function (aMethod,aStream){
  137. var self=this;
  138. return smalltalk.withContext(function($ctx1) {
  139. var $1,$2;
  140. $1=aStream;
  141. _st($1)._lf();
  142. _st($1)._lf();
  143. _st($1)._nextPutAll_(self._chunkEscape_(_st(aMethod)._source()));
  144. _st($1)._lf();
  145. $2=_st($1)._nextPutAll_("!");
  146. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.ChunkExporter.klass)})},
  147. messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"]}),
  148. smalltalk.ChunkExporter.klass);
  149. smalltalk.addMethod(
  150. smalltalk.method({
  151. selector: "exportPackageDefinitionOf:on:",
  152. fn: function (package_,aStream){
  153. var self=this;
  154. return smalltalk.withContext(function($ctx1) {
  155. var $1,$2;
  156. $1=aStream;
  157. _st($1)._nextPutAll_(_st("Smalltalk current createPackage: '".__comma(_st(package_)._name())).__comma("'!"));
  158. $2=_st($1)._lf();
  159. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream},smalltalk.ChunkExporter.klass)})},
  160. messageSends: ["nextPutAll:", ",", "name", "lf"]}),
  161. smalltalk.ChunkExporter.klass);
  162. smalltalk.addMethod(
  163. smalltalk.method({
  164. selector: "extensionCategoriesOfPackage:",
  165. fn: function (package_){
  166. var self=this;
  167. var name,map,result;
  168. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  169. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  170. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  171. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  172. return smalltalk.withContext(function($ctx1) {
  173. var $1,$2;
  174. name=_st(package_)._name();
  175. result=_st($OrderedCollection())._new();
  176. _st(_st($Package())._sortedClasses_(_st(_st($Smalltalk())._current())._classes()))._do_((function(each){
  177. return smalltalk.withContext(function($ctx2) {
  178. return _st([each,_st(each)._class()])._do_((function(aClass){
  179. return smalltalk.withContext(function($ctx3) {
  180. map=_st($Dictionary())._new();
  181. map;
  182. _st(aClass)._protocolsDo_((function(category,methods){
  183. return smalltalk.withContext(function($ctx4) {
  184. $1=_st(category)._match_("^\x5c*".__comma(name));
  185. if(smalltalk.assert($1)){
  186. return _st(map)._at_put_(category,methods);
  187. };
  188. }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx3)})}));
  189. return _st(result)._addAll_(_st(_st(_st(map)._keys())._sorted_((function(a,b){
  190. return smalltalk.withContext(function($ctx4) {
  191. return _st(a).__lt_eq(b);
  192. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._collect_((function(category){
  193. return smalltalk.withContext(function($ctx4) {
  194. return smalltalk.HashedCollection._from_(["methods".__minus_gt(_st(map)._at_(category)),"name".__minus_gt(category),"class".__minus_gt(aClass)]);
  195. }, function($ctx4) {$ctx4.fillBlock({category:category},$ctx3)})})));
  196. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
  197. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  198. $2=result;
  199. return $2;
  200. }, function($ctx1) {$ctx1.fill(self,"extensionCategoriesOfPackage:",{package_:package_,name:name,map:map,result:result},smalltalk.ChunkExporter.klass)})},
  201. messageSends: ["name", "new", "do:", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "addAll:", "collect:", "->", "at:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"]}),
  202. smalltalk.ChunkExporter.klass);
  203. smalltalk.addMethod(
  204. smalltalk.method({
  205. selector: "methodsOfCategory:",
  206. fn: function (category){
  207. var self=this;
  208. return smalltalk.withContext(function($ctx1) {
  209. var $1;
  210. $1=_st(_st(category)._at_("methods"))._sorted_((function(a,b){
  211. return smalltalk.withContext(function($ctx2) {
  212. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  213. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  214. return $1;
  215. }, function($ctx1) {$ctx1.fill(self,"methodsOfCategory:",{category:category},smalltalk.ChunkExporter.klass)})},
  216. messageSends: ["sorted:", "<=", "selector", "at:"]}),
  217. smalltalk.ChunkExporter.klass);
  218. smalltalk.addMethod(
  219. smalltalk.method({
  220. selector: "ownCategoriesOfClass:",
  221. fn: function (aClass){
  222. var self=this;
  223. var map;
  224. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  225. return smalltalk.withContext(function($ctx1) {
  226. var $1,$2;
  227. map=_st($Dictionary())._new();
  228. _st(aClass)._protocolsDo_((function(category,methods){
  229. return smalltalk.withContext(function($ctx2) {
  230. $1=_st(category)._match_("^\x5c*");
  231. if(! smalltalk.assert($1)){
  232. return _st(map)._at_put_(category,methods);
  233. };
  234. }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
  235. $2=_st(_st(_st(map)._keys())._sorted_((function(a,b){
  236. return smalltalk.withContext(function($ctx2) {
  237. return _st(a).__lt_eq(b);
  238. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._collect_((function(category){
  239. return smalltalk.withContext(function($ctx2) {
  240. return smalltalk.HashedCollection._from_(["methods".__minus_gt(_st(map)._at_(category)),"name".__minus_gt(category),"class".__minus_gt(aClass)]);
  241. }, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1)})}));
  242. return $2;
  243. }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfClass:",{aClass:aClass,map:map},smalltalk.ChunkExporter.klass)})},
  244. messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "collect:", "->", "at:", "sorted:", "<=", "keys"]}),
  245. smalltalk.ChunkExporter.klass);
  246. smalltalk.addMethod(
  247. smalltalk.method({
  248. selector: "ownCategoriesOfMetaClass:",
  249. fn: function (aClass){
  250. var self=this;
  251. return smalltalk.withContext(function($ctx1) {
  252. var $1;
  253. $1=self._ownCategoriesOfClass_(_st(aClass)._class());
  254. return $1;
  255. }, function($ctx1) {$ctx1.fill(self,"ownCategoriesOfMetaClass:",{aClass:aClass},smalltalk.ChunkExporter.klass)})},
  256. messageSends: ["ownCategoriesOfClass:", "class"]}),
  257. smalltalk.ChunkExporter.klass);
  258. smalltalk.addMethod(
  259. smalltalk.method({
  260. selector: "recipe",
  261. fn: function (){
  262. var self=this;
  263. var exportCategoryRecipe;
  264. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  265. return smalltalk.withContext(function($ctx1) {
  266. var $1;
  267. exportCategoryRecipe=[self.__minus_gt("exportCategoryPrologueOf:on:"),[self.__minus_gt("methodsOfCategory:"),self.__minus_gt("exportMethod:on:")],self.__minus_gt("exportCategoryEpilogueOf:on:")];
  268. $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)];
  269. return $1;
  270. }, function($ctx1) {$ctx1.fill(self,"recipe",{exportCategoryRecipe:exportCategoryRecipe},smalltalk.ChunkExporter.klass)})},
  271. messageSends: ["->", ","]}),
  272. smalltalk.ChunkExporter.klass);
  273. smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "nextChunk",
  277. fn: function (){
  278. var self=this;
  279. var char,result,chunk;
  280. return smalltalk.withContext(function($ctx1) {
  281. var $1,$2,$3;
  282. var $early={};
  283. try {
  284. result=""._writeStream();
  285. _st((function(){
  286. return smalltalk.withContext(function($ctx2) {
  287. char=_st(self["@stream"])._next();
  288. char;
  289. return _st(char)._notNil();
  290. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  291. return smalltalk.withContext(function($ctx2) {
  292. $1=_st(char).__eq("!");
  293. if(smalltalk.assert($1)){
  294. $2=_st(_st(self["@stream"])._peek()).__eq("!");
  295. if(smalltalk.assert($2)){
  296. _st(self["@stream"])._next();
  297. } else {
  298. $3=_st(_st(result)._contents())._trimBoth();
  299. throw $early=[$3];
  300. };
  301. };
  302. return _st(result)._nextPut_(char);
  303. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  304. return nil;
  305. }
  306. catch(e) {if(e===$early)return e[0]; throw e}
  307. }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk},smalltalk.ChunkParser)})},
  308. messageSends: ["writeStream", "whileTrue:", "ifTrue:", "ifTrue:ifFalse:", "next", "trimBoth", "contents", "=", "peek", "nextPut:", "notNil"]}),
  309. smalltalk.ChunkParser);
  310. smalltalk.addMethod(
  311. smalltalk.method({
  312. selector: "stream:",
  313. fn: function (aStream){
  314. var self=this;
  315. return smalltalk.withContext(function($ctx1) {
  316. self["@stream"]=aStream;
  317. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.ChunkParser)})},
  318. messageSends: []}),
  319. smalltalk.ChunkParser);
  320. smalltalk.addMethod(
  321. smalltalk.method({
  322. selector: "on:",
  323. fn: function (aStream){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) {
  326. var $1;
  327. $1=_st(self._new())._stream_(aStream);
  328. return $1;
  329. }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream},smalltalk.ChunkParser.klass)})},
  330. messageSends: ["stream:", "new"]}),
  331. smalltalk.ChunkParser.klass);
  332. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Importer-Exporter');
  333. smalltalk.addMethod(
  334. smalltalk.method({
  335. selector: "classNameFor:",
  336. fn: function (aClass){
  337. var self=this;
  338. return smalltalk.withContext(function($ctx1) {
  339. var $2,$3,$1;
  340. $2=_st(aClass)._isMetaclass();
  341. if(smalltalk.assert($2)){
  342. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
  343. } else {
  344. $3=_st(aClass)._isNil();
  345. if(smalltalk.assert($3)){
  346. $1="nil";
  347. } else {
  348. $1=_st(aClass)._name();
  349. };
  350. };
  351. return $1;
  352. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.Exporter.klass)})},
  353. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"]}),
  354. smalltalk.Exporter.klass);
  355. smalltalk.addMethod(
  356. smalltalk.method({
  357. selector: "exportDefinitionOf:on:",
  358. fn: function (aClass,aStream){
  359. var self=this;
  360. return smalltalk.withContext(function($ctx1) {
  361. var $1,$2,$3,$4,$5,$6,$7;
  362. $1=aStream;
  363. _st($1)._lf();
  364. _st($1)._nextPutAll_("smalltalk.addClass(");
  365. _st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
  366. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
  367. $2=_st($1)._nextPutAll_(", [");
  368. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  369. return smalltalk.withContext(function($ctx2) {
  370. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  371. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  372. return smalltalk.withContext(function($ctx2) {
  373. return _st(aStream)._nextPutAll_(", ");
  374. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  375. $3=aStream;
  376. _st($3)._nextPutAll_("], '");
  377. _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
  378. $4=_st($3)._nextPutAll_(");");
  379. $5=_st(_st(aClass)._comment())._notEmpty();
  380. if(smalltalk.assert($5)){
  381. $6=aStream;
  382. _st($6)._lf();
  383. _st($6)._nextPutAll_("smalltalk.");
  384. _st($6)._nextPutAll_(self._classNameFor_(aClass));
  385. _st($6)._nextPutAll_(".comment=");
  386. _st($6)._nextPutAll_(_st(_st(aClass)._comment())._asJavascript());
  387. $7=_st($6)._nextPutAll_(";");
  388. $7;
  389. };
  390. _st(aStream)._lf();
  391. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.Exporter.klass)})},
  392. messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "asJavascript", "comment", "notEmpty"]}),
  393. smalltalk.Exporter.klass);
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "exportMetaDefinitionOf:on:",
  397. fn: function (aClass,aStream){
  398. var self=this;
  399. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  400. return smalltalk.withContext(function($ctx1) {
  401. var $1,$2,$3;
  402. _st(aStream)._lf();
  403. $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
  404. if(! smalltalk.assert($1)){
  405. $2=aStream;
  406. _st($2)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._class())));
  407. $3=_st($2)._nextPutAll_(".iVarNames = [");
  408. $3;
  409. _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
  410. return smalltalk.withContext(function($ctx2) {
  411. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  412. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  413. return smalltalk.withContext(function($ctx2) {
  414. return _st(aStream)._nextPutAll_(",");
  415. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  416. _st(aStream)._nextPutAll_("];".__comma(_st($String())._lf()));
  417. };
  418. return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.Exporter.klass)})},
  419. messageSends: ["lf", "ifFalse:", "nextPutAll:", ",", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "isEmpty"]}),
  420. smalltalk.Exporter.klass);
  421. smalltalk.addMethod(
  422. smalltalk.method({
  423. selector: "exportMethod:on:",
  424. fn: function (aMethod,aStream){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx1) {
  427. var $1,$2,$3,$4;
  428. $1=aStream;
  429. _st($1)._nextPutAll_("smalltalk.addMethod(");
  430. _st($1)._lf();
  431. _st($1)._nextPutAll_("smalltalk.method({");
  432. _st($1)._lf();
  433. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  434. _st($1)._lf();
  435. _st($1)._nextPutAll_(_st("category: '".__comma(_st(aMethod)._category())).__comma("',"));
  436. _st($1)._lf();
  437. _st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
  438. _st($1)._lf();
  439. _st($1)._nextPutAll_(_st("args: ".__comma(_st(_st(aMethod)._arguments())._asJavascript())).__comma(","));
  440. _st($1)._lf();
  441. _st($1)._nextPutAll_(_st("source: ".__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  442. _st($1)._lf();
  443. _st($1)._nextPutAll_(_st("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript())).__comma(","));
  444. _st($1)._lf();
  445. $2=_st($1)._nextPutAll_("referencedClasses: ".__comma(_st(_st(aMethod)._referencedClasses())._asJavascript()));
  446. $3=aStream;
  447. _st($3)._lf();
  448. _st($3)._nextPutAll_("}),");
  449. _st($3)._lf();
  450. _st($3)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
  451. _st($3)._nextPutAll_(");");
  452. _st($3)._lf();
  453. $4=_st($3)._lf();
  454. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.Exporter.klass)})},
  455. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:", "methodClass"]}),
  456. smalltalk.Exporter.klass);
  457. smalltalk.addMethod(
  458. smalltalk.method({
  459. selector: "exportPackageDefinitionOf:on:",
  460. fn: function (package_,aStream){
  461. var self=this;
  462. return smalltalk.withContext(function($ctx1) {
  463. var $1,$2;
  464. $1=aStream;
  465. _st($1)._nextPutAll_("smalltalk.addPackage(");
  466. _st($1)._nextPutAll_(_st("'".__comma(_st(package_)._name())).__comma("');"));
  467. $2=_st($1)._lf();
  468. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream},smalltalk.Exporter.klass)})},
  469. messageSends: ["nextPutAll:", ",", "name", "lf"]}),
  470. smalltalk.Exporter.klass);
  471. smalltalk.addMethod(
  472. smalltalk.method({
  473. selector: "exportPackageEpilogueOf:on:",
  474. fn: function (aPackage,aStream){
  475. var self=this;
  476. return smalltalk.withContext(function($ctx1) {
  477. var $1,$2;
  478. $1=aStream;
  479. _st($1)._nextPutAll_("})(global_smalltalk,global_nil,global__st);");
  480. $2=_st($1)._lf();
  481. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter.klass)})},
  482. messageSends: ["nextPutAll:", "lf"]}),
  483. smalltalk.Exporter.klass);
  484. smalltalk.addMethod(
  485. smalltalk.method({
  486. selector: "exportPackagePrologueOf:on:",
  487. fn: function (aPackage,aStream){
  488. var self=this;
  489. return smalltalk.withContext(function($ctx1) {
  490. var $1,$2;
  491. $1=aStream;
  492. _st($1)._nextPutAll_("(function(smalltalk,nil,_st){");
  493. $2=_st($1)._lf();
  494. return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter.klass)})},
  495. messageSends: ["nextPutAll:", "lf"]}),
  496. smalltalk.Exporter.klass);
  497. smalltalk.addMethod(
  498. smalltalk.method({
  499. selector: "extensionMethodsOfPackage:",
  500. fn: function (package_){
  501. var self=this;
  502. var name,result;
  503. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  504. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  505. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  506. return smalltalk.withContext(function($ctx1) {
  507. var $1;
  508. name=_st(package_)._name();
  509. result=_st($OrderedCollection())._new();
  510. _st(_st($Package())._sortedClasses_(_st(_st($Smalltalk())._current())._classes()))._do_((function(each){
  511. return smalltalk.withContext(function($ctx2) {
  512. return _st([each,_st(each)._class()])._do_((function(aClass){
  513. return smalltalk.withContext(function($ctx3) {
  514. return _st(result)._addAll_(_st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  515. return smalltalk.withContext(function($ctx4) {
  516. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  517. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._select_((function(method){
  518. return smalltalk.withContext(function($ctx4) {
  519. return _st(_st(method)._category())._match_("^\x5c*".__comma(name));
  520. }, function($ctx4) {$ctx4.fillBlock({method:method},$ctx3)})})));
  521. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
  522. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  523. $1=result;
  524. return $1;
  525. }, function($ctx1) {$ctx1.fill(self,"extensionMethodsOfPackage:",{package_:package_,name:name,result:result},smalltalk.Exporter.klass)})},
  526. messageSends: ["name", "new", "do:", "addAll:", "select:", "match:", ",", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "class", "sortedClasses:", "classes", "current"]}),
  527. smalltalk.Exporter.klass);
  528. smalltalk.addMethod(
  529. smalltalk.method({
  530. selector: "ownMethodsOfClass:",
  531. fn: function (aClass){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) {
  534. var $1;
  535. $1=_st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  536. return smalltalk.withContext(function($ctx2) {
  537. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  538. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._reject_((function(each){
  539. return smalltalk.withContext(function($ctx2) {
  540. return _st(_st(each)._category())._match_("^\x5c*");
  541. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  542. return $1;
  543. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfClass:",{aClass:aClass},smalltalk.Exporter.klass)})},
  544. messageSends: ["reject:", "match:", "category", "sorted:", "<=", "selector", "values", "methodDictionary"]}),
  545. smalltalk.Exporter.klass);
  546. smalltalk.addMethod(
  547. smalltalk.method({
  548. selector: "ownMethodsOfMetaClass:",
  549. fn: function (aClass){
  550. var self=this;
  551. return smalltalk.withContext(function($ctx1) {
  552. var $1;
  553. $1=self._ownMethodsOfClass_(_st(aClass)._class());
  554. return $1;
  555. }, function($ctx1) {$ctx1.fill(self,"ownMethodsOfMetaClass:",{aClass:aClass},smalltalk.Exporter.klass)})},
  556. messageSends: ["ownMethodsOfClass:", "class"]}),
  557. smalltalk.Exporter.klass);
  558. smalltalk.addMethod(
  559. smalltalk.method({
  560. selector: "recipe",
  561. fn: function (){
  562. var self=this;
  563. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  564. return smalltalk.withContext(function($ctx1) {
  565. var $1;
  566. $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:")];
  567. return $1;
  568. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.Exporter.klass)})},
  569. messageSends: ["->"]}),
  570. smalltalk.Exporter.klass);
  571. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "exportDefinitionOf:on:",
  575. fn: function (aClass,aStream){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) {
  578. var $1,$2,$3,$4;
  579. $1=aStream;
  580. _st($1)._lf();
  581. _st($1)._nextPutAll_("smalltalk.addClass(");
  582. _st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
  583. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
  584. $2=_st($1)._nextPutAll_(", [");
  585. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  586. return smalltalk.withContext(function($ctx2) {
  587. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  588. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  589. return smalltalk.withContext(function($ctx2) {
  590. return _st(aStream)._nextPutAll_(", ");
  591. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  592. $3=aStream;
  593. _st($3)._nextPutAll_("], '");
  594. _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
  595. $4=_st($3)._nextPutAll_(");");
  596. _st(aStream)._lf();
  597. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.StrippedExporter.klass)})},
  598. messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category"]}),
  599. smalltalk.StrippedExporter.klass);
  600. smalltalk.addMethod(
  601. smalltalk.method({
  602. selector: "exportMethod:on:",
  603. fn: function (aMethod,aStream){
  604. var self=this;
  605. return smalltalk.withContext(function($ctx1) {
  606. var $1,$2;
  607. $1=aStream;
  608. _st($1)._nextPutAll_("smalltalk.addMethod(");
  609. _st($1)._lf();
  610. _st($1)._nextPutAll_("smalltalk.method({");
  611. _st($1)._lf();
  612. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  613. _st($1)._lf();
  614. _st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
  615. _st($1)._lf();
  616. _st($1)._nextPutAll_("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript()));
  617. _st($1)._nextPutAll_("}),");
  618. _st($1)._lf();
  619. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
  620. _st($1)._nextPutAll_(");");
  621. _st($1)._lf();
  622. $2=_st($1)._lf();
  623. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.StrippedExporter.klass)})},
  624. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "compiledSource", "fn", "messageSends", "classNameFor:", "methodClass"]}),
  625. smalltalk.StrippedExporter.klass);
  626. smalltalk.addClass('Importer', smalltalk.Object, [], 'Importer-Exporter');
  627. smalltalk.addMethod(
  628. smalltalk.method({
  629. selector: "import:",
  630. fn: function (aStream){
  631. var self=this;
  632. var chunk,result,parser,lastEmpty;
  633. function $ChunkParser(){return smalltalk.ChunkParser||(typeof ChunkParser=="undefined"?nil:ChunkParser)}
  634. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  635. return smalltalk.withContext(function($ctx1) {
  636. var $1,$2;
  637. parser=_st($ChunkParser())._on_(aStream);
  638. lastEmpty=false;
  639. _st((function(){
  640. return smalltalk.withContext(function($ctx2) {
  641. chunk=_st(parser)._nextChunk();
  642. chunk;
  643. return _st(chunk)._isNil();
  644. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  645. return smalltalk.withContext(function($ctx2) {
  646. $1=_st(chunk)._isEmpty();
  647. if(smalltalk.assert($1)){
  648. lastEmpty=true;
  649. return lastEmpty;
  650. } else {
  651. result=_st(_st($Compiler())._new())._evaluateExpression_(chunk);
  652. result;
  653. $2=lastEmpty;
  654. if(smalltalk.assert($2)){
  655. lastEmpty=false;
  656. lastEmpty;
  657. return _st(result)._scanFrom_(parser);
  658. };
  659. };
  660. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  661. return self}, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty},smalltalk.Importer)})},
  662. messageSends: ["on:", "whileFalse:", "ifTrue:ifFalse:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "isEmpty", "nextChunk", "isNil"]}),
  663. smalltalk.Importer);
  664. smalltalk.addClass('MethodCategory', smalltalk.Object, ['methods', 'name', 'klass'], 'Importer-Exporter');
  665. smalltalk.addMethod(
  666. smalltalk.method({
  667. selector: "klass",
  668. fn: function (){
  669. var self=this;
  670. return smalltalk.withContext(function($ctx1) {
  671. var $1;
  672. $1=self["@klass"];
  673. return $1;
  674. }, function($ctx1) {$ctx1.fill(self,"klass",{},smalltalk.MethodCategory)})},
  675. messageSends: []}),
  676. smalltalk.MethodCategory);
  677. smalltalk.addMethod(
  678. smalltalk.method({
  679. selector: "klass:",
  680. fn: function (aClass){
  681. var self=this;
  682. return smalltalk.withContext(function($ctx1) {
  683. self["@klass"]=aClass;
  684. return self}, function($ctx1) {$ctx1.fill(self,"klass:",{aClass:aClass},smalltalk.MethodCategory)})},
  685. messageSends: []}),
  686. smalltalk.MethodCategory);
  687. smalltalk.addMethod(
  688. smalltalk.method({
  689. selector: "methods",
  690. fn: function (){
  691. var self=this;
  692. return smalltalk.withContext(function($ctx1) {
  693. var $1;
  694. $1=self["@methods"];
  695. return $1;
  696. }, function($ctx1) {$ctx1.fill(self,"methods",{},smalltalk.MethodCategory)})},
  697. messageSends: []}),
  698. smalltalk.MethodCategory);
  699. smalltalk.addMethod(
  700. smalltalk.method({
  701. selector: "methods:",
  702. fn: function (anArray){
  703. var self=this;
  704. return smalltalk.withContext(function($ctx1) {
  705. self["@methods"]=anArray;
  706. return self}, function($ctx1) {$ctx1.fill(self,"methods:",{anArray:anArray},smalltalk.MethodCategory)})},
  707. messageSends: []}),
  708. smalltalk.MethodCategory);
  709. smalltalk.addMethod(
  710. smalltalk.method({
  711. selector: "name",
  712. fn: function (){
  713. var self=this;
  714. return smalltalk.withContext(function($ctx1) {
  715. var $1;
  716. $1=self["@name"];
  717. return $1;
  718. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.MethodCategory)})},
  719. messageSends: []}),
  720. smalltalk.MethodCategory);
  721. smalltalk.addMethod(
  722. smalltalk.method({
  723. selector: "name:",
  724. fn: function (aString){
  725. var self=this;
  726. return smalltalk.withContext(function($ctx1) {
  727. self["@name"]=aString;
  728. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.MethodCategory)})},
  729. messageSends: []}),
  730. smalltalk.MethodCategory);
  731. smalltalk.addMethod(
  732. smalltalk.method({
  733. selector: "name:class:methods:",
  734. fn: function (aString,aClass,anArray){
  735. var self=this;
  736. return smalltalk.withContext(function($ctx1) {
  737. var $2,$3,$1;
  738. $2=self._new();
  739. _st($2)._name_(aString);
  740. _st($2)._klass_(aClass);
  741. _st($2)._methods_(anArray);
  742. $3=_st($2)._yourself();
  743. $1=$3;
  744. return $1;
  745. }, function($ctx1) {$ctx1.fill(self,"name:class:methods:",{aString:aString,aClass:aClass,anArray:anArray},smalltalk.MethodCategory.klass)})},
  746. messageSends: ["name:", "new", "klass:", "methods:", "yourself"]}),
  747. smalltalk.MethodCategory.klass);
  748. smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
  749. smalltalk.addMethod(
  750. smalltalk.method({
  751. selector: "ajaxPutAt:data:",
  752. fn: function (aURL,aString){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. 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){
  756. return smalltalk.withContext(function($ctx2) {
  757. return self._error_(_st(_st(_st("Commiting ".__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
  758. }, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
  759. return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.PackageHandler)})},
  760. messageSends: ["ajax:", "->", "error:", ",", "responseText"]}),
  761. smalltalk.PackageHandler);
  762. smalltalk.addMethod(
  763. smalltalk.method({
  764. selector: "commit:",
  765. fn: function (aPackage){
  766. var self=this;
  767. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  768. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  769. return smalltalk.withContext(function($ctx1) {
  770. _st(self._commitChannels())._do_displayingProgress_((function(commitStrategyFactory){
  771. var fileContents,commitStrategy;
  772. return smalltalk.withContext(function($ctx2) {
  773. commitStrategy=_st(commitStrategyFactory)._value_(aPackage);
  774. commitStrategy;
  775. fileContents=_st($String())._streamContents_((function(stream){
  776. return smalltalk.withContext(function($ctx3) {
  777. return _st(_st($PluggableExporter())._newUsing_(_st(commitStrategy)._key()))._exportPackage_on_(aPackage,stream);
  778. }, function($ctx3) {$ctx3.fillBlock({stream:stream},$ctx2)})}));
  779. fileContents;
  780. return self._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  781. }, function($ctx2) {$ctx2.fillBlock({commitStrategyFactory:commitStrategyFactory,fileContents:fileContents,commitStrategy:commitStrategy},$ctx1)})}),"Committing package ".__comma(_st(aPackage)._name()));
  782. return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)})},
  783. messageSends: ["do:displayingProgress:", "value:", "streamContents:", "exportPackage:on:", "newUsing:", "key", "ajaxPutAt:data:", "value", ",", "name", "commitChannels"]}),
  784. smalltalk.PackageHandler);
  785. smalltalk.addMethod(
  786. smalltalk.method({
  787. selector: "commitChannels",
  788. fn: function (){
  789. var self=this;
  790. return smalltalk.withContext(function($ctx1) {
  791. self._subclassResponsibility();
  792. return self}, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.PackageHandler)})},
  793. messageSends: ["subclassResponsibility"]}),
  794. smalltalk.PackageHandler);
  795. smalltalk.PackageHandler.klass.iVarNames = ['registry'];
  796. smalltalk.addMethod(
  797. smalltalk.method({
  798. selector: "classRegisteredFor:",
  799. fn: function (aString){
  800. var self=this;
  801. return smalltalk.withContext(function($ctx1) {
  802. var $1;
  803. $1=_st(self["@registry"])._at_(aString);
  804. return $1;
  805. }, function($ctx1) {$ctx1.fill(self,"classRegisteredFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  806. messageSends: ["at:"]}),
  807. smalltalk.PackageHandler.klass);
  808. smalltalk.addMethod(
  809. smalltalk.method({
  810. selector: "for:",
  811. fn: function (aString){
  812. var self=this;
  813. return smalltalk.withContext(function($ctx1) {
  814. var $1;
  815. $1=_st(self._classRegisteredFor_(aString))._new();
  816. return $1;
  817. }, function($ctx1) {$ctx1.fill(self,"for:",{aString:aString},smalltalk.PackageHandler.klass)})},
  818. messageSends: ["new", "classRegisteredFor:"]}),
  819. smalltalk.PackageHandler.klass);
  820. smalltalk.addMethod(
  821. smalltalk.method({
  822. selector: "initialize",
  823. fn: function (){
  824. var self=this;
  825. return smalltalk.withContext(function($ctx1) {
  826. smalltalk.PackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  827. self["@registry"]=smalltalk.HashedCollection._from_([]);
  828. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.PackageHandler.klass)})},
  829. messageSends: ["initialize"]}),
  830. smalltalk.PackageHandler.klass);
  831. smalltalk.addMethod(
  832. smalltalk.method({
  833. selector: "register:for:",
  834. fn: function (aClass,aString){
  835. var self=this;
  836. return smalltalk.withContext(function($ctx1) {
  837. _st(self["@registry"])._at_put_(aString,aClass);
  838. return self}, function($ctx1) {$ctx1.fill(self,"register:for:",{aClass:aClass,aString:aString},smalltalk.PackageHandler.klass)})},
  839. messageSends: ["at:put:"]}),
  840. smalltalk.PackageHandler.klass);
  841. smalltalk.addMethod(
  842. smalltalk.method({
  843. selector: "registerFor:",
  844. fn: function (aString){
  845. var self=this;
  846. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  847. return smalltalk.withContext(function($ctx1) {
  848. _st($PackageHandler())._register_for_(self,aString);
  849. return self}, function($ctx1) {$ctx1.fill(self,"registerFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  850. messageSends: ["register:for:"]}),
  851. smalltalk.PackageHandler.klass);
  852. smalltalk.addClass('LegacyPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  853. smalltalk.addMethod(
  854. smalltalk.method({
  855. selector: "commitChannels",
  856. fn: function (){
  857. var self=this;
  858. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  859. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  860. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  861. return smalltalk.withContext(function($ctx1) {
  862. var $1;
  863. $1=[(function(pkg){
  864. return smalltalk.withContext(function($ctx2) {
  865. return _st(_st($Exporter())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  866. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  867. return smalltalk.withContext(function($ctx2) {
  868. return _st(_st($StrippedExporter())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  869. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  870. return smalltalk.withContext(function($ctx2) {
  871. return _st(_st($ChunkExporter())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  872. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  873. return $1;
  874. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.LegacyPackageHandler)})},
  875. messageSends: ["->", ",", "name", "commitPathJs", "recipe", "commitPathSt"]}),
  876. smalltalk.LegacyPackageHandler);
  877. smalltalk.addMethod(
  878. smalltalk.method({
  879. selector: "commitPathJsFor:",
  880. fn: function (aPackage){
  881. var self=this;
  882. return smalltalk.withContext(function($ctx1) {
  883. var $1;
  884. $1=_st(self._class())._defaultCommitPathJs();
  885. return $1;
  886. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  887. messageSends: ["defaultCommitPathJs", "class"]}),
  888. smalltalk.LegacyPackageHandler);
  889. smalltalk.addMethod(
  890. smalltalk.method({
  891. selector: "commitPathStFor:",
  892. fn: function (aPackage){
  893. var self=this;
  894. return smalltalk.withContext(function($ctx1) {
  895. var $1;
  896. $1=_st(self._class())._defaultCommitPathSt();
  897. return $1;
  898. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  899. messageSends: ["defaultCommitPathSt", "class"]}),
  900. smalltalk.LegacyPackageHandler);
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "loadPackage:prefix:",
  904. fn: function (packageName,aString){
  905. var self=this;
  906. var url;
  907. return smalltalk.withContext(function($ctx1) {
  908. var $1;
  909. url=_st(_st(_st("/".__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
  910. self._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(url),"type".__minus_gt("GET"),"dataType".__minus_gt("script"),"complete".__minus_gt((function(jqXHR,textStatus){
  911. return smalltalk.withContext(function($ctx2) {
  912. $1=_st(_st(jqXHR)._readyState()).__eq((4));
  913. if(smalltalk.assert($1)){
  914. return self._setupPackageNamed_prefix_(packageName,aString);
  915. };
  916. }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),"error".__minus_gt((function(){
  917. return smalltalk.withContext(function($ctx2) {
  918. return self._alert_("Could not load package at: ".__comma(url));
  919. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  920. return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url},smalltalk.LegacyPackageHandler)})},
  921. messageSends: [",", "ajax:", "->", "ifTrue:", "setupPackageNamed:prefix:", "=", "readyState", "alert:"]}),
  922. smalltalk.LegacyPackageHandler);
  923. smalltalk.addMethod(
  924. smalltalk.method({
  925. selector: "loadPackages:prefix:",
  926. fn: function (aCollection,aString){
  927. var self=this;
  928. return smalltalk.withContext(function($ctx1) {
  929. _st(aCollection)._do_((function(each){
  930. return smalltalk.withContext(function($ctx2) {
  931. return self._loadPackage_prefix_(each,aString);
  932. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  933. return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler)})},
  934. messageSends: ["do:", "loadPackage:prefix:"]}),
  935. smalltalk.LegacyPackageHandler);
  936. smalltalk.addMethod(
  937. smalltalk.method({
  938. selector: "setupPackageNamed:prefix:",
  939. fn: function (packageName,aString){
  940. var self=this;
  941. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  942. return smalltalk.withContext(function($ctx1) {
  943. var $1,$2;
  944. $1=_st($Package())._named_(packageName);
  945. _st($1)._setupClasses();
  946. _st($1)._commitPathJs_(_st("/".__comma(aString)).__comma("/js"));
  947. $2=_st($1)._commitPathSt_(_st("/".__comma(aString)).__comma("/st"));
  948. return self}, function($ctx1) {$ctx1.fill(self,"setupPackageNamed:prefix:",{packageName:packageName,aString:aString},smalltalk.LegacyPackageHandler)})},
  949. messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"]}),
  950. smalltalk.LegacyPackageHandler);
  951. smalltalk.LegacyPackageHandler.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  952. smalltalk.addMethod(
  953. smalltalk.method({
  954. selector: "commitPathsFromLoader",
  955. fn: function (){
  956. var self=this;
  957. return smalltalk.withContext(function($ctx1) {
  958. var commitPath = typeof amber !== 'undefined' && amber.commitPath;
  959. if (!commitPath) return;
  960. if (commitPath.js) self._defaultCommitPathJs_(commitPath.js);
  961. if (commitPath.st) self._defaultCommitPathSt_(commitPath.st);
  962. ;
  963. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.LegacyPackageHandler.klass)})},
  964. messageSends: []}),
  965. smalltalk.LegacyPackageHandler.klass);
  966. smalltalk.addMethod(
  967. smalltalk.method({
  968. selector: "defaultCommitPathJs",
  969. fn: function (){
  970. var self=this;
  971. return smalltalk.withContext(function($ctx1) {
  972. var $2,$1;
  973. $2=self["@defaultCommitPathJs"];
  974. if(($receiver = $2) == nil || $receiver == undefined){
  975. self["@defaultCommitPathJs"]="js";
  976. $1=self["@defaultCommitPathJs"];
  977. } else {
  978. $1=$2;
  979. };
  980. return $1;
  981. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs",{},smalltalk.LegacyPackageHandler.klass)})},
  982. messageSends: ["ifNil:"]}),
  983. smalltalk.LegacyPackageHandler.klass);
  984. smalltalk.addMethod(
  985. smalltalk.method({
  986. selector: "defaultCommitPathJs:",
  987. fn: function (aString){
  988. var self=this;
  989. return smalltalk.withContext(function($ctx1) {
  990. self["@defaultCommitPathJs"]=aString;
  991. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  992. messageSends: []}),
  993. smalltalk.LegacyPackageHandler.klass);
  994. smalltalk.addMethod(
  995. smalltalk.method({
  996. selector: "defaultCommitPathSt",
  997. fn: function (){
  998. var self=this;
  999. return smalltalk.withContext(function($ctx1) {
  1000. var $2,$1;
  1001. $2=self["@defaultCommitPathSt"];
  1002. if(($receiver = $2) == nil || $receiver == undefined){
  1003. self["@defaultCommitPathSt"]="st";
  1004. $1=self["@defaultCommitPathSt"];
  1005. } else {
  1006. $1=$2;
  1007. };
  1008. return $1;
  1009. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt",{},smalltalk.LegacyPackageHandler.klass)})},
  1010. messageSends: ["ifNil:"]}),
  1011. smalltalk.LegacyPackageHandler.klass);
  1012. smalltalk.addMethod(
  1013. smalltalk.method({
  1014. selector: "defaultCommitPathSt:",
  1015. fn: function (aString){
  1016. var self=this;
  1017. return smalltalk.withContext(function($ctx1) {
  1018. self["@defaultCommitPathSt"]=aString;
  1019. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1020. messageSends: []}),
  1021. smalltalk.LegacyPackageHandler.klass);
  1022. smalltalk.addMethod(
  1023. smalltalk.method({
  1024. selector: "initialize",
  1025. fn: function (){
  1026. var self=this;
  1027. return smalltalk.withContext(function($ctx1) {
  1028. smalltalk.LegacyPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1029. self._registerFor_("unknown");
  1030. self._commitPathsFromLoader();
  1031. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.LegacyPackageHandler.klass)})},
  1032. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  1033. smalltalk.LegacyPackageHandler.klass);
  1034. smalltalk.addMethod(
  1035. smalltalk.method({
  1036. selector: "loadPackages:prefix:",
  1037. fn: function (aCollection,aString){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx1) {
  1040. var $1;
  1041. $1=_st(self._new())._loadPackages_prefix_(aCollection,aString);
  1042. return $1;
  1043. }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  1044. messageSends: ["loadPackages:prefix:", "new"]}),
  1045. smalltalk.LegacyPackageHandler.klass);
  1046. smalltalk.addMethod(
  1047. smalltalk.method({
  1048. selector: "resetCommitPaths",
  1049. fn: function (){
  1050. var self=this;
  1051. return smalltalk.withContext(function($ctx1) {
  1052. self["@defaultCommitPathJs"]=nil;
  1053. self["@defaultCommitPathSt"]=nil;
  1054. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.LegacyPackageHandler.klass)})},
  1055. messageSends: []}),
  1056. smalltalk.LegacyPackageHandler.klass);
  1057. smalltalk.addClass('PluggableExporter', smalltalk.Object, ['recipe'], 'Importer-Exporter');
  1058. smalltalk.addMethod(
  1059. smalltalk.method({
  1060. selector: "export:usingRecipe:on:",
  1061. fn: function (anObject,anArray,aStream){
  1062. var self=this;
  1063. var args;
  1064. return smalltalk.withContext(function($ctx1) {
  1065. var $1;
  1066. args=[anObject,aStream];
  1067. _st(anArray)._do_((function(each){
  1068. var val;
  1069. return smalltalk.withContext(function($ctx2) {
  1070. val=_st(each)._value();
  1071. val;
  1072. $1=_st(val).__eq_eq(each);
  1073. if(smalltalk.assert($1)){
  1074. var selection;
  1075. selection=_st(_st(_st(each)._first())._key())._perform_withArguments_(_st(_st(each)._first())._value(),[anObject]);
  1076. selection;
  1077. return _st(selection)._do_((function(eachPart){
  1078. return smalltalk.withContext(function($ctx3) {
  1079. return self._export_usingRecipe_on_(eachPart,_st(each)._allButFirst(),aStream);
  1080. }, function($ctx3) {$ctx3.fillBlock({eachPart:eachPart},$ctx2)})}));
  1081. } else {
  1082. return _st(_st(each)._key())._perform_withArguments_(val,args);
  1083. };
  1084. }, function($ctx2) {$ctx2.fillBlock({each:each,val:val},$ctx1)})}));
  1085. return self}, function($ctx1) {$ctx1.fill(self,"export:usingRecipe:on:",{anObject:anObject,anArray:anArray,aStream:aStream,args:args},smalltalk.PluggableExporter)})},
  1086. messageSends: ["do:", "value", "ifFalse:ifTrue:", "perform:withArguments:", "key", "first", "export:usingRecipe:on:", "allButFirst", "=="]}),
  1087. smalltalk.PluggableExporter);
  1088. smalltalk.addMethod(
  1089. smalltalk.method({
  1090. selector: "exportAll",
  1091. fn: function (){
  1092. var self=this;
  1093. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1094. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1095. return smalltalk.withContext(function($ctx1) {
  1096. var $1;
  1097. $1=_st($String())._streamContents_((function(stream){
  1098. return smalltalk.withContext(function($ctx2) {
  1099. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(pkg){
  1100. return smalltalk.withContext(function($ctx3) {
  1101. return self._exportPackage_on_(pkg,stream);
  1102. }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx2)})}));
  1103. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  1104. return $1;
  1105. }, function($ctx1) {$ctx1.fill(self,"exportAll",{},smalltalk.PluggableExporter)})},
  1106. messageSends: ["streamContents:", "do:", "exportPackage:on:", "packages", "current"]}),
  1107. smalltalk.PluggableExporter);
  1108. smalltalk.addMethod(
  1109. smalltalk.method({
  1110. selector: "exportPackage:on:",
  1111. fn: function (aPackage,aStream){
  1112. var self=this;
  1113. return smalltalk.withContext(function($ctx1) {
  1114. self._export_usingRecipe_on_(aPackage,self._recipe(),aStream);
  1115. return self}, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},smalltalk.PluggableExporter)})},
  1116. messageSends: ["export:usingRecipe:on:", "recipe"]}),
  1117. smalltalk.PluggableExporter);
  1118. smalltalk.addMethod(
  1119. smalltalk.method({
  1120. selector: "recipe",
  1121. fn: function (){
  1122. var self=this;
  1123. return smalltalk.withContext(function($ctx1) {
  1124. var $1;
  1125. $1=self["@recipe"];
  1126. return $1;
  1127. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.PluggableExporter)})},
  1128. messageSends: []}),
  1129. smalltalk.PluggableExporter);
  1130. smalltalk.addMethod(
  1131. smalltalk.method({
  1132. selector: "recipe:",
  1133. fn: function (anArray){
  1134. var self=this;
  1135. return smalltalk.withContext(function($ctx1) {
  1136. self["@recipe"]=anArray;
  1137. return self}, function($ctx1) {$ctx1.fill(self,"recipe:",{anArray:anArray},smalltalk.PluggableExporter)})},
  1138. messageSends: []}),
  1139. smalltalk.PluggableExporter);
  1140. smalltalk.addMethod(
  1141. smalltalk.method({
  1142. selector: "newUsing:",
  1143. fn: function (recipe){
  1144. var self=this;
  1145. return smalltalk.withContext(function($ctx1) {
  1146. var $2,$3,$1;
  1147. $2=self._new();
  1148. _st($2)._recipe_(recipe);
  1149. $3=_st($2)._yourself();
  1150. $1=$3;
  1151. return $1;
  1152. }, function($ctx1) {$ctx1.fill(self,"newUsing:",{recipe:recipe},smalltalk.PluggableExporter.klass)})},
  1153. messageSends: ["recipe:", "new", "yourself"]}),
  1154. smalltalk.PluggableExporter.klass);
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "ownClassesOfPackage:",
  1158. fn: function (package_){
  1159. var self=this;
  1160. return smalltalk.withContext(function($ctx1) {
  1161. var $1;
  1162. $1=_st(_st(package_)._sortedClasses())._asSet();
  1163. return $1;
  1164. }, function($ctx1) {$ctx1.fill(self,"ownClassesOfPackage:",{package_:package_},smalltalk.PluggableExporter.klass)})},
  1165. messageSends: ["asSet", "sortedClasses"]}),
  1166. smalltalk.PluggableExporter.klass);
  1167. smalltalk.addMethod(
  1168. smalltalk.method({
  1169. selector: "commit",
  1170. fn: function (){
  1171. var self=this;
  1172. return smalltalk.withContext(function($ctx1) {
  1173. var $1;
  1174. $1=_st(self._transport())._commit_(self);
  1175. return $1;
  1176. }, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
  1177. messageSends: ["commit:", "transport"]}),
  1178. smalltalk.Package);
  1179. smalltalk.addMethod(
  1180. smalltalk.method({
  1181. selector: "commitPathJs",
  1182. fn: function (){
  1183. var self=this;
  1184. return smalltalk.withContext(function($ctx1) {
  1185. var $3,$2,$1;
  1186. $3=self["@extension"];
  1187. if(($receiver = $3) == nil || $receiver == undefined){
  1188. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1189. $2=self["@extension"];
  1190. } else {
  1191. $2=$3;
  1192. };
  1193. $1=_st($2)._at_ifAbsentPut_("commitPathJs",(function(){
  1194. return smalltalk.withContext(function($ctx2) {
  1195. return _st(self._transport())._commitPathJsFor_(self);
  1196. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1197. return $1;
  1198. }, function($ctx1) {$ctx1.fill(self,"commitPathJs",{},smalltalk.Package)})},
  1199. messageSends: ["at:ifAbsentPut:", "commitPathJsFor:", "transport", "ifNil:"]}),
  1200. smalltalk.Package);
  1201. smalltalk.addMethod(
  1202. smalltalk.method({
  1203. selector: "commitPathJs:",
  1204. fn: function (aString){
  1205. var self=this;
  1206. return smalltalk.withContext(function($ctx1) {
  1207. var $3,$2,$1;
  1208. $3=self["@extension"];
  1209. if(($receiver = $3) == nil || $receiver == undefined){
  1210. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1211. $2=self["@extension"];
  1212. } else {
  1213. $2=$3;
  1214. };
  1215. $1=_st($2)._at_put_("commitPathJs",aString);
  1216. return $1;
  1217. }, function($ctx1) {$ctx1.fill(self,"commitPathJs:",{aString:aString},smalltalk.Package)})},
  1218. messageSends: ["at:put:", "ifNil:"]}),
  1219. smalltalk.Package);
  1220. smalltalk.addMethod(
  1221. smalltalk.method({
  1222. selector: "commitPathSt",
  1223. fn: function (){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx1) {
  1226. var $3,$2,$1;
  1227. $3=self["@extension"];
  1228. if(($receiver = $3) == nil || $receiver == undefined){
  1229. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1230. $2=self["@extension"];
  1231. } else {
  1232. $2=$3;
  1233. };
  1234. $1=_st($2)._at_ifAbsentPut_("commitPathSt",(function(){
  1235. return smalltalk.withContext(function($ctx2) {
  1236. return _st(self._transport())._commitPathStFor_(self);
  1237. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1238. return $1;
  1239. }, function($ctx1) {$ctx1.fill(self,"commitPathSt",{},smalltalk.Package)})},
  1240. messageSends: ["at:ifAbsentPut:", "commitPathStFor:", "transport", "ifNil:"]}),
  1241. smalltalk.Package);
  1242. smalltalk.addMethod(
  1243. smalltalk.method({
  1244. selector: "commitPathSt:",
  1245. fn: function (aString){
  1246. var self=this;
  1247. return smalltalk.withContext(function($ctx1) {
  1248. var $3,$2,$1;
  1249. $3=self["@extension"];
  1250. if(($receiver = $3) == nil || $receiver == undefined){
  1251. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1252. $2=self["@extension"];
  1253. } else {
  1254. $2=$3;
  1255. };
  1256. $1=_st($2)._at_put_("commitPathSt",aString);
  1257. return $1;
  1258. }, function($ctx1) {$ctx1.fill(self,"commitPathSt:",{aString:aString},smalltalk.Package)})},
  1259. messageSends: ["at:put:", "ifNil:"]}),
  1260. smalltalk.Package);
  1261. smalltalk.addMethod(
  1262. smalltalk.method({
  1263. selector: "transport",
  1264. fn: function (){
  1265. var self=this;
  1266. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  1267. return smalltalk.withContext(function($ctx1) {
  1268. var $1;
  1269. $1=_st($PackageHandler())._for_(self._transportType());
  1270. return $1;
  1271. }, function($ctx1) {$ctx1.fill(self,"transport",{},smalltalk.Package)})},
  1272. messageSends: ["for:", "transportType"]}),
  1273. smalltalk.Package);
  1274. smalltalk.addMethod(
  1275. smalltalk.method({
  1276. selector: "transportType",
  1277. fn: function (){
  1278. var self=this;
  1279. return smalltalk.withContext(function($ctx1) {
  1280. return (self.transport && self.transport.type) || 'unknown';;
  1281. return self}, function($ctx1) {$ctx1.fill(self,"transportType",{},smalltalk.Package)})},
  1282. messageSends: []}),
  1283. smalltalk.Package);
  1284. })(global_smalltalk,global_nil,global__st);