Helios-Environments.deploy.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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.addMethod(
  154. "_systemAnnouncer",
  155. smalltalk.method({
  156. selector: "systemAnnouncer",
  157. fn: function (){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) {
  160. var $1;
  161. $1=_st(self)._subclassResponsibility();
  162. return $1;
  163. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLEnvironment)})},
  164. messageSends: ["subclassResponsibility"]}),
  165. smalltalk.HLEnvironment);
  166. smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  167. smalltalk.addMethod(
  168. "_availableClassNames",
  169. smalltalk.method({
  170. selector: "availableClassNames",
  171. fn: function () {
  172. var self=this;
  173. return smalltalk.withContext(function($ctx1) { var $1;
  174. $1=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._collect_((function(each){
  175. return smalltalk.withContext(function($ctx2) { return _st(each)._name();
  176. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  177. return $1;
  178. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLLocalEnvironment)});},
  179. messageSends: ["collect:", "name", "classes", "current"]}),
  180. smalltalk.HLLocalEnvironment);
  181. smalltalk.addMethod(
  182. "_availableProtocolsFor_",
  183. smalltalk.method({
  184. selector: "availableProtocolsFor:",
  185. fn: function (aClass) {
  186. var self=this;
  187. var protocols;
  188. return smalltalk.withContext(function($ctx1) { var $1,$2;
  189. protocols=_st(aClass)._protocols();
  190. $1=_st(aClass)._superclass();
  191. if(($receiver = $1) == nil || $receiver == undefined){
  192. $1;
  193. } else {
  194. _st(protocols)._addAll_(_st(self)._availableProtocolsFor_(_st(aClass)._superclass()));
  195. };
  196. $2=_st(_st(protocols)._asSet())._asArray();
  197. return $2;
  198. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.HLLocalEnvironment)});},
  199. messageSends: ["protocols", "ifNotNil:", "addAll:", "availableProtocolsFor:", "superclass", "asArray", "asSet"]}),
  200. smalltalk.HLLocalEnvironment);
  201. smalltalk.addMethod(
  202. "_classBuilder",
  203. smalltalk.method({
  204. selector: "classBuilder",
  205. fn: function () {
  206. var self=this;
  207. return smalltalk.withContext(function($ctx1) { var $1;
  208. $1=_st((smalltalk.ClassBuilder || ClassBuilder))._new();
  209. return $1;
  210. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{}, smalltalk.HLLocalEnvironment)});},
  211. messageSends: ["new"]}),
  212. smalltalk.HLLocalEnvironment);
  213. smalltalk.addMethod(
  214. "_classNamed_",
  215. smalltalk.method({
  216. selector: "classNamed:",
  217. fn: function (aString) {
  218. var self=this;
  219. return smalltalk.withContext(function($ctx1) { var $2,$1;
  220. $2=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aString)._asSymbol());
  221. if(($receiver = $2) == nil || $receiver == undefined){
  222. $1=_st(self)._error_("Invalid class name");
  223. } else {
  224. $1=$2;
  225. };
  226. return $1;
  227. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.HLLocalEnvironment)});},
  228. messageSends: ["ifNil:", "error:", "at:", "asSymbol", "current"]}),
  229. smalltalk.HLLocalEnvironment);
  230. smalltalk.addMethod(
  231. "_commitPackage_",
  232. smalltalk.method({
  233. selector: "commitPackage:",
  234. fn: function (aPackage) {
  235. var self=this;
  236. return smalltalk.withContext(function($ctx1) {
  237. _st(aPackage)._commit();
  238. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLLocalEnvironment)});},
  239. messageSends: ["commit"]}),
  240. smalltalk.HLLocalEnvironment);
  241. smalltalk.addMethod(
  242. "_eval_on_",
  243. smalltalk.method({
  244. selector: "eval:on:",
  245. fn: function (aString, aReceiver) {
  246. var self=this;
  247. var compiler;
  248. return smalltalk.withContext(function($ctx1) { var $1,$2;
  249. var $early={};
  250. try {
  251. compiler=_st((smalltalk.Compiler || Compiler))._new();
  252. _st((function(){
  253. return smalltalk.withContext(function($ctx2) { return _st(compiler)._parseExpression_(aString);
  254. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
  255. return smalltalk.withContext(function($ctx2) { $1=_st(window)._alert_(_st(ex)._messageText());
  256. throw $early=[$1];
  257. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  258. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  259. return $2;
  260. }
  261. catch(e) {if(e===$early)return e[0]; throw e}
  262. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler}, smalltalk.HLLocalEnvironment)});},
  263. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"]}),
  264. smalltalk.HLLocalEnvironment);
  265. smalltalk.addMethod(
  266. "_moveMethod_toClass_",
  267. smalltalk.method({
  268. selector: "moveMethod:toClass:",
  269. fn: function (aMethod, aClassName) {
  270. var self=this;
  271. var destinationClass;
  272. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  273. destinationClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aClassName)._asSymbol());
  274. $1=destinationClass;
  275. if(($receiver = $1) == nil || $receiver == undefined){
  276. _st(self)._error_("Invalid class name");
  277. } else {
  278. $1;
  279. };
  280. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  281. if(smalltalk.assert($2)){
  282. $3=self;
  283. return $3;
  284. };
  285. _st(destinationClass)._adoptMethod_(aMethod);
  286. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  287. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)});},
  288. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"]}),
  289. smalltalk.HLLocalEnvironment);
  290. smalltalk.addMethod(
  291. "_moveMethod_toProtocol_",
  292. smalltalk.method({
  293. selector: "moveMethod:toProtocol:",
  294. fn: function (aMethod, aProtocol) {
  295. var self=this;
  296. return smalltalk.withContext(function($ctx1) { _st(aMethod)._category_(aProtocol);
  297. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLLocalEnvironment)});},
  298. messageSends: ["category:"]}),
  299. smalltalk.HLLocalEnvironment);
  300. smalltalk.addMethod(
  301. "_packages",
  302. smalltalk.method({
  303. selector: "packages",
  304. fn: function () {
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) { var $1;
  307. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages();
  308. return $1;
  309. }, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLLocalEnvironment)});},
  310. messageSends: ["packages", "current"]}),
  311. smalltalk.HLLocalEnvironment);
  312. smalltalk.addMethod(
  313. "_removeMethod_",
  314. smalltalk.method({
  315. selector: "removeMethod:",
  316. fn: function (aMethod) {
  317. var self=this;
  318. return smalltalk.withContext(function($ctx1) { _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  319. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLLocalEnvironment)});},
  320. messageSends: ["forsakeMethod:", "methodClass"]}),
  321. smalltalk.HLLocalEnvironment);
  322. smalltalk.addMethod(
  323. "_systemAnnouncer",
  324. smalltalk.method({
  325. selector: "systemAnnouncer",
  326. fn: function (){
  327. var self=this;
  328. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  329. return smalltalk.withContext(function($ctx1) {
  330. var $1;
  331. $1=_st($SystemAnnouncer())._current();
  332. return $1;
  333. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLLocalEnvironment)})},
  334. messageSends: ["current"]}),
  335. smalltalk.HLLocalEnvironment);
  336. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  337. smalltalk.addMethod(
  338. "_eval_on_",
  339. smalltalk.method({
  340. selector: "eval:on:",
  341. fn: function (someCode, aReceiver) {
  342. var self=this;
  343. return smalltalk.withContext(function($ctx1) { _st(self)._notYetImplemented();
  344. return self}, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver}, smalltalk.HLRemoteEnvironment)});},
  345. messageSends: ["notYetImplemented"]}),
  346. smalltalk.HLRemoteEnvironment);
  347. smalltalk.addMethod(
  348. "_packages",
  349. smalltalk.method({
  350. selector: "packages",
  351. fn: function () {
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLRemoteEnvironment)});},
  354. messageSends: []}),
  355. smalltalk.HLRemoteEnvironment);
  356. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
  357. smalltalk.addMethod(
  358. "_doesNotUnderstand_",
  359. smalltalk.method({
  360. selector: "doesNotUnderstand:",
  361. fn: function (aMessage) {
  362. var self=this;
  363. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage}, smalltalk.HLRemoteObject)});},
  364. messageSends: []}),
  365. smalltalk.HLRemoteObject);
  366. smalltalk.addMethod(
  367. "_inspectOn_",
  368. smalltalk.method({
  369. selector: "inspectOn:",
  370. fn: function (anInspector) {
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector}, smalltalk.HLRemoteObject)});},
  373. messageSends: []}),
  374. smalltalk.HLRemoteObject);
  375. smalltalk.addMethod(
  376. "_printString",
  377. smalltalk.method({
  378. selector: "printString",
  379. fn: function () {
  380. var self=this;
  381. return smalltalk.withContext(function($ctx1) { return "this is a remote object";
  382. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.HLRemoteObject)});},
  383. messageSends: []}),
  384. smalltalk.HLRemoteObject);
  385. smalltalk.addMethod(
  386. "_adoptMethod_",
  387. smalltalk.method({
  388. selector: "adoptMethod:",
  389. fn: function (aMethod) {
  390. var self=this;
  391. return smalltalk.withContext(function($ctx1) { _st(self)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  392. return self}, function($ctx1) {$ctx1.fill(self,"adoptMethod:",{aMethod:aMethod},smalltalk.Behavior)});},
  393. messageSends: ["compile:category:", "source", "protocol"]}),
  394. smalltalk.Behavior);
  395. smalltalk.addMethod(
  396. "_forsakeMethod_",
  397. smalltalk.method({
  398. selector: "forsakeMethod:",
  399. fn: function (aMethod) {
  400. var self=this;
  401. return smalltalk.withContext(function($ctx1) { _st(self)._removeCompiledMethod_(aMethod);
  402. return self}, function($ctx1) {$ctx1.fill(self,"forsakeMethod:",{aMethod:aMethod},smalltalk.Behavior)});},
  403. messageSends: ["removeCompiledMethod:"]}),
  404. smalltalk.Behavior);