2
0

Kernel-Infrastructure.deploy.js 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737
  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.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  981. smalltalk.addMethod(
  982. smalltalk.method({
  983. selector: "load:",
  984. fn: function (aPackageName){
  985. var self=this;
  986. return smalltalk.withContext(function($ctx1) {
  987. self._deprecatedAPI();
  988. self._load_prefix_(aPackageName,_st(self._defaultCommitPathJs()).__comma("/"));
  989. return self}, function($ctx1) {$ctx1.fill(self,"load:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
  990. messageSends: ["deprecatedAPI", "load:prefix:", ",", "defaultCommitPathJs"]}),
  991. smalltalk.Package.klass);
  992. smalltalk.addMethod(
  993. smalltalk.method({
  994. selector: "load:prefix:",
  995. fn: function (aPackageName,aPrefix){
  996. var self=this;
  997. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  998. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  999. return smalltalk.withContext(function($ctx1) {
  1000. self._deprecatedAPI();
  1001. _st($PlatformInterface())._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(_st(_st(aPrefix).__comma(aPackageName)).__comma(".js")),"dataType".__minus_gt("script"),"success".__minus_gt((function(){
  1002. return smalltalk.withContext(function($ctx2) {
  1003. return _st(_st($Package())._named_(aPackageName))._setupClasses();
  1004. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1005. return self}, function($ctx1) {$ctx1.fill(self,"load:prefix:",{aPackageName:aPackageName,aPrefix:aPrefix},smalltalk.Package.klass)})},
  1006. messageSends: ["deprecatedAPI", "ajax:", "->", ",", "setupClasses", "named:"]}),
  1007. smalltalk.Package.klass);
  1008. smalltalk.addMethod(
  1009. smalltalk.method({
  1010. selector: "named:",
  1011. fn: function (aPackageName){
  1012. var self=this;
  1013. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1014. return smalltalk.withContext(function($ctx1) {
  1015. var $1;
  1016. $1=_st(_st($Smalltalk())._current())._packageAt_(aPackageName);
  1017. return $1;
  1018. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
  1019. messageSends: ["packageAt:", "current"]}),
  1020. smalltalk.Package.klass);
  1021. smalltalk.addMethod(
  1022. smalltalk.method({
  1023. selector: "named:ifAbsent:",
  1024. fn: function (aPackageName,aBlock){
  1025. var self=this;
  1026. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1027. return smalltalk.withContext(function($ctx1) {
  1028. var $1;
  1029. $1=_st(_st($Smalltalk())._current())._packageAt_ifAbsent_(aPackageName,aBlock);
  1030. return $1;
  1031. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},smalltalk.Package.klass)})},
  1032. messageSends: ["packageAt:ifAbsent:", "current"]}),
  1033. smalltalk.Package.klass);
  1034. smalltalk.addMethod(
  1035. smalltalk.method({
  1036. selector: "sortedClasses:",
  1037. fn: function (classes){
  1038. var self=this;
  1039. var children,others,nodes,expandedClasses;
  1040. function $ClassSorterNode(){return smalltalk.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  1041. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1042. return smalltalk.withContext(function($ctx1) {
  1043. var $1,$2;
  1044. children=[];
  1045. others=[];
  1046. _st(classes)._do_((function(each){
  1047. return smalltalk.withContext(function($ctx2) {
  1048. $1=_st(classes)._includes_(_st(each)._superclass());
  1049. if(smalltalk.assert($1)){
  1050. return _st(others)._add_(each);
  1051. } else {
  1052. return _st(children)._add_(each);
  1053. };
  1054. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1055. nodes=_st(children)._collect_((function(each){
  1056. return smalltalk.withContext(function($ctx2) {
  1057. return _st($ClassSorterNode())._on_classes_level_(each,others,(0));
  1058. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1059. nodes=_st(nodes)._sorted_((function(a,b){
  1060. return smalltalk.withContext(function($ctx2) {
  1061. return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1062. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  1063. expandedClasses=_st($Array())._new();
  1064. _st(nodes)._do_((function(aNode){
  1065. return smalltalk.withContext(function($ctx2) {
  1066. return _st(aNode)._traverseClassesWith_(expandedClasses);
  1067. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  1068. $2=expandedClasses;
  1069. return $2;
  1070. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},smalltalk.Package.klass)})},
  1071. messageSends: ["do:", "ifFalse:ifTrue:", "add:", "includes:", "superclass", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"]}),
  1072. smalltalk.Package.klass);
  1073. smalltalk.addClass('PlatformInterface', smalltalk.Object, [], 'Kernel-Infrastructure');
  1074. smalltalk.PlatformInterface.klass.iVarNames = ['worker'];
  1075. smalltalk.addMethod(
  1076. smalltalk.method({
  1077. selector: "ajax:",
  1078. fn: function (anObject){
  1079. var self=this;
  1080. return smalltalk.withContext(function($ctx1) {
  1081. var $2,$1;
  1082. $2=self["@worker"];
  1083. if(($receiver = $2) == nil || $receiver == undefined){
  1084. $1=self._error_("ajax: not available");
  1085. } else {
  1086. $1=_st(self["@worker"])._ajax_(anObject);
  1087. };
  1088. return $1;
  1089. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
  1090. messageSends: ["ifNotNil:ifNil:", "ajax:", "error:"]}),
  1091. smalltalk.PlatformInterface.klass);
  1092. smalltalk.addMethod(
  1093. smalltalk.method({
  1094. selector: "alert:",
  1095. fn: function (aString){
  1096. var self=this;
  1097. return smalltalk.withContext(function($ctx1) {
  1098. var $2,$1;
  1099. $2=self["@worker"];
  1100. if(($receiver = $2) == nil || $receiver == undefined){
  1101. $1=self._error_("alert: not available");
  1102. } else {
  1103. $1=_st(self["@worker"])._alert_(aString);
  1104. };
  1105. return $1;
  1106. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1107. messageSends: ["ifNotNil:ifNil:", "alert:", "error:"]}),
  1108. smalltalk.PlatformInterface.klass);
  1109. smalltalk.addMethod(
  1110. smalltalk.method({
  1111. selector: "confirm:",
  1112. fn: function (aString){
  1113. var self=this;
  1114. return smalltalk.withContext(function($ctx1) {
  1115. var $2,$1;
  1116. $2=self["@worker"];
  1117. if(($receiver = $2) == nil || $receiver == undefined){
  1118. $1=self._error_("confirm: not available");
  1119. } else {
  1120. $1=_st(self["@worker"])._confirm_(aString);
  1121. };
  1122. return $1;
  1123. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1124. messageSends: ["ifNotNil:ifNil:", "confirm:", "error:"]}),
  1125. smalltalk.PlatformInterface.klass);
  1126. smalltalk.addMethod(
  1127. smalltalk.method({
  1128. selector: "existsGlobal:",
  1129. fn: function (aString){
  1130. var self=this;
  1131. return smalltalk.withContext(function($ctx1) {
  1132. var f = new Function('aString',
  1133. 'if (/^[0-9]/.test(aString) || !/^[\\w_]+$/.test(aString))\n'+
  1134. ' return false;\n'+
  1135. 'try { eval(aString); return true; } catch (ex) {}\n'+
  1136. 'return false;');
  1137. return f(aString);;
  1138. return self}, function($ctx1) {$ctx1.fill(self,"existsGlobal:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1139. messageSends: []}),
  1140. smalltalk.PlatformInterface.klass);
  1141. smalltalk.addMethod(
  1142. smalltalk.method({
  1143. selector: "initialize",
  1144. fn: function (){
  1145. var self=this;
  1146. var candidate;
  1147. function $BrowserInterface(){return smalltalk.BrowserInterface||(typeof BrowserInterface=="undefined"?nil:BrowserInterface)}
  1148. return smalltalk.withContext(function($ctx1) {
  1149. var $1,$2,$3;
  1150. smalltalk.PlatformInterface.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1151. $1=$BrowserInterface();
  1152. if(($receiver = $1) == nil || $receiver == undefined){
  1153. $1;
  1154. } else {
  1155. candidate=_st($BrowserInterface())._new();
  1156. candidate;
  1157. $2=_st(candidate)._isAvailable();
  1158. if(smalltalk.assert($2)){
  1159. self._setWorker_(candidate);
  1160. $3=self;
  1161. return $3;
  1162. };
  1163. };
  1164. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{candidate:candidate},smalltalk.PlatformInterface.klass)})},
  1165. messageSends: ["initialize", "ifNotNil:", "new", "ifTrue:", "setWorker:", "isAvailable"]}),
  1166. smalltalk.PlatformInterface.klass);
  1167. smalltalk.addMethod(
  1168. smalltalk.method({
  1169. selector: "prompt:",
  1170. fn: function (aString){
  1171. var self=this;
  1172. return smalltalk.withContext(function($ctx1) {
  1173. var $2,$1;
  1174. $2=self["@worker"];
  1175. if(($receiver = $2) == nil || $receiver == undefined){
  1176. $1=self._error_("prompt: not available");
  1177. } else {
  1178. $1=_st(self["@worker"])._prompt_(aString);
  1179. };
  1180. return $1;
  1181. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1182. messageSends: ["ifNotNil:ifNil:", "prompt:", "error:"]}),
  1183. smalltalk.PlatformInterface.klass);
  1184. smalltalk.addMethod(
  1185. smalltalk.method({
  1186. selector: "setWorker:",
  1187. fn: function (anObject){
  1188. var self=this;
  1189. return smalltalk.withContext(function($ctx1) {
  1190. self["@worker"]=anObject;
  1191. return self}, function($ctx1) {$ctx1.fill(self,"setWorker:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
  1192. messageSends: []}),
  1193. smalltalk.PlatformInterface.klass);
  1194. smalltalk.addClass('ProgressHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
  1195. smalltalk.addMethod(
  1196. smalltalk.method({
  1197. selector: "do:on:displaying:",
  1198. fn: function (aBlock,aCollection,aString){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx1) {
  1201. _st(aCollection)._do_(aBlock);
  1202. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},smalltalk.ProgressHandler)})},
  1203. messageSends: ["do:"]}),
  1204. smalltalk.ProgressHandler);
  1205. smalltalk.ProgressHandler.klass.iVarNames = ['current'];
  1206. smalltalk.addMethod(
  1207. smalltalk.method({
  1208. selector: "current",
  1209. fn: function (){
  1210. var self=this;
  1211. return smalltalk.withContext(function($ctx1) {
  1212. var $2,$1;
  1213. $2=self["@current"];
  1214. if(($receiver = $2) == nil || $receiver == undefined){
  1215. self["@current"]=self._new();
  1216. $1=self["@current"];
  1217. } else {
  1218. $1=$2;
  1219. };
  1220. return $1;
  1221. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ProgressHandler.klass)})},
  1222. messageSends: ["ifNil:", "new"]}),
  1223. smalltalk.ProgressHandler.klass);
  1224. smalltalk.addMethod(
  1225. smalltalk.method({
  1226. selector: "initialize",
  1227. fn: function (){
  1228. var self=this;
  1229. return smalltalk.withContext(function($ctx1) {
  1230. self._register();
  1231. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ProgressHandler.klass)})},
  1232. messageSends: ["register"]}),
  1233. smalltalk.ProgressHandler.klass);
  1234. smalltalk.addMethod(
  1235. smalltalk.method({
  1236. selector: "register",
  1237. fn: function (){
  1238. var self=this;
  1239. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1240. return smalltalk.withContext(function($ctx1) {
  1241. _st($ProgressHandler())._setCurrent_(self._new());
  1242. return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.ProgressHandler.klass)})},
  1243. messageSends: ["setCurrent:", "new"]}),
  1244. smalltalk.ProgressHandler.klass);
  1245. smalltalk.addMethod(
  1246. smalltalk.method({
  1247. selector: "setCurrent:",
  1248. fn: function (anHandler){
  1249. var self=this;
  1250. return smalltalk.withContext(function($ctx1) {
  1251. self["@current"]=anHandler;
  1252. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler},smalltalk.ProgressHandler.klass)})},
  1253. messageSends: []}),
  1254. smalltalk.ProgressHandler.klass);
  1255. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Infrastructure');
  1256. smalltalk.addMethod(
  1257. smalltalk.method({
  1258. selector: "addGlobalJsVariable:",
  1259. fn: function (aString){
  1260. var self=this;
  1261. return smalltalk.withContext(function($ctx1) {
  1262. _st(self._globalJsVariables())._add_(aString);
  1263. return self}, function($ctx1) {$ctx1.fill(self,"addGlobalJsVariable:",{aString:aString},smalltalk.Smalltalk)})},
  1264. messageSends: ["add:", "globalJsVariables"]}),
  1265. smalltalk.Smalltalk);
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "asSmalltalkException:",
  1269. fn: function (anObject){
  1270. var self=this;
  1271. function $JavaScriptException(){return smalltalk.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  1272. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1273. return smalltalk.withContext(function($ctx1) {
  1274. var $2,$1;
  1275. $2=_st(self._isSmalltalkObject_(anObject))._and_((function(){
  1276. return smalltalk.withContext(function($ctx2) {
  1277. return _st(anObject)._isKindOf_($Error());
  1278. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1279. if(smalltalk.assert($2)){
  1280. $1=anObject;
  1281. } else {
  1282. $1=_st($JavaScriptException())._on_(anObject);
  1283. };
  1284. return $1;
  1285. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},smalltalk.Smalltalk)})},
  1286. messageSends: ["ifTrue:ifFalse:", "on:", "and:", "isKindOf:", "isSmalltalkObject:"]}),
  1287. smalltalk.Smalltalk);
  1288. smalltalk.addMethod(
  1289. smalltalk.method({
  1290. selector: "at:",
  1291. fn: function (aString){
  1292. var self=this;
  1293. return smalltalk.withContext(function($ctx1) {
  1294. return self[aString];
  1295. return self}, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.Smalltalk)})},
  1296. messageSends: []}),
  1297. smalltalk.Smalltalk);
  1298. smalltalk.addMethod(
  1299. smalltalk.method({
  1300. selector: "basicParse:",
  1301. fn: function (aString){
  1302. var self=this;
  1303. return smalltalk.withContext(function($ctx1) {
  1304. return smalltalk.parser.parse(aString);
  1305. return self}, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString},smalltalk.Smalltalk)})},
  1306. messageSends: []}),
  1307. smalltalk.Smalltalk);
  1308. smalltalk.addMethod(
  1309. smalltalk.method({
  1310. selector: "classes",
  1311. fn: function (){
  1312. var self=this;
  1313. return smalltalk.withContext(function($ctx1) {
  1314. return self.classes();
  1315. return self}, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Smalltalk)})},
  1316. messageSends: []}),
  1317. smalltalk.Smalltalk);
  1318. smalltalk.addMethod(
  1319. smalltalk.method({
  1320. selector: "createPackage:",
  1321. fn: function (packageName){
  1322. var self=this;
  1323. return smalltalk.withContext(function($ctx1) {
  1324. return smalltalk.addPackage(packageName);
  1325. return self}, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1326. messageSends: []}),
  1327. smalltalk.Smalltalk);
  1328. smalltalk.addMethod(
  1329. smalltalk.method({
  1330. selector: "createPackage:properties:",
  1331. fn: function (packageName,aDict){
  1332. var self=this;
  1333. return smalltalk.withContext(function($ctx1) {
  1334. var $1,$2;
  1335. self._deprecatedAPI();
  1336. $1=_st(aDict)._isEmpty();
  1337. if(! smalltalk.assert($1)){
  1338. self._error_("createPackage:properties: called with nonempty properties");
  1339. };
  1340. $2=self._createPackage_(packageName);
  1341. return $2;
  1342. }, function($ctx1) {$ctx1.fill(self,"createPackage:properties:",{packageName:packageName,aDict:aDict},smalltalk.Smalltalk)})},
  1343. messageSends: ["deprecatedAPI", "ifFalse:", "error:", "isEmpty", "createPackage:"]}),
  1344. smalltalk.Smalltalk);
  1345. smalltalk.addMethod(
  1346. smalltalk.method({
  1347. selector: "deleteClass:",
  1348. fn: function (aClass){
  1349. var self=this;
  1350. return smalltalk.withContext(function($ctx1) {
  1351. self.removeClass(aClass);
  1352. return self}, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass},smalltalk.Smalltalk)})},
  1353. messageSends: []}),
  1354. smalltalk.Smalltalk);
  1355. smalltalk.addMethod(
  1356. smalltalk.method({
  1357. selector: "deleteGlobalJsVariable:",
  1358. fn: function (aString){
  1359. var self=this;
  1360. return smalltalk.withContext(function($ctx1) {
  1361. _st(self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
  1362. return smalltalk.withContext(function($ctx2) {
  1363. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1364. return self}, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},smalltalk.Smalltalk)})},
  1365. messageSends: ["remove:ifAbsent:", "globalJsVariables"]}),
  1366. smalltalk.Smalltalk);
  1367. smalltalk.addMethod(
  1368. smalltalk.method({
  1369. selector: "deletePackage:",
  1370. fn: function (packageName){
  1371. var self=this;
  1372. return smalltalk.withContext(function($ctx1) {
  1373. delete smalltalk.packages[packageName];
  1374. return self}, function($ctx1) {$ctx1.fill(self,"deletePackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1375. messageSends: []}),
  1376. smalltalk.Smalltalk);
  1377. smalltalk.addMethod(
  1378. smalltalk.method({
  1379. selector: "globalJsVariables",
  1380. fn: function (){
  1381. var self=this;
  1382. return smalltalk.withContext(function($ctx1) {
  1383. return self.globalJsVariables;
  1384. return self}, function($ctx1) {$ctx1.fill(self,"globalJsVariables",{},smalltalk.Smalltalk)})},
  1385. messageSends: []}),
  1386. smalltalk.Smalltalk);
  1387. smalltalk.addMethod(
  1388. smalltalk.method({
  1389. selector: "isSmalltalkObject:",
  1390. fn: function (anObject){
  1391. var self=this;
  1392. return smalltalk.withContext(function($ctx1) {
  1393. return typeof anObject.klass !== 'undefined';
  1394. return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},smalltalk.Smalltalk)})},
  1395. messageSends: []}),
  1396. smalltalk.Smalltalk);
  1397. smalltalk.addMethod(
  1398. smalltalk.method({
  1399. selector: "packageAt:",
  1400. fn: function (packageName){
  1401. var self=this;
  1402. return smalltalk.withContext(function($ctx1) {
  1403. return self.packages[packageName];
  1404. return self}, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName},smalltalk.Smalltalk)})},
  1405. messageSends: []}),
  1406. smalltalk.Smalltalk);
  1407. smalltalk.addMethod(
  1408. smalltalk.method({
  1409. selector: "packageAt:ifAbsent:",
  1410. fn: function (packageName,aBlock){
  1411. var self=this;
  1412. return smalltalk.withContext(function($ctx1) {
  1413. var $2,$1;
  1414. $2=self._packageAt_(packageName);
  1415. $1=_st($2)._ifNil_(aBlock);
  1416. return $1;
  1417. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},smalltalk.Smalltalk)})},
  1418. messageSends: ["ifNil:", "packageAt:"]}),
  1419. smalltalk.Smalltalk);
  1420. smalltalk.addMethod(
  1421. smalltalk.method({
  1422. selector: "packages",
  1423. fn: function (){
  1424. var self=this;
  1425. return smalltalk.withContext(function($ctx1) {
  1426. return self.packages.all();
  1427. return self}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.Smalltalk)})},
  1428. messageSends: []}),
  1429. smalltalk.Smalltalk);
  1430. smalltalk.addMethod(
  1431. smalltalk.method({
  1432. selector: "parse:",
  1433. fn: function (aString){
  1434. var self=this;
  1435. var result;
  1436. return smalltalk.withContext(function($ctx1) {
  1437. var $2,$3,$1;
  1438. self._try_catch_((function(){
  1439. return smalltalk.withContext(function($ctx2) {
  1440. result=self._basicParse_(aString);
  1441. return result;
  1442. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(ex){
  1443. return smalltalk.withContext(function($ctx2) {
  1444. return _st(self._parseError_parsing_(ex,aString))._signal();
  1445. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  1446. $2=result;
  1447. _st($2)._source_(aString);
  1448. $3=_st($2)._yourself();
  1449. $1=$3;
  1450. return $1;
  1451. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},smalltalk.Smalltalk)})},
  1452. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]}),
  1453. smalltalk.Smalltalk);
  1454. smalltalk.addMethod(
  1455. smalltalk.method({
  1456. selector: "parseError:parsing:",
  1457. fn: function (anException,aString){
  1458. var self=this;
  1459. function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  1460. return smalltalk.withContext(function($ctx1) {
  1461. var $1;
  1462. $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")));
  1463. return $1;
  1464. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString},smalltalk.Smalltalk)})},
  1465. messageSends: ["messageText:", ",", "basicAt:", "new"]}),
  1466. smalltalk.Smalltalk);
  1467. smalltalk.addMethod(
  1468. smalltalk.method({
  1469. selector: "pseudoVariableNames",
  1470. fn: function (){
  1471. var self=this;
  1472. return smalltalk.withContext(function($ctx1) {
  1473. var $1;
  1474. $1=["self", "super", "nil", "true", "false", "thisContext"];
  1475. return $1;
  1476. }, function($ctx1) {$ctx1.fill(self,"pseudoVariableNames",{},smalltalk.Smalltalk)})},
  1477. messageSends: []}),
  1478. smalltalk.Smalltalk);
  1479. smalltalk.addMethod(
  1480. smalltalk.method({
  1481. selector: "readJSObject:",
  1482. fn: function (anObject){
  1483. var self=this;
  1484. return smalltalk.withContext(function($ctx1) {
  1485. return self.readJSObject(anObject);
  1486. return self}, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject},smalltalk.Smalltalk)})},
  1487. messageSends: []}),
  1488. smalltalk.Smalltalk);
  1489. smalltalk.addMethod(
  1490. smalltalk.method({
  1491. selector: "removeClass:",
  1492. fn: function (aClass){
  1493. var self=this;
  1494. function $ClassRemoved(){return smalltalk.ClassRemoved||(typeof ClassRemoved=="undefined"?nil:ClassRemoved)}
  1495. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1496. return smalltalk.withContext(function($ctx1) {
  1497. var $1,$2,$3;
  1498. $1=_st(aClass)._isMetaclass();
  1499. if(smalltalk.assert($1)){
  1500. self._error_(_st(_st(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!"));
  1501. };
  1502. self._deleteClass_(aClass);
  1503. $2=_st($ClassRemoved())._new();
  1504. _st($2)._theClass_(aClass);
  1505. $3=_st($2)._yourself();
  1506. _st(_st($SystemAnnouncer())._current())._announce_($3);
  1507. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Smalltalk)})},
  1508. messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "deleteClass:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1509. smalltalk.Smalltalk);
  1510. smalltalk.addMethod(
  1511. smalltalk.method({
  1512. selector: "removePackage:",
  1513. fn: function (packageName){
  1514. var self=this;
  1515. var pkg;
  1516. return smalltalk.withContext(function($ctx1) {
  1517. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  1518. return smalltalk.withContext(function($ctx2) {
  1519. return self._error_("Missing package: ".__comma(packageName));
  1520. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1521. _st(_st(pkg)._classes())._do_((function(each){
  1522. return smalltalk.withContext(function($ctx2) {
  1523. return self._removeClass_(each);
  1524. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1525. self._deletePackage_(packageName);
  1526. return self}, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},smalltalk.Smalltalk)})},
  1527. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "removeClass:", "classes", "deletePackage:"]}),
  1528. smalltalk.Smalltalk);
  1529. smalltalk.addMethod(
  1530. smalltalk.method({
  1531. selector: "renamePackage:to:",
  1532. fn: function (packageName,newName){
  1533. var self=this;
  1534. var pkg;
  1535. return smalltalk.withContext(function($ctx1) {
  1536. var $1;
  1537. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  1538. return smalltalk.withContext(function($ctx2) {
  1539. return self._error_("Missing package: ".__comma(packageName));
  1540. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1541. $1=self._packageAt_(newName);
  1542. if(($receiver = $1) == nil || $receiver == undefined){
  1543. $1;
  1544. } else {
  1545. self._error_("Already exists a package called: ".__comma(newName));
  1546. };
  1547. _st(self._basicAt_("packages"))._at_put_(newName,pkg);
  1548. _st(pkg)._name_(newName);
  1549. self._deletePackage_(packageName);
  1550. return self}, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},smalltalk.Smalltalk)})},
  1551. messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "at:put:", "basicAt:", "name:", "deletePackage:"]}),
  1552. smalltalk.Smalltalk);
  1553. smalltalk.addMethod(
  1554. smalltalk.method({
  1555. selector: "reservedWords",
  1556. fn: function (){
  1557. var self=this;
  1558. return smalltalk.withContext(function($ctx1) {
  1559. return self.reservedWords;
  1560. return self}, function($ctx1) {$ctx1.fill(self,"reservedWords",{},smalltalk.Smalltalk)})},
  1561. messageSends: []}),
  1562. smalltalk.Smalltalk);
  1563. smalltalk.addMethod(
  1564. smalltalk.method({
  1565. selector: "version",
  1566. fn: function (){
  1567. var self=this;
  1568. return smalltalk.withContext(function($ctx1) {
  1569. return "0.11.0";
  1570. }, function($ctx1) {$ctx1.fill(self,"version",{},smalltalk.Smalltalk)})},
  1571. messageSends: []}),
  1572. smalltalk.Smalltalk);
  1573. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  1574. smalltalk.addMethod(
  1575. smalltalk.method({
  1576. selector: "current",
  1577. fn: function (){
  1578. var self=this;
  1579. return smalltalk.withContext(function($ctx1) {
  1580. return smalltalk;
  1581. return self}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Smalltalk.klass)})},
  1582. messageSends: []}),
  1583. smalltalk.Smalltalk.klass);
  1584. smalltalk.addMethod(
  1585. smalltalk.method({
  1586. selector: "asJavaScriptSelector",
  1587. fn: function (){
  1588. var self=this;
  1589. return smalltalk.withContext(function($ctx1) {
  1590. var $1;
  1591. $1=self._replace_with_("^([a-zA-Z0-9]*).*$","$1");
  1592. return $1;
  1593. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSelector",{},smalltalk.String)})},
  1594. messageSends: ["replace:with:"]}),
  1595. smalltalk.String);
  1596. });