Helios-Environments.deploy.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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) { _st(aPackage)._heliosCommit();
  224. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLLocalEnvironment)})},
  225. messageSends: ["heliosCommit"]}),
  226. smalltalk.HLLocalEnvironment);
  227. smalltalk.addMethod(
  228. "_eval_on_",
  229. smalltalk.method({
  230. selector: "eval:on:",
  231. fn: function (aString,aReceiver){
  232. var self=this;
  233. var compiler;
  234. return smalltalk.withContext(function($ctx1) { var $1,$2;
  235. var $early={};
  236. try {
  237. compiler=_st((smalltalk.Compiler || Compiler))._new();
  238. _st((function(){
  239. return smalltalk.withContext(function($ctx2) { return _st(compiler)._parseExpression_(aString);
  240. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
  241. return smalltalk.withContext(function($ctx2) { $1=_st(window)._alert_(_st(ex)._messageText());
  242. throw $early=[$1];
  243. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  244. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  245. return $2;
  246. }
  247. catch(e) {if(e===$early)return e[0]; throw e}
  248. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler}, smalltalk.HLLocalEnvironment)})},
  249. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"]}),
  250. smalltalk.HLLocalEnvironment);
  251. smalltalk.addMethod(
  252. "_moveMethod_toClass_",
  253. smalltalk.method({
  254. selector: "moveMethod:toClass:",
  255. fn: function (aMethod,aClassName){
  256. var self=this;
  257. var destinationClass;
  258. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  259. destinationClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aClassName)._asSymbol());
  260. $1=destinationClass;
  261. if(($receiver = $1) == nil || $receiver == undefined){
  262. _st(self)._error_("Invalid class name");
  263. } else {
  264. $1;
  265. };
  266. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  267. if(smalltalk.assert($2)){
  268. $3=self;
  269. return $3;
  270. };
  271. _st(destinationClass)._adoptMethod_(aMethod);
  272. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  273. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
  274. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"]}),
  275. smalltalk.HLLocalEnvironment);
  276. smalltalk.addMethod(
  277. "_moveMethod_toProtocol_",
  278. smalltalk.method({
  279. selector: "moveMethod:toProtocol:",
  280. fn: function (aMethod,aProtocol){
  281. var self=this;
  282. return smalltalk.withContext(function($ctx1) { _st(aMethod)._category_(aProtocol);
  283. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLLocalEnvironment)})},
  284. messageSends: ["category:"]}),
  285. smalltalk.HLLocalEnvironment);
  286. smalltalk.addMethod(
  287. "_packages",
  288. smalltalk.method({
  289. selector: "packages",
  290. fn: function (){
  291. var self=this;
  292. return smalltalk.withContext(function($ctx1) { var $1;
  293. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages();
  294. return $1;
  295. }, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLLocalEnvironment)})},
  296. messageSends: ["packages", "current"]}),
  297. smalltalk.HLLocalEnvironment);
  298. smalltalk.addMethod(
  299. "_removeMethod_",
  300. smalltalk.method({
  301. selector: "removeMethod:",
  302. fn: function (aMethod){
  303. var self=this;
  304. return smalltalk.withContext(function($ctx1) { _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  305. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLLocalEnvironment)})},
  306. messageSends: ["forsakeMethod:", "methodClass"]}),
  307. smalltalk.HLLocalEnvironment);
  308. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  309. smalltalk.addMethod(
  310. "_eval_on_",
  311. smalltalk.method({
  312. selector: "eval:on:",
  313. fn: function (someCode,aReceiver){
  314. var self=this;
  315. return smalltalk.withContext(function($ctx1) { _st(self)._notYetImplemented();
  316. return self}, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver}, smalltalk.HLRemoteEnvironment)})},
  317. messageSends: ["notYetImplemented"]}),
  318. smalltalk.HLRemoteEnvironment);
  319. smalltalk.addMethod(
  320. "_packages",
  321. smalltalk.method({
  322. selector: "packages",
  323. fn: function (){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"packages",{}, smalltalk.HLRemoteEnvironment)})},
  326. messageSends: []}),
  327. smalltalk.HLRemoteEnvironment);
  328. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
  329. smalltalk.addMethod(
  330. "_doesNotUnderstand_",
  331. smalltalk.method({
  332. selector: "doesNotUnderstand:",
  333. fn: function (aMessage){
  334. var self=this;
  335. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage}, smalltalk.HLRemoteObject)})},
  336. messageSends: []}),
  337. smalltalk.HLRemoteObject);
  338. smalltalk.addMethod(
  339. "_inspectOn_",
  340. smalltalk.method({
  341. selector: "inspectOn:",
  342. fn: function (anInspector){
  343. var self=this;
  344. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector}, smalltalk.HLRemoteObject)})},
  345. messageSends: []}),
  346. smalltalk.HLRemoteObject);
  347. smalltalk.addMethod(
  348. "_printString",
  349. smalltalk.method({
  350. selector: "printString",
  351. fn: function (){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) { return "this is a remote object";
  354. }, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.HLRemoteObject)})},
  355. messageSends: []}),
  356. smalltalk.HLRemoteObject);
  357. smalltalk.addMethod(
  358. "_adoptMethod_",
  359. smalltalk.method({
  360. selector: "adoptMethod:",
  361. fn: function (aMethod){
  362. var self=this;
  363. return smalltalk.withContext(function($ctx1) { _st(self)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  364. return self}, function($ctx1) {$ctx1.fill(self,"adoptMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  365. messageSends: ["compile:category:", "source", "protocol"]}),
  366. smalltalk.Behavior);
  367. smalltalk.addMethod(
  368. "_forsakeMethod_",
  369. smalltalk.method({
  370. selector: "forsakeMethod:",
  371. fn: function (aMethod){
  372. var self=this;
  373. return smalltalk.withContext(function($ctx1) { _st(self)._removeCompiledMethod_(aMethod);
  374. return self}, function($ctx1) {$ctx1.fill(self,"forsakeMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  375. messageSends: ["removeCompiledMethod:"]}),
  376. smalltalk.Behavior);