1
0

Helios-Environments.deploy.js 13 KB

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