Kernel-Infrastructure.deploy.js 62 KB

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