Importer-Exporter.deploy.js 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283
  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('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
  665. smalltalk.addMethod(
  666. smalltalk.method({
  667. selector: "ajaxPutAt:data:",
  668. fn: function (aURL,aString){
  669. var self=this;
  670. return smalltalk.withContext(function($ctx1) {
  671. 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){
  672. return smalltalk.withContext(function($ctx2) {
  673. return self._error_(_st(_st(_st("Commiting ".__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
  674. }, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
  675. return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.PackageHandler)})},
  676. messageSends: ["ajax:", "->", "error:", ",", "responseText"]}),
  677. smalltalk.PackageHandler);
  678. smalltalk.addMethod(
  679. smalltalk.method({
  680. selector: "commit:",
  681. fn: function (aPackage){
  682. var self=this;
  683. function $PluggableExporter(){return smalltalk.PluggableExporter||(typeof PluggableExporter=="undefined"?nil:PluggableExporter)}
  684. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  685. return smalltalk.withContext(function($ctx1) {
  686. _st(self._commitChannels())._do_displayingProgress_((function(commitStrategyFactory){
  687. var fileContents,commitStrategy;
  688. return smalltalk.withContext(function($ctx2) {
  689. commitStrategy=_st(commitStrategyFactory)._value_(aPackage);
  690. commitStrategy;
  691. fileContents=_st($String())._streamContents_((function(stream){
  692. return smalltalk.withContext(function($ctx3) {
  693. return _st(_st($PluggableExporter())._newUsing_(_st(commitStrategy)._key()))._exportPackage_on_(aPackage,stream);
  694. }, function($ctx3) {$ctx3.fillBlock({stream:stream},$ctx2)})}));
  695. fileContents;
  696. return self._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  697. }, function($ctx2) {$ctx2.fillBlock({commitStrategyFactory:commitStrategyFactory,fileContents:fileContents,commitStrategy:commitStrategy},$ctx1)})}),"Committing package ".__comma(_st(aPackage)._name()));
  698. return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)})},
  699. messageSends: ["do:displayingProgress:", "value:", "streamContents:", "exportPackage:on:", "newUsing:", "key", "ajaxPutAt:data:", "value", ",", "name", "commitChannels"]}),
  700. smalltalk.PackageHandler);
  701. smalltalk.addMethod(
  702. smalltalk.method({
  703. selector: "commitChannels",
  704. fn: function (){
  705. var self=this;
  706. return smalltalk.withContext(function($ctx1) {
  707. self._subclassResponsibility();
  708. return self}, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.PackageHandler)})},
  709. messageSends: ["subclassResponsibility"]}),
  710. smalltalk.PackageHandler);
  711. smalltalk.PackageHandler.klass.iVarNames = ['registry'];
  712. smalltalk.addMethod(
  713. smalltalk.method({
  714. selector: "classRegisteredFor:",
  715. fn: function (aString){
  716. var self=this;
  717. return smalltalk.withContext(function($ctx1) {
  718. var $1;
  719. $1=_st(self["@registry"])._at_(aString);
  720. return $1;
  721. }, function($ctx1) {$ctx1.fill(self,"classRegisteredFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  722. messageSends: ["at:"]}),
  723. smalltalk.PackageHandler.klass);
  724. smalltalk.addMethod(
  725. smalltalk.method({
  726. selector: "for:",
  727. fn: function (aString){
  728. var self=this;
  729. return smalltalk.withContext(function($ctx1) {
  730. var $1;
  731. $1=_st(self._classRegisteredFor_(aString))._new();
  732. return $1;
  733. }, function($ctx1) {$ctx1.fill(self,"for:",{aString:aString},smalltalk.PackageHandler.klass)})},
  734. messageSends: ["new", "classRegisteredFor:"]}),
  735. smalltalk.PackageHandler.klass);
  736. smalltalk.addMethod(
  737. smalltalk.method({
  738. selector: "initialize",
  739. fn: function (){
  740. var self=this;
  741. return smalltalk.withContext(function($ctx1) {
  742. smalltalk.PackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  743. self["@registry"]=smalltalk.HashedCollection._from_([]);
  744. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.PackageHandler.klass)})},
  745. messageSends: ["initialize"]}),
  746. smalltalk.PackageHandler.klass);
  747. smalltalk.addMethod(
  748. smalltalk.method({
  749. selector: "register:for:",
  750. fn: function (aClass,aString){
  751. var self=this;
  752. return smalltalk.withContext(function($ctx1) {
  753. _st(self["@registry"])._at_put_(aString,aClass);
  754. return self}, function($ctx1) {$ctx1.fill(self,"register:for:",{aClass:aClass,aString:aString},smalltalk.PackageHandler.klass)})},
  755. messageSends: ["at:put:"]}),
  756. smalltalk.PackageHandler.klass);
  757. smalltalk.addMethod(
  758. smalltalk.method({
  759. selector: "registerFor:",
  760. fn: function (aString){
  761. var self=this;
  762. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  763. return smalltalk.withContext(function($ctx1) {
  764. _st($PackageHandler())._register_for_(self,aString);
  765. return self}, function($ctx1) {$ctx1.fill(self,"registerFor:",{aString:aString},smalltalk.PackageHandler.klass)})},
  766. messageSends: ["register:for:"]}),
  767. smalltalk.PackageHandler.klass);
  768. smalltalk.addClass('LegacyPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
  769. smalltalk.addMethod(
  770. smalltalk.method({
  771. selector: "commitChannels",
  772. fn: function (){
  773. var self=this;
  774. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  775. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  776. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  777. return smalltalk.withContext(function($ctx1) {
  778. var $1;
  779. $1=[(function(pkg){
  780. return smalltalk.withContext(function($ctx2) {
  781. return _st(_st($Exporter())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".js"));
  782. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  783. return smalltalk.withContext(function($ctx2) {
  784. return _st(_st($StrippedExporter())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathJs()).__comma("/")).__comma(_st(pkg)._name())).__comma(".deploy.js"));
  785. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})}),(function(pkg){
  786. return smalltalk.withContext(function($ctx2) {
  787. return _st(_st($ChunkExporter())._recipe()).__minus_gt(_st(_st(_st(_st(pkg)._commitPathSt()).__comma("/")).__comma(_st(pkg)._name())).__comma(".st"));
  788. }, function($ctx2) {$ctx2.fillBlock({pkg:pkg},$ctx1)})})];
  789. return $1;
  790. }, function($ctx1) {$ctx1.fill(self,"commitChannels",{},smalltalk.LegacyPackageHandler)})},
  791. messageSends: ["->", ",", "name", "commitPathJs", "recipe", "commitPathSt"]}),
  792. smalltalk.LegacyPackageHandler);
  793. smalltalk.addMethod(
  794. smalltalk.method({
  795. selector: "commitPathJsFor:",
  796. fn: function (aPackage){
  797. var self=this;
  798. return smalltalk.withContext(function($ctx1) {
  799. var $1;
  800. $1=_st(self._class())._defaultCommitPathJs();
  801. return $1;
  802. }, function($ctx1) {$ctx1.fill(self,"commitPathJsFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  803. messageSends: ["defaultCommitPathJs", "class"]}),
  804. smalltalk.LegacyPackageHandler);
  805. smalltalk.addMethod(
  806. smalltalk.method({
  807. selector: "commitPathStFor:",
  808. fn: function (aPackage){
  809. var self=this;
  810. return smalltalk.withContext(function($ctx1) {
  811. var $1;
  812. $1=_st(self._class())._defaultCommitPathSt();
  813. return $1;
  814. }, function($ctx1) {$ctx1.fill(self,"commitPathStFor:",{aPackage:aPackage},smalltalk.LegacyPackageHandler)})},
  815. messageSends: ["defaultCommitPathSt", "class"]}),
  816. smalltalk.LegacyPackageHandler);
  817. smalltalk.addMethod(
  818. smalltalk.method({
  819. selector: "loadPackage:prefix:",
  820. fn: function (packageName,aString){
  821. var self=this;
  822. var url;
  823. return smalltalk.withContext(function($ctx1) {
  824. var $1;
  825. url=_st(_st(_st("/".__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
  826. self._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(url),"type".__minus_gt("GET"),"dataType".__minus_gt("script"),"complete".__minus_gt((function(jqXHR,textStatus){
  827. return smalltalk.withContext(function($ctx2) {
  828. $1=_st(_st(jqXHR)._readyState()).__eq((4));
  829. if(smalltalk.assert($1)){
  830. return self._setupPackageNamed_prefix_(packageName,aString);
  831. };
  832. }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),"error".__minus_gt((function(){
  833. return smalltalk.withContext(function($ctx2) {
  834. return self._alert_("Could not load package at: ".__comma(url));
  835. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  836. return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url},smalltalk.LegacyPackageHandler)})},
  837. messageSends: [",", "ajax:", "->", "ifTrue:", "setupPackageNamed:prefix:", "=", "readyState", "alert:"]}),
  838. smalltalk.LegacyPackageHandler);
  839. smalltalk.addMethod(
  840. smalltalk.method({
  841. selector: "loadPackages:prefix:",
  842. fn: function (aCollection,aString){
  843. var self=this;
  844. return smalltalk.withContext(function($ctx1) {
  845. _st(aCollection)._do_((function(each){
  846. return smalltalk.withContext(function($ctx2) {
  847. return self._loadPackage_prefix_(each,aString);
  848. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  849. return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler)})},
  850. messageSends: ["do:", "loadPackage:prefix:"]}),
  851. smalltalk.LegacyPackageHandler);
  852. smalltalk.addMethod(
  853. smalltalk.method({
  854. selector: "setupPackageNamed:prefix:",
  855. fn: function (packageName,aString){
  856. var self=this;
  857. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  858. return smalltalk.withContext(function($ctx1) {
  859. var $1,$2;
  860. $1=_st($Package())._named_(packageName);
  861. _st($1)._setupClasses();
  862. _st($1)._commitPathJs_(_st("/".__comma(aString)).__comma("/js"));
  863. $2=_st($1)._commitPathSt_(_st("/".__comma(aString)).__comma("/st"));
  864. return self}, function($ctx1) {$ctx1.fill(self,"setupPackageNamed:prefix:",{packageName:packageName,aString:aString},smalltalk.LegacyPackageHandler)})},
  865. messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"]}),
  866. smalltalk.LegacyPackageHandler);
  867. smalltalk.LegacyPackageHandler.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  868. smalltalk.addMethod(
  869. smalltalk.method({
  870. selector: "commitPathsFromLoader",
  871. fn: function (){
  872. var self=this;
  873. return smalltalk.withContext(function($ctx1) {
  874. var commitPath = typeof amber !== 'undefined' && amber.commitPath;
  875. if (!commitPath) return;
  876. if (commitPath.js) self._defaultCommitPathJs_(commitPath.js);
  877. if (commitPath.st) self._defaultCommitPathSt_(commitPath.st);
  878. ;
  879. return self}, function($ctx1) {$ctx1.fill(self,"commitPathsFromLoader",{},smalltalk.LegacyPackageHandler.klass)})},
  880. messageSends: []}),
  881. smalltalk.LegacyPackageHandler.klass);
  882. smalltalk.addMethod(
  883. smalltalk.method({
  884. selector: "defaultCommitPathJs",
  885. fn: function (){
  886. var self=this;
  887. return smalltalk.withContext(function($ctx1) {
  888. var $2,$1;
  889. $2=self["@defaultCommitPathJs"];
  890. if(($receiver = $2) == nil || $receiver == undefined){
  891. self["@defaultCommitPathJs"]="js";
  892. $1=self["@defaultCommitPathJs"];
  893. } else {
  894. $1=$2;
  895. };
  896. return $1;
  897. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs",{},smalltalk.LegacyPackageHandler.klass)})},
  898. messageSends: ["ifNil:"]}),
  899. smalltalk.LegacyPackageHandler.klass);
  900. smalltalk.addMethod(
  901. smalltalk.method({
  902. selector: "defaultCommitPathJs:",
  903. fn: function (aString){
  904. var self=this;
  905. return smalltalk.withContext(function($ctx1) {
  906. self["@defaultCommitPathJs"]=aString;
  907. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathJs:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  908. messageSends: []}),
  909. smalltalk.LegacyPackageHandler.klass);
  910. smalltalk.addMethod(
  911. smalltalk.method({
  912. selector: "defaultCommitPathSt",
  913. fn: function (){
  914. var self=this;
  915. return smalltalk.withContext(function($ctx1) {
  916. var $2,$1;
  917. $2=self["@defaultCommitPathSt"];
  918. if(($receiver = $2) == nil || $receiver == undefined){
  919. self["@defaultCommitPathSt"]="st";
  920. $1=self["@defaultCommitPathSt"];
  921. } else {
  922. $1=$2;
  923. };
  924. return $1;
  925. }, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt",{},smalltalk.LegacyPackageHandler.klass)})},
  926. messageSends: ["ifNil:"]}),
  927. smalltalk.LegacyPackageHandler.klass);
  928. smalltalk.addMethod(
  929. smalltalk.method({
  930. selector: "defaultCommitPathSt:",
  931. fn: function (aString){
  932. var self=this;
  933. return smalltalk.withContext(function($ctx1) {
  934. self["@defaultCommitPathSt"]=aString;
  935. return self}, function($ctx1) {$ctx1.fill(self,"defaultCommitPathSt:",{aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  936. messageSends: []}),
  937. smalltalk.LegacyPackageHandler.klass);
  938. smalltalk.addMethod(
  939. smalltalk.method({
  940. selector: "initialize",
  941. fn: function (){
  942. var self=this;
  943. return smalltalk.withContext(function($ctx1) {
  944. smalltalk.LegacyPackageHandler.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  945. self._registerFor_("unknown");
  946. self._commitPathsFromLoader();
  947. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.LegacyPackageHandler.klass)})},
  948. messageSends: ["initialize", "registerFor:", "commitPathsFromLoader"]}),
  949. smalltalk.LegacyPackageHandler.klass);
  950. smalltalk.addMethod(
  951. smalltalk.method({
  952. selector: "loadPackages:prefix:",
  953. fn: function (aCollection,aString){
  954. var self=this;
  955. return smalltalk.withContext(function($ctx1) {
  956. var $1;
  957. $1=_st(self._new())._loadPackages_prefix_(aCollection,aString);
  958. return $1;
  959. }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.LegacyPackageHandler.klass)})},
  960. messageSends: ["loadPackages:prefix:", "new"]}),
  961. smalltalk.LegacyPackageHandler.klass);
  962. smalltalk.addMethod(
  963. smalltalk.method({
  964. selector: "resetCommitPaths",
  965. fn: function (){
  966. var self=this;
  967. return smalltalk.withContext(function($ctx1) {
  968. self["@defaultCommitPathJs"]=nil;
  969. self["@defaultCommitPathSt"]=nil;
  970. return self}, function($ctx1) {$ctx1.fill(self,"resetCommitPaths",{},smalltalk.LegacyPackageHandler.klass)})},
  971. messageSends: []}),
  972. smalltalk.LegacyPackageHandler.klass);
  973. smalltalk.addClass('PluggableExporter', smalltalk.Object, ['recipe'], 'Importer-Exporter');
  974. smalltalk.addMethod(
  975. smalltalk.method({
  976. selector: "export:usingRecipe:on:",
  977. fn: function (anObject,anArray,aStream){
  978. var self=this;
  979. var args;
  980. return smalltalk.withContext(function($ctx1) {
  981. var $1;
  982. args=[anObject,aStream];
  983. _st(anArray)._do_((function(each){
  984. var val;
  985. return smalltalk.withContext(function($ctx2) {
  986. val=_st(each)._value();
  987. val;
  988. $1=_st(val).__eq_eq(each);
  989. if(smalltalk.assert($1)){
  990. var selection;
  991. selection=_st(_st(_st(each)._first())._key())._perform_withArguments_(_st(_st(each)._first())._value(),[anObject]);
  992. selection;
  993. return _st(selection)._do_((function(eachPart){
  994. return smalltalk.withContext(function($ctx3) {
  995. return self._export_usingRecipe_on_(eachPart,_st(each)._allButFirst(),aStream);
  996. }, function($ctx3) {$ctx3.fillBlock({eachPart:eachPart},$ctx2)})}));
  997. } else {
  998. return _st(_st(each)._key())._perform_withArguments_(val,args);
  999. };
  1000. }, function($ctx2) {$ctx2.fillBlock({each:each,val:val},$ctx1)})}));
  1001. return self}, function($ctx1) {$ctx1.fill(self,"export:usingRecipe:on:",{anObject:anObject,anArray:anArray,aStream:aStream,args:args},smalltalk.PluggableExporter)})},
  1002. messageSends: ["do:", "value", "ifFalse:ifTrue:", "perform:withArguments:", "key", "first", "export:usingRecipe:on:", "allButFirst", "=="]}),
  1003. smalltalk.PluggableExporter);
  1004. smalltalk.addMethod(
  1005. smalltalk.method({
  1006. selector: "exportAll",
  1007. fn: function (){
  1008. var self=this;
  1009. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1010. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1011. return smalltalk.withContext(function($ctx1) {
  1012. var $1;
  1013. $1=_st($String())._streamContents_((function(stream){
  1014. return smalltalk.withContext(function($ctx2) {
  1015. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(pkg){
  1016. return smalltalk.withContext(function($ctx3) {
  1017. return self._exportPackage_on_(pkg,stream);
  1018. }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx2)})}));
  1019. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  1020. return $1;
  1021. }, function($ctx1) {$ctx1.fill(self,"exportAll",{},smalltalk.PluggableExporter)})},
  1022. messageSends: ["streamContents:", "do:", "exportPackage:on:", "packages", "current"]}),
  1023. smalltalk.PluggableExporter);
  1024. smalltalk.addMethod(
  1025. smalltalk.method({
  1026. selector: "exportPackage:on:",
  1027. fn: function (aPackage,aStream){
  1028. var self=this;
  1029. return smalltalk.withContext(function($ctx1) {
  1030. self._export_usingRecipe_on_(aPackage,self._recipe(),aStream);
  1031. return self}, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{aPackage:aPackage,aStream:aStream},smalltalk.PluggableExporter)})},
  1032. messageSends: ["export:usingRecipe:on:", "recipe"]}),
  1033. smalltalk.PluggableExporter);
  1034. smalltalk.addMethod(
  1035. smalltalk.method({
  1036. selector: "recipe",
  1037. fn: function (){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx1) {
  1040. var $1;
  1041. $1=self["@recipe"];
  1042. return $1;
  1043. }, function($ctx1) {$ctx1.fill(self,"recipe",{},smalltalk.PluggableExporter)})},
  1044. messageSends: []}),
  1045. smalltalk.PluggableExporter);
  1046. smalltalk.addMethod(
  1047. smalltalk.method({
  1048. selector: "recipe:",
  1049. fn: function (anArray){
  1050. var self=this;
  1051. return smalltalk.withContext(function($ctx1) {
  1052. self["@recipe"]=anArray;
  1053. return self}, function($ctx1) {$ctx1.fill(self,"recipe:",{anArray:anArray},smalltalk.PluggableExporter)})},
  1054. messageSends: []}),
  1055. smalltalk.PluggableExporter);
  1056. smalltalk.addMethod(
  1057. smalltalk.method({
  1058. selector: "newUsing:",
  1059. fn: function (recipe){
  1060. var self=this;
  1061. return smalltalk.withContext(function($ctx1) {
  1062. var $2,$3,$1;
  1063. $2=self._new();
  1064. _st($2)._recipe_(recipe);
  1065. $3=_st($2)._yourself();
  1066. $1=$3;
  1067. return $1;
  1068. }, function($ctx1) {$ctx1.fill(self,"newUsing:",{recipe:recipe},smalltalk.PluggableExporter.klass)})},
  1069. messageSends: ["recipe:", "new", "yourself"]}),
  1070. smalltalk.PluggableExporter.klass);
  1071. smalltalk.addMethod(
  1072. smalltalk.method({
  1073. selector: "ownClassesOfPackage:",
  1074. fn: function (package_){
  1075. var self=this;
  1076. return smalltalk.withContext(function($ctx1) {
  1077. var $1;
  1078. $1=_st(_st(package_)._sortedClasses())._asSet();
  1079. return $1;
  1080. }, function($ctx1) {$ctx1.fill(self,"ownClassesOfPackage:",{package_:package_},smalltalk.PluggableExporter.klass)})},
  1081. messageSends: ["asSet", "sortedClasses"]}),
  1082. smalltalk.PluggableExporter.klass);
  1083. smalltalk.addMethod(
  1084. smalltalk.method({
  1085. selector: "commit",
  1086. fn: function (){
  1087. var self=this;
  1088. return smalltalk.withContext(function($ctx1) {
  1089. var $1;
  1090. $1=_st(self._transport())._commit_(self);
  1091. return $1;
  1092. }, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
  1093. messageSends: ["commit:", "transport"]}),
  1094. smalltalk.Package);
  1095. smalltalk.addMethod(
  1096. smalltalk.method({
  1097. selector: "commitPathJs",
  1098. fn: function (){
  1099. var self=this;
  1100. return smalltalk.withContext(function($ctx1) {
  1101. var $3,$2,$1;
  1102. $3=self["@extension"];
  1103. if(($receiver = $3) == nil || $receiver == undefined){
  1104. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1105. $2=self["@extension"];
  1106. } else {
  1107. $2=$3;
  1108. };
  1109. $1=_st($2)._at_ifAbsentPut_("commitPathJs",(function(){
  1110. return smalltalk.withContext(function($ctx2) {
  1111. return _st(self._transport())._commitPathJsFor_(self);
  1112. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1113. return $1;
  1114. }, function($ctx1) {$ctx1.fill(self,"commitPathJs",{},smalltalk.Package)})},
  1115. messageSends: ["at:ifAbsentPut:", "commitPathJsFor:", "transport", "ifNil:"]}),
  1116. smalltalk.Package);
  1117. smalltalk.addMethod(
  1118. smalltalk.method({
  1119. selector: "commitPathJs:",
  1120. fn: function (aString){
  1121. var self=this;
  1122. return smalltalk.withContext(function($ctx1) {
  1123. var $3,$2,$1;
  1124. $3=self["@extension"];
  1125. if(($receiver = $3) == nil || $receiver == undefined){
  1126. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1127. $2=self["@extension"];
  1128. } else {
  1129. $2=$3;
  1130. };
  1131. $1=_st($2)._at_put_("commitPathJs",aString);
  1132. return $1;
  1133. }, function($ctx1) {$ctx1.fill(self,"commitPathJs:",{aString:aString},smalltalk.Package)})},
  1134. messageSends: ["at:put:", "ifNil:"]}),
  1135. smalltalk.Package);
  1136. smalltalk.addMethod(
  1137. smalltalk.method({
  1138. selector: "commitPathSt",
  1139. fn: function (){
  1140. var self=this;
  1141. return smalltalk.withContext(function($ctx1) {
  1142. var $3,$2,$1;
  1143. $3=self["@extension"];
  1144. if(($receiver = $3) == nil || $receiver == undefined){
  1145. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1146. $2=self["@extension"];
  1147. } else {
  1148. $2=$3;
  1149. };
  1150. $1=_st($2)._at_ifAbsentPut_("commitPathSt",(function(){
  1151. return smalltalk.withContext(function($ctx2) {
  1152. return _st(self._transport())._commitPathStFor_(self);
  1153. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1154. return $1;
  1155. }, function($ctx1) {$ctx1.fill(self,"commitPathSt",{},smalltalk.Package)})},
  1156. messageSends: ["at:ifAbsentPut:", "commitPathStFor:", "transport", "ifNil:"]}),
  1157. smalltalk.Package);
  1158. smalltalk.addMethod(
  1159. smalltalk.method({
  1160. selector: "commitPathSt:",
  1161. fn: function (aString){
  1162. var self=this;
  1163. return smalltalk.withContext(function($ctx1) {
  1164. var $3,$2,$1;
  1165. $3=self["@extension"];
  1166. if(($receiver = $3) == nil || $receiver == undefined){
  1167. self["@extension"]=smalltalk.HashedCollection._from_([]);
  1168. $2=self["@extension"];
  1169. } else {
  1170. $2=$3;
  1171. };
  1172. $1=_st($2)._at_put_("commitPathSt",aString);
  1173. return $1;
  1174. }, function($ctx1) {$ctx1.fill(self,"commitPathSt:",{aString:aString},smalltalk.Package)})},
  1175. messageSends: ["at:put:", "ifNil:"]}),
  1176. smalltalk.Package);
  1177. smalltalk.addMethod(
  1178. smalltalk.method({
  1179. selector: "transport",
  1180. fn: function (){
  1181. var self=this;
  1182. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  1183. return smalltalk.withContext(function($ctx1) {
  1184. var $1;
  1185. $1=_st($PackageHandler())._for_(self._transportType());
  1186. return $1;
  1187. }, function($ctx1) {$ctx1.fill(self,"transport",{},smalltalk.Package)})},
  1188. messageSends: ["for:", "transportType"]}),
  1189. smalltalk.Package);
  1190. smalltalk.addMethod(
  1191. smalltalk.method({
  1192. selector: "transportType",
  1193. fn: function (){
  1194. var self=this;
  1195. return smalltalk.withContext(function($ctx1) {
  1196. return (self.transport && self.transport.type) || 'unknown';;
  1197. return self}, function($ctx1) {$ctx1.fill(self,"transportType",{},smalltalk.Package)})},
  1198. messageSends: []}),
  1199. smalltalk.Package);
  1200. })(global_smalltalk,global_nil,global__st);