Importer-Exporter.deploy.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. (function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Importer-Exporter');
  3. smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "nextChunk",
  7. fn: function (){
  8. var self=this;
  9. var char,result,chunk;
  10. return smalltalk.withContext(function($ctx1) {
  11. var $1,$2,$3;
  12. var $early={};
  13. try {
  14. result=""._writeStream();
  15. _st((function(){
  16. return smalltalk.withContext(function($ctx2) {
  17. char=_st(self["@stream"])._next();
  18. char;
  19. return _st(char)._notNil();
  20. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  21. return smalltalk.withContext(function($ctx2) {
  22. $1=_st(char).__eq("!");
  23. if(smalltalk.assert($1)){
  24. $2=_st(_st(self["@stream"])._peek()).__eq("!");
  25. if(smalltalk.assert($2)){
  26. _st(self["@stream"])._next();
  27. } else {
  28. $3=_st(_st(result)._contents())._trimBoth();
  29. throw $early=[$3];
  30. };
  31. };
  32. return _st(result)._nextPut_(char);
  33. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  34. return nil;
  35. }
  36. catch(e) {if(e===$early)return e[0]; throw e}
  37. }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk},smalltalk.ChunkParser)})},
  38. messageSends: ["writeStream", "whileTrue:", "ifTrue:", "ifTrue:ifFalse:", "next", "trimBoth", "contents", "=", "peek", "nextPut:", "notNil"]}),
  39. smalltalk.ChunkParser);
  40. smalltalk.addMethod(
  41. smalltalk.method({
  42. selector: "stream:",
  43. fn: function (aStream){
  44. var self=this;
  45. return smalltalk.withContext(function($ctx1) {
  46. self["@stream"]=aStream;
  47. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.ChunkParser)})},
  48. messageSends: []}),
  49. smalltalk.ChunkParser);
  50. smalltalk.addMethod(
  51. smalltalk.method({
  52. selector: "on:",
  53. fn: function (aStream){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) {
  56. var $1;
  57. $1=_st(self._new())._stream_(aStream);
  58. return $1;
  59. }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream},smalltalk.ChunkParser.klass)})},
  60. messageSends: ["stream:", "new"]}),
  61. smalltalk.ChunkParser.klass);
  62. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Importer-Exporter');
  63. smalltalk.addMethod(
  64. smalltalk.method({
  65. selector: "classNameFor:",
  66. fn: function (aClass){
  67. var self=this;
  68. return smalltalk.withContext(function($ctx1) {
  69. var $2,$3,$1;
  70. $2=_st(aClass)._isMetaclass();
  71. if(smalltalk.assert($2)){
  72. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
  73. } else {
  74. $3=_st(aClass)._isNil();
  75. if(smalltalk.assert($3)){
  76. $1="nil";
  77. } else {
  78. $1=_st(aClass)._name();
  79. };
  80. };
  81. return $1;
  82. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.Exporter)})},
  83. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"]}),
  84. smalltalk.Exporter);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "exportAll",
  88. fn: function (){
  89. var self=this;
  90. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  91. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  92. return smalltalk.withContext(function($ctx1) {
  93. var $1;
  94. $1=_st($String())._streamContents_((function(stream){
  95. return smalltalk.withContext(function($ctx2) {
  96. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(pkg){
  97. return smalltalk.withContext(function($ctx3) {
  98. return self._exportPackage_on_(_st(pkg)._name(),stream);
  99. }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx2)})}));
  100. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
  101. return $1;
  102. }, function($ctx1) {$ctx1.fill(self,"exportAll",{},smalltalk.Exporter)})},
  103. messageSends: ["streamContents:", "do:", "exportPackage:on:", "name", "packages", "current"]}),
  104. smalltalk.Exporter);
  105. smalltalk.addMethod(
  106. smalltalk.method({
  107. selector: "exportClass:on:",
  108. fn: function (aClass,aStream){
  109. var self=this;
  110. return smalltalk.withContext(function($ctx1) {
  111. self._exportDefinitionOf_on_(aClass,aStream);
  112. self._exportMethodsOf_on_(aClass,aStream);
  113. self._exportMetaDefinitionOf_on_(aClass,aStream);
  114. self._exportMethodsOf_on_(_st(aClass)._class(),aStream);
  115. return self}, function($ctx1) {$ctx1.fill(self,"exportClass:on:",{aClass:aClass,aStream:aStream},smalltalk.Exporter)})},
  116. messageSends: ["exportDefinitionOf:on:", "exportMethodsOf:on:", "exportMetaDefinitionOf:on:", "class"]}),
  117. smalltalk.Exporter);
  118. smalltalk.addMethod(
  119. smalltalk.method({
  120. selector: "exportDefinitionOf:on:",
  121. fn: function (aClass,aStream){
  122. var self=this;
  123. return smalltalk.withContext(function($ctx1) {
  124. var $1,$2,$3,$4,$5,$6,$7;
  125. $1=aStream;
  126. _st($1)._nextPutAll_("smalltalk.addClass(");
  127. _st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
  128. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
  129. $2=_st($1)._nextPutAll_(", [");
  130. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  131. return smalltalk.withContext(function($ctx2) {
  132. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  133. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  134. return smalltalk.withContext(function($ctx2) {
  135. return _st(aStream)._nextPutAll_(", ");
  136. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  137. $3=aStream;
  138. _st($3)._nextPutAll_("], '");
  139. _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
  140. $4=_st($3)._nextPutAll_(");");
  141. $5=_st(_st(aClass)._comment())._notEmpty();
  142. if(smalltalk.assert($5)){
  143. $6=aStream;
  144. _st($6)._lf();
  145. _st($6)._nextPutAll_("smalltalk.");
  146. _st($6)._nextPutAll_(self._classNameFor_(aClass));
  147. _st($6)._nextPutAll_(".comment=");
  148. _st($6)._nextPutAll_(_st(_st(aClass)._comment())._asJavascript());
  149. $7=_st($6)._nextPutAll_(";");
  150. $7;
  151. };
  152. _st(aStream)._lf();
  153. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.Exporter)})},
  154. messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "lf", "asJavascript", "comment", "notEmpty"]}),
  155. smalltalk.Exporter);
  156. smalltalk.addMethod(
  157. smalltalk.method({
  158. selector: "exportMetaDefinitionOf:on:",
  159. fn: function (aClass,aStream){
  160. var self=this;
  161. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  162. return smalltalk.withContext(function($ctx1) {
  163. var $1,$2,$3;
  164. $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
  165. if(! smalltalk.assert($1)){
  166. $2=aStream;
  167. _st($2)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._class())));
  168. $3=_st($2)._nextPutAll_(".iVarNames = [");
  169. $3;
  170. _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
  171. return smalltalk.withContext(function($ctx2) {
  172. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  173. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  174. return smalltalk.withContext(function($ctx2) {
  175. return _st(aStream)._nextPutAll_(",");
  176. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  177. _st(aStream)._nextPutAll_("];".__comma(_st($String())._lf()));
  178. };
  179. return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.Exporter)})},
  180. messageSends: ["ifFalse:", "nextPutAll:", ",", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "lf", "isEmpty"]}),
  181. smalltalk.Exporter);
  182. smalltalk.addMethod(
  183. smalltalk.method({
  184. selector: "exportMethod:on:",
  185. fn: function (aMethod,aStream){
  186. var self=this;
  187. return smalltalk.withContext(function($ctx1) {
  188. var $1,$2,$3,$4;
  189. $1=aStream;
  190. _st($1)._nextPutAll_("smalltalk.addMethod(");
  191. _st($1)._lf();
  192. _st($1)._nextPutAll_("smalltalk.method({");
  193. _st($1)._lf();
  194. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  195. _st($1)._lf();
  196. _st($1)._nextPutAll_(_st("category: '".__comma(_st(aMethod)._category())).__comma("',"));
  197. _st($1)._lf();
  198. _st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
  199. _st($1)._lf();
  200. _st($1)._nextPutAll_(_st("args: ".__comma(_st(_st(aMethod)._arguments())._asJavascript())).__comma(","));
  201. _st($1)._lf();
  202. _st($1)._nextPutAll_(_st("source: ".__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  203. _st($1)._lf();
  204. _st($1)._nextPutAll_(_st("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript())).__comma(","));
  205. _st($1)._lf();
  206. $2=_st($1)._nextPutAll_("referencedClasses: ".__comma(_st(_st(aMethod)._referencedClasses())._asJavascript()));
  207. $3=aStream;
  208. _st($3)._lf();
  209. _st($3)._nextPutAll_("}),");
  210. _st($3)._lf();
  211. _st($3)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
  212. _st($3)._nextPutAll_(");");
  213. _st($3)._lf();
  214. $4=_st($3)._lf();
  215. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.Exporter)})},
  216. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:", "methodClass"]}),
  217. smalltalk.Exporter);
  218. smalltalk.addMethod(
  219. smalltalk.method({
  220. selector: "exportMethodsOf:on:",
  221. fn: function (aClass,aStream){
  222. var self=this;
  223. return smalltalk.withContext(function($ctx1) {
  224. var $1;
  225. _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  226. return smalltalk.withContext(function($ctx2) {
  227. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  228. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  229. return smalltalk.withContext(function($ctx2) {
  230. $1=_st(_st(each)._category())._match_("^\x5c*");
  231. if(! smalltalk.assert($1)){
  232. return self._exportMethod_on_(each,aStream);
  233. };
  234. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  235. _st(aStream)._lf();
  236. return self}, function($ctx1) {$ctx1.fill(self,"exportMethodsOf:on:",{aClass:aClass,aStream:aStream},smalltalk.Exporter)})},
  237. messageSends: ["do:", "ifFalse:", "exportMethod:on:", "match:", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "lf"]}),
  238. smalltalk.Exporter);
  239. smalltalk.addMethod(
  240. smalltalk.method({
  241. selector: "exportPackage:on:",
  242. fn: function (packageName,stream){
  243. var self=this;
  244. var package_;
  245. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  246. return smalltalk.withContext(function($ctx1) {
  247. package_=_st(_st($Smalltalk())._current())._packageAt_(packageName);
  248. self._exportPackagePrologueOf_on_(package_,stream);
  249. _st((function(){
  250. return smalltalk.withContext(function($ctx2) {
  251. self._exportPackageDefinitionOf_on_(package_,stream);
  252. _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
  253. return smalltalk.withContext(function($ctx3) {
  254. return self._exportClass_on_(each,stream);
  255. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  256. return self._exportPackageExtensionsOf_on_(package_,stream);
  257. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
  258. return smalltalk.withContext(function($ctx2) {
  259. return self._exportPackageEpilogueOf_on_(package_,stream);
  260. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  261. return self}, function($ctx1) {$ctx1.fill(self,"exportPackage:on:",{packageName:packageName,stream:stream,package_:package_},smalltalk.Exporter)})},
  262. messageSends: ["packageAt:", "current", "exportPackagePrologueOf:on:", "ensure:", "exportPackageEpilogueOf:on:", "exportPackageDefinitionOf:on:", "do:", "exportClass:on:", "asSet", "sortedClasses", "exportPackageExtensionsOf:on:"]}),
  263. smalltalk.Exporter);
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "exportPackageDefinitionOf:on:",
  267. fn: function (package_,aStream){
  268. var self=this;
  269. return smalltalk.withContext(function($ctx1) {
  270. var $1,$2;
  271. $1=aStream;
  272. _st($1)._nextPutAll_("smalltalk.addPackage(");
  273. _st($1)._nextPutAll_(_st("'".__comma(_st(package_)._name())).__comma("');"));
  274. $2=_st($1)._lf();
  275. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream},smalltalk.Exporter)})},
  276. messageSends: ["nextPutAll:", ",", "name", "lf"]}),
  277. smalltalk.Exporter);
  278. smalltalk.addMethod(
  279. smalltalk.method({
  280. selector: "exportPackageEpilogueOf:on:",
  281. fn: function (aPackage,aStream){
  282. var self=this;
  283. return smalltalk.withContext(function($ctx1) {
  284. var $1,$2;
  285. $1=aStream;
  286. _st($1)._nextPutAll_("})(global_smalltalk,global_nil,global__st);");
  287. $2=_st($1)._lf();
  288. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter)})},
  289. messageSends: ["nextPutAll:", "lf"]}),
  290. smalltalk.Exporter);
  291. smalltalk.addMethod(
  292. smalltalk.method({
  293. selector: "exportPackageExtensionsOf:on:",
  294. fn: function (package_,aStream){
  295. var self=this;
  296. var name;
  297. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  298. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  299. return smalltalk.withContext(function($ctx1) {
  300. var $1;
  301. name=_st(package_)._name();
  302. _st(_st($Package())._sortedClasses_(_st(_st($Smalltalk())._current())._classes()))._do_((function(each){
  303. return smalltalk.withContext(function($ctx2) {
  304. return _st([each,_st(each)._class()])._do_((function(aClass){
  305. return smalltalk.withContext(function($ctx3) {
  306. return _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
  307. return smalltalk.withContext(function($ctx4) {
  308. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  309. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._do_((function(method){
  310. return smalltalk.withContext(function($ctx4) {
  311. $1=_st(_st(method)._category())._match_("^\x5c*".__comma(name));
  312. if(smalltalk.assert($1)){
  313. return self._exportMethod_on_(method,aStream);
  314. };
  315. }, function($ctx4) {$ctx4.fillBlock({method:method},$ctx3)})}));
  316. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
  317. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  318. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageExtensionsOf:on:",{package_:package_,aStream:aStream,name:name},smalltalk.Exporter)})},
  319. messageSends: ["name", "do:", "ifTrue:", "exportMethod:on:", "match:", ",", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "class", "sortedClasses:", "classes", "current"]}),
  320. smalltalk.Exporter);
  321. smalltalk.addMethod(
  322. smalltalk.method({
  323. selector: "exportPackagePrologueOf:on:",
  324. fn: function (aPackage,aStream){
  325. var self=this;
  326. return smalltalk.withContext(function($ctx1) {
  327. var $1,$2;
  328. $1=aStream;
  329. _st($1)._nextPutAll_("(function(smalltalk,nil,_st){");
  330. $2=_st($1)._lf();
  331. return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.Exporter)})},
  332. messageSends: ["nextPutAll:", "lf"]}),
  333. smalltalk.Exporter);
  334. smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Importer-Exporter');
  335. smalltalk.addMethod(
  336. smalltalk.method({
  337. selector: "chunkEscape:",
  338. fn: function (aString){
  339. var self=this;
  340. return smalltalk.withContext(function($ctx1) {
  341. var $1;
  342. $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
  343. return $1;
  344. }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString},smalltalk.ChunkExporter)})},
  345. messageSends: ["trimBoth", "replace:with:"]}),
  346. smalltalk.ChunkExporter);
  347. smalltalk.addMethod(
  348. smalltalk.method({
  349. selector: "classNameFor:",
  350. fn: function (aClass){
  351. var self=this;
  352. return smalltalk.withContext(function($ctx1) {
  353. var $2,$3,$1;
  354. $2=_st(aClass)._isMetaclass();
  355. if(smalltalk.assert($2)){
  356. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(" class");
  357. } else {
  358. $3=_st(aClass)._isNil();
  359. if(smalltalk.assert($3)){
  360. $1="nil";
  361. } else {
  362. $1=_st(aClass)._name();
  363. };
  364. };
  365. return $1;
  366. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.ChunkExporter)})},
  367. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"]}),
  368. smalltalk.ChunkExporter);
  369. smalltalk.addMethod(
  370. smalltalk.method({
  371. selector: "exportCategory:on:",
  372. fn: function (category,aStream){
  373. var self=this;
  374. return smalltalk.withContext(function($ctx1) {
  375. var $1,$2,$3,$4;
  376. $1=aStream;
  377. _st($1)._nextPutAll_("!".__comma(self._classNameFor_(_st(category)._at_("class"))));
  378. $2=_st($1)._nextPutAll_(_st(" methodsFor: '".__comma(_st(category)._at_("name"))).__comma("'!"));
  379. _st(_st(_st(category)._at_("methods"))._sorted_((function(a,b){
  380. return smalltalk.withContext(function($ctx2) {
  381. return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
  382. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  383. return smalltalk.withContext(function($ctx2) {
  384. return self._exportMethod_on_(each,aStream);
  385. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  386. $3=aStream;
  387. _st($3)._nextPutAll_(" !");
  388. _st($3)._lf();
  389. $4=_st($3)._lf();
  390. return self}, function($ctx1) {$ctx1.fill(self,"exportCategory:on:",{category:category,aStream:aStream},smalltalk.ChunkExporter)})},
  391. messageSends: ["nextPutAll:", ",", "classNameFor:", "at:", "do:", "exportMethod:on:", "sorted:", "<=", "selector", "lf"]}),
  392. smalltalk.ChunkExporter);
  393. smalltalk.addMethod(
  394. smalltalk.method({
  395. selector: "exportDefinitionOf:on:",
  396. fn: function (aClass,aStream){
  397. var self=this;
  398. return smalltalk.withContext(function($ctx1) {
  399. var $1,$2,$3,$4,$5,$6,$7;
  400. $1=aStream;
  401. _st($1)._nextPutAll_(self._classNameFor_(_st(aClass)._superclass()));
  402. _st($1)._nextPutAll_(" subclass: #".__comma(self._classNameFor_(aClass)));
  403. _st($1)._lf();
  404. _st($1)._tab();
  405. $2=_st($1)._nextPutAll_("instanceVariableNames: '");
  406. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  407. return smalltalk.withContext(function($ctx2) {
  408. return _st(aStream)._nextPutAll_(each);
  409. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  410. return smalltalk.withContext(function($ctx2) {
  411. return _st(aStream)._nextPutAll_(" ");
  412. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  413. $3=aStream;
  414. _st($3)._nextPutAll_("'");
  415. _st($3)._lf();
  416. _st($3)._tab();
  417. _st($3)._nextPutAll_(_st("package: '".__comma(_st(aClass)._category())).__comma("'!"));
  418. $4=_st($3)._lf();
  419. $5=_st(_st(aClass)._comment())._notEmpty();
  420. if(smalltalk.assert($5)){
  421. $6=aStream;
  422. _st($6)._nextPutAll_(_st("!".__comma(self._classNameFor_(aClass))).__comma(" commentStamp!"));
  423. _st($6)._lf();
  424. _st($6)._nextPutAll_(_st(self._chunkEscape_(_st(aClass)._comment())).__comma("!"));
  425. $7=_st($6)._lf();
  426. $7;
  427. };
  428. _st(aStream)._lf();
  429. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.ChunkExporter)})},
  430. messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "tab", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"]}),
  431. smalltalk.ChunkExporter);
  432. smalltalk.addMethod(
  433. smalltalk.method({
  434. selector: "exportMetaDefinitionOf:on:",
  435. fn: function (aClass,aStream){
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) {
  438. var $1,$2,$3,$4,$5;
  439. $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
  440. if(! smalltalk.assert($1)){
  441. $2=aStream;
  442. _st($2)._nextPutAll_(self._classNameFor_(_st(aClass)._class()));
  443. $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
  444. $3;
  445. _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
  446. return smalltalk.withContext(function($ctx2) {
  447. return _st(aStream)._nextPutAll_(each);
  448. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  449. return smalltalk.withContext(function($ctx2) {
  450. return _st(aStream)._nextPutAll_(" ");
  451. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  452. $4=aStream;
  453. _st($4)._nextPutAll_("'!");
  454. _st($4)._lf();
  455. $5=_st($4)._lf();
  456. $5;
  457. };
  458. return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.ChunkExporter)})},
  459. messageSends: ["ifFalse:", "nextPutAll:", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "lf", "isEmpty"]}),
  460. smalltalk.ChunkExporter);
  461. smalltalk.addMethod(
  462. smalltalk.method({
  463. selector: "exportMethod:on:",
  464. fn: function (aMethod,aStream){
  465. var self=this;
  466. return smalltalk.withContext(function($ctx1) {
  467. var $1,$2;
  468. $1=aStream;
  469. _st($1)._lf();
  470. _st($1)._lf();
  471. _st($1)._nextPutAll_(self._chunkEscape_(_st(aMethod)._source()));
  472. _st($1)._lf();
  473. $2=_st($1)._nextPutAll_("!");
  474. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.ChunkExporter)})},
  475. messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"]}),
  476. smalltalk.ChunkExporter);
  477. smalltalk.addMethod(
  478. smalltalk.method({
  479. selector: "exportMethodsOf:on:",
  480. fn: function (aClass,aStream){
  481. var self=this;
  482. var map;
  483. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  484. return smalltalk.withContext(function($ctx1) {
  485. var $1;
  486. map=_st($Dictionary())._new();
  487. _st(aClass)._protocolsDo_((function(category,methods){
  488. return smalltalk.withContext(function($ctx2) {
  489. $1=_st(category)._match_("^\x5c*");
  490. if(! smalltalk.assert($1)){
  491. return _st(map)._at_put_(category,methods);
  492. };
  493. }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
  494. _st(_st(_st(map)._keys())._sorted_((function(a,b){
  495. return smalltalk.withContext(function($ctx2) {
  496. return _st(a).__lt_eq(b);
  497. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
  498. var methods;
  499. return smalltalk.withContext(function($ctx2) {
  500. methods=_st(map)._at_(category);
  501. methods;
  502. return self._exportCategory_on_(smalltalk.HashedCollection._from_(["methods".__minus_gt(methods),"name".__minus_gt(category),"class".__minus_gt(aClass)]),aStream);
  503. }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
  504. return self}, function($ctx1) {$ctx1.fill(self,"exportMethodsOf:on:",{aClass:aClass,aStream:aStream,map:map},smalltalk.ChunkExporter)})},
  505. messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "do:", "at:", "exportCategory:on:", "->", "sorted:", "<=", "keys"]}),
  506. smalltalk.ChunkExporter);
  507. smalltalk.addMethod(
  508. smalltalk.method({
  509. selector: "exportPackageDefinitionOf:on:",
  510. fn: function (package_,aStream){
  511. var self=this;
  512. return smalltalk.withContext(function($ctx1) {
  513. var $1,$2;
  514. $1=aStream;
  515. _st($1)._nextPutAll_(_st("Smalltalk current createPackage: '".__comma(_st(package_)._name())).__comma("'!"));
  516. $2=_st($1)._lf();
  517. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream},smalltalk.ChunkExporter)})},
  518. messageSends: ["nextPutAll:", ",", "name", "lf"]}),
  519. smalltalk.ChunkExporter);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "exportPackageEpilogueOf:on:",
  523. fn: function (aPackage,aStream){
  524. var self=this;
  525. return smalltalk.withContext(function($ctx1) {
  526. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.ChunkExporter)})},
  527. messageSends: []}),
  528. smalltalk.ChunkExporter);
  529. smalltalk.addMethod(
  530. smalltalk.method({
  531. selector: "exportPackageExtensionsOf:on:",
  532. fn: function (package_,aStream){
  533. var self=this;
  534. var name,map;
  535. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  536. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  537. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  538. return smalltalk.withContext(function($ctx1) {
  539. var $1;
  540. name=_st(package_)._name();
  541. _st(_st($Package())._sortedClasses_(_st(_st($Smalltalk())._current())._classes()))._do_((function(each){
  542. return smalltalk.withContext(function($ctx2) {
  543. return _st([each,_st(each)._class()])._do_((function(aClass){
  544. return smalltalk.withContext(function($ctx3) {
  545. map=_st($Dictionary())._new();
  546. map;
  547. _st(aClass)._protocolsDo_((function(category,methods){
  548. return smalltalk.withContext(function($ctx4) {
  549. $1=_st(category)._match_("^\x5c*".__comma(name));
  550. if(smalltalk.assert($1)){
  551. return _st(map)._at_put_(category,methods);
  552. };
  553. }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx3)})}));
  554. return _st(_st(_st(map)._keys())._sorted_((function(a,b){
  555. return smalltalk.withContext(function($ctx4) {
  556. return _st(a).__lt_eq(b);
  557. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._do_((function(category){
  558. var methods;
  559. return smalltalk.withContext(function($ctx4) {
  560. methods=_st(map)._at_(category);
  561. methods;
  562. return self._exportCategory_on_(smalltalk.HashedCollection._from_(["methods".__minus_gt(methods),"name".__minus_gt(category),"class".__minus_gt(aClass)]),aStream);
  563. }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx3)})}));
  564. }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx2)})}));
  565. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  566. return self}, function($ctx1) {$ctx1.fill(self,"exportPackageExtensionsOf:on:",{package_:package_,aStream:aStream,name:name,map:map},smalltalk.ChunkExporter)})},
  567. messageSends: ["name", "do:", "new", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "at:", "exportCategory:on:", "->", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"]}),
  568. smalltalk.ChunkExporter);
  569. smalltalk.addMethod(
  570. smalltalk.method({
  571. selector: "exportPackagePrologueOf:on:",
  572. fn: function (aPackage,aStream){
  573. var self=this;
  574. return smalltalk.withContext(function($ctx1) {
  575. return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOf:on:",{aPackage:aPackage,aStream:aStream},smalltalk.ChunkExporter)})},
  576. messageSends: []}),
  577. smalltalk.ChunkExporter);
  578. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
  579. smalltalk.addMethod(
  580. smalltalk.method({
  581. selector: "exportDefinitionOf:on:",
  582. fn: function (aClass,aStream){
  583. var self=this;
  584. return smalltalk.withContext(function($ctx1) {
  585. var $1,$2,$3,$4;
  586. $1=aStream;
  587. _st($1)._nextPutAll_("smalltalk.addClass(");
  588. _st($1)._nextPutAll_(_st("'".__comma(self._classNameFor_(aClass))).__comma("', "));
  589. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aClass)._superclass())));
  590. $2=_st($1)._nextPutAll_(", [");
  591. _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
  592. return smalltalk.withContext(function($ctx2) {
  593. return _st(aStream)._nextPutAll_(_st("'".__comma(each)).__comma("'"));
  594. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  595. return smalltalk.withContext(function($ctx2) {
  596. return _st(aStream)._nextPutAll_(", ");
  597. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  598. $3=aStream;
  599. _st($3)._nextPutAll_("], '");
  600. _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
  601. $4=_st($3)._nextPutAll_(");");
  602. _st(aStream)._lf();
  603. return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},smalltalk.StrippedExporter)})},
  604. messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "lf"]}),
  605. smalltalk.StrippedExporter);
  606. smalltalk.addMethod(
  607. smalltalk.method({
  608. selector: "exportMethod:on:",
  609. fn: function (aMethod,aStream){
  610. var self=this;
  611. return smalltalk.withContext(function($ctx1) {
  612. var $1,$2;
  613. $1=aStream;
  614. _st($1)._nextPutAll_("smalltalk.addMethod(");
  615. _st($1)._lf();
  616. _st($1)._nextPutAll_("smalltalk.method({");
  617. _st($1)._lf();
  618. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  619. _st($1)._lf();
  620. _st($1)._nextPutAll_(_st("fn: ".__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
  621. _st($1)._lf();
  622. _st($1)._nextPutAll_("messageSends: ".__comma(_st(_st(aMethod)._messageSends())._asJavascript()));
  623. _st($1)._nextPutAll_("}),");
  624. _st($1)._lf();
  625. _st($1)._nextPutAll_("smalltalk.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
  626. _st($1)._nextPutAll_(");");
  627. _st($1)._lf();
  628. $2=_st($1)._lf();
  629. return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},smalltalk.StrippedExporter)})},
  630. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "compiledSource", "fn", "messageSends", "classNameFor:", "methodClass"]}),
  631. smalltalk.StrippedExporter);
  632. smalltalk.addClass('Importer', smalltalk.Object, [], 'Importer-Exporter');
  633. smalltalk.addMethod(
  634. smalltalk.method({
  635. selector: "import:",
  636. fn: function (aStream){
  637. var self=this;
  638. var chunk,result,parser,lastEmpty;
  639. function $ChunkParser(){return smalltalk.ChunkParser||(typeof ChunkParser=="undefined"?nil:ChunkParser)}
  640. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  641. return smalltalk.withContext(function($ctx1) {
  642. var $1,$2;
  643. parser=_st($ChunkParser())._on_(aStream);
  644. lastEmpty=false;
  645. _st((function(){
  646. return smalltalk.withContext(function($ctx2) {
  647. chunk=_st(parser)._nextChunk();
  648. chunk;
  649. return _st(chunk)._isNil();
  650. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  651. return smalltalk.withContext(function($ctx2) {
  652. $1=_st(chunk)._isEmpty();
  653. if(smalltalk.assert($1)){
  654. lastEmpty=true;
  655. return lastEmpty;
  656. } else {
  657. result=_st(_st($Compiler())._new())._evaluateExpression_(chunk);
  658. result;
  659. $2=lastEmpty;
  660. if(smalltalk.assert($2)){
  661. lastEmpty=false;
  662. lastEmpty;
  663. return _st(result)._scanFrom_(parser);
  664. };
  665. };
  666. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  667. return self}, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty},smalltalk.Importer)})},
  668. messageSends: ["on:", "whileFalse:", "ifTrue:ifFalse:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "isEmpty", "nextChunk", "isNil"]}),
  669. smalltalk.Importer);
  670. smalltalk.addClass('PackageHandler', smalltalk.Object, [], 'Importer-Exporter');
  671. smalltalk.addMethod(
  672. smalltalk.method({
  673. selector: "ajaxPutAt:data:",
  674. fn: function (aURL,aString){
  675. var self=this;
  676. return smalltalk.withContext(function($ctx1) {
  677. _st(jQuery)._ajax_options_(aURL,smalltalk.HashedCollection._from_(["type".__minus_gt("PUT"),"data".__minus_gt(aString),"contentType".__minus_gt("text/plain;charset=UTF-8"),"error".__minus_gt((function(xhr){
  678. return smalltalk.withContext(function($ctx2) {
  679. return self._error_(_st(_st(_st("Commiting ".__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
  680. }, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
  681. return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.PackageHandler)})},
  682. messageSends: ["ajax:options:", "->", "error:", ",", "responseText"]}),
  683. smalltalk.PackageHandler);
  684. smalltalk.addMethod(
  685. smalltalk.method({
  686. selector: "commit:",
  687. fn: function (aPackage){
  688. var self=this;
  689. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  690. function $Exporter(){return smalltalk.Exporter||(typeof Exporter=="undefined"?nil:Exporter)}
  691. function $StrippedExporter(){return smalltalk.StrippedExporter||(typeof StrippedExporter=="undefined"?nil:StrippedExporter)}
  692. function $ChunkExporter(){return smalltalk.ChunkExporter||(typeof ChunkExporter=="undefined"?nil:ChunkExporter)}
  693. return smalltalk.withContext(function($ctx1) {
  694. _st([_st($Exporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathJs()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".js")),_st($StrippedExporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathJs()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".deploy.js")),_st($ChunkExporter()).__minus_gt(_st(_st(_st(_st(aPackage)._commitPathSt()).__comma("/")).__comma(_st(aPackage)._name())).__comma(".st"))])._do_displayingProgress_((function(commitStrategy){
  695. var fileContents;
  696. return smalltalk.withContext(function($ctx2) {
  697. fileContents=_st($String())._streamContents_((function(stream){
  698. return smalltalk.withContext(function($ctx3) {
  699. return _st(_st(_st(commitStrategy)._key())._new())._exportPackage_on_(_st(aPackage)._name(),stream);
  700. }, function($ctx3) {$ctx3.fillBlock({stream:stream},$ctx2)})}));
  701. fileContents;
  702. return self._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  703. }, function($ctx2) {$ctx2.fillBlock({commitStrategy:commitStrategy,fileContents:fileContents},$ctx1)})}),"Committing package ".__comma(_st(aPackage)._name()));
  704. return self}, function($ctx1) {$ctx1.fill(self,"commit:",{aPackage:aPackage},smalltalk.PackageHandler)})},
  705. messageSends: ["do:displayingProgress:", "streamContents:", "exportPackage:on:", "name", "new", "key", "ajaxPutAt:data:", "value", ",", "->", "commitPathJs", "commitPathSt"]}),
  706. smalltalk.PackageHandler);
  707. smalltalk.addMethod(
  708. smalltalk.method({
  709. selector: "loadPackage:prefix:",
  710. fn: function (packageName,aString){
  711. var self=this;
  712. var url;
  713. return smalltalk.withContext(function($ctx1) {
  714. var $1;
  715. url=_st(_st(_st("/".__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
  716. _st(jQuery)._ajax_options_(url,smalltalk.HashedCollection._from_(["type".__minus_gt("GET"),"dataType".__minus_gt("script"),"complete".__minus_gt((function(jqXHR,textStatus){
  717. return smalltalk.withContext(function($ctx2) {
  718. $1=_st(_st(jqXHR)._readyState()).__eq((4));
  719. if(smalltalk.assert($1)){
  720. return self._setupPackageNamed_prefix_(packageName,aString);
  721. };
  722. }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),"error".__minus_gt((function(){
  723. return smalltalk.withContext(function($ctx2) {
  724. return _st(window)._alert_("Could not load package at: ".__comma(url));
  725. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  726. return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url},smalltalk.PackageHandler)})},
  727. messageSends: [",", "ajax:options:", "->", "ifTrue:", "setupPackageNamed:prefix:", "=", "readyState", "alert:"]}),
  728. smalltalk.PackageHandler);
  729. smalltalk.addMethod(
  730. smalltalk.method({
  731. selector: "loadPackages:prefix:",
  732. fn: function (aCollection,aString){
  733. var self=this;
  734. return smalltalk.withContext(function($ctx1) {
  735. _st(aCollection)._do_((function(each){
  736. return smalltalk.withContext(function($ctx2) {
  737. return self._loadPackage_prefix_(each,aString);
  738. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  739. return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.PackageHandler)})},
  740. messageSends: ["do:", "loadPackage:prefix:"]}),
  741. smalltalk.PackageHandler);
  742. smalltalk.addMethod(
  743. smalltalk.method({
  744. selector: "setupPackageNamed:prefix:",
  745. fn: function (packageName,aString){
  746. var self=this;
  747. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  748. return smalltalk.withContext(function($ctx1) {
  749. var $1,$2;
  750. $1=_st($Package())._named_(packageName);
  751. _st($1)._setupClasses();
  752. _st($1)._commitPathJs_(_st("/".__comma(aString)).__comma("/js"));
  753. $2=_st($1)._commitPathSt_(_st("/".__comma(aString)).__comma("/st"));
  754. return self}, function($ctx1) {$ctx1.fill(self,"setupPackageNamed:prefix:",{packageName:packageName,aString:aString},smalltalk.PackageHandler)})},
  755. messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"]}),
  756. smalltalk.PackageHandler);
  757. smalltalk.addMethod(
  758. smalltalk.method({
  759. selector: "loadPackages:prefix:",
  760. fn: function (aCollection,aString){
  761. var self=this;
  762. return smalltalk.withContext(function($ctx1) {
  763. var $1;
  764. $1=_st(self._new())._loadPackages_prefix_(aCollection,aString);
  765. return $1;
  766. }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString},smalltalk.PackageHandler.klass)})},
  767. messageSends: ["loadPackages:prefix:", "new"]}),
  768. smalltalk.PackageHandler.klass);
  769. smalltalk.addMethod(
  770. smalltalk.method({
  771. selector: "commit",
  772. fn: function (){
  773. var self=this;
  774. function $PackageHandler(){return smalltalk.PackageHandler||(typeof PackageHandler=="undefined"?nil:PackageHandler)}
  775. return smalltalk.withContext(function($ctx1) {
  776. var $1;
  777. $1=_st(_st($PackageHandler())._new())._commit_(self);
  778. return $1;
  779. }, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
  780. messageSends: ["commit:", "new"]}),
  781. smalltalk.Package);
  782. })(global_smalltalk,global_nil,global__st);