1
0

Helios-Debugger.deploy.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. smalltalk.addPackage('Helios-Debugger');
  2. smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "context",
  6. fn: function (){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. var $1;
  10. $1=self["@context"];
  11. return $1;
  12. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.HLContextInspectorDecorator)})},
  13. messageSends: []}),
  14. smalltalk.HLContextInspectorDecorator);
  15. smalltalk.addMethod(
  16. smalltalk.method({
  17. selector: "initializeFromContext:",
  18. fn: function (aContext){
  19. var self=this;
  20. return smalltalk.withContext(function($ctx1) {
  21. self["@context"]=aContext;
  22. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aContext:aContext},smalltalk.HLContextInspectorDecorator)})},
  23. messageSends: []}),
  24. smalltalk.HLContextInspectorDecorator);
  25. smalltalk.addMethod(
  26. smalltalk.method({
  27. selector: "inspectOn:",
  28. fn: function (anInspector){
  29. var self=this;
  30. var variables,inspectedContext;
  31. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  32. return smalltalk.withContext(function($ctx1) {
  33. var $1,$2,$3;
  34. variables=_st($Dictionary())._new();
  35. inspectedContext=_st(self)._context();
  36. _st(variables)._addAll_(_st(inspectedContext)._locals());
  37. _st((function(){
  38. return smalltalk.withContext(function($ctx2) {
  39. return _st(_st(inspectedContext)._notNil())._and_((function(){
  40. return smalltalk.withContext(function($ctx3) {
  41. return _st(inspectedContext)._isBlockContext();
  42. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  43. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  44. return smalltalk.withContext(function($ctx2) {
  45. inspectedContext=_st(inspectedContext)._outerContext();
  46. inspectedContext;
  47. $1=inspectedContext;
  48. if(($receiver = $1) == nil || $receiver == undefined){
  49. return $1;
  50. } else {
  51. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  52. };
  53. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  54. $2=anInspector;
  55. _st($2)._setLabel_("Context");
  56. $3=_st($2)._setVariables_(variables);
  57. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
  58. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "outerContext", "ifNotNil:", "and:", "isBlockContext", "notNil", "setLabel:", "setVariables:"]}),
  59. smalltalk.HLContextInspectorDecorator);
  60. smalltalk.addMethod(
  61. smalltalk.method({
  62. selector: "on:",
  63. fn: function (aContext){
  64. var self=this;
  65. return smalltalk.withContext(function($ctx1) {
  66. var $2,$3,$1;
  67. $2=_st(self)._new();
  68. _st($2)._initializeFromContext_(aContext);
  69. $3=_st($2)._yourself();
  70. $1=$3;
  71. return $1;
  72. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},smalltalk.HLContextInspectorDecorator.klass)})},
  73. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  74. smalltalk.HLContextInspectorDecorator.klass);
  75. smalltalk.addClass('HLDebugger', smalltalk.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  76. smalltalk.addMethod(
  77. smalltalk.method({
  78. selector: "codeWidget",
  79. fn: function (){
  80. var self=this;
  81. function $HLDebuggerCodeWidget(){return smalltalk.HLDebuggerCodeWidget||(typeof HLDebuggerCodeWidget=="undefined"?nil:HLDebuggerCodeWidget)}
  82. return smalltalk.withContext(function($ctx1) {
  83. var $2,$3,$4,$1;
  84. $2=self["@codeWidget"];
  85. if(($receiver = $2) == nil || $receiver == undefined){
  86. $3=_st($HLDebuggerCodeWidget())._new();
  87. _st($3)._browserModel_(_st(self)._model());
  88. $4=_st($3)._yourself();
  89. self["@codeWidget"]=$4;
  90. $1=self["@codeWidget"];
  91. } else {
  92. $1=$2;
  93. };
  94. return $1;
  95. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLDebugger)})},
  96. messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"]}),
  97. smalltalk.HLDebugger);
  98. smalltalk.addMethod(
  99. smalltalk.method({
  100. selector: "focus",
  101. fn: function (){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. _st(_st(self)._stackListWidget())._focus();
  105. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLDebugger)})},
  106. messageSends: ["focus", "stackListWidget"]}),
  107. smalltalk.HLDebugger);
  108. smalltalk.addMethod(
  109. smalltalk.method({
  110. selector: "initializeFromMethodContext:",
  111. fn: function (aMethodContext){
  112. var self=this;
  113. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  114. return smalltalk.withContext(function($ctx1) {
  115. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  116. _st(self)._observeModel();
  117. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.HLDebugger)})},
  118. messageSends: ["on:", "observeModel"]}),
  119. smalltalk.HLDebugger);
  120. smalltalk.addMethod(
  121. smalltalk.method({
  122. selector: "inspectorWidget",
  123. fn: function (){
  124. var self=this;
  125. function $HLInspectorWidget(){return smalltalk.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  126. return smalltalk.withContext(function($ctx1) {
  127. var $2,$1;
  128. $2=self["@inspectorWidget"];
  129. if(($receiver = $2) == nil || $receiver == undefined){
  130. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  131. $1=self["@inspectorWidget"];
  132. } else {
  133. $1=$2;
  134. };
  135. return $1;
  136. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},smalltalk.HLDebugger)})},
  137. messageSends: ["ifNil:", "new"]}),
  138. smalltalk.HLDebugger);
  139. smalltalk.addMethod(
  140. smalltalk.method({
  141. selector: "model",
  142. fn: function (){
  143. var self=this;
  144. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  145. return smalltalk.withContext(function($ctx1) {
  146. var $2,$1;
  147. $2=self["@model"];
  148. if(($receiver = $2) == nil || $receiver == undefined){
  149. self["@model"]=_st($HLDebuggerModel())._new();
  150. $1=self["@model"];
  151. } else {
  152. $1=$2;
  153. };
  154. return $1;
  155. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLDebugger)})},
  156. messageSends: ["ifNil:", "new"]}),
  157. smalltalk.HLDebugger);
  158. smalltalk.addMethod(
  159. smalltalk.method({
  160. selector: "observeModel",
  161. fn: function (){
  162. var self=this;
  163. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  164. return smalltalk.withContext(function($ctx1) {
  165. _st(_st(_st(self)._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  166. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
  167. messageSends: ["on:send:to:", "announcer", "model"]}),
  168. smalltalk.HLDebugger);
  169. smalltalk.addMethod(
  170. smalltalk.method({
  171. selector: "onContextSelected:",
  172. fn: function (anAnnouncement){
  173. var self=this;
  174. function $HLContextInspectorDecorator(){return smalltalk.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  175. return smalltalk.withContext(function($ctx1) {
  176. _st(_st(self)._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  177. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDebugger)})},
  178. messageSends: ["inspect:", "on:", "context", "inspectorWidget"]}),
  179. smalltalk.HLDebugger);
  180. smalltalk.addMethod(
  181. smalltalk.method({
  182. selector: "open",
  183. fn: function (){
  184. var self=this;
  185. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  186. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  187. return smalltalk.withContext(function($ctx1) {
  188. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(self,_st(_st(self)._class())._tabLabel()));
  189. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.HLDebugger)})},
  190. messageSends: ["addTab:", "on:labelled:", "tabLabel", "class", "current"]}),
  191. smalltalk.HLDebugger);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "registerBindingsOn:",
  195. fn: function (aBindingGroup){
  196. var self=this;
  197. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  198. return smalltalk.withContext(function($ctx1) {
  199. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,_st(self)._model());
  200. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLDebugger)})},
  201. messageSends: ["registerConcreteClassesOn:for:", "model"]}),
  202. smalltalk.HLDebugger);
  203. smalltalk.addMethod(
  204. smalltalk.method({
  205. selector: "renderContentOn:",
  206. fn: function (html){
  207. var self=this;
  208. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  209. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  210. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  211. return smalltalk.withContext(function($ctx1) {
  212. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(_st(self)._stackListWidget(),_st($HLVerticalSplitter())._with_with_(_st(self)._codeWidget(),_st(self)._inspectorWidget()))));
  213. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  214. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"]}),
  215. smalltalk.HLDebugger);
  216. smalltalk.addMethod(
  217. smalltalk.method({
  218. selector: "stackListWidget",
  219. fn: function (){
  220. var self=this;
  221. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  222. return smalltalk.withContext(function($ctx1) {
  223. var $2,$3,$4,$1;
  224. $2=self["@stackListWidget"];
  225. if(($receiver = $2) == nil || $receiver == undefined){
  226. $3=_st($HLStackListWidget())._on_(_st(self)._model());
  227. _st($3)._next_(_st(self)._codeWidget());
  228. $4=_st($3)._yourself();
  229. self["@stackListWidget"]=$4;
  230. $1=self["@stackListWidget"];
  231. } else {
  232. $1=$2;
  233. };
  234. return $1;
  235. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  236. messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"]}),
  237. smalltalk.HLDebugger);
  238. smalltalk.addMethod(
  239. smalltalk.method({
  240. selector: "unregister",
  241. fn: function (){
  242. var self=this;
  243. return smalltalk.withContext(function($ctx1) {
  244. smalltalk.HLFocusableWidget.fn.prototype._unregister.apply(_st(self), []);
  245. _st(_st(self)._inspectorWidget())._unregister();
  246. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
  247. messageSends: ["unregister", "inspectorWidget"]}),
  248. smalltalk.HLDebugger);
  249. smalltalk.addMethod(
  250. smalltalk.method({
  251. selector: "on:",
  252. fn: function (aMethodContext){
  253. var self=this;
  254. return smalltalk.withContext(function($ctx1) {
  255. var $2,$3,$1;
  256. $2=_st(self)._new();
  257. _st($2)._initializeFromMethodContext_(aMethodContext);
  258. $3=_st($2)._yourself();
  259. $1=$3;
  260. return $1;
  261. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebugger.klass)})},
  262. messageSends: ["initializeFromMethodContext:", "new", "yourself"]}),
  263. smalltalk.HLDebugger.klass);
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "tabClass",
  267. fn: function (){
  268. var self=this;
  269. return smalltalk.withContext(function($ctx1) {
  270. return "debugger";
  271. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLDebugger.klass)})},
  272. messageSends: []}),
  273. smalltalk.HLDebugger.klass);
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "tabLabel",
  277. fn: function (){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) {
  280. return "Debugger";
  281. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLDebugger.klass)})},
  282. messageSends: []}),
  283. smalltalk.HLDebugger.klass);
  284. smalltalk.addClass('HLDebuggerCodeWidget', smalltalk.HLBrowserCodeWidget, ['highlightedNode'], 'Helios-Debugger');
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "addStopAt:",
  288. fn: function (anInteger){
  289. var self=this;
  290. return smalltalk.withContext(function($ctx1) {
  291. _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st(_st("<div class=\x22stop\x22></stop>")._asJQuery())._toArray())._first());
  292. return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  293. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"]}),
  294. smalltalk.HLDebuggerCodeWidget);
  295. smalltalk.addMethod(
  296. smalltalk.method({
  297. selector: "clearHighlight",
  298. fn: function (){
  299. var self=this;
  300. return smalltalk.withContext(function($ctx1) {
  301. var $1;
  302. _st(self["@editor"])._clearGutter_("stops");
  303. $1=_st(self)._highlightedNode();
  304. if(($receiver = $1) == nil || $receiver == undefined){
  305. $1;
  306. } else {
  307. var node;
  308. node=$receiver;
  309. _st(self["@editor"])._removeLineClass_where_class_(_st(_st(_st(node)._position())._x()).__minus((1)),"background","highlighted");
  310. };
  311. return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},smalltalk.HLDebuggerCodeWidget)})},
  312. messageSends: ["clearGutter:", "ifNotNil:", "removeLineClass:where:class:", "-", "x", "position", "highlightedNode"]}),
  313. smalltalk.HLDebuggerCodeWidget);
  314. smalltalk.addMethod(
  315. smalltalk.method({
  316. selector: "contents:",
  317. fn: function (aString){
  318. var self=this;
  319. return smalltalk.withContext(function($ctx1) {
  320. _st(self)._clearHighlight();
  321. smalltalk.HLBrowserCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  322. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLDebuggerCodeWidget)})},
  323. messageSends: ["clearHighlight", "contents:"]}),
  324. smalltalk.HLDebuggerCodeWidget);
  325. smalltalk.addMethod(
  326. smalltalk.method({
  327. selector: "editorOptions",
  328. fn: function (){
  329. var self=this;
  330. return smalltalk.withContext(function($ctx1) {
  331. var $2,$3,$1;
  332. $2=smalltalk.HLBrowserCodeWidget.fn.prototype._editorOptions.apply(_st(self), []);
  333. _st($2)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  334. $3=_st($2)._yourself();
  335. $1=$3;
  336. return $1;
  337. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},smalltalk.HLDebuggerCodeWidget)})},
  338. messageSends: ["at:put:", "editorOptions", "yourself"]}),
  339. smalltalk.HLDebuggerCodeWidget);
  340. smalltalk.addMethod(
  341. smalltalk.method({
  342. selector: "highlight",
  343. fn: function (){
  344. var self=this;
  345. var anchor,head,selection;
  346. return smalltalk.withContext(function($ctx1) {
  347. head=smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(_st(_st(_st(_st(self)._highlightedNode())._position())._x()).__minus((1))),_st("ch").__minus_gt(_st(_st(_st(_st(self)._highlightedNode())._position())._y()).__minus((1)))]);
  348. anchor=smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(_st(_st(_st(_st(self)._highlightedNode())._extent())._x()).__minus((1))),_st("ch").__minus_gt(_st(_st(_st(_st(self)._highlightedNode())._extent())._y()).__minus((1)))]);
  349. _st(self["@editor"])._setSelection_to_(head,anchor);
  350. return self}, function($ctx1) {$ctx1.fill(self,"highlight",{anchor:anchor,head:head,selection:selection},smalltalk.HLDebuggerCodeWidget)})},
  351. messageSends: ["->", "-", "x", "position", "highlightedNode", "y", "extent", "setSelection:to:"]}),
  352. smalltalk.HLDebuggerCodeWidget);
  353. smalltalk.addMethod(
  354. smalltalk.method({
  355. selector: "highlightLine:",
  356. fn: function (anInteger){
  357. var self=this;
  358. return smalltalk.withContext(function($ctx1) {
  359. _st(self["@editor"])._addLineClass_where_class_(anInteger,"background","highlighted");
  360. return self}, function($ctx1) {$ctx1.fill(self,"highlightLine:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  361. messageSends: ["addLineClass:where:class:"]}),
  362. smalltalk.HLDebuggerCodeWidget);
  363. smalltalk.addMethod(
  364. smalltalk.method({
  365. selector: "highlightNode:",
  366. fn: function (aNode){
  367. var self=this;
  368. var line;
  369. return smalltalk.withContext(function($ctx1) {
  370. var $1,$2,$3;
  371. $1=aNode;
  372. if(($receiver = $1) == nil || $receiver == undefined){
  373. $1;
  374. } else {
  375. line=_st(_st(_st(aNode)._position())._x()).__minus((1));
  376. line;
  377. $2=self;
  378. _st($2)._clearHighlight();
  379. _st($2)._addStopAt_(line);
  380. _st($2)._highlightLine_(line);
  381. $3=_st($2)._highlightedNode_(aNode);
  382. $3;
  383. };
  384. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,line:line},smalltalk.HLDebuggerCodeWidget)})},
  385. messageSends: ["ifNotNil:", "-", "x", "position", "clearHighlight", "addStopAt:", "highlightLine:", "highlightedNode:"]}),
  386. smalltalk.HLDebuggerCodeWidget);
  387. smalltalk.addMethod(
  388. smalltalk.method({
  389. selector: "highlightedNode",
  390. fn: function (){
  391. var self=this;
  392. return smalltalk.withContext(function($ctx1) {
  393. var $1;
  394. $1=self["@highlightedNode"];
  395. return $1;
  396. }, function($ctx1) {$ctx1.fill(self,"highlightedNode",{},smalltalk.HLDebuggerCodeWidget)})},
  397. messageSends: []}),
  398. smalltalk.HLDebuggerCodeWidget);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "highlightedNode:",
  402. fn: function (aNode){
  403. var self=this;
  404. return smalltalk.withContext(function($ctx1) {
  405. self["@highlightedNode"]=aNode;
  406. return self}, function($ctx1) {$ctx1.fill(self,"highlightedNode:",{aNode:aNode},smalltalk.HLDebuggerCodeWidget)})},
  407. messageSends: []}),
  408. smalltalk.HLDebuggerCodeWidget);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "observeBrowserModel",
  412. fn: function (){
  413. var self=this;
  414. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  415. return smalltalk.withContext(function($ctx1) {
  416. smalltalk.HLBrowserCodeWidget.fn.prototype._observeBrowserModel.apply(_st(self), []);
  417. _st(_st(_st(self)._browserModel())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  418. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLDebuggerCodeWidget)})},
  419. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"]}),
  420. smalltalk.HLDebuggerCodeWidget);
  421. smalltalk.addMethod(
  422. smalltalk.method({
  423. selector: "onContextSelected",
  424. fn: function (){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx1) {
  427. _st(self)._highlightNode_(_st(_st(self)._browserModel())._nextNode());
  428. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},smalltalk.HLDebuggerCodeWidget)})},
  429. messageSends: ["highlightNode:", "nextNode", "browserModel"]}),
  430. smalltalk.HLDebuggerCodeWidget);
  431. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts', 'interpreter'], 'Helios-Debugger');
  432. smalltalk.addMethod(
  433. smalltalk.method({
  434. selector: "contexts",
  435. fn: function (){
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) {
  438. var $1;
  439. $1=self["@contexts"];
  440. return $1;
  441. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  442. messageSends: []}),
  443. smalltalk.HLDebuggerModel);
  444. smalltalk.addMethod(
  445. smalltalk.method({
  446. selector: "currentContext",
  447. fn: function (){
  448. var self=this;
  449. return smalltalk.withContext(function($ctx1) {
  450. var $1,$2;
  451. $1=self["@currentContext"];
  452. if(($receiver = $1) == nil || $receiver == undefined){
  453. _st(self)._currentContext_(_st(self)._rootContext());
  454. } else {
  455. $1;
  456. };
  457. $2=self["@currentContext"];
  458. return $2;
  459. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  460. messageSends: ["ifNil:", "currentContext:", "rootContext"]}),
  461. smalltalk.HLDebuggerModel);
  462. smalltalk.addMethod(
  463. smalltalk.method({
  464. selector: "currentContext:",
  465. fn: function (aContext){
  466. var self=this;
  467. function $ASTDebugger(){return smalltalk.ASTDebugger||(typeof ASTDebugger=="undefined"?nil:ASTDebugger)}
  468. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  469. return smalltalk.withContext(function($ctx1) {
  470. var $1,$2;
  471. _st(self)._withChangesDo_((function(){
  472. return smalltalk.withContext(function($ctx2) {
  473. _st(self)._selectedMethod_(_st(aContext)._method());
  474. self["@currentContext"]=aContext;
  475. self["@currentContext"];
  476. self["@interpreter"]=_st($ASTDebugger())._context_(aContext);
  477. self["@interpreter"];
  478. $1=_st($HLDebuggerContextSelected())._new();
  479. _st($1)._context_(aContext);
  480. $2=_st($1)._yourself();
  481. return _st(_st(self)._announcer())._announce_($2);
  482. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  483. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  484. messageSends: ["withChangesDo:", "selectedMethod:", "method", "context:", "announce:", "new", "yourself", "announcer"]}),
  485. smalltalk.HLDebuggerModel);
  486. smalltalk.addMethod(
  487. smalltalk.method({
  488. selector: "initializeContexts",
  489. fn: function (){
  490. var self=this;
  491. var context;
  492. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  493. return smalltalk.withContext(function($ctx1) {
  494. self["@contexts"]=_st($OrderedCollection())._new();
  495. context=_st(self)._rootContext();
  496. _st((function(){
  497. return smalltalk.withContext(function($ctx2) {
  498. return _st(context)._notNil();
  499. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  500. return smalltalk.withContext(function($ctx2) {
  501. _st(self["@contexts"])._add_(context);
  502. context=_st(context)._outerContext();
  503. return context;
  504. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  505. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  506. messageSends: ["new", "rootContext", "whileTrue:", "add:", "outerContext", "notNil"]}),
  507. smalltalk.HLDebuggerModel);
  508. smalltalk.addMethod(
  509. smalltalk.method({
  510. selector: "initializeFromContext:",
  511. fn: function (aMethodContext){
  512. var self=this;
  513. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  514. return smalltalk.withContext(function($ctx1) {
  515. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  516. _st(self)._initializeContexts();
  517. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  518. messageSends: ["fromMethodContext:", "initializeContexts"]}),
  519. smalltalk.HLDebuggerModel);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "interpreter",
  523. fn: function (){
  524. var self=this;
  525. return smalltalk.withContext(function($ctx1) {
  526. var $1;
  527. $1=self["@interpreter"];
  528. return $1;
  529. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.HLDebuggerModel)})},
  530. messageSends: []}),
  531. smalltalk.HLDebuggerModel);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "nextNode",
  535. fn: function (){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx1) {
  538. var $1;
  539. $1=_st(_st(self)._interpreter())._nextNode();
  540. return $1;
  541. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.HLDebuggerModel)})},
  542. messageSends: ["nextNode", "interpreter"]}),
  543. smalltalk.HLDebuggerModel);
  544. smalltalk.addMethod(
  545. smalltalk.method({
  546. selector: "rootContext",
  547. fn: function (){
  548. var self=this;
  549. return smalltalk.withContext(function($ctx1) {
  550. var $1;
  551. $1=self["@rootContext"];
  552. return $1;
  553. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  554. messageSends: []}),
  555. smalltalk.HLDebuggerModel);
  556. smalltalk.addMethod(
  557. smalltalk.method({
  558. selector: "on:",
  559. fn: function (aMethodContext){
  560. var self=this;
  561. return smalltalk.withContext(function($ctx1) {
  562. var $2,$3,$1;
  563. $2=_st(self)._new();
  564. _st($2)._initializeFromContext_(aMethodContext);
  565. $3=_st($2)._yourself();
  566. $1=$3;
  567. return $1;
  568. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  569. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  570. smalltalk.HLDebuggerModel.klass);
  571. smalltalk.addClass('HLErrorHandler', smalltalk.ErrorHandler, [], 'Helios-Debugger');
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "handleError:",
  575. fn: function (anError){
  576. var self=this;
  577. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  578. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  579. function $HLDebugger(){return smalltalk.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  580. return smalltalk.withContext(function($ctx1) {
  581. _st((function(){
  582. return smalltalk.withContext(function($ctx2) {
  583. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._open();
  584. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  585. return smalltalk.withContext(function($ctx2) {
  586. return _st(_st($ErrorHandler())._new())._handleError_(error);
  587. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  588. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  589. messageSends: ["on:do:", "handleError:", "new", "open", "on:", "context"]}),
  590. smalltalk.HLErrorHandler);
  591. smalltalk.addMethod(
  592. smalltalk.method({
  593. selector: "handleError:",
  594. fn: function (anError){
  595. var self=this;
  596. return smalltalk.withContext(function($ctx1) {
  597. var $1;
  598. $1=_st(_st(self)._new())._handleError_(anError);
  599. return $1;
  600. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler.klass)})},
  601. messageSends: ["handleError:", "new"]}),
  602. smalltalk.HLErrorHandler.klass);
  603. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  604. smalltalk.addMethod(
  605. smalltalk.method({
  606. selector: "items",
  607. fn: function (){
  608. var self=this;
  609. return smalltalk.withContext(function($ctx1) {
  610. var $2,$1;
  611. $2=self["@items"];
  612. if(($receiver = $2) == nil || $receiver == undefined){
  613. self["@items"]=_st(_st(self)._model())._contexts();
  614. $1=self["@items"];
  615. } else {
  616. $1=$2;
  617. };
  618. return $1;
  619. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  620. messageSends: ["ifNil:", "contexts", "model"]}),
  621. smalltalk.HLStackListWidget);
  622. smalltalk.addMethod(
  623. smalltalk.method({
  624. selector: "label",
  625. fn: function (){
  626. var self=this;
  627. return smalltalk.withContext(function($ctx1) {
  628. return "Call stack";
  629. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  630. messageSends: []}),
  631. smalltalk.HLStackListWidget);
  632. smalltalk.addMethod(
  633. smalltalk.method({
  634. selector: "selectItem:",
  635. fn: function (aContext){
  636. var self=this;
  637. return smalltalk.withContext(function($ctx1) {
  638. _st(_st(self)._model())._currentContext_(aContext);
  639. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  640. messageSends: ["currentContext:", "model"]}),
  641. smalltalk.HLStackListWidget);