1
0

Helios-Environments.deploy.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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. "_classBuilder",
  29. smalltalk.method({
  30. selector: "classBuilder",
  31. fn: function (){
  32. var self=this;
  33. return smalltalk.withContext(function($ctx1) { var $1;
  34. $1=_st(self)._subclassResponsibility();
  35. return $1;
  36. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{}, smalltalk.HLEnvironment)})},
  37. messageSends: ["subclassResponsibility"]}),
  38. smalltalk.HLEnvironment);
  39. smalltalk.addMethod(
  40. "_compileClassComment_for_",
  41. smalltalk.method({
  42. selector: "compileClassComment:for:",
  43. fn: function (aString,aClass){
  44. var self=this;
  45. return smalltalk.withContext(function($ctx1) { _st(aClass)._comment_(aString);
  46. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass}, smalltalk.HLEnvironment)})},
  47. messageSends: ["comment:"]}),
  48. smalltalk.HLEnvironment);
  49. smalltalk.addMethod(
  50. "_compileClassDefinition_",
  51. smalltalk.method({
  52. selector: "compileClassDefinition:",
  53. fn: function (aString){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) { _st(self)._eval_on_(aString,_st((smalltalk.DoIt || DoIt))._new());
  56. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString}, smalltalk.HLEnvironment)})},
  57. messageSends: ["eval:on:", "new"]}),
  58. smalltalk.HLEnvironment);
  59. smalltalk.addMethod(
  60. "_compileMethod_for_protocol_",
  61. smalltalk.method({
  62. selector: "compileMethod:for:protocol:",
  63. fn: function (sourceCode,class_,protocol){
  64. var self=this;
  65. return smalltalk.withContext(function($ctx1) { _st(class_)._compile_category_(sourceCode,protocol);
  66. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol}, smalltalk.HLEnvironment)})},
  67. messageSends: ["compile:category:"]}),
  68. smalltalk.HLEnvironment);
  69. smalltalk.addMethod(
  70. "_eval_on_",
  71. smalltalk.method({
  72. selector: "eval:on:",
  73. fn: function (someCode,aReceiver){
  74. var self=this;
  75. return smalltalk.withContext(function($ctx1) { var $1;
  76. $1=_st(self)._subclassResponsibility();
  77. return $1;
  78. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver}, smalltalk.HLEnvironment)})},
  79. messageSends: ["subclassResponsibility"]}),
  80. smalltalk.HLEnvironment);
  81. smalltalk.addMethod(
  82. "_moveMethod_toClass_",
  83. smalltalk.method({
  84. selector: "moveMethod:toClass:",
  85. fn: function (aMethod,aClassName){
  86. var self=this;
  87. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  88. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName},smalltalk.HLEnvironment)})},
  89. messageSends: ["subclassResponsibility"]}),
  90. smalltalk.HLEnvironment);
  91. smalltalk.addMethod(
  92. "_packages",
  93. smalltalk.method({
  94. selector: "packages",
  95. fn: function (){
  96. var self=this;
  97. return smalltalk.withContext(function($ctx1) { var $1;
  98. $1=_st(self)._subclassResponsibility();
  99. return $1;
  100. }, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLEnvironment)})},
  101. messageSends: ["subclassResponsibility"]}),
  102. smalltalk.HLEnvironment);
  103. smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  104. smalltalk.addMethod(
  105. "_availableClassNames",
  106. smalltalk.method({
  107. selector: "availableClassNames",
  108. fn: function (){
  109. var self=this;
  110. return smalltalk.withContext(function($ctx1) { var $1;
  111. $1=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._collect_((function(each){
  112. return smalltalk.withContext(function($ctx2) { return _st(each)._name();
  113. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  114. return $1;
  115. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLLocalEnvironment)})},
  116. messageSends: ["collect:", "name", "classes", "current"]}),
  117. smalltalk.HLLocalEnvironment);
  118. smalltalk.addMethod(
  119. "_classBuilder",
  120. smalltalk.method({
  121. selector: "classBuilder",
  122. fn: function (){
  123. var self=this;
  124. return smalltalk.withContext(function($ctx1) { var $1;
  125. $1=_st((smalltalk.ClassBuilder || ClassBuilder))._new();
  126. return $1;
  127. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{}, smalltalk.HLLocalEnvironment)})},
  128. messageSends: ["new"]}),
  129. smalltalk.HLLocalEnvironment);
  130. smalltalk.addMethod(
  131. "_eval_on_",
  132. smalltalk.method({
  133. selector: "eval:on:",
  134. fn: function (aString,aReceiver){
  135. var self=this;
  136. var compiler;
  137. return smalltalk.withContext(function($ctx1) { var $1,$2;
  138. var $early={};
  139. try {
  140. compiler=_st((smalltalk.Compiler || Compiler))._new();
  141. _st((function(){
  142. return smalltalk.withContext(function($ctx2) { return _st(compiler)._parseExpression_(aString);
  143. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
  144. return smalltalk.withContext(function($ctx2) { $1=_st(window)._alert_(_st(ex)._messageText());
  145. throw $early=[$1];
  146. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  147. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  148. return $2;
  149. }
  150. catch(e) {if(e===$early)return e[0]; throw e}
  151. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler}, smalltalk.HLLocalEnvironment)})},
  152. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"]}),
  153. smalltalk.HLLocalEnvironment);
  154. smalltalk.addMethod(
  155. "_moveMethod_toClass_",
  156. smalltalk.method({
  157. selector: "moveMethod:toClass:",
  158. fn: function (aMethod,aClassName){
  159. var self=this;
  160. var destinationClass;
  161. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  162. destinationClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aClassName)._asSymbol());
  163. $1=destinationClass;
  164. if(($receiver = $1) == nil || $receiver == undefined){
  165. _st(self)._error_("Invalid class name");
  166. } else {
  167. $1;
  168. };
  169. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  170. if(smalltalk.assert($2)){
  171. $3=self;
  172. return $3;
  173. };
  174. _st(destinationClass)._adoptMethod_(aMethod);
  175. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  176. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
  177. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"]}),
  178. smalltalk.HLLocalEnvironment);
  179. smalltalk.addMethod(
  180. "_packages",
  181. smalltalk.method({
  182. selector: "packages",
  183. fn: function (){
  184. var self=this;
  185. return smalltalk.withContext(function($ctx1) { var $1;
  186. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages();
  187. return $1;
  188. }, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLLocalEnvironment)})},
  189. messageSends: ["packages", "current"]}),
  190. smalltalk.HLLocalEnvironment);
  191. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  192. smalltalk.addMethod(
  193. "_eval_on_",
  194. smalltalk.method({
  195. selector: "eval:on:",
  196. fn: function (someCode,aReceiver){
  197. var self=this;
  198. return smalltalk.withContext(function($ctx1) { _st(self)._notYetImplemented();
  199. return self}, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver}, smalltalk.HLRemoteEnvironment)})},
  200. messageSends: ["notYetImplemented"]}),
  201. smalltalk.HLRemoteEnvironment);
  202. smalltalk.addMethod(
  203. "_packages",
  204. smalltalk.method({
  205. selector: "packages",
  206. fn: function (){
  207. var self=this;
  208. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLRemoteEnvironment)})},
  209. messageSends: []}),
  210. smalltalk.HLRemoteEnvironment);
  211. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
  212. smalltalk.addMethod(
  213. "_doesNotUnderstand_",
  214. smalltalk.method({
  215. selector: "doesNotUnderstand:",
  216. fn: function (aMessage){
  217. var self=this;
  218. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage}, smalltalk.HLRemoteObject)})},
  219. messageSends: []}),
  220. smalltalk.HLRemoteObject);
  221. smalltalk.addMethod(
  222. "_inspectOn_",
  223. smalltalk.method({
  224. selector: "inspectOn:",
  225. fn: function (anInspector){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector}, smalltalk.HLRemoteObject)})},
  228. messageSends: []}),
  229. smalltalk.HLRemoteObject);
  230. smalltalk.addMethod(
  231. "_printString",
  232. smalltalk.method({
  233. selector: "printString",
  234. fn: function (){
  235. var self=this;
  236. return smalltalk.withContext(function($ctx1) { return "this is a remote object";
  237. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.HLRemoteObject)})},
  238. messageSends: []}),
  239. smalltalk.HLRemoteObject);
  240. smalltalk.addMethod(
  241. "_adoptMethod_",
  242. smalltalk.method({
  243. selector: "adoptMethod:",
  244. fn: function (aMethod){
  245. var self=this;
  246. return smalltalk.withContext(function($ctx1) { _st(self)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  247. return self}, function($ctx1) {$ctx1.fill(self,"adoptMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  248. messageSends: ["compile:category:", "source", "protocol"]}),
  249. smalltalk.Behavior);
  250. smalltalk.addMethod(
  251. "_forsakeMethod_",
  252. smalltalk.method({
  253. selector: "forsakeMethod:",
  254. fn: function (aMethod){
  255. var self=this;
  256. return smalltalk.withContext(function($ctx1) { _st(self)._removeCompiledMethod_(aMethod);
  257. return self}, function($ctx1) {$ctx1.fill(self,"forsakeMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  258. messageSends: ["removeCompiledMethod:"]}),
  259. smalltalk.Behavior);