Helios-Environments.deploy.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. smalltalk.addPackage('Helios-Environments');
  2. smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Environments');
  3. smalltalk.addMethod(
  4. "_addInstVarNamed_to_",
  5. smalltalk.method({
  6. selector: "addInstVarNamed:to:",
  7. fn: function (aString,aClass){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { 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. "_availableClassNames",
  19. smalltalk.method({
  20. selector: "availableClassNames",
  21. fn: function (){
  22. var self=this;
  23. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  24. return self}, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLEnvironment)})},
  25. messageSends: ["subclassResponsibility"]}),
  26. smalltalk.HLEnvironment);
  27. smalltalk.addMethod(
  28. "_availableProtocolsFor_",
  29. smalltalk.method({
  30. selector: "availableProtocolsFor:",
  31. fn: function (aClass){
  32. var self=this;
  33. return smalltalk.withContext(function($ctx1) { _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. "_classBuilder",
  39. smalltalk.method({
  40. selector: "classBuilder",
  41. fn: function (){
  42. var self=this;
  43. return smalltalk.withContext(function($ctx1) { 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. "_commitPackage_",
  51. smalltalk.method({
  52. selector: "commitPackage:",
  53. fn: function (aPackage){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  56. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLEnvironment)})},
  57. messageSends: ["subclassResponsibility"]}),
  58. smalltalk.HLEnvironment);
  59. smalltalk.addMethod(
  60. "_compileClassComment_for_",
  61. smalltalk.method({
  62. selector: "compileClassComment:for:",
  63. fn: function (aString,aClass){
  64. var self=this;
  65. return smalltalk.withContext(function($ctx1) { _st(aClass)._comment_(aString);
  66. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass}, smalltalk.HLEnvironment)})},
  67. messageSends: ["comment:"]}),
  68. smalltalk.HLEnvironment);
  69. smalltalk.addMethod(
  70. "_compileClassDefinition_",
  71. smalltalk.method({
  72. selector: "compileClassDefinition:",
  73. fn: function (aString){
  74. var self=this;
  75. return smalltalk.withContext(function($ctx1) { _st(self)._eval_on_(aString,_st((smalltalk.DoIt || DoIt))._new());
  76. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString}, smalltalk.HLEnvironment)})},
  77. messageSends: ["eval:on:", "new"]}),
  78. smalltalk.HLEnvironment);
  79. smalltalk.addMethod(
  80. "_compileMethod_for_protocol_",
  81. smalltalk.method({
  82. selector: "compileMethod:for:protocol:",
  83. fn: function (sourceCode,class_,protocol){
  84. var self=this;
  85. return smalltalk.withContext(function($ctx1) { _st(class_)._compile_category_(sourceCode,protocol);
  86. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol}, smalltalk.HLEnvironment)})},
  87. messageSends: ["compile:category:"]}),
  88. smalltalk.HLEnvironment);
  89. smalltalk.addMethod(
  90. "_eval_on_",
  91. smalltalk.method({
  92. selector: "eval:on:",
  93. fn: function (someCode,aReceiver){
  94. var self=this;
  95. return smalltalk.withContext(function($ctx1) { var $1;
  96. $1=_st(self)._subclassResponsibility();
  97. return $1;
  98. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver}, smalltalk.HLEnvironment)})},
  99. messageSends: ["subclassResponsibility"]}),
  100. smalltalk.HLEnvironment);
  101. smalltalk.addMethod(
  102. "_moveMethod_toClass_",
  103. smalltalk.method({
  104. selector: "moveMethod:toClass:",
  105. fn: function (aMethod,aClassName){
  106. var self=this;
  107. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  108. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName},smalltalk.HLEnvironment)})},
  109. messageSends: ["subclassResponsibility"]}),
  110. smalltalk.HLEnvironment);
  111. smalltalk.addMethod(
  112. "_moveMethod_toProtocol_",
  113. smalltalk.method({
  114. selector: "moveMethod:toProtocol:",
  115. fn: function (aMethod,aProtocol){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  118. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLEnvironment)})},
  119. messageSends: ["subclassResponsibility"]}),
  120. smalltalk.HLEnvironment);
  121. smalltalk.addMethod(
  122. "_packages",
  123. smalltalk.method({
  124. selector: "packages",
  125. fn: function (){
  126. var self=this;
  127. return smalltalk.withContext(function($ctx1) { var $1;
  128. $1=_st(self)._subclassResponsibility();
  129. return $1;
  130. }, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLEnvironment)})},
  131. messageSends: ["subclassResponsibility"]}),
  132. smalltalk.HLEnvironment);
  133. smalltalk.addMethod(
  134. "_removeMethod_",
  135. smalltalk.method({
  136. selector: "removeMethod:",
  137. fn: function (aMethod){
  138. var self=this;
  139. return smalltalk.withContext(function($ctx1) { _st(self)._sublcassResponsibility();
  140. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLEnvironment)})},
  141. messageSends: ["sublcassResponsibility"]}),
  142. smalltalk.HLEnvironment);
  143. smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  144. smalltalk.addMethod(
  145. "_availableClassNames",
  146. smalltalk.method({
  147. selector: "availableClassNames",
  148. fn: function (){
  149. var self=this;
  150. return smalltalk.withContext(function($ctx1) { var $1;
  151. $1=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._collect_((function(each){
  152. return smalltalk.withContext(function($ctx2) { return _st(each)._name();
  153. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  154. return $1;
  155. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLLocalEnvironment)})},
  156. messageSends: ["collect:", "name", "classes", "current"]}),
  157. smalltalk.HLLocalEnvironment);
  158. smalltalk.addMethod(
  159. "_availableProtocolsFor_",
  160. smalltalk.method({
  161. selector: "availableProtocolsFor:",
  162. fn: function (aClass){
  163. var self=this;
  164. var protocols;
  165. return smalltalk.withContext(function($ctx1) { var $1,$2;
  166. protocols=_st(aClass)._protocols();
  167. $1=_st(aClass)._superclass();
  168. if(($receiver = $1) == nil || $receiver == undefined){
  169. $1;
  170. } else {
  171. _st(protocols)._addAll_(_st(self)._availableProtocolsFor_(_st(aClass)._superclass()));
  172. };
  173. $2=_st(_st(protocols)._asSet())._asArray();
  174. return $2;
  175. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.HLLocalEnvironment)})},
  176. messageSends: ["protocols", "ifNotNil:", "addAll:", "availableProtocolsFor:", "superclass", "asArray", "asSet"]}),
  177. smalltalk.HLLocalEnvironment);
  178. smalltalk.addMethod(
  179. "_classBuilder",
  180. smalltalk.method({
  181. selector: "classBuilder",
  182. fn: function (){
  183. var self=this;
  184. return smalltalk.withContext(function($ctx1) { var $1;
  185. $1=_st((smalltalk.ClassBuilder || ClassBuilder))._new();
  186. return $1;
  187. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{}, smalltalk.HLLocalEnvironment)})},
  188. messageSends: ["new"]}),
  189. smalltalk.HLLocalEnvironment);
  190. smalltalk.addMethod(
  191. "_commitPackage_",
  192. smalltalk.method({
  193. selector: "commitPackage:",
  194. fn: function (aPackage){
  195. var self=this;
  196. return smalltalk.withContext(function($ctx1) { _st(aPackage)._heliosCommit();
  197. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLLocalEnvironment)})},
  198. messageSends: ["heliosCommit"]}),
  199. smalltalk.HLLocalEnvironment);
  200. smalltalk.addMethod(
  201. "_eval_on_",
  202. smalltalk.method({
  203. selector: "eval:on:",
  204. fn: function (aString,aReceiver){
  205. var self=this;
  206. var compiler;
  207. return smalltalk.withContext(function($ctx1) { var $1,$2;
  208. var $early={};
  209. try {
  210. compiler=_st((smalltalk.Compiler || Compiler))._new();
  211. _st((function(){
  212. return smalltalk.withContext(function($ctx2) { return _st(compiler)._parseExpression_(aString);
  213. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
  214. return smalltalk.withContext(function($ctx2) { $1=_st(window)._alert_(_st(ex)._messageText());
  215. throw $early=[$1];
  216. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  217. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  218. return $2;
  219. }
  220. catch(e) {if(e===$early)return e[0]; throw e}
  221. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler}, smalltalk.HLLocalEnvironment)})},
  222. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"]}),
  223. smalltalk.HLLocalEnvironment);
  224. smalltalk.addMethod(
  225. "_moveMethod_toClass_",
  226. smalltalk.method({
  227. selector: "moveMethod:toClass:",
  228. fn: function (aMethod,aClassName){
  229. var self=this;
  230. var destinationClass;
  231. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  232. destinationClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aClassName)._asSymbol());
  233. $1=destinationClass;
  234. if(($receiver = $1) == nil || $receiver == undefined){
  235. _st(self)._error_("Invalid class name");
  236. } else {
  237. $1;
  238. };
  239. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  240. if(smalltalk.assert($2)){
  241. $3=self;
  242. return $3;
  243. };
  244. _st(destinationClass)._adoptMethod_(aMethod);
  245. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  246. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
  247. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"]}),
  248. smalltalk.HLLocalEnvironment);
  249. smalltalk.addMethod(
  250. "_moveMethod_toProtocol_",
  251. smalltalk.method({
  252. selector: "moveMethod:toProtocol:",
  253. fn: function (aMethod,aProtocol){
  254. var self=this;
  255. return smalltalk.withContext(function($ctx1) { _st(aMethod)._category_(aProtocol);
  256. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLLocalEnvironment)})},
  257. messageSends: ["category:"]}),
  258. smalltalk.HLLocalEnvironment);
  259. smalltalk.addMethod(
  260. "_packages",
  261. smalltalk.method({
  262. selector: "packages",
  263. fn: function (){
  264. var self=this;
  265. return smalltalk.withContext(function($ctx1) { var $1;
  266. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages();
  267. return $1;
  268. }, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLLocalEnvironment)})},
  269. messageSends: ["packages", "current"]}),
  270. smalltalk.HLLocalEnvironment);
  271. smalltalk.addMethod(
  272. "_removeMethod_",
  273. smalltalk.method({
  274. selector: "removeMethod:",
  275. fn: function (aMethod){
  276. var self=this;
  277. return smalltalk.withContext(function($ctx1) { _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  278. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLLocalEnvironment)})},
  279. messageSends: ["forsakeMethod:", "methodClass"]}),
  280. smalltalk.HLLocalEnvironment);
  281. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  282. smalltalk.addMethod(
  283. "_eval_on_",
  284. smalltalk.method({
  285. selector: "eval:on:",
  286. fn: function (someCode,aReceiver){
  287. var self=this;
  288. return smalltalk.withContext(function($ctx1) { _st(self)._notYetImplemented();
  289. return self}, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver}, smalltalk.HLRemoteEnvironment)})},
  290. messageSends: ["notYetImplemented"]}),
  291. smalltalk.HLRemoteEnvironment);
  292. smalltalk.addMethod(
  293. "_packages",
  294. smalltalk.method({
  295. selector: "packages",
  296. fn: function (){
  297. var self=this;
  298. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLRemoteEnvironment)})},
  299. messageSends: []}),
  300. smalltalk.HLRemoteEnvironment);
  301. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
  302. smalltalk.addMethod(
  303. "_doesNotUnderstand_",
  304. smalltalk.method({
  305. selector: "doesNotUnderstand:",
  306. fn: function (aMessage){
  307. var self=this;
  308. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage}, smalltalk.HLRemoteObject)})},
  309. messageSends: []}),
  310. smalltalk.HLRemoteObject);
  311. smalltalk.addMethod(
  312. "_inspectOn_",
  313. smalltalk.method({
  314. selector: "inspectOn:",
  315. fn: function (anInspector){
  316. var self=this;
  317. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector}, smalltalk.HLRemoteObject)})},
  318. messageSends: []}),
  319. smalltalk.HLRemoteObject);
  320. smalltalk.addMethod(
  321. "_printString",
  322. smalltalk.method({
  323. selector: "printString",
  324. fn: function (){
  325. var self=this;
  326. return smalltalk.withContext(function($ctx1) { return "this is a remote object";
  327. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.HLRemoteObject)})},
  328. messageSends: []}),
  329. smalltalk.HLRemoteObject);
  330. smalltalk.addMethod(
  331. "_adoptMethod_",
  332. smalltalk.method({
  333. selector: "adoptMethod:",
  334. fn: function (aMethod){
  335. var self=this;
  336. return smalltalk.withContext(function($ctx1) { _st(self)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  337. return self}, function($ctx1) {$ctx1.fill(self,"adoptMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  338. messageSends: ["compile:category:", "source", "protocol"]}),
  339. smalltalk.Behavior);
  340. smalltalk.addMethod(
  341. "_forsakeMethod_",
  342. smalltalk.method({
  343. selector: "forsakeMethod:",
  344. fn: function (aMethod){
  345. var self=this;
  346. return smalltalk.withContext(function($ctx1) { _st(self)._removeCompiledMethod_(aMethod);
  347. return self}, function($ctx1) {$ctx1.fill(self,"forsakeMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  348. messageSends: ["removeCompiledMethod:"]}),
  349. smalltalk.Behavior);