Helios-Environments.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  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: "availablePackageNames",
  41. category: 'accessing',
  42. fn: function (){
  43. var self=this;
  44. return smalltalk.withContext(function($ctx1) {
  45. _st(self)._subclassResponsibility();
  46. return self}, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.HLEnvironment)})},
  47. args: [],
  48. source: "availablePackageNames\x0a\x09self subclassResponsibility",
  49. messageSends: ["subclassResponsibility"],
  50. referencedClasses: []
  51. }),
  52. smalltalk.HLEnvironment);
  53. smalltalk.addMethod(
  54. smalltalk.method({
  55. selector: "availableProtocolsFor:",
  56. category: 'accessing',
  57. fn: function (aClass){
  58. var self=this;
  59. return smalltalk.withContext(function($ctx1) {
  60. _st(self)._subclassResponsibility();
  61. return self}, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass},smalltalk.HLEnvironment)})},
  62. args: ["aClass"],
  63. source: "availableProtocolsFor: aClass\x0a\x09self subclassResponsibility",
  64. messageSends: ["subclassResponsibility"],
  65. referencedClasses: []
  66. }),
  67. smalltalk.HLEnvironment);
  68. smalltalk.addMethod(
  69. smalltalk.method({
  70. selector: "classBuilder",
  71. category: 'accessing',
  72. fn: function (){
  73. var self=this;
  74. return smalltalk.withContext(function($ctx1) {
  75. var $1;
  76. $1=_st(self)._subclassResponsibility();
  77. return $1;
  78. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.HLEnvironment)})},
  79. args: [],
  80. source: "classBuilder\x0a\x09^ self subclassResponsibility",
  81. messageSends: ["subclassResponsibility"],
  82. referencedClasses: []
  83. }),
  84. smalltalk.HLEnvironment);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "classNamed:",
  88. category: 'accessing',
  89. fn: function (aString){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) {
  92. _st(self)._subclassResponsibility();
  93. return self}, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.HLEnvironment)})},
  94. args: ["aString"],
  95. source: "classNamed: aString\x0a\x09self subclassResponsibility",
  96. messageSends: ["subclassResponsibility"],
  97. referencedClasses: []
  98. }),
  99. smalltalk.HLEnvironment);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "commitPackage:",
  103. category: 'actions',
  104. fn: function (aPackage){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. _st(self)._subclassResponsibility();
  108. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLEnvironment)})},
  109. args: ["aPackage"],
  110. source: "commitPackage: aPackage\x0a\x09self subclassResponsibility",
  111. messageSends: ["subclassResponsibility"],
  112. referencedClasses: []
  113. }),
  114. smalltalk.HLEnvironment);
  115. smalltalk.addMethod(
  116. smalltalk.method({
  117. selector: "compileClassComment:for:",
  118. category: 'compiling',
  119. fn: function (aString,aClass){
  120. var self=this;
  121. return smalltalk.withContext(function($ctx1) {
  122. _st(aClass)._comment_(aString);
  123. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},smalltalk.HLEnvironment)})},
  124. args: ["aString", "aClass"],
  125. source: "compileClassComment: aString for: aClass\x0a\x09aClass comment: aString",
  126. messageSends: ["comment:"],
  127. referencedClasses: []
  128. }),
  129. smalltalk.HLEnvironment);
  130. smalltalk.addMethod(
  131. smalltalk.method({
  132. selector: "compileClassDefinition:",
  133. category: 'compiling',
  134. fn: function (aString){
  135. var self=this;
  136. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  137. return smalltalk.withContext(function($ctx1) {
  138. _st(self)._eval_on_(aString,_st($DoIt())._new());
  139. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.HLEnvironment)})},
  140. args: ["aString"],
  141. source: "compileClassDefinition: aString\x0a\x09self eval: aString on: DoIt new",
  142. messageSends: ["eval:on:", "new"],
  143. referencedClasses: ["DoIt"]
  144. }),
  145. smalltalk.HLEnvironment);
  146. smalltalk.addMethod(
  147. smalltalk.method({
  148. selector: "compileMethod:for:protocol:",
  149. category: 'compiling',
  150. fn: function (sourceCode,class_,protocol){
  151. var self=this;
  152. return smalltalk.withContext(function($ctx1) {
  153. _st(class_)._compile_category_(sourceCode,protocol);
  154. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},smalltalk.HLEnvironment)})},
  155. args: ["sourceCode", "class", "protocol"],
  156. source: "compileMethod: sourceCode for: class protocol: protocol\x0a\x09class\x0a\x09\x09compile: sourceCode\x0a\x09\x09category: protocol",
  157. messageSends: ["compile:category:"],
  158. referencedClasses: []
  159. }),
  160. smalltalk.HLEnvironment);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "eval:on:",
  164. category: 'actions',
  165. fn: function (someCode,aReceiver){
  166. var self=this;
  167. return smalltalk.withContext(function($ctx1) {
  168. var $1;
  169. $1=_st(self)._subclassResponsibility();
  170. return $1;
  171. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver},smalltalk.HLEnvironment)})},
  172. args: ["someCode", "aReceiver"],
  173. source: "eval: someCode on: aReceiver\x0a\x0a\x09^ self subclassResponsibility",
  174. messageSends: ["subclassResponsibility"],
  175. referencedClasses: []
  176. }),
  177. smalltalk.HLEnvironment);
  178. smalltalk.addMethod(
  179. smalltalk.method({
  180. selector: "moveClass:toPackage:",
  181. category: 'actions',
  182. fn: function (aClass,aPackageName){
  183. var self=this;
  184. return smalltalk.withContext(function($ctx1) {
  185. _st(self)._subclassResponsibility();
  186. return self}, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName},smalltalk.HLEnvironment)})},
  187. args: ["aClass", "aPackageName"],
  188. source: "moveClass: aClass toPackage: aPackageName\x0a\x09self subclassResponsibility",
  189. messageSends: ["subclassResponsibility"],
  190. referencedClasses: []
  191. }),
  192. smalltalk.HLEnvironment);
  193. smalltalk.addMethod(
  194. smalltalk.method({
  195. selector: "moveMethod:toClass:",
  196. category: 'actions',
  197. fn: function (aMethod,aClassName){
  198. var self=this;
  199. return smalltalk.withContext(function($ctx1) {
  200. _st(self)._subclassResponsibility();
  201. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName},smalltalk.HLEnvironment)})},
  202. args: ["aMethod", "aClassName"],
  203. source: "moveMethod: aMethod toClass: aClassName\x0a\x09self subclassResponsibility",
  204. messageSends: ["subclassResponsibility"],
  205. referencedClasses: []
  206. }),
  207. smalltalk.HLEnvironment);
  208. smalltalk.addMethod(
  209. smalltalk.method({
  210. selector: "moveMethod:toProtocol:",
  211. category: 'actions',
  212. fn: function (aMethod,aProtocol){
  213. var self=this;
  214. return smalltalk.withContext(function($ctx1) {
  215. _st(self)._subclassResponsibility();
  216. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLEnvironment)})},
  217. args: ["aMethod", "aProtocol"],
  218. source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09self subclassResponsibility",
  219. messageSends: ["subclassResponsibility"],
  220. referencedClasses: []
  221. }),
  222. smalltalk.HLEnvironment);
  223. smalltalk.addMethod(
  224. smalltalk.method({
  225. selector: "packages",
  226. category: 'accessing',
  227. fn: function (){
  228. var self=this;
  229. return smalltalk.withContext(function($ctx1) {
  230. var $1;
  231. $1=_st(self)._subclassResponsibility();
  232. return $1;
  233. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLEnvironment)})},
  234. args: [],
  235. source: "packages\x0a\x09^ self subclassResponsibility",
  236. messageSends: ["subclassResponsibility"],
  237. referencedClasses: []
  238. }),
  239. smalltalk.HLEnvironment);
  240. smalltalk.addMethod(
  241. smalltalk.method({
  242. selector: "removeClass:",
  243. category: 'actions',
  244. fn: function (aClass){
  245. var self=this;
  246. return smalltalk.withContext(function($ctx1) {
  247. _st(self)._sublcassResponsibility();
  248. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.HLEnvironment)})},
  249. args: ["aClass"],
  250. source: "removeClass: aClass\x0a\x09self sublcassResponsibility",
  251. messageSends: ["sublcassResponsibility"],
  252. referencedClasses: []
  253. }),
  254. smalltalk.HLEnvironment);
  255. smalltalk.addMethod(
  256. smalltalk.method({
  257. selector: "removeMethod:",
  258. category: 'actions',
  259. fn: function (aMethod){
  260. var self=this;
  261. return smalltalk.withContext(function($ctx1) {
  262. _st(self)._sublcassResponsibility();
  263. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLEnvironment)})},
  264. args: ["aMethod"],
  265. source: "removeMethod: aMethod\x0a\x09self sublcassResponsibility",
  266. messageSends: ["sublcassResponsibility"],
  267. referencedClasses: []
  268. }),
  269. smalltalk.HLEnvironment);
  270. smalltalk.addMethod(
  271. smalltalk.method({
  272. selector: "systemAnnouncer",
  273. category: 'accessing',
  274. fn: function (){
  275. var self=this;
  276. return smalltalk.withContext(function($ctx1) {
  277. var $1;
  278. $1=_st(self)._subclassResponsibility();
  279. return $1;
  280. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLEnvironment)})},
  281. args: [],
  282. source: "systemAnnouncer\x0a\x09^ self subclassResponsibility",
  283. messageSends: ["subclassResponsibility"],
  284. referencedClasses: []
  285. }),
  286. smalltalk.HLEnvironment);
  287. smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  288. smalltalk.addMethod(
  289. smalltalk.method({
  290. selector: "availableClassNames",
  291. category: 'accessing',
  292. fn: function (){
  293. var self=this;
  294. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  295. return smalltalk.withContext(function($ctx1) {
  296. var $1;
  297. $1=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  298. return smalltalk.withContext(function($ctx2) {
  299. return _st(each)._name();
  300. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  301. return $1;
  302. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLLocalEnvironment)})},
  303. args: [],
  304. source: "availableClassNames\x0a\x09^ Smalltalk current classes \x0a\x09\x09collect: [ :each | each name ]",
  305. messageSends: ["collect:", "name", "classes", "current"],
  306. referencedClasses: ["Smalltalk"]
  307. }),
  308. smalltalk.HLLocalEnvironment);
  309. smalltalk.addMethod(
  310. smalltalk.method({
  311. selector: "availablePackageNames",
  312. category: 'accessing',
  313. fn: function (){
  314. var self=this;
  315. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  316. return smalltalk.withContext(function($ctx1) {
  317. var $1;
  318. $1=_st(_st(_st($Smalltalk())._current())._packages())._collect_((function(each){
  319. return smalltalk.withContext(function($ctx2) {
  320. return _st(each)._name();
  321. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  322. return $1;
  323. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.HLLocalEnvironment)})},
  324. args: [],
  325. source: "availablePackageNames\x0a\x09^ Smalltalk current packages \x0a\x09\x09collect: [ :each | each name ]",
  326. messageSends: ["collect:", "name", "packages", "current"],
  327. referencedClasses: ["Smalltalk"]
  328. }),
  329. smalltalk.HLLocalEnvironment);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "availableProtocolsFor:",
  333. category: 'accessing',
  334. fn: function (aClass){
  335. var self=this;
  336. var protocols;
  337. return smalltalk.withContext(function($ctx1) {
  338. var $1,$2;
  339. protocols=_st(aClass)._protocols();
  340. $1=_st(aClass)._superclass();
  341. if(($receiver = $1) == nil || $receiver == undefined){
  342. $1;
  343. } else {
  344. _st(protocols)._addAll_(_st(self)._availableProtocolsFor_(_st(aClass)._superclass()));
  345. };
  346. $2=_st(_st(protocols)._asSet())._asArray();
  347. return $2;
  348. }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.HLLocalEnvironment)})},
  349. args: ["aClass"],
  350. 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",
  351. messageSends: ["protocols", "ifNotNil:", "addAll:", "availableProtocolsFor:", "superclass", "asArray", "asSet"],
  352. referencedClasses: []
  353. }),
  354. smalltalk.HLLocalEnvironment);
  355. smalltalk.addMethod(
  356. smalltalk.method({
  357. selector: "classBuilder",
  358. category: 'accessing',
  359. fn: function (){
  360. var self=this;
  361. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  362. return smalltalk.withContext(function($ctx1) {
  363. var $1;
  364. $1=_st($ClassBuilder())._new();
  365. return $1;
  366. }, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.HLLocalEnvironment)})},
  367. args: [],
  368. source: "classBuilder\x0a\x09^ ClassBuilder new",
  369. messageSends: ["new"],
  370. referencedClasses: ["ClassBuilder"]
  371. }),
  372. smalltalk.HLLocalEnvironment);
  373. smalltalk.addMethod(
  374. smalltalk.method({
  375. selector: "classNamed:",
  376. category: 'accessing',
  377. fn: function (aString){
  378. var self=this;
  379. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  380. return smalltalk.withContext(function($ctx1) {
  381. var $2,$1;
  382. $2=_st(_st($Smalltalk())._current())._at_(_st(aString)._asSymbol());
  383. if(($receiver = $2) == nil || $receiver == undefined){
  384. $1=_st(self)._error_("Invalid class name");
  385. } else {
  386. $1=$2;
  387. };
  388. return $1;
  389. }, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.HLLocalEnvironment)})},
  390. args: ["aString"],
  391. source: "classNamed: aString\x0a\x09^ (Smalltalk current at: aString asSymbol)\x0a\x09\x09ifNil: [ self error: 'Invalid class name' ]",
  392. messageSends: ["ifNil:", "error:", "at:", "asSymbol", "current"],
  393. referencedClasses: ["Smalltalk"]
  394. }),
  395. smalltalk.HLLocalEnvironment);
  396. smalltalk.addMethod(
  397. smalltalk.method({
  398. selector: "commitPackage:",
  399. category: 'actions',
  400. fn: function (aPackage){
  401. var self=this;
  402. return smalltalk.withContext(function($ctx1) {
  403. _st(aPackage)._commit();
  404. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLLocalEnvironment)})},
  405. args: ["aPackage"],
  406. source: "commitPackage: aPackage\x0a\x09aPackage commit",
  407. messageSends: ["commit"],
  408. referencedClasses: []
  409. }),
  410. smalltalk.HLLocalEnvironment);
  411. smalltalk.addMethod(
  412. smalltalk.method({
  413. selector: "eval:on:",
  414. category: 'actions',
  415. fn: function (aString,aReceiver){
  416. var self=this;
  417. var compiler;
  418. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  419. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  420. return smalltalk.withContext(function($ctx1) {
  421. var $1,$2;
  422. var $early={};
  423. try {
  424. compiler=_st($Compiler())._new();
  425. _st((function(){
  426. return smalltalk.withContext(function($ctx2) {
  427. return _st(compiler)._parseExpression_(aString);
  428. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(ex){
  429. return smalltalk.withContext(function($ctx2) {
  430. $1=_st(window)._alert_(_st(ex)._messageText());
  431. throw $early=[$1];
  432. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  433. $2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
  434. return $2;
  435. }
  436. catch(e) {if(e===$early)return e[0]; throw e}
  437. }, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler},smalltalk.HLLocalEnvironment)})},
  438. args: ["aString", "aReceiver"],
  439. 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",
  440. messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "evaluateExpression:on:"],
  441. referencedClasses: ["Compiler", "Error"]
  442. }),
  443. smalltalk.HLLocalEnvironment);
  444. smalltalk.addMethod(
  445. smalltalk.method({
  446. selector: "moveClass:toPackage:",
  447. category: 'actions',
  448. fn: function (aClass,aPackageName){
  449. var self=this;
  450. var package_;
  451. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  452. return smalltalk.withContext(function($ctx1) {
  453. var $1,$2,$3;
  454. package_=_st($Package())._named_(aPackageName);
  455. $1=package_;
  456. if(($receiver = $1) == nil || $receiver == undefined){
  457. _st(self)._error_("Invalid package name");
  458. } else {
  459. $1;
  460. };
  461. $2=_st(package_).__eq_eq(_st(aClass)._package());
  462. if(smalltalk.assert($2)){
  463. $3=self;
  464. return $3;
  465. };
  466. _st(package_)._addClass_(aClass);
  467. return self}, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName,package_:package_},smalltalk.HLLocalEnvironment)})},
  468. args: ["aClass", "aPackageName"],
  469. source: "moveClass: aClass toPackage: aPackageName\x0a\x09| package |\x0a\x09\x0a\x09package := Package named: aPackageName.\x0a\x09package ifNil: [ self error: 'Invalid package name' ].\x0a\x09package == aClass package ifTrue: [ ^ self ].\x0a\x09\x0a\x09package addClass: aClass",
  470. messageSends: ["named:", "ifNil:", "error:", "ifTrue:", "==", "package", "addClass:"],
  471. referencedClasses: ["Package"]
  472. }),
  473. smalltalk.HLLocalEnvironment);
  474. smalltalk.addMethod(
  475. smalltalk.method({
  476. selector: "moveMethod:toClass:",
  477. category: 'actions',
  478. fn: function (aMethod,aClassName){
  479. var self=this;
  480. var destinationClass;
  481. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  482. return smalltalk.withContext(function($ctx1) {
  483. var $1,$2,$3;
  484. destinationClass=_st(_st($Smalltalk())._current())._at_(_st(aClassName)._asSymbol());
  485. $1=destinationClass;
  486. if(($receiver = $1) == nil || $receiver == undefined){
  487. _st(self)._error_("Invalid class name");
  488. } else {
  489. $1;
  490. };
  491. $2=_st(destinationClass).__eq_eq(_st(aMethod)._methodClass());
  492. if(smalltalk.assert($2)){
  493. $3=self;
  494. return $3;
  495. };
  496. _st(destinationClass)._adoptMethod_(aMethod);
  497. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  498. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.HLLocalEnvironment)})},
  499. args: ["aMethod", "aClassName"],
  500. 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",
  501. messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"],
  502. referencedClasses: ["Smalltalk"]
  503. }),
  504. smalltalk.HLLocalEnvironment);
  505. smalltalk.addMethod(
  506. smalltalk.method({
  507. selector: "moveMethod:toProtocol:",
  508. category: 'actions',
  509. fn: function (aMethod,aProtocol){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) {
  512. _st(aMethod)._category_(aProtocol);
  513. return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLLocalEnvironment)})},
  514. args: ["aMethod", "aProtocol"],
  515. source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09aMethod category: aProtocol",
  516. messageSends: ["category:"],
  517. referencedClasses: []
  518. }),
  519. smalltalk.HLLocalEnvironment);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "packages",
  523. category: 'accessing',
  524. fn: function (){
  525. var self=this;
  526. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  527. return smalltalk.withContext(function($ctx1) {
  528. var $1;
  529. $1=_st(_st($Smalltalk())._current())._packages();
  530. return $1;
  531. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLLocalEnvironment)})},
  532. args: [],
  533. source: "packages\x0a\x09^ Smalltalk current packages",
  534. messageSends: ["packages", "current"],
  535. referencedClasses: ["Smalltalk"]
  536. }),
  537. smalltalk.HLLocalEnvironment);
  538. smalltalk.addMethod(
  539. smalltalk.method({
  540. selector: "removeClass:",
  541. category: 'actions',
  542. fn: function (aClass){
  543. var self=this;
  544. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  545. return smalltalk.withContext(function($ctx1) {
  546. _st(_st($Smalltalk())._current())._removeClass_(aClass);
  547. return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.HLLocalEnvironment)})},
  548. args: ["aClass"],
  549. source: "removeClass: aClass\x0a\x09Smalltalk current removeClass: aClass",
  550. messageSends: ["removeClass:", "current"],
  551. referencedClasses: ["Smalltalk"]
  552. }),
  553. smalltalk.HLLocalEnvironment);
  554. smalltalk.addMethod(
  555. smalltalk.method({
  556. selector: "removeMethod:",
  557. category: 'actions',
  558. fn: function (aMethod){
  559. var self=this;
  560. return smalltalk.withContext(function($ctx1) {
  561. _st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
  562. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLLocalEnvironment)})},
  563. args: ["aMethod"],
  564. source: "removeMethod: aMethod\x0a\x09aMethod methodClass forsakeMethod: aMethod",
  565. messageSends: ["forsakeMethod:", "methodClass"],
  566. referencedClasses: []
  567. }),
  568. smalltalk.HLLocalEnvironment);
  569. smalltalk.addMethod(
  570. smalltalk.method({
  571. selector: "systemAnnouncer",
  572. category: 'accessing',
  573. fn: function (){
  574. var self=this;
  575. function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
  576. return smalltalk.withContext(function($ctx1) {
  577. var $1;
  578. $1=_st($SystemAnnouncer())._current();
  579. return $1;
  580. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLLocalEnvironment)})},
  581. args: [],
  582. source: "systemAnnouncer\x0a\x09^ SystemAnnouncer current",
  583. messageSends: ["current"],
  584. referencedClasses: ["SystemAnnouncer"]
  585. }),
  586. smalltalk.HLLocalEnvironment);
  587. smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "eval:on:",
  591. category: 'actions',
  592. fn: function (someCode,aReceiver){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx1) {
  595. _st(self)._notYetImplemented();
  596. return self}, function($ctx1) {$ctx1.fill(self,"eval:on:",{someCode:someCode,aReceiver:aReceiver},smalltalk.HLRemoteEnvironment)})},
  597. args: ["someCode", "aReceiver"],
  598. 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",
  599. messageSends: ["notYetImplemented"],
  600. referencedClasses: []
  601. }),
  602. smalltalk.HLRemoteEnvironment);
  603. smalltalk.addMethod(
  604. smalltalk.method({
  605. selector: "packages",
  606. category: 'accessing',
  607. fn: function (){
  608. var self=this;
  609. return smalltalk.withContext(function($ctx1) {
  610. return self}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLRemoteEnvironment)})},
  611. args: [],
  612. 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",
  613. messageSends: [],
  614. referencedClasses: []
  615. }),
  616. smalltalk.HLRemoteEnvironment);
  617. smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
  618. 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"
  619. smalltalk.addMethod(
  620. smalltalk.method({
  621. selector: "doesNotUnderstand:",
  622. category: 'actions',
  623. fn: function (aMessage){
  624. var self=this;
  625. return smalltalk.withContext(function($ctx1) {
  626. return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.HLRemoteObject)})},
  627. args: ["aMessage"],
  628. source: "doesNotUnderstand: aMessage\x0a\x0a\x09\x22to-do\x0a\x0a\x09aham, blah blah\x0a\x0a\x09super doesNotUnderstand: aMessage\x22",
  629. messageSends: [],
  630. referencedClasses: []
  631. }),
  632. smalltalk.HLRemoteObject);
  633. smalltalk.addMethod(
  634. smalltalk.method({
  635. selector: "inspectOn:",
  636. category: 'actions',
  637. fn: function (anInspector){
  638. var self=this;
  639. return smalltalk.withContext(function($ctx1) {
  640. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector},smalltalk.HLRemoteObject)})},
  641. args: ["anInspector"],
  642. source: "inspectOn: anInspector\x0a\x0a\x09\x22to-do\x22\x0a\x0a\x09\x22this is a source of so much fun...\x22",
  643. messageSends: [],
  644. referencedClasses: []
  645. }),
  646. smalltalk.HLRemoteObject);
  647. smalltalk.addMethod(
  648. smalltalk.method({
  649. selector: "printString",
  650. category: 'actions',
  651. fn: function (){
  652. var self=this;
  653. return smalltalk.withContext(function($ctx1) {
  654. return "this is a remote object";
  655. }, function($ctx1) {$ctx1.fill(self,"printString",{},smalltalk.HLRemoteObject)})},
  656. args: [],
  657. source: "printString\x0a\x09^ 'this is a remote object'",
  658. messageSends: [],
  659. referencedClasses: []
  660. }),
  661. smalltalk.HLRemoteObject);
  662. smalltalk.addMethod(
  663. smalltalk.method({
  664. selector: "adoptMethod:",
  665. category: '*Helios-Environments',
  666. fn: function (aMethod){
  667. var self=this;
  668. return smalltalk.withContext(function($ctx1) {
  669. _st(self)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
  670. return self}, function($ctx1) {$ctx1.fill(self,"adoptMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  671. args: ["aMethod"],
  672. source: "adoptMethod: aMethod\x0a\x09self \x0a\x09\x09compile: aMethod source\x0a\x09\x09category: aMethod protocol.",
  673. messageSends: ["compile:category:", "source", "protocol"],
  674. referencedClasses: []
  675. }),
  676. smalltalk.Behavior);
  677. smalltalk.addMethod(
  678. smalltalk.method({
  679. selector: "forsakeMethod:",
  680. category: '*Helios-Environments',
  681. fn: function (aMethod){
  682. var self=this;
  683. return smalltalk.withContext(function($ctx1) {
  684. _st(self)._removeCompiledMethod_(aMethod);
  685. return self}, function($ctx1) {$ctx1.fill(self,"forsakeMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
  686. args: ["aMethod"],
  687. source: "forsakeMethod: aMethod\x0a\x09self removeCompiledMethod: aMethod",
  688. messageSends: ["removeCompiledMethod:"],
  689. referencedClasses: []
  690. }),
  691. smalltalk.Behavior);