Kernel-Infrastructure.deploy.js 59 KB

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