Helios-Environments.deploy.js 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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_ifAbsent_",
  73. smalltalk.method({
  74. selector: "moveMethod:toClass:ifAbsent:",
  75. fn: function (aMethod,aClassName,aBlock){
  76. var self=this;
  77. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  78. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:ifAbsent:",{aMethod:aMethod,aClassName:aClassName,aBlock:aBlock},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_ifAbsent_",
  132. smalltalk.method({
  133. selector: "moveMethod:toClass:ifAbsent:",
  134. fn: function (aMethod,aClassName,aBlock){
  135. var self=this;
  136. var destinationClass;
  137. return smalltalk.withContext(function($ctx1) { var $1,$2;
  138. destinationClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aClassName)._asSymbol());
  139. $1=destinationClass;
  140. if(($receiver = $1) == nil || $receiver == undefined){
  141. $2=_st(aBlock)._value();
  142. return $2;
  143. } else {
  144. $1;
  145. };
  146. _st(destinationClass)._adoptMethod_(aMethod);
  147. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  148. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:ifAbsent:",{aMethod:aMethod,aClassName:aClassName,aBlock:aBlock,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
  149. messageSends: ["at:", "asSymbol", "current", "ifNil:", "value", "adoptMethod:", "forsakeMethod:", "methodClass"]}),
  150. smalltalk.HLLocalEnvironment);
  151. smalltalk.addMethod(
  152. "_packages",
  153. smalltalk.method({
  154. selector: "packages",
  155. fn: function (){
  156. var self=this;
  157. return smalltalk.withContext(function($ctx1) { var $1;
  158. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages();
  159. return $1;
  160. }, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLLocalEnvironment)})},
  161. messageSends: ["packages", "current"]}),
  162. smalltalk.HLLocalEnvironment);
  163. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  164. smalltalk.addMethod(
  165. "_eval_on_",
  166. smalltalk.method({
  167. selector: "eval:on:",
  168. fn: function (someCode,aReceiver){
  169. var self=this;
  170. return smalltalk.withContext(function($ctx1) { _st(self)._notYetImplemented();
  171. return self}, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver}, smalltalk.HLRemoteEnvironment)})},
  172. messageSends: ["notYetImplemented"]}),
  173. smalltalk.HLRemoteEnvironment);
  174. smalltalk.addMethod(
  175. "_packages",
  176. smalltalk.method({
  177. selector: "packages",
  178. fn: function (){
  179. var self=this;
  180. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLRemoteEnvironment)})},
  181. messageSends: []}),
  182. smalltalk.HLRemoteEnvironment);
  183. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
  184. smalltalk.addMethod(
  185. "_doesNotUnderstand_",
  186. smalltalk.method({
  187. selector: "doesNotUnderstand:",
  188. fn: function (aMessage){
  189. var self=this;
  190. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage}, smalltalk.HLRemoteObject)})},
  191. messageSends: []}),
  192. smalltalk.HLRemoteObject);
  193. smalltalk.addMethod(
  194. "_inspectOn_",
  195. smalltalk.method({
  196. selector: "inspectOn:",
  197. fn: function (anInspector){
  198. var self=this;
  199. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector}, smalltalk.HLRemoteObject)})},
  200. messageSends: []}),
  201. smalltalk.HLRemoteObject);
  202. smalltalk.addMethod(
  203. "_printString",
  204. smalltalk.method({
  205. selector: "printString",
  206. fn: function (){
  207. var self=this;
  208. return smalltalk.withContext(function($ctx1) { return "this is a remote object";
  209. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.HLRemoteObject)})},
  210. messageSends: []}),
  211. smalltalk.HLRemoteObject);
  212. smalltalk.addMethod(
  213. "_adoptMethod_",
  214. smalltalk.method({
  215. selector: "adoptMethod:",
  216. fn: function (aMethod){
  217. var self=this;
  218. return smalltalk.withContext(function($ctx1) { var $1,$2;
  219. $1=self;
  220. _st($1)._compile_(_st(aMethod)._source());
  221. $2=_st($1)._category_(_st(aMethod)._protocol());
  222. return self}, function($ctx1) {$ctx1.fill(self,"adoptMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  223. messageSends: ["compile:", "source", "category:", "protocol"]}),
  224. smalltalk.Behavior);
  225. smalltalk.addMethod(
  226. "_forsakeMethod_",
  227. smalltalk.method({
  228. selector: "forsakeMethod:",
  229. fn: function (aMethod){
  230. var self=this;
  231. return smalltalk.withContext(function($ctx1) { _st(self)._removeCompiledMethod_(aMethod);
  232. return self}, function($ctx1) {$ctx1.fill(self,"forsakeMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  233. messageSends: ["removeCompiledMethod:"]}),
  234. smalltalk.Behavior);