1
0

Kernel-Infrastructure.deploy.js 64 KB

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