Helios-Environments.deploy.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. smalltalk.addPackage('Helios-Environments');
  2. smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Environments');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "addInstVarNamed:to:",
  6. fn: function (aString,aClass){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. var $1,$2;
  10. $1=_st(_st(aClass)._instanceVariableNames())._copy();
  11. _st($1)._add_(aString);
  12. $2=_st($1)._yourself();
  13. _st(_st(self)._classBuilder())._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),_st(aClass)._name(),$2,_st(_st(aClass)._package())._name());
  14. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},smalltalk.HLEnvironment)})},
  15. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package", "classBuilder"]}),
  16. smalltalk.HLEnvironment);
  17. smalltalk.addMethod(
  18. smalltalk.method({
  19. selector: "availableClassNames",
  20. fn: function (){
  21. var self=this;
  22. return smalltalk.withContext(function($ctx1) {
  23. _st(self)._subclassResponsibility();
  24. return self}, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLEnvironment)})},
  25. messageSends: ["subclassResponsibility"]}),
  26. smalltalk.HLEnvironment);
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "availableProtocolsFor:",
  30. fn: function (aClass){
  31. var self=this;
  32. return smalltalk.withContext(function($ctx1) {
  33. _st(self)._subclassResponsibility();
  34. return self}, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass},smalltalk.HLEnvironment)})},
  35. messageSends: ["subclassResponsibility"]}),
  36. smalltalk.HLEnvironment);
  37. smalltalk.addMethod(
  38. smalltalk.method({
  39. selector: "classBuilder",
  40. fn: function (){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. var $1;
  44. $1=_st(self)._subclassResponsibility();
  45. return $1;
  46. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.HLEnvironment)})},
  47. messageSends: ["subclassResponsibility"]}),
  48. smalltalk.HLEnvironment);
  49. smalltalk.addMethod(
  50. smalltalk.method({
  51. selector: "classNamed:",
  52. fn: function (aString){
  53. var self=this;
  54. return smalltalk.withContext(function($ctx1) {
  55. _st(self)._subclassResponsibility();
  56. return self}, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.HLEnvironment)})},
  57. messageSends: ["subclassResponsibility"]}),
  58. smalltalk.HLEnvironment);
  59. smalltalk.addMethod(
  60. smalltalk.method({
  61. selector: "commitPackage:",
  62. fn: function (aPackage){
  63. var self=this;
  64. return smalltalk.withContext(function($ctx1) {
  65. _st(self)._subclassResponsibility();
  66. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLEnvironment)})},
  67. messageSends: ["subclassResponsibility"]}),
  68. smalltalk.HLEnvironment);
  69. smalltalk.addMethod(
  70. smalltalk.method({
  71. selector: "compileClassComment:for:",
  72. fn: function (aString,aClass){
  73. var self=this;
  74. return smalltalk.withContext(function($ctx1) {
  75. _st(aClass)._comment_(aString);
  76. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},smalltalk.HLEnvironment)})},
  77. messageSends: ["comment:"]}),
  78. smalltalk.HLEnvironment);
  79. smalltalk.addMethod(
  80. smalltalk.method({
  81. selector: "compileClassDefinition:",
  82. fn: function (aString){
  83. var self=this;
  84. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  85. return smalltalk.withContext(function($ctx1) {
  86. _st(self)._eval_on_(aString,_st($DoIt())._new());
  87. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.HLEnvironment)})},
  88. messageSends: ["eval:on:", "new"]}),
  89. smalltalk.HLEnvironment);
  90. smalltalk.addMethod(
  91. smalltalk.method({
  92. selector: "compileMethod:for:protocol:",
  93. fn: function (sourceCode,class_,protocol){
  94. var self=this;
  95. return smalltalk.withContext(function($ctx1) {
  96. _st(class_)._compile_category_(sourceCode,protocol);
  97. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},smalltalk.HLEnvironment)})},
  98. messageSends: ["compile:category:"]}),
  99. smalltalk.HLEnvironment);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "eval:on:",
  103. fn: function (someCode,aReceiver){
  104. var self=this;
  105. return smalltalk.withContext(function($ctx1) {
  106. var $1;
  107. $1=_st(self)._subclassResponsibility();
  108. return $1;
  109. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver},smalltalk.HLEnvironment)})},
  110. messageSends: ["subclassResponsibility"]}),
  111. smalltalk.HLEnvironment);
  112. smalltalk.addMethod(
  113. smalltalk.method({
  114. selector: "moveMethod:toClass:",
  115. fn: function (aMethod,aClassName){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) {
  118. _st(self)._subclassResponsibility();
  119. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName},smalltalk.HLEnvironment)})},
  120. messageSends: ["subclassResponsibility"]}),
  121. smalltalk.HLEnvironment);
  122. smalltalk.addMethod(
  123. smalltalk.method({
  124. selector: "moveMethod:toProtocol:",
  125. fn: function (aMethod,aProtocol){
  126. var self=this;
  127. return smalltalk.withContext(function($ctx1) {
  128. _st(self)._subclassResponsibility();
  129. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLEnvironment)})},
  130. messageSends: ["subclassResponsibility"]}),
  131. smalltalk.HLEnvironment);
  132. smalltalk.addMethod(
  133. smalltalk.method({
  134. selector: "packages",
  135. fn: function (){
  136. var self=this;
  137. return smalltalk.withContext(function($ctx1) {
  138. var $1;
  139. $1=_st(self)._subclassResponsibility();
  140. return $1;
  141. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLEnvironment)})},
  142. messageSends: ["subclassResponsibility"]}),
  143. smalltalk.HLEnvironment);
  144. smalltalk.addMethod(
  145. smalltalk.method({
  146. selector: "removeMethod:",
  147. fn: function (aMethod){
  148. var self=this;
  149. return smalltalk.withContext(function($ctx1) {
  150. _st(self)._sublcassResponsibility();
  151. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLEnvironment)})},
  152. messageSends: ["sublcassResponsibility"]}),
  153. smalltalk.HLEnvironment);
  154. smalltalk.addMethod(
  155. smalltalk.method({
  156. selector: "systemAnnouncer",
  157. fn: function (){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) {
  160. var $1;
  161. $1=_st(self)._subclassResponsibility();
  162. return $1;
  163. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLEnvironment)})},
  164. messageSends: ["subclassResponsibility"]}),
  165. smalltalk.HLEnvironment);
  166. smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  167. smalltalk.addMethod(
  168. smalltalk.method({
  169. selector: "availableClassNames",
  170. fn: function (){
  171. var self=this;
  172. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  173. return smalltalk.withContext(function($ctx1) {
  174. var $1;
  175. $1=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  176. return smalltalk.withContext(function($ctx2) {
  177. return _st(each)._name();
  178. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  179. return $1;
  180. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLLocalEnvironment)})},
  181. messageSends: ["collect:", "name", "classes", "current"]}),
  182. smalltalk.HLLocalEnvironment);
  183. smalltalk.addMethod(
  184. smalltalk.method({
  185. selector: "availableProtocolsFor:",
  186. fn: function (aClass){
  187. var self=this;
  188. var protocols;
  189. return smalltalk.withContext(function($ctx1) {
  190. var $1,$2;
  191. protocols=_st(aClass)._protocols();
  192. $1=_st(aClass)._superclass();
  193. if(($receiver = $1) == nil || $receiver == undefined){
  194. $1;
  195. } else {
  196. _st(protocols)._addAll_(_st(self)._availableProtocolsFor_(_st(aClass)._superclass()));
  197. };
  198. $2=_st(_st(protocols)._asSet())._asArray();
  199. return $2;
  200. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.HLLocalEnvironment)})},
  201. messageSends: ["protocols", "ifNotNil:", "addAll:", "availableProtocolsFor:", "superclass", "asArray", "asSet"]}),
  202. smalltalk.HLLocalEnvironment);
  203. smalltalk.addMethod(
  204. smalltalk.method({
  205. selector: "classBuilder",
  206. fn: function (){
  207. var self=this;
  208. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  209. return smalltalk.withContext(function($ctx1) {
  210. var $1;
  211. $1=_st($ClassBuilder())._new();
  212. return $1;
  213. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.HLLocalEnvironment)})},
  214. messageSends: ["new"]}),
  215. smalltalk.HLLocalEnvironment);
  216. smalltalk.addMethod(
  217. smalltalk.method({
  218. selector: "classNamed:",
  219. fn: function (aString){
  220. var self=this;
  221. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  222. return smalltalk.withContext(function($ctx1) {
  223. var $2,$1;
  224. $2=_st(_st($Smalltalk())._current())._at_(_st(aString)._asSymbol());
  225. if(($receiver = $2) == nil || $receiver == undefined){
  226. $1=_st(self)._error_("Invalid class name");
  227. } else {
  228. $1=$2;
  229. };
  230. return $1;
  231. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.HLLocalEnvironment)})},
  232. messageSends: ["ifNil:", "error:", "at:", "asSymbol", "current"]}),
  233. smalltalk.HLLocalEnvironment);
  234. smalltalk.addMethod(
  235. smalltalk.method({
  236. selector: "commitPackage:",
  237. fn: function (aPackage){
  238. var self=this;
  239. return smalltalk.withContext(function($ctx1) {
  240. _st(aPackage)._commit();
  241. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLLocalEnvironment)})},
  242. messageSends: ["commit"]}),
  243. smalltalk.HLLocalEnvironment);
  244. smalltalk.addMethod(
  245. smalltalk.method({
  246. selector: "eval:on:",
  247. fn: function (aString,aReceiver){
  248. var self=this;
  249. var compiler;
  250. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  251. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  252. return smalltalk.withContext(function($ctx1) {
  253. var $1,$2;
  254. var $early={};
  255. try {
  256. compiler=_st($Compiler())._new();
  257. _st((function(){
  258. return smalltalk.withContext(function($ctx2) {
  259. return _st(compiler)._parseExpression_(aString);
  260. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(ex){
  261. return smalltalk.withContext(function($ctx2) {
  262. $1=_st(window)._alert_(_st(ex)._messageText());
  263. throw $early=[$1];
  264. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  265. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  266. return $2;
  267. }
  268. catch(e) {if(e===$early)return e[0]; throw e}
  269. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler},smalltalk.HLLocalEnvironment)})},
  270. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"]}),
  271. smalltalk.HLLocalEnvironment);
  272. smalltalk.addMethod(
  273. smalltalk.method({
  274. selector: "moveMethod:toClass:",
  275. fn: function (aMethod,aClassName){
  276. var self=this;
  277. var destinationClass;
  278. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  279. return smalltalk.withContext(function($ctx1) {
  280. var $1,$2,$3;
  281. destinationClass=_st(_st($Smalltalk())._current())._at_(_st(aClassName)._asSymbol());
  282. $1=destinationClass;
  283. if(($receiver = $1) == nil || $receiver == undefined){
  284. _st(self)._error_("Invalid class name");
  285. } else {
  286. $1;
  287. };
  288. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  289. if(smalltalk.assert($2)){
  290. $3=self;
  291. return $3;
  292. };
  293. _st(destinationClass)._adoptMethod_(aMethod);
  294. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  295. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
  296. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"]}),
  297. smalltalk.HLLocalEnvironment);
  298. smalltalk.addMethod(
  299. smalltalk.method({
  300. selector: "moveMethod:toProtocol:",
  301. fn: function (aMethod,aProtocol){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx1) {
  304. _st(aMethod)._category_(aProtocol);
  305. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLLocalEnvironment)})},
  306. messageSends: ["category:"]}),
  307. smalltalk.HLLocalEnvironment);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "packages",
  311. fn: function (){
  312. var self=this;
  313. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  314. return smalltalk.withContext(function($ctx1) {
  315. var $1;
  316. $1=_st(_st($Smalltalk())._current())._packages();
  317. return $1;
  318. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLLocalEnvironment)})},
  319. messageSends: ["packages", "current"]}),
  320. smalltalk.HLLocalEnvironment);
  321. smalltalk.addMethod(
  322. smalltalk.method({
  323. selector: "removeMethod:",
  324. fn: function (aMethod){
  325. var self=this;
  326. return smalltalk.withContext(function($ctx1) {
  327. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  328. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLLocalEnvironment)})},
  329. messageSends: ["forsakeMethod:", "methodClass"]}),
  330. smalltalk.HLLocalEnvironment);
  331. smalltalk.addMethod(
  332. smalltalk.method({
  333. selector: "systemAnnouncer",
  334. fn: function (){
  335. var self=this;
  336. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  337. return smalltalk.withContext(function($ctx1) {
  338. var $1;
  339. $1=_st($SystemAnnouncer())._current();
  340. return $1;
  341. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLLocalEnvironment)})},
  342. messageSends: ["current"]}),
  343. smalltalk.HLLocalEnvironment);
  344. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  345. smalltalk.addMethod(
  346. smalltalk.method({
  347. selector: "eval:on:",
  348. fn: function (someCode,aReceiver){
  349. var self=this;
  350. return smalltalk.withContext(function($ctx1) {
  351. _st(self)._notYetImplemented();
  352. return self}, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver},smalltalk.HLRemoteEnvironment)})},
  353. messageSends: ["notYetImplemented"]}),
  354. smalltalk.HLRemoteEnvironment);
  355. smalltalk.addMethod(
  356. smalltalk.method({
  357. selector: "packages",
  358. fn: function (){
  359. var self=this;
  360. return smalltalk.withContext(function($ctx1) {
  361. return self}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLRemoteEnvironment)})},
  362. messageSends: []}),
  363. smalltalk.HLRemoteEnvironment);
  364. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
  365. smalltalk.addMethod(
  366. smalltalk.method({
  367. selector: "doesNotUnderstand:",
  368. fn: function (aMessage){
  369. var self=this;
  370. return smalltalk.withContext(function($ctx1) {
  371. return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.HLRemoteObject)})},
  372. messageSends: []}),
  373. smalltalk.HLRemoteObject);
  374. smalltalk.addMethod(
  375. smalltalk.method({
  376. selector: "inspectOn:",
  377. fn: function (anInspector){
  378. var self=this;
  379. return smalltalk.withContext(function($ctx1) {
  380. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector},smalltalk.HLRemoteObject)})},
  381. messageSends: []}),
  382. smalltalk.HLRemoteObject);
  383. smalltalk.addMethod(
  384. smalltalk.method({
  385. selector: "printString",
  386. fn: function (){
  387. var self=this;
  388. return smalltalk.withContext(function($ctx1) {
  389. return "this is a remote object";
  390. }, function($ctx1) {$ctx1.fill(self,"printString",{},smalltalk.HLRemoteObject)})},
  391. messageSends: []}),
  392. smalltalk.HLRemoteObject);
  393. smalltalk.addMethod(
  394. smalltalk.method({
  395. selector: "adoptMethod:",
  396. fn: function (aMethod){
  397. var self=this;
  398. return smalltalk.withContext(function($ctx1) {
  399. _st(self)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  400. return self}, function($ctx1) {$ctx1.fill(self,"adoptMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  401. messageSends: ["compile:category:", "source", "protocol"]}),
  402. smalltalk.Behavior);
  403. smalltalk.addMethod(
  404. smalltalk.method({
  405. selector: "forsakeMethod:",
  406. fn: function (aMethod){
  407. var self=this;
  408. return smalltalk.withContext(function($ctx1) {
  409. _st(self)._removeCompiledMethod_(aMethod);
  410. return self}, function($ctx1) {$ctx1.fill(self,"forsakeMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  411. messageSends: ["removeCompiledMethod:"]}),
  412. smalltalk.Behavior);