Helios-Environments.deploy.js 9.4 KB

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