1
0

Helios-Environments.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. smalltalk.addPackage('Helios-Environments');
  2. smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Environments');
  3. smalltalk.HLEnvironment.comment="Abstract class defining common behavior for local and remote environments"
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "addInstVarNamed:to:",
  7. category: 'compiling',
  8. fn: function (aString,aClass){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. var $1,$2;
  12. $1=_st(_st(aClass)._instanceVariableNames())._copy();
  13. _st($1)._add_(aString);
  14. $2=_st($1)._yourself();
  15. _st(_st(self)._classBuilder())._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),_st(aClass)._name(),$2,_st(_st(aClass)._package())._name());
  16. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},smalltalk.HLEnvironment)})},
  17. args: ["aString", "aClass"],
  18. source: "addInstVarNamed: aString to: aClass\x0a\x09self classBuilder\x0a\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09named: aClass name \x0a\x09\x09instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)\x0a\x09\x09package: aClass package name",
  19. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package", "classBuilder"],
  20. referencedClasses: []
  21. }),
  22. smalltalk.HLEnvironment);
  23. smalltalk.addMethod(
  24. smalltalk.method({
  25. selector: "availableClassNames",
  26. category: 'accessing',
  27. fn: function (){
  28. var self=this;
  29. return smalltalk.withContext(function($ctx1) {
  30. _st(self)._subclassResponsibility();
  31. return self}, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLEnvironment)})},
  32. args: [],
  33. source: "availableClassNames\x0a\x09self subclassResponsibility",
  34. messageSends: ["subclassResponsibility"],
  35. referencedClasses: []
  36. }),
  37. smalltalk.HLEnvironment);
  38. smalltalk.addMethod(
  39. smalltalk.method({
  40. selector: "availableProtocolsFor:",
  41. category: 'accessing',
  42. fn: function (aClass){
  43. var self=this;
  44. return smalltalk.withContext(function($ctx1) {
  45. _st(self)._subclassResponsibility();
  46. return self}, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass},smalltalk.HLEnvironment)})},
  47. args: ["aClass"],
  48. source: "availableProtocolsFor: aClass\x0a\x09self subclassResponsibility",
  49. messageSends: ["subclassResponsibility"],
  50. referencedClasses: []
  51. }),
  52. smalltalk.HLEnvironment);
  53. smalltalk.addMethod(
  54. smalltalk.method({
  55. selector: "classBuilder",
  56. category: 'accessing',
  57. fn: function (){
  58. var self=this;
  59. return smalltalk.withContext(function($ctx1) {
  60. var $1;
  61. $1=_st(self)._subclassResponsibility();
  62. return $1;
  63. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.HLEnvironment)})},
  64. args: [],
  65. source: "classBuilder\x0a\x09^ self subclassResponsibility",
  66. messageSends: ["subclassResponsibility"],
  67. referencedClasses: []
  68. }),
  69. smalltalk.HLEnvironment);
  70. smalltalk.addMethod(
  71. smalltalk.method({
  72. selector: "classNamed:",
  73. category: 'accessing',
  74. fn: function (aString){
  75. var self=this;
  76. return smalltalk.withContext(function($ctx1) {
  77. _st(self)._subclassResponsibility();
  78. return self}, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.HLEnvironment)})},
  79. args: ["aString"],
  80. source: "classNamed: aString\x0a\x09self subclassResponsibility",
  81. messageSends: ["subclassResponsibility"],
  82. referencedClasses: []
  83. }),
  84. smalltalk.HLEnvironment);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "commitPackage:",
  88. category: 'actions',
  89. fn: function (aPackage){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) {
  92. _st(self)._subclassResponsibility();
  93. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLEnvironment)})},
  94. args: ["aPackage"],
  95. source: "commitPackage: aPackage\x0a\x09self subclassResponsibility",
  96. messageSends: ["subclassResponsibility"],
  97. referencedClasses: []
  98. }),
  99. smalltalk.HLEnvironment);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "compileClassComment:for:",
  103. category: 'compiling',
  104. fn: function (aString,aClass){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. _st(aClass)._comment_(aString);
  108. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},smalltalk.HLEnvironment)})},
  109. args: ["aString", "aClass"],
  110. source: "compileClassComment: aString for: aClass\x0a\x09aClass comment: aString",
  111. messageSends: ["comment:"],
  112. referencedClasses: []
  113. }),
  114. smalltalk.HLEnvironment);
  115. smalltalk.addMethod(
  116. smalltalk.method({
  117. selector: "compileClassDefinition:",
  118. category: 'compiling',
  119. fn: function (aString){
  120. var self=this;
  121. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  122. return smalltalk.withContext(function($ctx1) {
  123. _st(self)._eval_on_(aString,_st($DoIt())._new());
  124. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.HLEnvironment)})},
  125. args: ["aString"],
  126. source: "compileClassDefinition: aString\x0a\x09self eval: aString on: DoIt new",
  127. messageSends: ["eval:on:", "new"],
  128. referencedClasses: ["DoIt"]
  129. }),
  130. smalltalk.HLEnvironment);
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "compileMethod:for:protocol:",
  134. category: 'compiling',
  135. fn: function (sourceCode,class_,protocol){
  136. var self=this;
  137. return smalltalk.withContext(function($ctx1) {
  138. _st(class_)._compile_category_(sourceCode,protocol);
  139. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},smalltalk.HLEnvironment)})},
  140. args: ["sourceCode", "class", "protocol"],
  141. source: "compileMethod: sourceCode for: class protocol: protocol\x0a\x09class\x0a\x09\x09compile: sourceCode\x0a\x09\x09category: protocol",
  142. messageSends: ["compile:category:"],
  143. referencedClasses: []
  144. }),
  145. smalltalk.HLEnvironment);
  146. smalltalk.addMethod(
  147. smalltalk.method({
  148. selector: "eval:on:",
  149. category: 'actions',
  150. fn: function (someCode,aReceiver){
  151. var self=this;
  152. return smalltalk.withContext(function($ctx1) {
  153. var $1;
  154. $1=_st(self)._subclassResponsibility();
  155. return $1;
  156. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver},smalltalk.HLEnvironment)})},
  157. args: ["someCode", "aReceiver"],
  158. source: "eval: someCode on: aReceiver\x0a\x0a\x09^ self subclassResponsibility",
  159. messageSends: ["subclassResponsibility"],
  160. referencedClasses: []
  161. }),
  162. smalltalk.HLEnvironment);
  163. smalltalk.addMethod(
  164. smalltalk.method({
  165. selector: "moveMethod:toClass:",
  166. category: 'actions',
  167. fn: function (aMethod,aClassName){
  168. var self=this;
  169. return smalltalk.withContext(function($ctx1) {
  170. _st(self)._subclassResponsibility();
  171. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName},smalltalk.HLEnvironment)})},
  172. args: ["aMethod", "aClassName"],
  173. source: "moveMethod: aMethod toClass: aClassName\x0a\x09self subclassResponsibility",
  174. messageSends: ["subclassResponsibility"],
  175. referencedClasses: []
  176. }),
  177. smalltalk.HLEnvironment);
  178. smalltalk.addMethod(
  179. smalltalk.method({
  180. selector: "moveMethod:toProtocol:",
  181. category: 'actions',
  182. fn: function (aMethod,aProtocol){
  183. var self=this;
  184. return smalltalk.withContext(function($ctx1) {
  185. _st(self)._subclassResponsibility();
  186. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLEnvironment)})},
  187. args: ["aMethod", "aProtocol"],
  188. source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09self subclassResponsibility",
  189. messageSends: ["subclassResponsibility"],
  190. referencedClasses: []
  191. }),
  192. smalltalk.HLEnvironment);
  193. smalltalk.addMethod(
  194. smalltalk.method({
  195. selector: "packages",
  196. category: 'accessing',
  197. fn: function (){
  198. var self=this;
  199. return smalltalk.withContext(function($ctx1) {
  200. var $1;
  201. $1=_st(self)._subclassResponsibility();
  202. return $1;
  203. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLEnvironment)})},
  204. args: [],
  205. source: "packages\x0a\x09^ self subclassResponsibility",
  206. messageSends: ["subclassResponsibility"],
  207. referencedClasses: []
  208. }),
  209. smalltalk.HLEnvironment);
  210. smalltalk.addMethod(
  211. smalltalk.method({
  212. selector: "removeMethod:",
  213. category: 'actions',
  214. fn: function (aMethod){
  215. var self=this;
  216. return smalltalk.withContext(function($ctx1) {
  217. _st(self)._sublcassResponsibility();
  218. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLEnvironment)})},
  219. args: ["aMethod"],
  220. source: "removeMethod: aMethod\x0a\x09self sublcassResponsibility",
  221. messageSends: ["sublcassResponsibility"],
  222. referencedClasses: []
  223. }),
  224. smalltalk.HLEnvironment);
  225. smalltalk.addMethod(
  226. smalltalk.method({
  227. selector: "systemAnnouncer",
  228. category: 'accessing',
  229. fn: function (){
  230. var self=this;
  231. return smalltalk.withContext(function($ctx1) {
  232. var $1;
  233. $1=_st(self)._subclassResponsibility();
  234. return $1;
  235. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLEnvironment)})},
  236. args: [],
  237. source: "systemAnnouncer\x0a\x09^ self subclassResponsibility",
  238. messageSends: ["subclassResponsibility"],
  239. referencedClasses: []
  240. }),
  241. smalltalk.HLEnvironment);
  242. smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  243. smalltalk.addMethod(
  244. smalltalk.method({
  245. selector: "availableClassNames",
  246. category: 'accessing',
  247. fn: function (){
  248. var self=this;
  249. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  250. return smalltalk.withContext(function($ctx1) {
  251. var $1;
  252. $1=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  253. return smalltalk.withContext(function($ctx2) {
  254. return _st(each)._name();
  255. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  256. return $1;
  257. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLLocalEnvironment)})},
  258. args: [],
  259. source: "availableClassNames\x0a\x09^ Smalltalk current classes \x0a\x09\x09collect: [ :each | each name ]",
  260. messageSends: ["collect:", "name", "classes", "current"],
  261. referencedClasses: ["Smalltalk"]
  262. }),
  263. smalltalk.HLLocalEnvironment);
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "availableProtocolsFor:",
  267. category: 'accessing',
  268. fn: function (aClass){
  269. var self=this;
  270. var protocols;
  271. return smalltalk.withContext(function($ctx1) {
  272. var $1,$2;
  273. protocols=_st(aClass)._protocols();
  274. $1=_st(aClass)._superclass();
  275. if(($receiver = $1) == nil || $receiver == undefined){
  276. $1;
  277. } else {
  278. _st(protocols)._addAll_(_st(self)._availableProtocolsFor_(_st(aClass)._superclass()));
  279. };
  280. $2=_st(_st(protocols)._asSet())._asArray();
  281. return $2;
  282. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.HLLocalEnvironment)})},
  283. args: ["aClass"],
  284. source: "availableProtocolsFor: aClass\x0a\x09| protocols |\x0a\x09\x0a\x09protocols := aClass protocols.\x0a\x09aClass superclass ifNotNil: [ protocols addAll: (self availableProtocolsFor: aClass superclass) ].\x0a\x09^ protocols asSet asArray",
  285. messageSends: ["protocols", "ifNotNil:", "addAll:", "availableProtocolsFor:", "superclass", "asArray", "asSet"],
  286. referencedClasses: []
  287. }),
  288. smalltalk.HLLocalEnvironment);
  289. smalltalk.addMethod(
  290. smalltalk.method({
  291. selector: "classBuilder",
  292. category: 'accessing',
  293. fn: function (){
  294. var self=this;
  295. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  296. return smalltalk.withContext(function($ctx1) {
  297. var $1;
  298. $1=_st($ClassBuilder())._new();
  299. return $1;
  300. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.HLLocalEnvironment)})},
  301. args: [],
  302. source: "classBuilder\x0a\x09^ ClassBuilder new",
  303. messageSends: ["new"],
  304. referencedClasses: ["ClassBuilder"]
  305. }),
  306. smalltalk.HLLocalEnvironment);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "classNamed:",
  310. category: 'accessing',
  311. fn: function (aString){
  312. var self=this;
  313. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  314. return smalltalk.withContext(function($ctx1) {
  315. var $2,$1;
  316. $2=_st(_st($Smalltalk())._current())._at_(_st(aString)._asSymbol());
  317. if(($receiver = $2) == nil || $receiver == undefined){
  318. $1=_st(self)._error_("Invalid class name");
  319. } else {
  320. $1=$2;
  321. };
  322. return $1;
  323. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.HLLocalEnvironment)})},
  324. args: ["aString"],
  325. source: "classNamed: aString\x0a\x09^ (Smalltalk current at: aString asSymbol)\x0a\x09\x09ifNil: [ self error: 'Invalid class name' ]",
  326. messageSends: ["ifNil:", "error:", "at:", "asSymbol", "current"],
  327. referencedClasses: ["Smalltalk"]
  328. }),
  329. smalltalk.HLLocalEnvironment);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "commitPackage:",
  333. category: 'actions',
  334. fn: function (aPackage){
  335. var self=this;
  336. return smalltalk.withContext(function($ctx1) {
  337. _st(aPackage)._commit();
  338. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLLocalEnvironment)})},
  339. args: ["aPackage"],
  340. source: "commitPackage: aPackage\x0a\x09aPackage commit",
  341. messageSends: ["commit"],
  342. referencedClasses: []
  343. }),
  344. smalltalk.HLLocalEnvironment);
  345. smalltalk.addMethod(
  346. smalltalk.method({
  347. selector: "eval:on:",
  348. category: 'actions',
  349. fn: function (aString,aReceiver){
  350. var self=this;
  351. var compiler;
  352. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  353. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  354. return smalltalk.withContext(function($ctx1) {
  355. var $1,$2;
  356. var $early={};
  357. try {
  358. compiler=_st($Compiler())._new();
  359. _st((function(){
  360. return smalltalk.withContext(function($ctx2) {
  361. return _st(compiler)._parseExpression_(aString);
  362. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(ex){
  363. return smalltalk.withContext(function($ctx2) {
  364. $1=_st(window)._alert_(_st(ex)._messageText());
  365. throw $early=[$1];
  366. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  367. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  368. return $2;
  369. }
  370. catch(e) {if(e===$early)return e[0]; throw e}
  371. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler},smalltalk.HLLocalEnvironment)})},
  372. args: ["aString", "aReceiver"],
  373. source: "eval: aString on: aReceiver\x0a\x09| compiler |\x0a\x09compiler := Compiler new.\x0a\x09[ compiler parseExpression: aString ] on: Error do: [ :ex |\x0a\x09\x09^ window alert: ex messageText ].\x0a\x09^ compiler evaluateExpression: aString on: aReceiver",
  374. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"],
  375. referencedClasses: ["Compiler", "Error"]
  376. }),
  377. smalltalk.HLLocalEnvironment);
  378. smalltalk.addMethod(
  379. smalltalk.method({
  380. selector: "moveMethod:toClass:",
  381. category: 'actions',
  382. fn: function (aMethod,aClassName){
  383. var self=this;
  384. var destinationClass;
  385. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  386. return smalltalk.withContext(function($ctx1) {
  387. var $1,$2,$3;
  388. destinationClass=_st(_st($Smalltalk())._current())._at_(_st(aClassName)._asSymbol());
  389. $1=destinationClass;
  390. if(($receiver = $1) == nil || $receiver == undefined){
  391. _st(self)._error_("Invalid class name");
  392. } else {
  393. $1;
  394. };
  395. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  396. if(smalltalk.assert($2)){
  397. $3=self;
  398. return $3;
  399. };
  400. _st(destinationClass)._adoptMethod_(aMethod);
  401. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  402. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
  403. args: ["aMethod", "aClassName"],
  404. source: "moveMethod: aMethod toClass: aClassName\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := Smalltalk current at: aClassName asSymbol.\x0a\x09destinationClass ifNil: [ self error: 'Invalid class name' ].\x0a\x09destinationClass == aMethod methodClass ifTrue: [ ^ self ].\x0a\x09\x0a\x09destinationClass adoptMethod: aMethod.\x0a\x09aMethod methodClass forsakeMethod: aMethod.\x0a\x09",
  405. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"],
  406. referencedClasses: ["Smalltalk"]
  407. }),
  408. smalltalk.HLLocalEnvironment);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "moveMethod:toProtocol:",
  412. category: 'actions',
  413. fn: function (aMethod,aProtocol){
  414. var self=this;
  415. return smalltalk.withContext(function($ctx1) {
  416. _st(aMethod)._category_(aProtocol);
  417. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLLocalEnvironment)})},
  418. args: ["aMethod", "aProtocol"],
  419. source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09aMethod category: aProtocol",
  420. messageSends: ["category:"],
  421. referencedClasses: []
  422. }),
  423. smalltalk.HLLocalEnvironment);
  424. smalltalk.addMethod(
  425. smalltalk.method({
  426. selector: "packages",
  427. category: 'accessing',
  428. fn: function (){
  429. var self=this;
  430. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  431. return smalltalk.withContext(function($ctx1) {
  432. var $1;
  433. $1=_st(_st($Smalltalk())._current())._packages();
  434. return $1;
  435. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLLocalEnvironment)})},
  436. args: [],
  437. source: "packages\x0a\x09^ Smalltalk current packages",
  438. messageSends: ["packages", "current"],
  439. referencedClasses: ["Smalltalk"]
  440. }),
  441. smalltalk.HLLocalEnvironment);
  442. smalltalk.addMethod(
  443. smalltalk.method({
  444. selector: "removeMethod:",
  445. category: 'actions',
  446. fn: function (aMethod){
  447. var self=this;
  448. return smalltalk.withContext(function($ctx1) {
  449. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  450. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLLocalEnvironment)})},
  451. args: ["aMethod"],
  452. source: "removeMethod: aMethod\x0a\x09aMethod methodClass forsakeMethod: aMethod",
  453. messageSends: ["forsakeMethod:", "methodClass"],
  454. referencedClasses: []
  455. }),
  456. smalltalk.HLLocalEnvironment);
  457. smalltalk.addMethod(
  458. smalltalk.method({
  459. selector: "systemAnnouncer",
  460. category: 'accessing',
  461. fn: function (){
  462. var self=this;
  463. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  464. return smalltalk.withContext(function($ctx1) {
  465. var $1;
  466. $1=_st($SystemAnnouncer())._current();
  467. return $1;
  468. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLLocalEnvironment)})},
  469. args: [],
  470. source: "systemAnnouncer\x0a\x09^ SystemAnnouncer current",
  471. messageSends: ["current"],
  472. referencedClasses: ["SystemAnnouncer"]
  473. }),
  474. smalltalk.HLLocalEnvironment);
  475. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  476. smalltalk.addMethod(
  477. smalltalk.method({
  478. selector: "eval:on:",
  479. category: 'actions',
  480. fn: function (someCode,aReceiver){
  481. var self=this;
  482. return smalltalk.withContext(function($ctx1) {
  483. _st(self)._notYetImplemented();
  484. return self}, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver},smalltalk.HLRemoteEnvironment)})},
  485. args: ["someCode", "aReceiver"],
  486. source: "eval: someCode on: aReceiver\x0a\x0a\x09\x22Note for future self and friends:\x0a whatever way this compilation happens on the other side, \x0a it should return a proxy to the remote resulting object\x22\x0a \x0a self notYetImplemented",
  487. messageSends: ["notYetImplemented"],
  488. referencedClasses: []
  489. }),
  490. smalltalk.HLRemoteEnvironment);
  491. smalltalk.addMethod(
  492. smalltalk.method({
  493. selector: "packages",
  494. category: 'accessing',
  495. fn: function (){
  496. var self=this;
  497. return smalltalk.withContext(function($ctx1) {
  498. return self}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLRemoteEnvironment)})},
  499. args: [],
  500. source: "packages\x0a\x09\x22Answer the remote environment's packages\x22\x0a \x0a\x09\x22to-do\x22\x0a \x0a \x22Note for future self and friends:\x0a the problem with remote stuff is that the answers shouldn't be expected to be\x0a received in a syncrhonous fashion. Everything network is asyc, so you *are going to deal with callbacks* here\x22",
  501. messageSends: [],
  502. referencedClasses: []
  503. }),
  504. smalltalk.HLRemoteEnvironment);
  505. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
  506. smalltalk.HLRemoteObject.comment="This is a local proxy to a remote object.\x0aTipically useful for evaluating and inspecting and interacting with instances of a remote VM.\x0a"
  507. smalltalk.addMethod(
  508. smalltalk.method({
  509. selector: "doesNotUnderstand:",
  510. category: 'actions',
  511. fn: function (aMessage){
  512. var self=this;
  513. return smalltalk.withContext(function($ctx1) {
  514. return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.HLRemoteObject)})},
  515. args: ["aMessage"],
  516. source: "doesNotUnderstand: aMessage\x0a\x0a\x09\x22to-do\x0a\x0a\x09aham, blah blah\x0a\x0a\x09super doesNotUnderstand: aMessage\x22",
  517. messageSends: [],
  518. referencedClasses: []
  519. }),
  520. smalltalk.HLRemoteObject);
  521. smalltalk.addMethod(
  522. smalltalk.method({
  523. selector: "inspectOn:",
  524. category: 'actions',
  525. fn: function (anInspector){
  526. var self=this;
  527. return smalltalk.withContext(function($ctx1) {
  528. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector},smalltalk.HLRemoteObject)})},
  529. args: ["anInspector"],
  530. source: "inspectOn: anInspector\x0a\x0a\x09\x22to-do\x22\x0a\x0a\x09\x22this is a source of so much fun...\x22",
  531. messageSends: [],
  532. referencedClasses: []
  533. }),
  534. smalltalk.HLRemoteObject);
  535. smalltalk.addMethod(
  536. smalltalk.method({
  537. selector: "printString",
  538. category: 'actions',
  539. fn: function (){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx1) {
  542. return "this is a remote object";
  543. }, function($ctx1) {$ctx1.fill(self,"printString",{},smalltalk.HLRemoteObject)})},
  544. args: [],
  545. source: "printString\x0a\x09^ 'this is a remote object'",
  546. messageSends: [],
  547. referencedClasses: []
  548. }),
  549. smalltalk.HLRemoteObject);
  550. smalltalk.addMethod(
  551. smalltalk.method({
  552. selector: "adoptMethod:",
  553. category: '*Helios-Environments',
  554. fn: function (aMethod){
  555. var self=this;
  556. return smalltalk.withContext(function($ctx1) {
  557. _st(self)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  558. return self}, function($ctx1) {$ctx1.fill(self,"adoptMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  559. args: ["aMethod"],
  560. source: "adoptMethod: aMethod\x0a\x09self \x0a\x09\x09compile: aMethod source\x0a\x09\x09category: aMethod protocol.",
  561. messageSends: ["compile:category:", "source", "protocol"],
  562. referencedClasses: []
  563. }),
  564. smalltalk.Behavior);
  565. smalltalk.addMethod(
  566. smalltalk.method({
  567. selector: "forsakeMethod:",
  568. category: '*Helios-Environments',
  569. fn: function (aMethod){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) {
  572. _st(self)._removeCompiledMethod_(aMethod);
  573. return self}, function($ctx1) {$ctx1.fill(self,"forsakeMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  574. args: ["aMethod"],
  575. source: "forsakeMethod: aMethod\x0a\x09self removeCompiledMethod: aMethod",
  576. messageSends: ["removeCompiledMethod:"],
  577. referencedClasses: []
  578. }),
  579. smalltalk.Behavior);