2
0

Kernel-Infrastructure.deploy.js 61 KB

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