2
0

Kernel-Infrastructure.deploy.js 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773
  1. define("amber/Kernel-Infrastructure", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber/Kernel-Objects", "amber/Kernel-Collections"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Kernel-Infrastructure');
  3. smalltalk.packages["Kernel-Infrastructure"].transport = {"type":"amd","amdNamespace":"amber"};
  4. smalltalk.addClass('InspectorHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
  5. smalltalk.InspectorHandler.klass.iVarNames = ['inspector'];
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "inspect:",
  9. fn: function (anObject){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) {
  12. var $1;
  13. $1=_st(self._inspector())._inspect_(anObject);
  14. return $1;
  15. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.InspectorHandler.klass)})},
  16. messageSends: ["inspect:", "inspector"]}),
  17. smalltalk.InspectorHandler.klass);
  18. smalltalk.addMethod(
  19. smalltalk.method({
  20. selector: "inspector",
  21. fn: function (){
  22. var self=this;
  23. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  24. return smalltalk.withContext(function($ctx1) {
  25. var $2,$1;
  26. $2=self["@inspector"];
  27. if(($receiver = $2) == nil || $receiver == undefined){
  28. self["@inspector"]=$Transcript();
  29. $1=self["@inspector"];
  30. } else {
  31. $1=$2;
  32. };
  33. return $1;
  34. }, function($ctx1) {$ctx1.fill(self,"inspector",{},smalltalk.InspectorHandler.klass)})},
  35. messageSends: ["ifNil:"]}),
  36. smalltalk.InspectorHandler.klass);
  37. smalltalk.addMethod(
  38. smalltalk.method({
  39. selector: "register:",
  40. fn: function (anInspector){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. self["@inspector"]=anInspector;
  44. return self}, function($ctx1) {$ctx1.fill(self,"register:",{anInspector:anInspector},smalltalk.InspectorHandler.klass)})},
  45. messageSends: []}),
  46. smalltalk.InspectorHandler.klass);
  47. smalltalk.addClass('InterfacingObject', smalltalk.Object, [], 'Kernel-Infrastructure');
  48. smalltalk.addMethod(
  49. smalltalk.method({
  50. selector: "ajax:",
  51. fn: function (anObject){
  52. var self=this;
  53. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  54. return smalltalk.withContext(function($ctx1) {
  55. var $1;
  56. $1=_st($PlatformInterface())._ajax_(anObject);
  57. return $1;
  58. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.InterfacingObject)})},
  59. messageSends: ["ajax:"]}),
  60. smalltalk.InterfacingObject);
  61. smalltalk.addMethod(
  62. smalltalk.method({
  63. selector: "alert:",
  64. fn: function (aString){
  65. var self=this;
  66. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  67. return smalltalk.withContext(function($ctx1) {
  68. var $1;
  69. $1=_st($PlatformInterface())._alert_(aString);
  70. return $1;
  71. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.InterfacingObject)})},
  72. messageSends: ["alert:"]}),
  73. smalltalk.InterfacingObject);
  74. smalltalk.addMethod(
  75. smalltalk.method({
  76. selector: "confirm:",
  77. fn: function (aString){
  78. var self=this;
  79. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  80. return smalltalk.withContext(function($ctx1) {
  81. var $1;
  82. $1=_st($PlatformInterface())._confirm_(aString);
  83. return $1;
  84. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.InterfacingObject)})},
  85. messageSends: ["confirm:"]}),
  86. smalltalk.InterfacingObject);
  87. smalltalk.addMethod(
  88. smalltalk.method({
  89. selector: "prompt:",
  90. fn: function (aString){
  91. var self=this;
  92. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  93. return smalltalk.withContext(function($ctx1) {
  94. var $1;
  95. $1=_st($PlatformInterface())._prompt_(aString);
  96. return $1;
  97. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.InterfacingObject)})},
  98. messageSends: ["prompt:"]}),
  99. smalltalk.InterfacingObject);
  100. smalltalk.addClass('Environment', smalltalk.InterfacingObject, [], 'Kernel-Infrastructure');
  101. smalltalk.addMethod(
  102. smalltalk.method({
  103. selector: "addInstVarNamed:to:",
  104. fn: function (aString,aClass){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. var $1,$2;
  108. $1=_st(_st(aClass)._instanceVariableNames())._copy();
  109. _st($1)._add_(aString);
  110. $2=_st($1)._yourself();
  111. _st(self._classBuilder())._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),_st(aClass)._name(),$2,_st(_st(aClass)._package())._name());
  112. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
  113. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package", "classBuilder"]}),
  114. smalltalk.Environment);
  115. smalltalk.addMethod(
  116. smalltalk.method({
  117. selector: "allSelectors",
  118. fn: function (){
  119. var self=this;
  120. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  121. return smalltalk.withContext(function($ctx1) {
  122. var $1;
  123. $1=_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value();
  124. return $1;
  125. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.Environment)})},
  126. messageSends: ["value", "at:", "current"]}),
  127. smalltalk.Environment);
  128. smalltalk.addMethod(
  129. smalltalk.method({
  130. selector: "availableClassNames",
  131. fn: function (){
  132. var self=this;
  133. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  134. return smalltalk.withContext(function($ctx1) {
  135. var $1;
  136. $1=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  137. return smalltalk.withContext(function($ctx2) {
  138. return _st(each)._name();
  139. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  140. return $1;
  141. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.Environment)})},
  142. messageSends: ["collect:", "name", "classes", "current"]}),
  143. smalltalk.Environment);
  144. smalltalk.addMethod(
  145. smalltalk.method({
  146. selector: "availablePackageNames",
  147. fn: function (){
  148. var self=this;
  149. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  150. return smalltalk.withContext(function($ctx1) {
  151. var $1;
  152. $1=_st(_st(_st($Smalltalk())._current())._packages())._collect_((function(each){
  153. return smalltalk.withContext(function($ctx2) {
  154. return _st(each)._name();
  155. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  156. return $1;
  157. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.Environment)})},
  158. messageSends: ["collect:", "name", "packages", "current"]}),
  159. smalltalk.Environment);
  160. smalltalk.addMethod(
  161. smalltalk.method({
  162. selector: "availableProtocolsFor:",
  163. fn: function (aClass){
  164. var self=this;
  165. var protocols;
  166. return smalltalk.withContext(function($ctx1) {
  167. var $1,$2;
  168. protocols=_st(aClass)._protocols();
  169. $1=_st(aClass)._superclass();
  170. if(($receiver = $1) == nil || $receiver == undefined){
  171. $1;
  172. } else {
  173. _st(protocols)._addAll_(self._availableProtocolsFor_(_st(aClass)._superclass()));
  174. };
  175. $2=_st(_st(protocols)._asSet())._asArray();
  176. return $2;
  177. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.Environment)})},
  178. messageSends: ["protocols", "ifNotNil:", "addAll:", "availableProtocolsFor:", "superclass", "asArray", "asSet"]}),
  179. smalltalk.Environment);
  180. smalltalk.addMethod(
  181. smalltalk.method({
  182. selector: "classBuilder",
  183. fn: function (){
  184. var self=this;
  185. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  186. return smalltalk.withContext(function($ctx1) {
  187. var $1;
  188. $1=_st($ClassBuilder())._new();
  189. return $1;
  190. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.Environment)})},
  191. messageSends: ["new"]}),
  192. smalltalk.Environment);
  193. smalltalk.addMethod(
  194. smalltalk.method({
  195. selector: "classNamed:",
  196. fn: function (aString){
  197. var self=this;
  198. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  199. return smalltalk.withContext(function($ctx1) {
  200. var $2,$1;
  201. $2=_st(_st($Smalltalk())._current())._at_(_st(aString)._asSymbol());
  202. if(($receiver = $2) == nil || $receiver == undefined){
  203. $1=self._error_("Invalid class name");
  204. } else {
  205. $1=$2;
  206. };
  207. return $1;
  208. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.Environment)})},
  209. messageSends: ["ifNil:", "error:", "at:", "asSymbol", "current"]}),
  210. smalltalk.Environment);
  211. smalltalk.addMethod(
  212. smalltalk.method({
  213. selector: "classes",
  214. fn: function (){
  215. var self=this;
  216. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  217. return smalltalk.withContext(function($ctx1) {
  218. var $1;
  219. $1=_st(_st($Smalltalk())._current())._classes();
  220. return $1;
  221. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Environment)})},
  222. messageSends: ["classes", "current"]}),
  223. smalltalk.Environment);
  224. smalltalk.addMethod(
  225. smalltalk.method({
  226. selector: "commitPackage:",
  227. fn: function (aPackage){
  228. var self=this;
  229. return smalltalk.withContext(function($ctx1) {
  230. _st(aPackage)._commit();
  231. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.Environment)})},
  232. messageSends: ["commit"]}),
  233. smalltalk.Environment);
  234. smalltalk.addMethod(
  235. smalltalk.method({
  236. selector: "compileClassComment:for:",
  237. fn: function (aString,aClass){
  238. var self=this;
  239. return smalltalk.withContext(function($ctx1) {
  240. _st(aClass)._comment_(aString);
  241. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
  242. messageSends: ["comment:"]}),
  243. smalltalk.Environment);
  244. smalltalk.addMethod(
  245. smalltalk.method({
  246. selector: "compileClassDefinition:",
  247. fn: function (aString){
  248. var self=this;
  249. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  250. return smalltalk.withContext(function($ctx1) {
  251. self._eval_on_(aString,_st($DoIt())._new());
  252. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.Environment)})},
  253. messageSends: ["eval:on:", "new"]}),
  254. smalltalk.Environment);
  255. smalltalk.addMethod(
  256. smalltalk.method({
  257. selector: "compileMethod:for:protocol:",
  258. fn: function (sourceCode,class_,protocol){
  259. var self=this;
  260. return smalltalk.withContext(function($ctx1) {
  261. var $1;
  262. $1=_st(class_)._compile_category_(sourceCode,protocol);
  263. return $1;
  264. }, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},smalltalk.Environment)})},
  265. messageSends: ["compile:category:"]}),
  266. smalltalk.Environment);
  267. smalltalk.addMethod(
  268. smalltalk.method({
  269. selector: "copyClass:to:",
  270. fn: function (aClass,aClassName){
  271. var self=this;
  272. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  273. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  274. return smalltalk.withContext(function($ctx1) {
  275. var $1;
  276. $1=_st(_st($Smalltalk())._current())._at_(aClassName);
  277. if(($receiver = $1) == nil || $receiver == undefined){
  278. $1;
  279. } else {
  280. self._error_(_st("A class named ".__comma(aClassName)).__comma(" already exists"));
  281. };
  282. _st(_st($ClassBuilder())._new())._copyClass_named_(aClass,aClassName);
  283. return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,aClassName:aClassName},smalltalk.Environment)})},
  284. messageSends: ["ifNotNil:", "error:", ",", "at:", "current", "copyClass:named:", "new"]}),
  285. smalltalk.Environment);
  286. smalltalk.addMethod(
  287. smalltalk.method({
  288. selector: "eval:on:",
  289. fn: function (aString,aReceiver){
  290. var self=this;
  291. var compiler;
  292. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  293. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  294. return smalltalk.withContext(function($ctx1) {
  295. var $1,$2;
  296. var $early={};
  297. try {
  298. compiler=_st($Compiler())._new();
  299. _st((function(){
  300. return smalltalk.withContext(function($ctx2) {
  301. return _st(compiler)._parseExpression_(aString);
  302. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(ex){
  303. return smalltalk.withContext(function($ctx2) {
  304. $1=self._alert_(_st(ex)._messageText());
  305. throw $early=[$1];
  306. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  307. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  308. return $2;
  309. }
  310. catch(e) {if(e===$early)return e[0]; throw e}
  311. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler},smalltalk.Environment)})},
  312. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"]}),
  313. smalltalk.Environment);
  314. smalltalk.addMethod(
  315. smalltalk.method({
  316. selector: "evaluate:on:do:",
  317. fn: function (aBlock,anErrorClass,exceptionBlock){
  318. var self=this;
  319. return smalltalk.withContext(function($ctx1) {
  320. var $1;
  321. self._try_catch_(aBlock,(function(exception){
  322. return smalltalk.withContext(function($ctx2) {
  323. $1=_st(exception)._isKindOf_(self._classNamed_(_st(anErrorClass)._name()));
  324. if(smalltalk.assert($1)){
  325. return _st(exceptionBlock)._value_(exception);
  326. } else {
  327. return _st(exception)._signal();
  328. };
  329. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1)})}));
  330. return self}, function($ctx1) {$ctx1.fill(self,"evaluate:on:do:",{aBlock:aBlock,anErrorClass:anErrorClass,exceptionBlock:exceptionBlock},smalltalk.Environment)})},
  331. messageSends: ["try:catch:", "ifTrue:ifFalse:", "value:", "signal", "isKindOf:", "classNamed:", "name"]}),
  332. smalltalk.Environment);
  333. smalltalk.addMethod(
  334. smalltalk.method({
  335. selector: "inspect:",
  336. fn: function (anObject){
  337. var self=this;
  338. function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
  339. return smalltalk.withContext(function($ctx1) {
  340. _st(_st($InspectorHandler())._inspector())._inspect_(anObject);
  341. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Environment)})},
  342. messageSends: ["inspect:", "inspector"]}),
  343. smalltalk.Environment);
  344. smalltalk.addMethod(
  345. smalltalk.method({
  346. selector: "moveClass:toPackage:",
  347. fn: function (aClass,aPackageName){
  348. var self=this;
  349. var package_;
  350. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  351. return smalltalk.withContext(function($ctx1) {
  352. var $1,$2,$3;
  353. package_=_st($Package())._named_(aPackageName);
  354. $1=package_;
  355. if(($receiver = $1) == nil || $receiver == undefined){
  356. self._error_("Invalid package name");
  357. } else {
  358. $1;
  359. };
  360. $2=_st(package_).__eq_eq(_st(aClass)._package());
  361. if(smalltalk.assert($2)){
  362. $3=self;
  363. return $3;
  364. };
  365. _st(aClass)._package_(package_);
  366. return self}, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName,package_:package_},smalltalk.Environment)})},
  367. messageSends: ["named:", "ifNil:", "error:", "ifTrue:", "==", "package", "package:"]}),
  368. smalltalk.Environment);
  369. smalltalk.addMethod(
  370. smalltalk.method({
  371. selector: "moveMethod:toClass:",
  372. fn: function (aMethod,aClassName){
  373. var self=this;
  374. var destinationClass;
  375. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  376. return smalltalk.withContext(function($ctx1) {
  377. var $1,$2,$3;
  378. destinationClass=_st(_st($Smalltalk())._current())._at_(_st(aClassName)._asSymbol());
  379. $1=destinationClass;
  380. if(($receiver = $1) == nil || $receiver == undefined){
  381. self._error_("Invalid class name");
  382. } else {
  383. $1;
  384. };
  385. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  386. if(smalltalk.assert($2)){
  387. $3=self;
  388. return $3;
  389. };
  390. _st(destinationClass)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  391. _st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  392. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.Environment)})},
  393. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "compile:category:", "source", "protocol", "removeCompiledMethod:"]}),
  394. smalltalk.Environment);
  395. smalltalk.addMethod(
  396. smalltalk.method({
  397. selector: "moveMethod:toProtocol:",
  398. fn: function (aMethod,aProtocol){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) {
  401. _st(aMethod)._category_(aProtocol);
  402. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.Environment)})},
  403. messageSends: ["category:"]}),
  404. smalltalk.Environment);
  405. smalltalk.addMethod(
  406. smalltalk.method({
  407. selector: "packages",
  408. fn: function (){
  409. var self=this;
  410. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  411. return smalltalk.withContext(function($ctx1) {
  412. var $1;
  413. $1=_st(_st($Smalltalk())._current())._packages();
  414. return $1;
  415. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.Environment)})},
  416. messageSends: ["packages", "current"]}),
  417. smalltalk.Environment);
  418. smalltalk.addMethod(
  419. smalltalk.method({
  420. selector: "registerErrorHandler:",
  421. fn: function (anErrorHandler){
  422. var self=this;
  423. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  424. return smalltalk.withContext(function($ctx1) {
  425. _st($ErrorHandler())._setCurrent_(anErrorHandler);
  426. return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.Environment)})},
  427. messageSends: ["setCurrent:"]}),
  428. smalltalk.Environment);
  429. smalltalk.addMethod(
  430. smalltalk.method({
  431. selector: "registerInspector:",
  432. fn: function (anInspector){
  433. var self=this;
  434. function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
  435. return smalltalk.withContext(function($ctx1) {
  436. _st($InspectorHandler())._register_(anInspector);
  437. return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.Environment)})},
  438. messageSends: ["register:"]}),
  439. smalltalk.Environment);
  440. smalltalk.addMethod(
  441. smalltalk.method({
  442. selector: "registerProgressHandler:",
  443. fn: function (aProgressHandler){
  444. var self=this;
  445. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  446. return smalltalk.withContext(function($ctx1) {
  447. _st($ProgressHandler())._setCurrent_(aProgressHandler);
  448. return self}, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},smalltalk.Environment)})},
  449. messageSends: ["setCurrent:"]}),
  450. smalltalk.Environment);
  451. smalltalk.addMethod(
  452. smalltalk.method({
  453. selector: "removeClass:",
  454. fn: function (aClass){
  455. var self=this;
  456. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  457. return smalltalk.withContext(function($ctx1) {
  458. _st(_st($Smalltalk())._current())._removeClass_(aClass);
  459. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Environment)})},
  460. messageSends: ["removeClass:", "current"]}),
  461. smalltalk.Environment);
  462. smalltalk.addMethod(
  463. smalltalk.method({
  464. selector: "removeMethod:",
  465. fn: function (aMethod){
  466. var self=this;
  467. return smalltalk.withContext(function($ctx1) {
  468. _st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
  469. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.Environment)})},
  470. messageSends: ["removeCompiledMethod:", "methodClass"]}),
  471. smalltalk.Environment);
  472. smalltalk.addMethod(
  473. smalltalk.method({
  474. selector: "removeProtocol:from:",
  475. fn: function (aString,aClass){
  476. var self=this;
  477. return smalltalk.withContext(function($ctx1) {
  478. _st(_st(_st(aClass)._methods())._select_((function(each){
  479. return smalltalk.withContext(function($ctx2) {
  480. return _st(_st(each)._protocol()).__eq(aString);
  481. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._do_((function(each){
  482. return smalltalk.withContext(function($ctx2) {
  483. return _st(aClass)._removeCompiledMethod_(each);
  484. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  485. return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol:from:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
  486. messageSends: ["do:", "removeCompiledMethod:", "select:", "=", "protocol", "methods"]}),
  487. smalltalk.Environment);
  488. smalltalk.addMethod(
  489. smalltalk.method({
  490. selector: "renameClass:to:",
  491. fn: function (aClass,aClassName){
  492. var self=this;
  493. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  494. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  495. return smalltalk.withContext(function($ctx1) {
  496. var $1;
  497. $1=_st(_st($Smalltalk())._current())._at_(aClassName);
  498. if(($receiver = $1) == nil || $receiver == undefined){
  499. $1;
  500. } else {
  501. self._error_(_st("A class named ".__comma(aClassName)).__comma(" already exists"));
  502. };
  503. _st(_st($ClassBuilder())._new())._renameClass_to_(aClass,aClassName);
  504. return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aClassName:aClassName},smalltalk.Environment)})},
  505. messageSends: ["ifNotNil:", "error:", ",", "at:", "current", "renameClass:to:", "new"]}),
  506. smalltalk.Environment);
  507. smalltalk.addMethod(
  508. smalltalk.method({
  509. selector: "renameProtocol:to:in:",
  510. fn: function (aString,anotherString,aClass){
  511. var self=this;
  512. return smalltalk.withContext(function($ctx1) {
  513. _st(_st(_st(aClass)._methods())._select_((function(each){
  514. return smalltalk.withContext(function($ctx2) {
  515. return _st(_st(each)._protocol()).__eq(aString);
  516. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._do_((function(each){
  517. return smalltalk.withContext(function($ctx2) {
  518. return _st(each)._protocol_(anotherString);
  519. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  520. return self}, function($ctx1) {$ctx1.fill(self,"renameProtocol:to:in:",{aString:aString,anotherString:anotherString,aClass:aClass},smalltalk.Environment)})},
  521. messageSends: ["do:", "protocol:", "select:", "=", "protocol", "methods"]}),
  522. smalltalk.Environment);
  523. smalltalk.addMethod(
  524. smalltalk.method({
  525. selector: "setClassCommentOf:to:",
  526. fn: function (aClass,aString){
  527. var self=this;
  528. return smalltalk.withContext(function($ctx1) {
  529. _st(aClass)._comment_(aString);
  530. return self}, function($ctx1) {$ctx1.fill(self,"setClassCommentOf:to:",{aClass:aClass,aString:aString},smalltalk.Environment)})},
  531. messageSends: ["comment:"]}),
  532. smalltalk.Environment);
  533. smalltalk.addMethod(
  534. smalltalk.method({
  535. selector: "systemAnnouncer",
  536. fn: function (){
  537. var self=this;
  538. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  539. return smalltalk.withContext(function($ctx1) {
  540. var $1;
  541. $1=_st(_st(_st($Smalltalk())._current())._at_("SystemAnnouncer"))._current();
  542. return $1;
  543. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.Environment)})},
  544. messageSends: ["current", "at:"]}),
  545. smalltalk.Environment);
  546. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Infrastructure');
  547. smalltalk.addMethod(
  548. smalltalk.method({
  549. selector: "addObjectVariablesTo:",
  550. fn: function (aDictionary){
  551. var self=this;
  552. return smalltalk.withContext(function($ctx1) {
  553. for(var i in self['@jsObject']) {
  554. aDictionary._at_put_(i, self['@jsObject'][i]);
  555. }
  556. ;
  557. return self}, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:",{aDictionary:aDictionary},smalltalk.JSObjectProxy)})},
  558. messageSends: []}),
  559. smalltalk.JSObjectProxy);
  560. smalltalk.addMethod(
  561. smalltalk.method({
  562. selector: "at:",
  563. fn: function (aString){
  564. var self=this;
  565. return smalltalk.withContext(function($ctx1) {
  566. return self['@jsObject'][aString];
  567. return self}, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.JSObjectProxy)})},
  568. messageSends: []}),
  569. smalltalk.JSObjectProxy);
  570. smalltalk.addMethod(
  571. smalltalk.method({
  572. selector: "at:ifAbsent:",
  573. fn: function (aString,aBlock){
  574. var self=this;
  575. return smalltalk.withContext(function($ctx1) {
  576. var obj = self['@jsObject'];
  577. return aString in obj ? obj[aString] : aBlock._value();
  578. ;
  579. return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},smalltalk.JSObjectProxy)})},
  580. messageSends: []}),
  581. smalltalk.JSObjectProxy);
  582. smalltalk.addMethod(
  583. smalltalk.method({
  584. selector: "at:ifPresent:",
  585. fn: function (aString,aBlock){
  586. var self=this;
  587. return smalltalk.withContext(function($ctx1) {
  588. var obj = self['@jsObject'];
  589. return aString in obj ? aBlock._value_(obj[aString]) : nil;
  590. ;
  591. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aString:aString,aBlock:aBlock},smalltalk.JSObjectProxy)})},
  592. messageSends: []}),
  593. smalltalk.JSObjectProxy);
  594. smalltalk.addMethod(
  595. smalltalk.method({
  596. selector: "at:ifPresent:ifAbsent:",
  597. fn: function (aString,aBlock,anotherBlock){
  598. var self=this;
  599. return smalltalk.withContext(function($ctx1) {
  600. var obj = self['@jsObject'];
  601. return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
  602. ;
  603. return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSObjectProxy)})},
  604. messageSends: []}),
  605. smalltalk.JSObjectProxy);
  606. smalltalk.addMethod(
  607. smalltalk.method({
  608. selector: "at:put:",
  609. fn: function (aString,anObject){
  610. var self=this;
  611. return smalltalk.withContext(function($ctx1) {
  612. self['@jsObject'][aString] = anObject;
  613. return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},smalltalk.JSObjectProxy)})},
  614. messageSends: []}),
  615. smalltalk.JSObjectProxy);
  616. smalltalk.addMethod(
  617. smalltalk.method({
  618. selector: "doesNotUnderstand:",
  619. fn: function (aMessage){
  620. var self=this;
  621. return smalltalk.withContext(function($ctx1) {
  622. var $2,$1;
  623. $2=self._lookupProperty_(_st(_st(aMessage)._selector())._asJavaScriptSelector());
  624. if(($receiver = $2) == nil || $receiver == undefined){
  625. $1=smalltalk.JSObjectProxy.superclass.fn.prototype._doesNotUnderstand_.apply(_st(self), [aMessage]);
  626. } else {
  627. var jsSelector;
  628. jsSelector=$receiver;
  629. $1=self._forwardMessage_withArguments_(jsSelector,_st(aMessage)._arguments());
  630. };
  631. return $1;
  632. }, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.JSObjectProxy)})},
  633. messageSends: ["ifNil:ifNotNil:", "doesNotUnderstand:", "forwardMessage:withArguments:", "arguments", "lookupProperty:", "asJavaScriptSelector", "selector"]}),
  634. smalltalk.JSObjectProxy);
  635. smalltalk.addMethod(
  636. smalltalk.method({
  637. selector: "forwardMessage:withArguments:",
  638. fn: function (aString,anArray){
  639. var self=this;
  640. return smalltalk.withContext(function($ctx1) {
  641. return smalltalk.send(self._jsObject(), aString, anArray);
  642. ;
  643. return self}, function($ctx1) {$ctx1.fill(self,"forwardMessage:withArguments:",{aString:aString,anArray:anArray},smalltalk.JSObjectProxy)})},
  644. messageSends: []}),
  645. smalltalk.JSObjectProxy);
  646. smalltalk.addMethod(
  647. smalltalk.method({
  648. selector: "inspectOn:",
  649. fn: function (anInspector){
  650. var self=this;
  651. var variables;
  652. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  653. return smalltalk.withContext(function($ctx1) {
  654. variables=_st($Dictionary())._new();
  655. _st(variables)._at_put_("#self",self._jsObject());
  656. _st(anInspector)._setLabel_(self._printString());
  657. self._addObjectVariablesTo_(variables);
  658. _st(anInspector)._setVariables_(variables);
  659. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.JSObjectProxy)})},
  660. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:", "setVariables:"]}),
  661. smalltalk.JSObjectProxy);
  662. smalltalk.addMethod(
  663. smalltalk.method({
  664. selector: "jsObject",
  665. fn: function (){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) {
  668. var $1;
  669. $1=self["@jsObject"];
  670. return $1;
  671. }, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxy)})},
  672. messageSends: []}),
  673. smalltalk.JSObjectProxy);
  674. smalltalk.addMethod(
  675. smalltalk.method({
  676. selector: "jsObject:",
  677. fn: function (aJSObject){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx1) {
  680. self["@jsObject"]=aJSObject;
  681. return self}, function($ctx1) {$ctx1.fill(self,"jsObject:",{aJSObject:aJSObject},smalltalk.JSObjectProxy)})},
  682. messageSends: []}),
  683. smalltalk.JSObjectProxy);
  684. smalltalk.addMethod(
  685. smalltalk.method({
  686. selector: "keysAndValuesDo:",
  687. fn: function (aBlock){
  688. var self=this;
  689. return smalltalk.withContext(function($ctx1) {
  690. var o = self['@jsObject'];
  691. for(var i in o) {
  692. aBlock._value_value_(i, o[i]);
  693. }
  694. ;
  695. return self}, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.JSObjectProxy)})},
  696. messageSends: []}),
  697. smalltalk.JSObjectProxy);
  698. smalltalk.addMethod(
  699. smalltalk.method({
  700. selector: "lookupProperty:",
  701. fn: function (aString){
  702. var self=this;
  703. return smalltalk.withContext(function($ctx1) {
  704. return aString in self._jsObject() ? aString : nil;
  705. return self}, function($ctx1) {$ctx1.fill(self,"lookupProperty:",{aString:aString},smalltalk.JSObjectProxy)})},
  706. messageSends: []}),
  707. smalltalk.JSObjectProxy);
  708. smalltalk.addMethod(
  709. smalltalk.method({
  710. selector: "printOn:",
  711. fn: function (aStream){
  712. var self=this;
  713. return smalltalk.withContext(function($ctx1) {
  714. _st(aStream)._nextPutAll_(_st(self._jsObject())._toString());
  715. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.JSObjectProxy)})},
  716. messageSends: ["nextPutAll:", "toString", "jsObject"]}),
  717. smalltalk.JSObjectProxy);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "value",
  721. fn: function (){
  722. var self=this;
  723. return smalltalk.withContext(function($ctx1) {
  724. var $1;
  725. $1=self._at_ifAbsent_("value",(function(){
  726. return smalltalk.withContext(function($ctx2) {
  727. return smalltalk.JSObjectProxy.superclass.fn.prototype._value.apply(_st(self), []);
  728. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  729. return $1;
  730. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.JSObjectProxy)})},
  731. messageSends: ["at:ifAbsent:", "value"]}),
  732. smalltalk.JSObjectProxy);
  733. smalltalk.addMethod(
  734. smalltalk.method({
  735. selector: "on:",
  736. fn: function (aJSObject){
  737. var self=this;
  738. return smalltalk.withContext(function($ctx1) {
  739. var $2,$3,$1;
  740. $2=self._new();
  741. _st($2)._jsObject_(aJSObject);
  742. $3=_st($2)._yourself();
  743. $1=$3;
  744. return $1;
  745. }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject},smalltalk.JSObjectProxy.klass)})},
  746. messageSends: ["jsObject:", "new", "yourself"]}),
  747. smalltalk.JSObjectProxy.klass);
  748. smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Infrastructure');
  749. smalltalk.addMethod(
  750. smalltalk.method({
  751. selector: "addElement:",
  752. fn: function (anObject){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. self.elements.addElement(anObject);
  756. return self}, function($ctx1) {$ctx1.fill(self,"addElement:",{anObject:anObject},smalltalk.Organizer)})},
  757. messageSends: []}),
  758. smalltalk.Organizer);
  759. smalltalk.addMethod(
  760. smalltalk.method({
  761. selector: "elements",
  762. fn: function (){
  763. var self=this;
  764. return smalltalk.withContext(function($ctx1) {
  765. var $1;
  766. $1=_st(self._basicAt_("elements"))._copy();
  767. return $1;
  768. }, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.Organizer)})},
  769. messageSends: ["copy", "basicAt:"]}),
  770. smalltalk.Organizer);
  771. smalltalk.addMethod(
  772. smalltalk.method({
  773. selector: "removeElement:",
  774. fn: function (anObject){
  775. var self=this;
  776. return smalltalk.withContext(function($ctx1) {
  777. self.elements.removeElement(anObject);
  778. return self}, function($ctx1) {$ctx1.fill(self,"removeElement:",{anObject:anObject},smalltalk.Organizer)})},
  779. messageSends: []}),
  780. smalltalk.Organizer);
  781. smalltalk.addClass('ClassOrganizer', smalltalk.Organizer, [], 'Kernel-Infrastructure');
  782. smalltalk.addMethod(
  783. smalltalk.method({
  784. selector: "addElement:",
  785. fn: function (aString){
  786. var self=this;
  787. function $ProtocolAdded(){return smalltalk.ProtocolAdded||(typeof ProtocolAdded=="undefined"?nil:ProtocolAdded)}
  788. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  789. return smalltalk.withContext(function($ctx1) {
  790. var $1,$2;
  791. smalltalk.ClassOrganizer.superclass.fn.prototype._addElement_.apply(_st(self), [aString]);
  792. $1=_st($ProtocolAdded())._new();
  793. _st($1)._protocol_(aString);
  794. _st($1)._theClass_(self._theClass());
  795. $2=_st($1)._yourself();
  796. _st(_st($SystemAnnouncer())._current())._announce_($2);
  797. return self}, function($ctx1) {$ctx1.fill(self,"addElement:",{aString:aString},smalltalk.ClassOrganizer)})},
  798. messageSends: ["addElement:", "announce:", "protocol:", "new", "theClass:", "theClass", "yourself", "current"]}),
  799. smalltalk.ClassOrganizer);
  800. smalltalk.addMethod(
  801. smalltalk.method({
  802. selector: "removeElement:",
  803. fn: function (aString){
  804. var self=this;
  805. function $ProtocolRemoved(){return smalltalk.ProtocolRemoved||(typeof ProtocolRemoved=="undefined"?nil:ProtocolRemoved)}
  806. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  807. return smalltalk.withContext(function($ctx1) {
  808. var $1,$2;
  809. smalltalk.ClassOrganizer.superclass.fn.prototype._removeElement_.apply(_st(self), [aString]);
  810. $1=_st($ProtocolRemoved())._new();
  811. _st($1)._protocol_(aString);
  812. _st($1)._theClass_(self._theClass());
  813. $2=_st($1)._yourself();
  814. _st(_st($SystemAnnouncer())._current())._announce_($2);
  815. return self}, function($ctx1) {$ctx1.fill(self,"removeElement:",{aString:aString},smalltalk.ClassOrganizer)})},
  816. messageSends: ["removeElement:", "announce:", "protocol:", "new", "theClass:", "theClass", "yourself", "current"]}),
  817. smalltalk.ClassOrganizer);
  818. smalltalk.addMethod(
  819. smalltalk.method({
  820. selector: "theClass",
  821. fn: function (){
  822. var self=this;
  823. return smalltalk.withContext(function($ctx1) {
  824. return self.theClass ;
  825. return self}, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassOrganizer)})},
  826. messageSends: []}),
  827. smalltalk.ClassOrganizer);
  828. smalltalk.addClass('PackageOrganizer', smalltalk.Organizer, [], 'Kernel-Infrastructure');
  829. smalltalk.addClass('Package', smalltalk.Object, ['extension'], 'Kernel-Infrastructure');
  830. smalltalk.addMethod(
  831. smalltalk.method({
  832. selector: "classes",
  833. fn: function (){
  834. var self=this;
  835. return smalltalk.withContext(function($ctx1) {
  836. var $1;
  837. $1=_st(self._organization())._elements();
  838. return $1;
  839. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Package)})},
  840. messageSends: ["elements", "organization"]}),
  841. smalltalk.Package);
  842. smalltalk.addMethod(
  843. smalltalk.method({
  844. selector: "isPackage",
  845. fn: function (){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx1) {
  848. return true;
  849. }, function($ctx1) {$ctx1.fill(self,"isPackage",{},smalltalk.Package)})},
  850. messageSends: []}),
  851. smalltalk.Package);
  852. smalltalk.addMethod(
  853. smalltalk.method({
  854. selector: "loadDependencies",
  855. fn: function (){
  856. var self=this;
  857. var classes,packages;
  858. return smalltalk.withContext(function($ctx1) {
  859. var $2,$3,$1;
  860. classes=self._loadDependencyClasses();
  861. $2=_st(_st(classes)._collect_((function(each){
  862. return smalltalk.withContext(function($ctx2) {
  863. return _st(each)._package();
  864. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asSet();
  865. _st($2)._remove_ifAbsent_(self,(function(){
  866. return smalltalk.withContext(function($ctx2) {
  867. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  868. $3=_st($2)._yourself();
  869. $1=$3;
  870. return $1;
  871. }, function($ctx1) {$ctx1.fill(self,"loadDependencies",{classes:classes,packages:packages},smalltalk.Package)})},
  872. messageSends: ["loadDependencyClasses", "remove:ifAbsent:", "asSet", "collect:", "package", "yourself"]}),
  873. smalltalk.Package);
  874. smalltalk.addMethod(
  875. smalltalk.method({
  876. selector: "loadDependencyClasses",
  877. fn: function (){
  878. var self=this;
  879. var starCategoryName;
  880. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  881. return smalltalk.withContext(function($ctx1) {
  882. var $2,$3,$1;
  883. starCategoryName="*".__comma(self._name());
  884. $2=_st(_st(self._classes())._collect_((function(each){
  885. return smalltalk.withContext(function($ctx2) {
  886. return _st(each)._superclass();
  887. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asSet();
  888. _st($2)._remove_ifAbsent_(nil,(function(){
  889. return smalltalk.withContext(function($ctx2) {
  890. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  891. _st($2)._addAll_(_st(_st(_st($Smalltalk())._current())._classes())._select_((function(each){
  892. return smalltalk.withContext(function($ctx2) {
  893. return _st(_st(each)._protocols())._includes_(starCategoryName);
  894. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  895. $3=_st($2)._yourself();
  896. $1=$3;
  897. return $1;
  898. }, function($ctx1) {$ctx1.fill(self,"loadDependencyClasses",{starCategoryName:starCategoryName},smalltalk.Package)})},
  899. messageSends: [",", "name", "remove:ifAbsent:", "asSet", "collect:", "superclass", "classes", "addAll:", "select:", "includes:", "protocols", "current", "yourself"]}),
  900. smalltalk.Package);
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "name",
  904. fn: function (){
  905. var self=this;
  906. return smalltalk.withContext(function($ctx1) {
  907. return self.pkgName;
  908. return self}, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.Package)})},
  909. messageSends: []}),
  910. smalltalk.Package);
  911. smalltalk.addMethod(
  912. smalltalk.method({
  913. selector: "name:",
  914. fn: function (aString){
  915. var self=this;
  916. return smalltalk.withContext(function($ctx1) {
  917. self.pkgName = aString;
  918. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.Package)})},
  919. messageSends: []}),
  920. smalltalk.Package);
  921. smalltalk.addMethod(
  922. smalltalk.method({
  923. selector: "organization",
  924. fn: function (){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) {
  927. var $1;
  928. $1=self._basicAt_("organization");
  929. return $1;
  930. }, function($ctx1) {$ctx1.fill(self,"organization",{},smalltalk.Package)})},
  931. messageSends: ["basicAt:"]}),
  932. smalltalk.Package);
  933. smalltalk.addMethod(
  934. smalltalk.method({
  935. selector: "printOn:",
  936. fn: function (aStream){
  937. var self=this;
  938. return smalltalk.withContext(function($ctx1) {
  939. var $1,$2;
  940. smalltalk.Package.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  941. $1=aStream;
  942. _st($1)._nextPutAll_(" (");
  943. _st($1)._nextPutAll_(self._name());
  944. $2=_st($1)._nextPutAll_(")");
  945. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Package)})},
  946. messageSends: ["printOn:", "nextPutAll:", "name"]}),
  947. smalltalk.Package);
  948. smalltalk.addMethod(
  949. smalltalk.method({
  950. selector: "setupClasses",
  951. fn: function (){
  952. var self=this;
  953. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  954. return smalltalk.withContext(function($ctx1) {
  955. var $1,$2;
  956. $1=self._classes();
  957. _st($1)._do_((function(each){
  958. return smalltalk.withContext(function($ctx2) {
  959. return _st(_st($ClassBuilder())._new())._setupClass_(each);
  960. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  961. $2=_st($1)._do_((function(each){
  962. return smalltalk.withContext(function($ctx2) {
  963. return _st(each)._initialize();
  964. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  965. return self}, function($ctx1) {$ctx1.fill(self,"setupClasses",{},smalltalk.Package)})},
  966. messageSends: ["do:", "setupClass:", "new", "classes", "initialize"]}),
  967. smalltalk.Package);
  968. smalltalk.addMethod(
  969. smalltalk.method({
  970. selector: "sortedClasses",
  971. fn: function (){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx1) {
  974. var $1;
  975. $1=_st(self._class())._sortedClasses_(self._classes());
  976. return $1;
  977. }, function($ctx1) {$ctx1.fill(self,"sortedClasses",{},smalltalk.Package)})},
  978. messageSends: ["sortedClasses:", "classes", "class"]}),
  979. smalltalk.Package);
  980. smalltalk.addMethod(
  981. smalltalk.method({
  982. selector: "withDefaultTransport",
  983. fn: function (){
  984. var self=this;
  985. return smalltalk.withContext(function($ctx1) {
  986. return self.withDefaultTransport();
  987. return self}, function($ctx1) {$ctx1.fill(self,"withDefaultTransport",{},smalltalk.Package)})},
  988. messageSends: []}),
  989. smalltalk.Package);
  990. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  991. smalltalk.addMethod(
  992. smalltalk.method({
  993. selector: "load:",
  994. fn: function (aPackageName){
  995. var self=this;
  996. return smalltalk.withContext(function($ctx1) {
  997. self._deprecatedAPI();
  998. self._load_prefix_(aPackageName,_st(self._defaultCommitPathJs()).__comma("/"));
  999. return self}, function($ctx1) {$ctx1.fill(self,"load:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
  1000. messageSends: ["deprecatedAPI", "load:prefix:", ",", "defaultCommitPathJs"]}),
  1001. smalltalk.Package.klass);
  1002. smalltalk.addMethod(
  1003. smalltalk.method({
  1004. selector: "load:prefix:",
  1005. fn: function (aPackageName,aPrefix){
  1006. var self=this;
  1007. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1008. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1009. return smalltalk.withContext(function($ctx1) {
  1010. self._deprecatedAPI();
  1011. _st($PlatformInterface())._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(_st(_st(aPrefix).__comma(aPackageName)).__comma(".js")),"dataType".__minus_gt("script"),"success".__minus_gt((function(){
  1012. return smalltalk.withContext(function($ctx2) {
  1013. return _st(_st($Package())._named_(aPackageName))._setupClasses();
  1014. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1015. return self}, function($ctx1) {$ctx1.fill(self,"load:prefix:",{aPackageName:aPackageName,aPrefix:aPrefix},smalltalk.Package.klass)})},
  1016. messageSends: ["deprecatedAPI", "ajax:", "->", ",", "setupClasses", "named:"]}),
  1017. smalltalk.Package.klass);
  1018. smalltalk.addMethod(
  1019. smalltalk.method({
  1020. selector: "named:",
  1021. fn: function (aPackageName){
  1022. var self=this;
  1023. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1024. return smalltalk.withContext(function($ctx1) {
  1025. var $1;
  1026. $1=_st(_st($Smalltalk())._current())._packageAt_(aPackageName);
  1027. return $1;
  1028. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
  1029. messageSends: ["packageAt:", "current"]}),
  1030. smalltalk.Package.klass);
  1031. smalltalk.addMethod(
  1032. smalltalk.method({
  1033. selector: "named:ifAbsent:",
  1034. fn: function (aPackageName,aBlock){
  1035. var self=this;
  1036. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1037. return smalltalk.withContext(function($ctx1) {
  1038. var $1;
  1039. $1=_st(_st($Smalltalk())._current())._packageAt_ifAbsent_(aPackageName,aBlock);
  1040. return $1;
  1041. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},smalltalk.Package.klass)})},
  1042. messageSends: ["packageAt:ifAbsent:", "current"]}),
  1043. smalltalk.Package.klass);
  1044. smalltalk.addMethod(
  1045. smalltalk.method({
  1046. selector: "sortedClasses:",
  1047. fn: function (classes){
  1048. var self=this;
  1049. var children,others,nodes,expandedClasses;
  1050. function $ClassSorterNode(){return smalltalk.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  1051. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1052. return smalltalk.withContext(function($ctx1) {
  1053. var $1,$2;
  1054. children=[];
  1055. others=[];
  1056. _st(classes)._do_((function(each){
  1057. return smalltalk.withContext(function($ctx2) {
  1058. $1=_st(classes)._includes_(_st(each)._superclass());
  1059. if(smalltalk.assert($1)){
  1060. return _st(others)._add_(each);
  1061. } else {
  1062. return _st(children)._add_(each);
  1063. };
  1064. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1065. nodes=_st(children)._collect_((function(each){
  1066. return smalltalk.withContext(function($ctx2) {
  1067. return _st($ClassSorterNode())._on_classes_level_(each,others,(0));
  1068. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1069. nodes=_st(nodes)._sorted_((function(a,b){
  1070. return smalltalk.withContext(function($ctx2) {
  1071. return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1072. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  1073. expandedClasses=_st($Array())._new();
  1074. _st(nodes)._do_((function(aNode){
  1075. return smalltalk.withContext(function($ctx2) {
  1076. return _st(aNode)._traverseClassesWith_(expandedClasses);
  1077. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  1078. $2=expandedClasses;
  1079. return $2;
  1080. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},smalltalk.Package.klass)})},
  1081. messageSends: ["do:", "ifFalse:ifTrue:", "add:", "includes:", "superclass", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"]}),
  1082. smalltalk.Package.klass);
  1083. smalltalk.addClass('PlatformInterface', smalltalk.Object, [], 'Kernel-Infrastructure');
  1084. smalltalk.PlatformInterface.klass.iVarNames = ['worker'];
  1085. smalltalk.addMethod(
  1086. smalltalk.method({
  1087. selector: "ajax:",
  1088. fn: function (anObject){
  1089. var self=this;
  1090. return smalltalk.withContext(function($ctx1) {
  1091. var $2,$1;
  1092. $2=self["@worker"];
  1093. if(($receiver = $2) == nil || $receiver == undefined){
  1094. $1=self._error_("ajax: not available");
  1095. } else {
  1096. $1=_st(self["@worker"])._ajax_(anObject);
  1097. };
  1098. return $1;
  1099. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
  1100. messageSends: ["ifNotNil:ifNil:", "ajax:", "error:"]}),
  1101. smalltalk.PlatformInterface.klass);
  1102. smalltalk.addMethod(
  1103. smalltalk.method({
  1104. selector: "alert:",
  1105. fn: function (aString){
  1106. var self=this;
  1107. return smalltalk.withContext(function($ctx1) {
  1108. var $2,$1;
  1109. $2=self["@worker"];
  1110. if(($receiver = $2) == nil || $receiver == undefined){
  1111. $1=self._error_("alert: not available");
  1112. } else {
  1113. $1=_st(self["@worker"])._alert_(aString);
  1114. };
  1115. return $1;
  1116. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1117. messageSends: ["ifNotNil:ifNil:", "alert:", "error:"]}),
  1118. smalltalk.PlatformInterface.klass);
  1119. smalltalk.addMethod(
  1120. smalltalk.method({
  1121. selector: "confirm:",
  1122. fn: function (aString){
  1123. var self=this;
  1124. return smalltalk.withContext(function($ctx1) {
  1125. var $2,$1;
  1126. $2=self["@worker"];
  1127. if(($receiver = $2) == nil || $receiver == undefined){
  1128. $1=self._error_("confirm: not available");
  1129. } else {
  1130. $1=_st(self["@worker"])._confirm_(aString);
  1131. };
  1132. return $1;
  1133. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1134. messageSends: ["ifNotNil:ifNil:", "confirm:", "error:"]}),
  1135. smalltalk.PlatformInterface.klass);
  1136. smalltalk.addMethod(
  1137. smalltalk.method({
  1138. selector: "existsGlobal:",
  1139. fn: function (aString){
  1140. var self=this;
  1141. return smalltalk.withContext(function($ctx1) {
  1142. var f = new Function('aString',
  1143. 'if (/^[0-9]/.test(aString) || !/^[\\w_]+$/.test(aString))\n'+
  1144. ' return false;\n'+
  1145. 'try { eval(aString); return true; } catch (ex) {}\n'+
  1146. 'return false;');
  1147. return f(aString);;
  1148. return self}, function($ctx1) {$ctx1.fill(self,"existsGlobal:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1149. messageSends: []}),
  1150. smalltalk.PlatformInterface.klass);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "initialize",
  1154. fn: function (){
  1155. var self=this;
  1156. var candidate;
  1157. function $BrowserInterface(){return smalltalk.BrowserInterface||(typeof BrowserInterface=="undefined"?nil:BrowserInterface)}
  1158. return smalltalk.withContext(function($ctx1) {
  1159. var $1,$2,$3;
  1160. smalltalk.PlatformInterface.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1161. $1=$BrowserInterface();
  1162. if(($receiver = $1) == nil || $receiver == undefined){
  1163. $1;
  1164. } else {
  1165. candidate=_st($BrowserInterface())._new();
  1166. candidate;
  1167. $2=_st(candidate)._isAvailable();
  1168. if(smalltalk.assert($2)){
  1169. self._setWorker_(candidate);
  1170. $3=self;
  1171. return $3;
  1172. };
  1173. };
  1174. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{candidate:candidate},smalltalk.PlatformInterface.klass)})},
  1175. messageSends: ["initialize", "ifNotNil:", "new", "ifTrue:", "setWorker:", "isAvailable"]}),
  1176. smalltalk.PlatformInterface.klass);
  1177. smalltalk.addMethod(
  1178. smalltalk.method({
  1179. selector: "prompt:",
  1180. fn: function (aString){
  1181. var self=this;
  1182. return smalltalk.withContext(function($ctx1) {
  1183. var $2,$1;
  1184. $2=self["@worker"];
  1185. if(($receiver = $2) == nil || $receiver == undefined){
  1186. $1=self._error_("prompt: not available");
  1187. } else {
  1188. $1=_st(self["@worker"])._prompt_(aString);
  1189. };
  1190. return $1;
  1191. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1192. messageSends: ["ifNotNil:ifNil:", "prompt:", "error:"]}),
  1193. smalltalk.PlatformInterface.klass);
  1194. smalltalk.addMethod(
  1195. smalltalk.method({
  1196. selector: "setWorker:",
  1197. fn: function (anObject){
  1198. var self=this;
  1199. return smalltalk.withContext(function($ctx1) {
  1200. self["@worker"]=anObject;
  1201. return self}, function($ctx1) {$ctx1.fill(self,"setWorker:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
  1202. messageSends: []}),
  1203. smalltalk.PlatformInterface.klass);
  1204. smalltalk.addClass('ProgressHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
  1205. smalltalk.addMethod(
  1206. smalltalk.method({
  1207. selector: "do:on:displaying:",
  1208. fn: function (aBlock,aCollection,aString){
  1209. var self=this;
  1210. return smalltalk.withContext(function($ctx1) {
  1211. _st(aCollection)._do_(aBlock);
  1212. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},smalltalk.ProgressHandler)})},
  1213. messageSends: ["do:"]}),
  1214. smalltalk.ProgressHandler);
  1215. smalltalk.ProgressHandler.klass.iVarNames = ['current'];
  1216. smalltalk.addMethod(
  1217. smalltalk.method({
  1218. selector: "current",
  1219. fn: function (){
  1220. var self=this;
  1221. return smalltalk.withContext(function($ctx1) {
  1222. var $2,$1;
  1223. $2=self["@current"];
  1224. if(($receiver = $2) == nil || $receiver == undefined){
  1225. self["@current"]=self._new();
  1226. $1=self["@current"];
  1227. } else {
  1228. $1=$2;
  1229. };
  1230. return $1;
  1231. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ProgressHandler.klass)})},
  1232. messageSends: ["ifNil:", "new"]}),
  1233. smalltalk.ProgressHandler.klass);
  1234. smalltalk.addMethod(
  1235. smalltalk.method({
  1236. selector: "initialize",
  1237. fn: function (){
  1238. var self=this;
  1239. return smalltalk.withContext(function($ctx1) {
  1240. self._register();
  1241. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ProgressHandler.klass)})},
  1242. messageSends: ["register"]}),
  1243. smalltalk.ProgressHandler.klass);
  1244. smalltalk.addMethod(
  1245. smalltalk.method({
  1246. selector: "register",
  1247. fn: function (){
  1248. var self=this;
  1249. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1250. return smalltalk.withContext(function($ctx1) {
  1251. _st($ProgressHandler())._setCurrent_(self._new());
  1252. return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.ProgressHandler.klass)})},
  1253. messageSends: ["setCurrent:", "new"]}),
  1254. smalltalk.ProgressHandler.klass);
  1255. smalltalk.addMethod(
  1256. smalltalk.method({
  1257. selector: "setCurrent:",
  1258. fn: function (anHandler){
  1259. var self=this;
  1260. return smalltalk.withContext(function($ctx1) {
  1261. self["@current"]=anHandler;
  1262. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler},smalltalk.ProgressHandler.klass)})},
  1263. messageSends: []}),
  1264. smalltalk.ProgressHandler.klass);
  1265. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Infrastructure');
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "addGlobalJsVariable:",
  1269. fn: function (aString){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) {
  1272. _st(self._globalJsVariables())._add_(aString);
  1273. return self}, function($ctx1) {$ctx1.fill(self,"addGlobalJsVariable:",{aString:aString},smalltalk.Smalltalk)})},
  1274. messageSends: ["add:", "globalJsVariables"]}),
  1275. smalltalk.Smalltalk);
  1276. smalltalk.addMethod(
  1277. smalltalk.method({
  1278. selector: "asSmalltalkException:",
  1279. fn: function (anObject){
  1280. var self=this;
  1281. function $JavaScriptException(){return smalltalk.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  1282. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1283. return smalltalk.withContext(function($ctx1) {
  1284. var $2,$1;
  1285. $2=_st(self._isSmalltalkObject_(anObject))._and_((function(){
  1286. return smalltalk.withContext(function($ctx2) {
  1287. return _st(anObject)._isKindOf_($Error());
  1288. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1289. if(smalltalk.assert($2)){
  1290. $1=anObject;
  1291. } else {
  1292. $1=_st($JavaScriptException())._on_(anObject);
  1293. };
  1294. return $1;
  1295. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},smalltalk.Smalltalk)})},
  1296. messageSends: ["ifTrue:ifFalse:", "on:", "and:", "isKindOf:", "isSmalltalkObject:"]}),
  1297. smalltalk.Smalltalk);
  1298. smalltalk.addMethod(
  1299. smalltalk.method({
  1300. selector: "at:",
  1301. fn: function (aString){
  1302. var self=this;
  1303. return smalltalk.withContext(function($ctx1) {
  1304. return self[aString];
  1305. return self}, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.Smalltalk)})},
  1306. messageSends: []}),
  1307. smalltalk.Smalltalk);
  1308. smalltalk.addMethod(
  1309. smalltalk.method({
  1310. selector: "basicParse:",
  1311. fn: function (aString){
  1312. var self=this;
  1313. return smalltalk.withContext(function($ctx1) {
  1314. return smalltalk.parser.parse(aString);
  1315. return self}, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString},smalltalk.Smalltalk)})},
  1316. messageSends: []}),
  1317. smalltalk.Smalltalk);
  1318. smalltalk.addMethod(
  1319. smalltalk.method({
  1320. selector: "classes",
  1321. fn: function (){
  1322. var self=this;
  1323. return smalltalk.withContext(function($ctx1) {
  1324. return self.classes();
  1325. return self}, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Smalltalk)})},
  1326. messageSends: []}),
  1327. smalltalk.Smalltalk);
  1328. smalltalk.addMethod(
  1329. smalltalk.method({
  1330. selector: "createDefaultPackage:",
  1331. fn: function (packageName){
  1332. var self=this;
  1333. return smalltalk.withContext(function($ctx1) {
  1334. var $1;
  1335. $1=_st(self._createPackage_(packageName))._withDefaultTransport();
  1336. return $1;
  1337. }, function($ctx1) {$ctx1.fill(self,"createDefaultPackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1338. messageSends: ["withDefaultTransport", "createPackage:"]}),
  1339. smalltalk.Smalltalk);
  1340. smalltalk.addMethod(
  1341. smalltalk.method({
  1342. selector: "createPackage:",
  1343. fn: function (packageName){
  1344. var self=this;
  1345. return smalltalk.withContext(function($ctx1) {
  1346. return smalltalk.addPackage(packageName);
  1347. return self}, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1348. messageSends: []}),
  1349. smalltalk.Smalltalk);
  1350. smalltalk.addMethod(
  1351. smalltalk.method({
  1352. selector: "createPackage:properties:",
  1353. fn: function (packageName,aDict){
  1354. var self=this;
  1355. return smalltalk.withContext(function($ctx1) {
  1356. var $1,$2;
  1357. self._deprecatedAPI();
  1358. $1=_st(aDict)._isEmpty();
  1359. if(! smalltalk.assert($1)){
  1360. self._error_("createPackage:properties: called with nonempty properties");
  1361. };
  1362. $2=self._createPackage_(packageName);
  1363. return $2;
  1364. }, function($ctx1) {$ctx1.fill(self,"createPackage:properties:",{packageName:packageName,aDict:aDict},smalltalk.Smalltalk)})},
  1365. messageSends: ["deprecatedAPI", "ifFalse:", "error:", "isEmpty", "createPackage:"]}),
  1366. smalltalk.Smalltalk);
  1367. smalltalk.addMethod(
  1368. smalltalk.method({
  1369. selector: "deleteClass:",
  1370. fn: function (aClass){
  1371. var self=this;
  1372. return smalltalk.withContext(function($ctx1) {
  1373. self.removeClass(aClass);
  1374. return self}, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass},smalltalk.Smalltalk)})},
  1375. messageSends: []}),
  1376. smalltalk.Smalltalk);
  1377. smalltalk.addMethod(
  1378. smalltalk.method({
  1379. selector: "deleteGlobalJsVariable:",
  1380. fn: function (aString){
  1381. var self=this;
  1382. return smalltalk.withContext(function($ctx1) {
  1383. _st(self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
  1384. return smalltalk.withContext(function($ctx2) {
  1385. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1386. return self}, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},smalltalk.Smalltalk)})},
  1387. messageSends: ["remove:ifAbsent:", "globalJsVariables"]}),
  1388. smalltalk.Smalltalk);
  1389. smalltalk.addMethod(
  1390. smalltalk.method({
  1391. selector: "deletePackage:",
  1392. fn: function (packageName){
  1393. var self=this;
  1394. return smalltalk.withContext(function($ctx1) {
  1395. delete smalltalk.packages[packageName];
  1396. return self}, function($ctx1) {$ctx1.fill(self,"deletePackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1397. messageSends: []}),
  1398. smalltalk.Smalltalk);
  1399. smalltalk.addMethod(
  1400. smalltalk.method({
  1401. selector: "globalJsVariables",
  1402. fn: function (){
  1403. var self=this;
  1404. return smalltalk.withContext(function($ctx1) {
  1405. return self.globalJsVariables;
  1406. return self}, function($ctx1) {$ctx1.fill(self,"globalJsVariables",{},smalltalk.Smalltalk)})},
  1407. messageSends: []}),
  1408. smalltalk.Smalltalk);
  1409. smalltalk.addMethod(
  1410. smalltalk.method({
  1411. selector: "isSmalltalkObject:",
  1412. fn: function (anObject){
  1413. var self=this;
  1414. return smalltalk.withContext(function($ctx1) {
  1415. return typeof anObject.klass !== 'undefined';
  1416. return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},smalltalk.Smalltalk)})},
  1417. messageSends: []}),
  1418. smalltalk.Smalltalk);
  1419. smalltalk.addMethod(
  1420. smalltalk.method({
  1421. selector: "packageAt:",
  1422. fn: function (packageName){
  1423. var self=this;
  1424. return smalltalk.withContext(function($ctx1) {
  1425. return self.packages[packageName];
  1426. return self}, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName},smalltalk.Smalltalk)})},
  1427. messageSends: []}),
  1428. smalltalk.Smalltalk);
  1429. smalltalk.addMethod(
  1430. smalltalk.method({
  1431. selector: "packageAt:ifAbsent:",
  1432. fn: function (packageName,aBlock){
  1433. var self=this;
  1434. return smalltalk.withContext(function($ctx1) {
  1435. var $2,$1;
  1436. $2=self._packageAt_(packageName);
  1437. $1=_st($2)._ifNil_(aBlock);
  1438. return $1;
  1439. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},smalltalk.Smalltalk)})},
  1440. messageSends: ["ifNil:", "packageAt:"]}),
  1441. smalltalk.Smalltalk);
  1442. smalltalk.addMethod(
  1443. smalltalk.method({
  1444. selector: "packages",
  1445. fn: function (){
  1446. var self=this;
  1447. return smalltalk.withContext(function($ctx1) {
  1448. return self.packages.all();
  1449. return self}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.Smalltalk)})},
  1450. messageSends: []}),
  1451. smalltalk.Smalltalk);
  1452. smalltalk.addMethod(
  1453. smalltalk.method({
  1454. selector: "parse:",
  1455. fn: function (aString){
  1456. var self=this;
  1457. var result;
  1458. return smalltalk.withContext(function($ctx1) {
  1459. var $2,$3,$1;
  1460. self._try_catch_((function(){
  1461. return smalltalk.withContext(function($ctx2) {
  1462. result=self._basicParse_(aString);
  1463. return result;
  1464. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(ex){
  1465. return smalltalk.withContext(function($ctx2) {
  1466. return _st(self._parseError_parsing_(ex,aString))._signal();
  1467. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  1468. $2=result;
  1469. _st($2)._source_(aString);
  1470. $3=_st($2)._yourself();
  1471. $1=$3;
  1472. return $1;
  1473. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},smalltalk.Smalltalk)})},
  1474. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]}),
  1475. smalltalk.Smalltalk);
  1476. smalltalk.addMethod(
  1477. smalltalk.method({
  1478. selector: "parseError:parsing:",
  1479. fn: function (anException,aString){
  1480. var self=this;
  1481. function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  1482. return smalltalk.withContext(function($ctx1) {
  1483. var $1;
  1484. $1=_st(_st($ParseError())._new())._messageText_(_st(_st(_st(_st("Parse error on line ".__comma(_st(anException)._basicAt_("line"))).__comma(" column ")).__comma(_st(anException)._basicAt_("column"))).__comma(" : Unexpected character ")).__comma(_st(anException)._basicAt_("found")));
  1485. return $1;
  1486. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString},smalltalk.Smalltalk)})},
  1487. messageSends: ["messageText:", ",", "basicAt:", "new"]}),
  1488. smalltalk.Smalltalk);
  1489. smalltalk.addMethod(
  1490. smalltalk.method({
  1491. selector: "pseudoVariableNames",
  1492. fn: function (){
  1493. var self=this;
  1494. return smalltalk.withContext(function($ctx1) {
  1495. var $1;
  1496. $1=["self", "super", "nil", "true", "false", "thisContext"];
  1497. return $1;
  1498. }, function($ctx1) {$ctx1.fill(self,"pseudoVariableNames",{},smalltalk.Smalltalk)})},
  1499. messageSends: []}),
  1500. smalltalk.Smalltalk);
  1501. smalltalk.addMethod(
  1502. smalltalk.method({
  1503. selector: "readJSObject:",
  1504. fn: function (anObject){
  1505. var self=this;
  1506. return smalltalk.withContext(function($ctx1) {
  1507. return self.readJSObject(anObject);
  1508. return self}, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject},smalltalk.Smalltalk)})},
  1509. messageSends: []}),
  1510. smalltalk.Smalltalk);
  1511. smalltalk.addMethod(
  1512. smalltalk.method({
  1513. selector: "removeClass:",
  1514. fn: function (aClass){
  1515. var self=this;
  1516. function $ClassRemoved(){return smalltalk.ClassRemoved||(typeof ClassRemoved=="undefined"?nil:ClassRemoved)}
  1517. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1518. return smalltalk.withContext(function($ctx1) {
  1519. var $1,$2,$3;
  1520. $1=_st(aClass)._isMetaclass();
  1521. if(smalltalk.assert($1)){
  1522. self._error_(_st(_st(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!"));
  1523. };
  1524. self._deleteClass_(aClass);
  1525. $2=_st($ClassRemoved())._new();
  1526. _st($2)._theClass_(aClass);
  1527. $3=_st($2)._yourself();
  1528. _st(_st($SystemAnnouncer())._current())._announce_($3);
  1529. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Smalltalk)})},
  1530. messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "deleteClass:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1531. smalltalk.Smalltalk);
  1532. smalltalk.addMethod(
  1533. smalltalk.method({
  1534. selector: "removePackage:",
  1535. fn: function (packageName){
  1536. var self=this;
  1537. var pkg;
  1538. return smalltalk.withContext(function($ctx1) {
  1539. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  1540. return smalltalk.withContext(function($ctx2) {
  1541. return self._error_("Missing package: ".__comma(packageName));
  1542. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1543. _st(_st(pkg)._classes())._do_((function(each){
  1544. return smalltalk.withContext(function($ctx2) {
  1545. return self._removeClass_(each);
  1546. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1547. self._deletePackage_(packageName);
  1548. return self}, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},smalltalk.Smalltalk)})},
  1549. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "removeClass:", "classes", "deletePackage:"]}),
  1550. smalltalk.Smalltalk);
  1551. smalltalk.addMethod(
  1552. smalltalk.method({
  1553. selector: "renamePackage:to:",
  1554. fn: function (packageName,newName){
  1555. var self=this;
  1556. var pkg;
  1557. return smalltalk.withContext(function($ctx1) {
  1558. var $1;
  1559. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  1560. return smalltalk.withContext(function($ctx2) {
  1561. return self._error_("Missing package: ".__comma(packageName));
  1562. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1563. $1=self._packageAt_(newName);
  1564. if(($receiver = $1) == nil || $receiver == undefined){
  1565. $1;
  1566. } else {
  1567. self._error_("Already exists a package called: ".__comma(newName));
  1568. };
  1569. _st(self._basicAt_("packages"))._at_put_(newName,pkg);
  1570. _st(pkg)._name_(newName);
  1571. self._deletePackage_(packageName);
  1572. return self}, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},smalltalk.Smalltalk)})},
  1573. messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "at:put:", "basicAt:", "name:", "deletePackage:"]}),
  1574. smalltalk.Smalltalk);
  1575. smalltalk.addMethod(
  1576. smalltalk.method({
  1577. selector: "reservedWords",
  1578. fn: function (){
  1579. var self=this;
  1580. return smalltalk.withContext(function($ctx1) {
  1581. return self.reservedWords;
  1582. return self}, function($ctx1) {$ctx1.fill(self,"reservedWords",{},smalltalk.Smalltalk)})},
  1583. messageSends: []}),
  1584. smalltalk.Smalltalk);
  1585. smalltalk.addMethod(
  1586. smalltalk.method({
  1587. selector: "version",
  1588. fn: function (){
  1589. var self=this;
  1590. return smalltalk.withContext(function($ctx1) {
  1591. return "0.11.0";
  1592. }, function($ctx1) {$ctx1.fill(self,"version",{},smalltalk.Smalltalk)})},
  1593. messageSends: []}),
  1594. smalltalk.Smalltalk);
  1595. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  1596. smalltalk.addMethod(
  1597. smalltalk.method({
  1598. selector: "current",
  1599. fn: function (){
  1600. var self=this;
  1601. return smalltalk.withContext(function($ctx1) {
  1602. return smalltalk;
  1603. return self}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Smalltalk.klass)})},
  1604. messageSends: []}),
  1605. smalltalk.Smalltalk.klass);
  1606. smalltalk.addMethod(
  1607. smalltalk.method({
  1608. selector: "do:displayingProgress:",
  1609. fn: function (aBlock,aString){
  1610. var self=this;
  1611. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1612. return smalltalk.withContext(function($ctx1) {
  1613. _st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
  1614. return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
  1615. messageSends: ["do:on:displaying:", "current"]}),
  1616. smalltalk.SequenceableCollection);
  1617. smalltalk.addMethod(
  1618. smalltalk.method({
  1619. selector: "asJavaScriptSelector",
  1620. fn: function (){
  1621. var self=this;
  1622. return smalltalk.withContext(function($ctx1) {
  1623. var $1;
  1624. $1=self._replace_with_("^([a-zA-Z0-9]*).*$","$1");
  1625. return $1;
  1626. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSelector",{},smalltalk.String)})},
  1627. messageSends: ["replace:with:"]}),
  1628. smalltalk.String);
  1629. });