Kernel-Infrastructure.deploy.js 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810
  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_(_st(self._jsObject())._toString());
  715. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.JSObjectProxy)})},
  716. messageSends: ["nextPutAll:", "toString", "jsObject"]}),
  717. smalltalk.JSObjectProxy);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "value",
  721. fn: function (){
  722. var self=this;
  723. return smalltalk.withContext(function($ctx1) {
  724. var $1;
  725. $1=self._at_ifAbsent_("value",(function(){
  726. return smalltalk.withContext(function($ctx2) {
  727. return smalltalk.JSObjectProxy.superclass.fn.prototype._value.apply(_st(self), []);
  728. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  729. return $1;
  730. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.JSObjectProxy)})},
  731. messageSends: ["at:ifAbsent:", "value"]}),
  732. smalltalk.JSObjectProxy);
  733. smalltalk.addMethod(
  734. smalltalk.method({
  735. selector: "on:",
  736. fn: function (aJSObject){
  737. var self=this;
  738. return smalltalk.withContext(function($ctx1) {
  739. var $2,$3,$1;
  740. $2=self._new();
  741. _st($2)._jsObject_(aJSObject);
  742. $3=_st($2)._yourself();
  743. $1=$3;
  744. return $1;
  745. }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject},smalltalk.JSObjectProxy.klass)})},
  746. messageSends: ["jsObject:", "new", "yourself"]}),
  747. smalltalk.JSObjectProxy.klass);
  748. smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Infrastructure');
  749. smalltalk.addMethod(
  750. smalltalk.method({
  751. selector: "addElement:",
  752. fn: function (anObject){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. self.elements.addElement(anObject);
  756. return self}, function($ctx1) {$ctx1.fill(self,"addElement:",{anObject:anObject},smalltalk.Organizer)})},
  757. messageSends: []}),
  758. smalltalk.Organizer);
  759. smalltalk.addMethod(
  760. smalltalk.method({
  761. selector: "elements",
  762. fn: function (){
  763. var self=this;
  764. return smalltalk.withContext(function($ctx1) {
  765. var $1;
  766. $1=_st(self._basicAt_("elements"))._copy();
  767. return $1;
  768. }, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.Organizer)})},
  769. messageSends: ["copy", "basicAt:"]}),
  770. smalltalk.Organizer);
  771. smalltalk.addMethod(
  772. smalltalk.method({
  773. selector: "removeElement:",
  774. fn: function (anObject){
  775. var self=this;
  776. return smalltalk.withContext(function($ctx1) {
  777. self.elements.removeElement(anObject);
  778. return self}, function($ctx1) {$ctx1.fill(self,"removeElement:",{anObject:anObject},smalltalk.Organizer)})},
  779. messageSends: []}),
  780. smalltalk.Organizer);
  781. smalltalk.addClass('ClassOrganizer', smalltalk.Organizer, [], 'Kernel-Infrastructure');
  782. smalltalk.addMethod(
  783. smalltalk.method({
  784. selector: "addElement:",
  785. fn: function (aString){
  786. var self=this;
  787. function $ProtocolAdded(){return smalltalk.ProtocolAdded||(typeof ProtocolAdded=="undefined"?nil:ProtocolAdded)}
  788. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  789. return smalltalk.withContext(function($ctx1) {
  790. var $1,$2;
  791. smalltalk.ClassOrganizer.superclass.fn.prototype._addElement_.apply(_st(self), [aString]);
  792. $1=_st($ProtocolAdded())._new();
  793. _st($1)._protocol_(aString);
  794. _st($1)._theClass_(self._theClass());
  795. $2=_st($1)._yourself();
  796. _st(_st($SystemAnnouncer())._current())._announce_($2);
  797. return self}, function($ctx1) {$ctx1.fill(self,"addElement:",{aString:aString},smalltalk.ClassOrganizer)})},
  798. messageSends: ["addElement:", "announce:", "protocol:", "new", "theClass:", "theClass", "yourself", "current"]}),
  799. smalltalk.ClassOrganizer);
  800. smalltalk.addMethod(
  801. smalltalk.method({
  802. selector: "removeElement:",
  803. fn: function (aString){
  804. var self=this;
  805. function $ProtocolRemoved(){return smalltalk.ProtocolRemoved||(typeof ProtocolRemoved=="undefined"?nil:ProtocolRemoved)}
  806. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  807. return smalltalk.withContext(function($ctx1) {
  808. var $1,$2;
  809. smalltalk.ClassOrganizer.superclass.fn.prototype._removeElement_.apply(_st(self), [aString]);
  810. $1=_st($ProtocolRemoved())._new();
  811. _st($1)._protocol_(aString);
  812. _st($1)._theClass_(self._theClass());
  813. $2=_st($1)._yourself();
  814. _st(_st($SystemAnnouncer())._current())._announce_($2);
  815. return self}, function($ctx1) {$ctx1.fill(self,"removeElement:",{aString:aString},smalltalk.ClassOrganizer)})},
  816. messageSends: ["removeElement:", "announce:", "protocol:", "new", "theClass:", "theClass", "yourself", "current"]}),
  817. smalltalk.ClassOrganizer);
  818. smalltalk.addMethod(
  819. smalltalk.method({
  820. selector: "theClass",
  821. fn: function (){
  822. var self=this;
  823. return smalltalk.withContext(function($ctx1) {
  824. return self.theClass ;
  825. return self}, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassOrganizer)})},
  826. messageSends: []}),
  827. smalltalk.ClassOrganizer);
  828. smalltalk.addClass('PackageOrganizer', smalltalk.Organizer, [], 'Kernel-Infrastructure');
  829. smalltalk.addClass('Package', smalltalk.Object, ['extension'], 'Kernel-Infrastructure');
  830. smalltalk.addMethod(
  831. smalltalk.method({
  832. selector: "classes",
  833. fn: function (){
  834. var self=this;
  835. return smalltalk.withContext(function($ctx1) {
  836. var $1;
  837. $1=_st(self._organization())._elements();
  838. return $1;
  839. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Package)})},
  840. messageSends: ["elements", "organization"]}),
  841. smalltalk.Package);
  842. smalltalk.addMethod(
  843. smalltalk.method({
  844. selector: "isPackage",
  845. fn: function (){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx1) {
  848. return true;
  849. }, function($ctx1) {$ctx1.fill(self,"isPackage",{},smalltalk.Package)})},
  850. messageSends: []}),
  851. smalltalk.Package);
  852. smalltalk.addMethod(
  853. smalltalk.method({
  854. selector: "loadDependencies",
  855. fn: function (){
  856. var self=this;
  857. var classes,packages;
  858. return smalltalk.withContext(function($ctx1) {
  859. var $2,$3,$1;
  860. classes=self._loadDependencyClasses();
  861. $2=_st(_st(classes)._collect_((function(each){
  862. return smalltalk.withContext(function($ctx2) {
  863. return _st(each)._package();
  864. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asSet();
  865. _st($2)._remove_ifAbsent_(self,(function(){
  866. return smalltalk.withContext(function($ctx2) {
  867. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  868. $3=_st($2)._yourself();
  869. $1=$3;
  870. return $1;
  871. }, function($ctx1) {$ctx1.fill(self,"loadDependencies",{classes:classes,packages:packages},smalltalk.Package)})},
  872. messageSends: ["loadDependencyClasses", "remove:ifAbsent:", "asSet", "collect:", "package", "yourself"]}),
  873. smalltalk.Package);
  874. smalltalk.addMethod(
  875. smalltalk.method({
  876. selector: "loadDependencyClasses",
  877. fn: function (){
  878. var self=this;
  879. var starCategoryName;
  880. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  881. return smalltalk.withContext(function($ctx1) {
  882. var $2,$3,$1;
  883. starCategoryName="*".__comma(self._name());
  884. $2=_st(_st(self._classes())._collect_((function(each){
  885. return smalltalk.withContext(function($ctx2) {
  886. return _st(each)._superclass();
  887. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asSet();
  888. _st($2)._remove_ifAbsent_(nil,(function(){
  889. return smalltalk.withContext(function($ctx2) {
  890. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  891. _st($2)._addAll_(_st(_st(_st($Smalltalk())._current())._classes())._select_((function(each){
  892. return smalltalk.withContext(function($ctx2) {
  893. return _st(_st(each)._protocols())._includes_(starCategoryName);
  894. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  895. $3=_st($2)._yourself();
  896. $1=$3;
  897. return $1;
  898. }, function($ctx1) {$ctx1.fill(self,"loadDependencyClasses",{starCategoryName:starCategoryName},smalltalk.Package)})},
  899. messageSends: [",", "name", "remove:ifAbsent:", "asSet", "collect:", "superclass", "classes", "addAll:", "select:", "includes:", "protocols", "current", "yourself"]}),
  900. smalltalk.Package);
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "name",
  904. fn: function (){
  905. var self=this;
  906. return smalltalk.withContext(function($ctx1) {
  907. return self.pkgName;
  908. return self}, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.Package)})},
  909. messageSends: []}),
  910. smalltalk.Package);
  911. smalltalk.addMethod(
  912. smalltalk.method({
  913. selector: "name:",
  914. fn: function (aString){
  915. var self=this;
  916. return smalltalk.withContext(function($ctx1) {
  917. self.pkgName = aString;
  918. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.Package)})},
  919. messageSends: []}),
  920. smalltalk.Package);
  921. smalltalk.addMethod(
  922. smalltalk.method({
  923. selector: "organization",
  924. fn: function (){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) {
  927. var $1;
  928. $1=self._basicAt_("organization");
  929. return $1;
  930. }, function($ctx1) {$ctx1.fill(self,"organization",{},smalltalk.Package)})},
  931. messageSends: ["basicAt:"]}),
  932. smalltalk.Package);
  933. smalltalk.addMethod(
  934. smalltalk.method({
  935. selector: "printOn:",
  936. fn: function (aStream){
  937. var self=this;
  938. return smalltalk.withContext(function($ctx1) {
  939. var $1,$2;
  940. smalltalk.Package.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
  941. $1=aStream;
  942. _st($1)._nextPutAll_(" (");
  943. _st($1)._nextPutAll_(self._name());
  944. $2=_st($1)._nextPutAll_(")");
  945. return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Package)})},
  946. messageSends: ["printOn:", "nextPutAll:", "name"]}),
  947. smalltalk.Package);
  948. smalltalk.addMethod(
  949. smalltalk.method({
  950. selector: "setupClasses",
  951. fn: function (){
  952. var self=this;
  953. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  954. return smalltalk.withContext(function($ctx1) {
  955. var $1,$2;
  956. $1=self._classes();
  957. _st($1)._do_((function(each){
  958. return smalltalk.withContext(function($ctx2) {
  959. return _st(_st($ClassBuilder())._new())._setupClass_(each);
  960. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  961. $2=_st($1)._do_((function(each){
  962. return smalltalk.withContext(function($ctx2) {
  963. return _st(each)._initialize();
  964. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  965. return self}, function($ctx1) {$ctx1.fill(self,"setupClasses",{},smalltalk.Package)})},
  966. messageSends: ["do:", "setupClass:", "new", "classes", "initialize"]}),
  967. smalltalk.Package);
  968. smalltalk.addMethod(
  969. smalltalk.method({
  970. selector: "sortedClasses",
  971. fn: function (){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx1) {
  974. var $1;
  975. $1=_st(self._class())._sortedClasses_(self._classes());
  976. return $1;
  977. }, function($ctx1) {$ctx1.fill(self,"sortedClasses",{},smalltalk.Package)})},
  978. messageSends: ["sortedClasses:", "classes", "class"]}),
  979. smalltalk.Package);
  980. smalltalk.addMethod(
  981. smalltalk.method({
  982. selector: "withDefaultTransport",
  983. fn: function (){
  984. var self=this;
  985. return smalltalk.withContext(function($ctx1) {
  986. return self.withDefaultTransport();
  987. return self}, function($ctx1) {$ctx1.fill(self,"withDefaultTransport",{},smalltalk.Package)})},
  988. messageSends: []}),
  989. smalltalk.Package);
  990. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  991. smalltalk.addMethod(
  992. smalltalk.method({
  993. selector: "load:",
  994. fn: function (aPackageName){
  995. var self=this;
  996. return smalltalk.withContext(function($ctx1) {
  997. self._deprecatedAPI();
  998. self._load_prefix_(aPackageName,_st(self._defaultCommitPathJs()).__comma("/"));
  999. return self}, function($ctx1) {$ctx1.fill(self,"load:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
  1000. messageSends: ["deprecatedAPI", "load:prefix:", ",", "defaultCommitPathJs"]}),
  1001. smalltalk.Package.klass);
  1002. smalltalk.addMethod(
  1003. smalltalk.method({
  1004. selector: "load:prefix:",
  1005. fn: function (aPackageName,aPrefix){
  1006. var self=this;
  1007. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  1008. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1009. return smalltalk.withContext(function($ctx1) {
  1010. self._deprecatedAPI();
  1011. _st($PlatformInterface())._ajax_(smalltalk.HashedCollection._from_(["url".__minus_gt(_st(_st(aPrefix).__comma(aPackageName)).__comma(".js")),"dataType".__minus_gt("script"),"success".__minus_gt((function(){
  1012. return smalltalk.withContext(function($ctx2) {
  1013. return _st(_st($Package())._named_(aPackageName))._setupClasses();
  1014. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
  1015. return self}, function($ctx1) {$ctx1.fill(self,"load:prefix:",{aPackageName:aPackageName,aPrefix:aPrefix},smalltalk.Package.klass)})},
  1016. messageSends: ["deprecatedAPI", "ajax:", "->", ",", "setupClasses", "named:"]}),
  1017. smalltalk.Package.klass);
  1018. smalltalk.addMethod(
  1019. smalltalk.method({
  1020. selector: "named:",
  1021. fn: function (aPackageName){
  1022. var self=this;
  1023. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1024. return smalltalk.withContext(function($ctx1) {
  1025. var $1;
  1026. $1=_st(_st($Smalltalk())._current())._packageAt_(aPackageName);
  1027. return $1;
  1028. }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
  1029. messageSends: ["packageAt:", "current"]}),
  1030. smalltalk.Package.klass);
  1031. smalltalk.addMethod(
  1032. smalltalk.method({
  1033. selector: "named:ifAbsent:",
  1034. fn: function (aPackageName,aBlock){
  1035. var self=this;
  1036. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1037. return smalltalk.withContext(function($ctx1) {
  1038. var $1;
  1039. $1=_st(_st($Smalltalk())._current())._packageAt_ifAbsent_(aPackageName,aBlock);
  1040. return $1;
  1041. }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},smalltalk.Package.klass)})},
  1042. messageSends: ["packageAt:ifAbsent:", "current"]}),
  1043. smalltalk.Package.klass);
  1044. smalltalk.addMethod(
  1045. smalltalk.method({
  1046. selector: "sortedClasses:",
  1047. fn: function (classes){
  1048. var self=this;
  1049. var children,others,nodes,expandedClasses;
  1050. function $ClassSorterNode(){return smalltalk.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
  1051. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1052. return smalltalk.withContext(function($ctx1) {
  1053. var $1,$2;
  1054. children=[];
  1055. others=[];
  1056. _st(classes)._do_((function(each){
  1057. return smalltalk.withContext(function($ctx2) {
  1058. $1=_st(classes)._includes_(_st(each)._superclass());
  1059. if(smalltalk.assert($1)){
  1060. return _st(others)._add_(each);
  1061. } else {
  1062. return _st(children)._add_(each);
  1063. };
  1064. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1065. nodes=_st(children)._collect_((function(each){
  1066. return smalltalk.withContext(function($ctx2) {
  1067. return _st($ClassSorterNode())._on_classes_level_(each,others,(0));
  1068. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1069. nodes=_st(nodes)._sorted_((function(a,b){
  1070. return smalltalk.withContext(function($ctx2) {
  1071. return _st(_st(_st(a)._theClass())._name()).__lt_eq(_st(_st(b)._theClass())._name());
  1072. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
  1073. expandedClasses=_st($Array())._new();
  1074. _st(nodes)._do_((function(aNode){
  1075. return smalltalk.withContext(function($ctx2) {
  1076. return _st(aNode)._traverseClassesWith_(expandedClasses);
  1077. }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
  1078. $2=expandedClasses;
  1079. return $2;
  1080. }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},smalltalk.Package.klass)})},
  1081. messageSends: ["do:", "ifFalse:ifTrue:", "add:", "includes:", "superclass", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"]}),
  1082. smalltalk.Package.klass);
  1083. smalltalk.addClass('PlatformInterface', smalltalk.Object, [], 'Kernel-Infrastructure');
  1084. smalltalk.PlatformInterface.klass.iVarNames = ['worker'];
  1085. smalltalk.addMethod(
  1086. smalltalk.method({
  1087. selector: "ajax:",
  1088. fn: function (anObject){
  1089. var self=this;
  1090. return smalltalk.withContext(function($ctx1) {
  1091. var $2,$1;
  1092. $2=self["@worker"];
  1093. if(($receiver = $2) == nil || $receiver == undefined){
  1094. $1=self._error_("ajax: not available");
  1095. } else {
  1096. $1=_st(self["@worker"])._ajax_(anObject);
  1097. };
  1098. return $1;
  1099. }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
  1100. messageSends: ["ifNotNil:ifNil:", "ajax:", "error:"]}),
  1101. smalltalk.PlatformInterface.klass);
  1102. smalltalk.addMethod(
  1103. smalltalk.method({
  1104. selector: "alert:",
  1105. fn: function (aString){
  1106. var self=this;
  1107. return smalltalk.withContext(function($ctx1) {
  1108. var $2,$1;
  1109. $2=self["@worker"];
  1110. if(($receiver = $2) == nil || $receiver == undefined){
  1111. $1=self._error_("alert: not available");
  1112. } else {
  1113. $1=_st(self["@worker"])._alert_(aString);
  1114. };
  1115. return $1;
  1116. }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1117. messageSends: ["ifNotNil:ifNil:", "alert:", "error:"]}),
  1118. smalltalk.PlatformInterface.klass);
  1119. smalltalk.addMethod(
  1120. smalltalk.method({
  1121. selector: "confirm:",
  1122. fn: function (aString){
  1123. var self=this;
  1124. return smalltalk.withContext(function($ctx1) {
  1125. var $2,$1;
  1126. $2=self["@worker"];
  1127. if(($receiver = $2) == nil || $receiver == undefined){
  1128. $1=self._error_("confirm: not available");
  1129. } else {
  1130. $1=_st(self["@worker"])._confirm_(aString);
  1131. };
  1132. return $1;
  1133. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1134. messageSends: ["ifNotNil:ifNil:", "confirm:", "error:"]}),
  1135. smalltalk.PlatformInterface.klass);
  1136. smalltalk.addMethod(
  1137. smalltalk.method({
  1138. selector: "existsGlobal:",
  1139. fn: function (aString){
  1140. var self=this;
  1141. return smalltalk.withContext(function($ctx1) {
  1142. var f = new Function('aString',
  1143. 'if (/^[0-9]/.test(aString) || !/^[\\w_]+$/.test(aString))\n'+
  1144. ' return false;\n'+
  1145. 'try { eval(aString); return true; } catch (ex) {}\n'+
  1146. 'return false;');
  1147. return f(aString);;
  1148. return self}, function($ctx1) {$ctx1.fill(self,"existsGlobal:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1149. messageSends: []}),
  1150. smalltalk.PlatformInterface.klass);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "initialize",
  1154. fn: function (){
  1155. var self=this;
  1156. var candidate;
  1157. function $BrowserInterface(){return smalltalk.BrowserInterface||(typeof BrowserInterface=="undefined"?nil:BrowserInterface)}
  1158. return smalltalk.withContext(function($ctx1) {
  1159. var $1,$2,$3;
  1160. smalltalk.PlatformInterface.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1161. $1=$BrowserInterface();
  1162. if(($receiver = $1) == nil || $receiver == undefined){
  1163. $1;
  1164. } else {
  1165. candidate=_st($BrowserInterface())._new();
  1166. candidate;
  1167. $2=_st(candidate)._isAvailable();
  1168. if(smalltalk.assert($2)){
  1169. self._setWorker_(candidate);
  1170. $3=self;
  1171. return $3;
  1172. };
  1173. };
  1174. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{candidate:candidate},smalltalk.PlatformInterface.klass)})},
  1175. messageSends: ["initialize", "ifNotNil:", "new", "ifTrue:", "setWorker:", "isAvailable"]}),
  1176. smalltalk.PlatformInterface.klass);
  1177. smalltalk.addMethod(
  1178. smalltalk.method({
  1179. selector: "prompt:",
  1180. fn: function (aString){
  1181. var self=this;
  1182. return smalltalk.withContext(function($ctx1) {
  1183. var $2,$1;
  1184. $2=self["@worker"];
  1185. if(($receiver = $2) == nil || $receiver == undefined){
  1186. $1=self._error_("prompt: not available");
  1187. } else {
  1188. $1=_st(self["@worker"])._prompt_(aString);
  1189. };
  1190. return $1;
  1191. }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.PlatformInterface.klass)})},
  1192. messageSends: ["ifNotNil:ifNil:", "prompt:", "error:"]}),
  1193. smalltalk.PlatformInterface.klass);
  1194. smalltalk.addMethod(
  1195. smalltalk.method({
  1196. selector: "setWorker:",
  1197. fn: function (anObject){
  1198. var self=this;
  1199. return smalltalk.withContext(function($ctx1) {
  1200. self["@worker"]=anObject;
  1201. return self}, function($ctx1) {$ctx1.fill(self,"setWorker:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
  1202. messageSends: []}),
  1203. smalltalk.PlatformInterface.klass);
  1204. smalltalk.addClass('ProgressHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
  1205. smalltalk.addMethod(
  1206. smalltalk.method({
  1207. selector: "do:on:displaying:",
  1208. fn: function (aBlock,aCollection,aString){
  1209. var self=this;
  1210. return smalltalk.withContext(function($ctx1) {
  1211. _st(aCollection)._do_(aBlock);
  1212. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},smalltalk.ProgressHandler)})},
  1213. messageSends: ["do:"]}),
  1214. smalltalk.ProgressHandler);
  1215. smalltalk.ProgressHandler.klass.iVarNames = ['current'];
  1216. smalltalk.addMethod(
  1217. smalltalk.method({
  1218. selector: "current",
  1219. fn: function (){
  1220. var self=this;
  1221. return smalltalk.withContext(function($ctx1) {
  1222. var $2,$1;
  1223. $2=self["@current"];
  1224. if(($receiver = $2) == nil || $receiver == undefined){
  1225. self["@current"]=self._new();
  1226. $1=self["@current"];
  1227. } else {
  1228. $1=$2;
  1229. };
  1230. return $1;
  1231. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ProgressHandler.klass)})},
  1232. messageSends: ["ifNil:", "new"]}),
  1233. smalltalk.ProgressHandler.klass);
  1234. smalltalk.addMethod(
  1235. smalltalk.method({
  1236. selector: "initialize",
  1237. fn: function (){
  1238. var self=this;
  1239. return smalltalk.withContext(function($ctx1) {
  1240. self._register();
  1241. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ProgressHandler.klass)})},
  1242. messageSends: ["register"]}),
  1243. smalltalk.ProgressHandler.klass);
  1244. smalltalk.addMethod(
  1245. smalltalk.method({
  1246. selector: "register",
  1247. fn: function (){
  1248. var self=this;
  1249. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1250. return smalltalk.withContext(function($ctx1) {
  1251. _st($ProgressHandler())._setCurrent_(self._new());
  1252. return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.ProgressHandler.klass)})},
  1253. messageSends: ["setCurrent:", "new"]}),
  1254. smalltalk.ProgressHandler.klass);
  1255. smalltalk.addMethod(
  1256. smalltalk.method({
  1257. selector: "setCurrent:",
  1258. fn: function (anHandler){
  1259. var self=this;
  1260. return smalltalk.withContext(function($ctx1) {
  1261. self["@current"]=anHandler;
  1262. return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler},smalltalk.ProgressHandler.klass)})},
  1263. messageSends: []}),
  1264. smalltalk.ProgressHandler.klass);
  1265. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Infrastructure');
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "addGlobalJsVariable:",
  1269. fn: function (aString){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) {
  1272. _st(self._globalJsVariables())._add_(aString);
  1273. return self}, function($ctx1) {$ctx1.fill(self,"addGlobalJsVariable:",{aString:aString},smalltalk.Smalltalk)})},
  1274. messageSends: ["add:", "globalJsVariables"]}),
  1275. smalltalk.Smalltalk);
  1276. smalltalk.addMethod(
  1277. smalltalk.method({
  1278. selector: "amdRequire",
  1279. fn: function (){
  1280. var self=this;
  1281. return smalltalk.withContext(function($ctx1) {
  1282. var $1;
  1283. $1=self._basicAt_("amdRequire");
  1284. return $1;
  1285. }, function($ctx1) {$ctx1.fill(self,"amdRequire",{},smalltalk.Smalltalk)})},
  1286. messageSends: ["basicAt:"]}),
  1287. smalltalk.Smalltalk);
  1288. smalltalk.addMethod(
  1289. smalltalk.method({
  1290. selector: "asSmalltalkException:",
  1291. fn: function (anObject){
  1292. var self=this;
  1293. function $JavaScriptException(){return smalltalk.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  1294. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1295. return smalltalk.withContext(function($ctx1) {
  1296. var $2,$1;
  1297. $2=_st(self._isSmalltalkObject_(anObject))._and_((function(){
  1298. return smalltalk.withContext(function($ctx2) {
  1299. return _st(anObject)._isKindOf_($Error());
  1300. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1301. if(smalltalk.assert($2)){
  1302. $1=anObject;
  1303. } else {
  1304. $1=_st($JavaScriptException())._on_(anObject);
  1305. };
  1306. return $1;
  1307. }, function($ctx1) {$ctx1.fill(self,"asSmalltalkException:",{anObject:anObject},smalltalk.Smalltalk)})},
  1308. messageSends: ["ifTrue:ifFalse:", "on:", "and:", "isKindOf:", "isSmalltalkObject:"]}),
  1309. smalltalk.Smalltalk);
  1310. smalltalk.addMethod(
  1311. smalltalk.method({
  1312. selector: "at:",
  1313. fn: function (aString){
  1314. var self=this;
  1315. return smalltalk.withContext(function($ctx1) {
  1316. return self[aString];
  1317. return self}, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.Smalltalk)})},
  1318. messageSends: []}),
  1319. smalltalk.Smalltalk);
  1320. smalltalk.addMethod(
  1321. smalltalk.method({
  1322. selector: "basicParse:",
  1323. fn: function (aString){
  1324. var self=this;
  1325. return smalltalk.withContext(function($ctx1) {
  1326. return smalltalk.parser.parse(aString);
  1327. return self}, function($ctx1) {$ctx1.fill(self,"basicParse:",{aString:aString},smalltalk.Smalltalk)})},
  1328. messageSends: []}),
  1329. smalltalk.Smalltalk);
  1330. smalltalk.addMethod(
  1331. smalltalk.method({
  1332. selector: "classes",
  1333. fn: function (){
  1334. var self=this;
  1335. return smalltalk.withContext(function($ctx1) {
  1336. return self.classes();
  1337. return self}, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Smalltalk)})},
  1338. messageSends: []}),
  1339. smalltalk.Smalltalk);
  1340. smalltalk.addMethod(
  1341. smalltalk.method({
  1342. selector: "createDefaultPackage:",
  1343. fn: function (packageName){
  1344. var self=this;
  1345. return smalltalk.withContext(function($ctx1) {
  1346. var $1;
  1347. $1=_st(self._createPackage_(packageName))._withDefaultTransport();
  1348. return $1;
  1349. }, function($ctx1) {$ctx1.fill(self,"createDefaultPackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1350. messageSends: ["withDefaultTransport", "createPackage:"]}),
  1351. smalltalk.Smalltalk);
  1352. smalltalk.addMethod(
  1353. smalltalk.method({
  1354. selector: "createPackage:",
  1355. fn: function (packageName){
  1356. var self=this;
  1357. return smalltalk.withContext(function($ctx1) {
  1358. return smalltalk.addPackage(packageName);
  1359. return self}, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1360. messageSends: []}),
  1361. smalltalk.Smalltalk);
  1362. smalltalk.addMethod(
  1363. smalltalk.method({
  1364. selector: "createPackage:properties:",
  1365. fn: function (packageName,aDict){
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) {
  1368. var $1,$2;
  1369. self._deprecatedAPI();
  1370. $1=_st(aDict)._isEmpty();
  1371. if(! smalltalk.assert($1)){
  1372. self._error_("createPackage:properties: called with nonempty properties");
  1373. };
  1374. $2=self._createPackage_(packageName);
  1375. return $2;
  1376. }, function($ctx1) {$ctx1.fill(self,"createPackage:properties:",{packageName:packageName,aDict:aDict},smalltalk.Smalltalk)})},
  1377. messageSends: ["deprecatedAPI", "ifFalse:", "error:", "isEmpty", "createPackage:"]}),
  1378. smalltalk.Smalltalk);
  1379. smalltalk.addMethod(
  1380. smalltalk.method({
  1381. selector: "defaultAMDNamespace",
  1382. fn: function (){
  1383. var self=this;
  1384. return smalltalk.withContext(function($ctx1) {
  1385. var $1;
  1386. $1=self._basicAt_("defaultAMDNamespace");
  1387. return $1;
  1388. }, function($ctx1) {$ctx1.fill(self,"defaultAMDNamespace",{},smalltalk.Smalltalk)})},
  1389. messageSends: ["basicAt:"]}),
  1390. smalltalk.Smalltalk);
  1391. smalltalk.addMethod(
  1392. smalltalk.method({
  1393. selector: "defaultAMDNamespace:",
  1394. fn: function (aString){
  1395. var self=this;
  1396. return smalltalk.withContext(function($ctx1) {
  1397. self._basicAt_put_("defaultAMDNamespace",aString);
  1398. return self}, function($ctx1) {$ctx1.fill(self,"defaultAMDNamespace:",{aString:aString},smalltalk.Smalltalk)})},
  1399. messageSends: ["basicAt:put:"]}),
  1400. smalltalk.Smalltalk);
  1401. smalltalk.addMethod(
  1402. smalltalk.method({
  1403. selector: "deleteClass:",
  1404. fn: function (aClass){
  1405. var self=this;
  1406. return smalltalk.withContext(function($ctx1) {
  1407. self.removeClass(aClass);
  1408. return self}, function($ctx1) {$ctx1.fill(self,"deleteClass:",{aClass:aClass},smalltalk.Smalltalk)})},
  1409. messageSends: []}),
  1410. smalltalk.Smalltalk);
  1411. smalltalk.addMethod(
  1412. smalltalk.method({
  1413. selector: "deleteGlobalJsVariable:",
  1414. fn: function (aString){
  1415. var self=this;
  1416. return smalltalk.withContext(function($ctx1) {
  1417. _st(self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
  1418. return smalltalk.withContext(function($ctx2) {
  1419. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1420. return self}, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},smalltalk.Smalltalk)})},
  1421. messageSends: ["remove:ifAbsent:", "globalJsVariables"]}),
  1422. smalltalk.Smalltalk);
  1423. smalltalk.addMethod(
  1424. smalltalk.method({
  1425. selector: "deletePackage:",
  1426. fn: function (packageName){
  1427. var self=this;
  1428. return smalltalk.withContext(function($ctx1) {
  1429. delete smalltalk.packages[packageName];
  1430. return self}, function($ctx1) {$ctx1.fill(self,"deletePackage:",{packageName:packageName},smalltalk.Smalltalk)})},
  1431. messageSends: []}),
  1432. smalltalk.Smalltalk);
  1433. smalltalk.addMethod(
  1434. smalltalk.method({
  1435. selector: "globalJsVariables",
  1436. fn: function (){
  1437. var self=this;
  1438. return smalltalk.withContext(function($ctx1) {
  1439. return self.globalJsVariables;
  1440. return self}, function($ctx1) {$ctx1.fill(self,"globalJsVariables",{},smalltalk.Smalltalk)})},
  1441. messageSends: []}),
  1442. smalltalk.Smalltalk);
  1443. smalltalk.addMethod(
  1444. smalltalk.method({
  1445. selector: "isSmalltalkObject:",
  1446. fn: function (anObject){
  1447. var self=this;
  1448. return smalltalk.withContext(function($ctx1) {
  1449. return typeof anObject.klass !== 'undefined';
  1450. return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkObject:",{anObject:anObject},smalltalk.Smalltalk)})},
  1451. messageSends: []}),
  1452. smalltalk.Smalltalk);
  1453. smalltalk.addMethod(
  1454. smalltalk.method({
  1455. selector: "packageAt:",
  1456. fn: function (packageName){
  1457. var self=this;
  1458. return smalltalk.withContext(function($ctx1) {
  1459. return self.packages[packageName];
  1460. return self}, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName},smalltalk.Smalltalk)})},
  1461. messageSends: []}),
  1462. smalltalk.Smalltalk);
  1463. smalltalk.addMethod(
  1464. smalltalk.method({
  1465. selector: "packageAt:ifAbsent:",
  1466. fn: function (packageName,aBlock){
  1467. var self=this;
  1468. return smalltalk.withContext(function($ctx1) {
  1469. var $2,$1;
  1470. $2=self._packageAt_(packageName);
  1471. $1=_st($2)._ifNil_(aBlock);
  1472. return $1;
  1473. }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},smalltalk.Smalltalk)})},
  1474. messageSends: ["ifNil:", "packageAt:"]}),
  1475. smalltalk.Smalltalk);
  1476. smalltalk.addMethod(
  1477. smalltalk.method({
  1478. selector: "packages",
  1479. fn: function (){
  1480. var self=this;
  1481. return smalltalk.withContext(function($ctx1) {
  1482. return self.packages.all();
  1483. return self}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.Smalltalk)})},
  1484. messageSends: []}),
  1485. smalltalk.Smalltalk);
  1486. smalltalk.addMethod(
  1487. smalltalk.method({
  1488. selector: "parse:",
  1489. fn: function (aString){
  1490. var self=this;
  1491. var result;
  1492. return smalltalk.withContext(function($ctx1) {
  1493. var $2,$3,$1;
  1494. self._try_catch_((function(){
  1495. return smalltalk.withContext(function($ctx2) {
  1496. result=self._basicParse_(aString);
  1497. return result;
  1498. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(ex){
  1499. return smalltalk.withContext(function($ctx2) {
  1500. return _st(self._parseError_parsing_(ex,aString))._signal();
  1501. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  1502. $2=result;
  1503. _st($2)._source_(aString);
  1504. $3=_st($2)._yourself();
  1505. $1=$3;
  1506. return $1;
  1507. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},smalltalk.Smalltalk)})},
  1508. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]}),
  1509. smalltalk.Smalltalk);
  1510. smalltalk.addMethod(
  1511. smalltalk.method({
  1512. selector: "parseError:parsing:",
  1513. fn: function (anException,aString){
  1514. var self=this;
  1515. function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  1516. return smalltalk.withContext(function($ctx1) {
  1517. var $1;
  1518. $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")));
  1519. return $1;
  1520. }, function($ctx1) {$ctx1.fill(self,"parseError:parsing:",{anException:anException,aString:aString},smalltalk.Smalltalk)})},
  1521. messageSends: ["messageText:", ",", "basicAt:", "new"]}),
  1522. smalltalk.Smalltalk);
  1523. smalltalk.addMethod(
  1524. smalltalk.method({
  1525. selector: "pseudoVariableNames",
  1526. fn: function (){
  1527. var self=this;
  1528. return smalltalk.withContext(function($ctx1) {
  1529. var $1;
  1530. $1=["self", "super", "nil", "true", "false", "thisContext"];
  1531. return $1;
  1532. }, function($ctx1) {$ctx1.fill(self,"pseudoVariableNames",{},smalltalk.Smalltalk)})},
  1533. messageSends: []}),
  1534. smalltalk.Smalltalk);
  1535. smalltalk.addMethod(
  1536. smalltalk.method({
  1537. selector: "readJSObject:",
  1538. fn: function (anObject){
  1539. var self=this;
  1540. return smalltalk.withContext(function($ctx1) {
  1541. return self.readJSObject(anObject);
  1542. return self}, function($ctx1) {$ctx1.fill(self,"readJSObject:",{anObject:anObject},smalltalk.Smalltalk)})},
  1543. messageSends: []}),
  1544. smalltalk.Smalltalk);
  1545. smalltalk.addMethod(
  1546. smalltalk.method({
  1547. selector: "removeClass:",
  1548. fn: function (aClass){
  1549. var self=this;
  1550. function $ClassRemoved(){return smalltalk.ClassRemoved||(typeof ClassRemoved=="undefined"?nil:ClassRemoved)}
  1551. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  1552. return smalltalk.withContext(function($ctx1) {
  1553. var $1,$2,$3;
  1554. $1=_st(aClass)._isMetaclass();
  1555. if(smalltalk.assert($1)){
  1556. self._error_(_st(_st(aClass)._asString()).__comma(" is a Metaclass and cannot be removed!"));
  1557. };
  1558. self._deleteClass_(aClass);
  1559. $2=_st($ClassRemoved())._new();
  1560. _st($2)._theClass_(aClass);
  1561. $3=_st($2)._yourself();
  1562. _st(_st($SystemAnnouncer())._current())._announce_($3);
  1563. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Smalltalk)})},
  1564. messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "deleteClass:", "announce:", "theClass:", "new", "yourself", "current"]}),
  1565. smalltalk.Smalltalk);
  1566. smalltalk.addMethod(
  1567. smalltalk.method({
  1568. selector: "removePackage:",
  1569. fn: function (packageName){
  1570. var self=this;
  1571. var pkg;
  1572. return smalltalk.withContext(function($ctx1) {
  1573. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  1574. return smalltalk.withContext(function($ctx2) {
  1575. return self._error_("Missing package: ".__comma(packageName));
  1576. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1577. _st(_st(pkg)._classes())._do_((function(each){
  1578. return smalltalk.withContext(function($ctx2) {
  1579. return self._removeClass_(each);
  1580. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1581. self._deletePackage_(packageName);
  1582. return self}, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},smalltalk.Smalltalk)})},
  1583. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "removeClass:", "classes", "deletePackage:"]}),
  1584. smalltalk.Smalltalk);
  1585. smalltalk.addMethod(
  1586. smalltalk.method({
  1587. selector: "renamePackage:to:",
  1588. fn: function (packageName,newName){
  1589. var self=this;
  1590. var pkg;
  1591. return smalltalk.withContext(function($ctx1) {
  1592. var $1;
  1593. pkg=self._packageAt_ifAbsent_(packageName,(function(){
  1594. return smalltalk.withContext(function($ctx2) {
  1595. return self._error_("Missing package: ".__comma(packageName));
  1596. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1597. $1=self._packageAt_(newName);
  1598. if(($receiver = $1) == nil || $receiver == undefined){
  1599. $1;
  1600. } else {
  1601. self._error_("Already exists a package called: ".__comma(newName));
  1602. };
  1603. _st(self._basicAt_("packages"))._at_put_(newName,pkg);
  1604. _st(pkg)._name_(newName);
  1605. self._deletePackage_(packageName);
  1606. return self}, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},smalltalk.Smalltalk)})},
  1607. messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "at:put:", "basicAt:", "name:", "deletePackage:"]}),
  1608. smalltalk.Smalltalk);
  1609. smalltalk.addMethod(
  1610. smalltalk.method({
  1611. selector: "reservedWords",
  1612. fn: function (){
  1613. var self=this;
  1614. return smalltalk.withContext(function($ctx1) {
  1615. return self.reservedWords;
  1616. return self}, function($ctx1) {$ctx1.fill(self,"reservedWords",{},smalltalk.Smalltalk)})},
  1617. messageSends: []}),
  1618. smalltalk.Smalltalk);
  1619. smalltalk.addMethod(
  1620. smalltalk.method({
  1621. selector: "version",
  1622. fn: function (){
  1623. var self=this;
  1624. return smalltalk.withContext(function($ctx1) {
  1625. return "0.12.0-pre";
  1626. }, function($ctx1) {$ctx1.fill(self,"version",{},smalltalk.Smalltalk)})},
  1627. messageSends: []}),
  1628. smalltalk.Smalltalk);
  1629. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  1630. smalltalk.addMethod(
  1631. smalltalk.method({
  1632. selector: "current",
  1633. fn: function (){
  1634. var self=this;
  1635. return smalltalk.withContext(function($ctx1) {
  1636. return smalltalk;
  1637. return self}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Smalltalk.klass)})},
  1638. messageSends: []}),
  1639. smalltalk.Smalltalk.klass);
  1640. smalltalk.addMethod(
  1641. smalltalk.method({
  1642. selector: "do:displayingProgress:",
  1643. fn: function (aBlock,aString){
  1644. var self=this;
  1645. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  1646. return smalltalk.withContext(function($ctx1) {
  1647. _st(_st($ProgressHandler())._current())._do_on_displaying_(aBlock,self,aString);
  1648. return self}, function($ctx1) {$ctx1.fill(self,"do:displayingProgress:",{aBlock:aBlock,aString:aString},smalltalk.SequenceableCollection)})},
  1649. messageSends: ["do:on:displaying:", "current"]}),
  1650. smalltalk.SequenceableCollection);
  1651. smalltalk.addMethod(
  1652. smalltalk.method({
  1653. selector: "asJavaScriptSelector",
  1654. fn: function (){
  1655. var self=this;
  1656. return smalltalk.withContext(function($ctx1) {
  1657. var $1;
  1658. $1=self._replace_with_("^([a-zA-Z0-9]*).*$","$1");
  1659. return $1;
  1660. }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSelector",{},smalltalk.String)})},
  1661. messageSends: ["replace:with:"]}),
  1662. smalltalk.String);
  1663. });