Helios-Environments.deploy.js 15 KB

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