2
0

Helios-Debugger.deploy.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  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=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({},$ctx2)})}));
  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=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_(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(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. 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(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(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: "registerBindingsOn:",
  183. fn: function (aBindingGroup){
  184. var self=this;
  185. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  186. return smalltalk.withContext(function($ctx1) {
  187. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model());
  188. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLDebugger)})},
  189. messageSends: ["registerConcreteClassesOn:for:", "model"]}),
  190. smalltalk.HLDebugger);
  191. smalltalk.addMethod(
  192. smalltalk.method({
  193. selector: "renderContentOn:",
  194. fn: function (html){
  195. var self=this;
  196. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  197. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  198. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  199. return smalltalk.withContext(function($ctx1) {
  200. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._stackListWidget(),_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget()))));
  201. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  202. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"]}),
  203. smalltalk.HLDebugger);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "stackListWidget",
  207. fn: function (){
  208. var self=this;
  209. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  210. return smalltalk.withContext(function($ctx1) {
  211. var $2,$3,$4,$1;
  212. $2=self["@stackListWidget"];
  213. if(($receiver = $2) == nil || $receiver == undefined){
  214. $3=_st($HLStackListWidget())._on_(self._model());
  215. _st($3)._next_(self._codeWidget());
  216. $4=_st($3)._yourself();
  217. self["@stackListWidget"]=$4;
  218. $1=self["@stackListWidget"];
  219. } else {
  220. $1=$2;
  221. };
  222. return $1;
  223. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  224. messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"]}),
  225. smalltalk.HLDebugger);
  226. smalltalk.addMethod(
  227. smalltalk.method({
  228. selector: "unregister",
  229. fn: function (){
  230. var self=this;
  231. return smalltalk.withContext(function($ctx1) {
  232. smalltalk.HLFocusableWidget.fn.prototype._unregister.apply(_st(self), []);
  233. _st(self._inspectorWidget())._unregister();
  234. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
  235. messageSends: ["unregister", "inspectorWidget"]}),
  236. smalltalk.HLDebugger);
  237. smalltalk.addMethod(
  238. smalltalk.method({
  239. selector: "on:",
  240. fn: function (aMethodContext){
  241. var self=this;
  242. return smalltalk.withContext(function($ctx1) {
  243. var $2,$3,$1;
  244. $2=self._new();
  245. _st($2)._initializeFromMethodContext_(aMethodContext);
  246. $3=_st($2)._yourself();
  247. $1=$3;
  248. return $1;
  249. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebugger.klass)})},
  250. messageSends: ["initializeFromMethodContext:", "new", "yourself"]}),
  251. smalltalk.HLDebugger.klass);
  252. smalltalk.addMethod(
  253. smalltalk.method({
  254. selector: "tabClass",
  255. fn: function (){
  256. var self=this;
  257. return smalltalk.withContext(function($ctx1) {
  258. return "debugger";
  259. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLDebugger.klass)})},
  260. messageSends: []}),
  261. smalltalk.HLDebugger.klass);
  262. smalltalk.addMethod(
  263. smalltalk.method({
  264. selector: "tabLabel",
  265. fn: function (){
  266. var self=this;
  267. return smalltalk.withContext(function($ctx1) {
  268. return "Debugger";
  269. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLDebugger.klass)})},
  270. messageSends: []}),
  271. smalltalk.HLDebugger.klass);
  272. smalltalk.addClass('HLDebuggerCodeWidget', smalltalk.HLBrowserCodeWidget, ['highlightedNode'], 'Helios-Debugger');
  273. smalltalk.addMethod(
  274. smalltalk.method({
  275. selector: "addStopAt:",
  276. fn: function (anInteger){
  277. var self=this;
  278. return smalltalk.withContext(function($ctx1) {
  279. _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st("<div class=\x22stop\x22></stop>"._asJQuery())._toArray())._first());
  280. return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  281. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"]}),
  282. smalltalk.HLDebuggerCodeWidget);
  283. smalltalk.addMethod(
  284. smalltalk.method({
  285. selector: "clearHighlight",
  286. fn: function (){
  287. var self=this;
  288. return smalltalk.withContext(function($ctx1) {
  289. var $1;
  290. _st(self["@editor"])._clearGutter_("stops");
  291. $1=self._highlightedNode();
  292. if(($receiver = $1) == nil || $receiver == undefined){
  293. $1;
  294. } else {
  295. var node;
  296. node=$receiver;
  297. _st(self["@editor"])._removeLineClass_where_class_(_st(_st(_st(node)._position())._x()).__minus((1)),"background","highlighted");
  298. };
  299. return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},smalltalk.HLDebuggerCodeWidget)})},
  300. messageSends: ["clearGutter:", "ifNotNil:", "removeLineClass:where:class:", "-", "x", "position", "highlightedNode"]}),
  301. smalltalk.HLDebuggerCodeWidget);
  302. smalltalk.addMethod(
  303. smalltalk.method({
  304. selector: "contents:",
  305. fn: function (aString){
  306. var self=this;
  307. return smalltalk.withContext(function($ctx1) {
  308. self._clearHighlight();
  309. smalltalk.HLBrowserCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  310. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLDebuggerCodeWidget)})},
  311. messageSends: ["clearHighlight", "contents:"]}),
  312. smalltalk.HLDebuggerCodeWidget);
  313. smalltalk.addMethod(
  314. smalltalk.method({
  315. selector: "editorOptions",
  316. fn: function (){
  317. var self=this;
  318. return smalltalk.withContext(function($ctx1) {
  319. var $2,$3,$1;
  320. $2=smalltalk.HLBrowserCodeWidget.fn.prototype._editorOptions.apply(_st(self), []);
  321. _st($2)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  322. $3=_st($2)._yourself();
  323. $1=$3;
  324. return $1;
  325. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},smalltalk.HLDebuggerCodeWidget)})},
  326. messageSends: ["at:put:", "editorOptions", "yourself"]}),
  327. smalltalk.HLDebuggerCodeWidget);
  328. smalltalk.addMethod(
  329. smalltalk.method({
  330. selector: "highlight",
  331. fn: function (){
  332. var self=this;
  333. var anchor,head,selection;
  334. return smalltalk.withContext(function($ctx1) {
  335. head=smalltalk.HashedCollection._from_(["line".__minus_gt(_st(_st(_st(self._highlightedNode())._position())._x()).__minus((1))),"ch".__minus_gt(_st(_st(_st(self._highlightedNode())._position())._y()).__minus((1)))]);
  336. anchor=smalltalk.HashedCollection._from_(["line".__minus_gt(_st(_st(_st(self._highlightedNode())._extent())._x()).__minus((1))),"ch".__minus_gt(_st(_st(_st(self._highlightedNode())._extent())._y()).__minus((1)))]);
  337. _st(self["@editor"])._setSelection_to_(head,anchor);
  338. return self}, function($ctx1) {$ctx1.fill(self,"highlight",{anchor:anchor,head:head,selection:selection},smalltalk.HLDebuggerCodeWidget)})},
  339. messageSends: ["->", "-", "x", "position", "highlightedNode", "y", "extent", "setSelection:to:"]}),
  340. smalltalk.HLDebuggerCodeWidget);
  341. smalltalk.addMethod(
  342. smalltalk.method({
  343. selector: "highlightLine:",
  344. fn: function (anInteger){
  345. var self=this;
  346. return smalltalk.withContext(function($ctx1) {
  347. _st(self["@editor"])._addLineClass_where_class_(anInteger,"background","highlighted");
  348. return self}, function($ctx1) {$ctx1.fill(self,"highlightLine:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  349. messageSends: ["addLineClass:where:class:"]}),
  350. smalltalk.HLDebuggerCodeWidget);
  351. smalltalk.addMethod(
  352. smalltalk.method({
  353. selector: "highlightNode:",
  354. fn: function (aNode){
  355. var self=this;
  356. var line;
  357. return smalltalk.withContext(function($ctx1) {
  358. var $1,$2,$3;
  359. $1=aNode;
  360. if(($receiver = $1) == nil || $receiver == undefined){
  361. $1;
  362. } else {
  363. line=_st(_st(_st(aNode)._position())._x()).__minus((1));
  364. line;
  365. $2=self;
  366. _st($2)._clearHighlight();
  367. _st($2)._addStopAt_(line);
  368. _st($2)._highlightLine_(line);
  369. $3=_st($2)._highlightedNode_(aNode);
  370. $3;
  371. };
  372. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,line:line},smalltalk.HLDebuggerCodeWidget)})},
  373. messageSends: ["ifNotNil:", "-", "x", "position", "clearHighlight", "addStopAt:", "highlightLine:", "highlightedNode:"]}),
  374. smalltalk.HLDebuggerCodeWidget);
  375. smalltalk.addMethod(
  376. smalltalk.method({
  377. selector: "highlightedNode",
  378. fn: function (){
  379. var self=this;
  380. return smalltalk.withContext(function($ctx1) {
  381. var $1;
  382. $1=self["@highlightedNode"];
  383. return $1;
  384. }, function($ctx1) {$ctx1.fill(self,"highlightedNode",{},smalltalk.HLDebuggerCodeWidget)})},
  385. messageSends: []}),
  386. smalltalk.HLDebuggerCodeWidget);
  387. smalltalk.addMethod(
  388. smalltalk.method({
  389. selector: "highlightedNode:",
  390. fn: function (aNode){
  391. var self=this;
  392. return smalltalk.withContext(function($ctx1) {
  393. self["@highlightedNode"]=aNode;
  394. return self}, function($ctx1) {$ctx1.fill(self,"highlightedNode:",{aNode:aNode},smalltalk.HLDebuggerCodeWidget)})},
  395. messageSends: []}),
  396. smalltalk.HLDebuggerCodeWidget);
  397. smalltalk.addMethod(
  398. smalltalk.method({
  399. selector: "observeBrowserModel",
  400. fn: function (){
  401. var self=this;
  402. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  403. return smalltalk.withContext(function($ctx1) {
  404. smalltalk.HLBrowserCodeWidget.fn.prototype._observeBrowserModel.apply(_st(self), []);
  405. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  406. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLDebuggerCodeWidget)})},
  407. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"]}),
  408. smalltalk.HLDebuggerCodeWidget);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "onContextSelected",
  412. fn: function (){
  413. var self=this;
  414. return smalltalk.withContext(function($ctx1) {
  415. self._highlightNode_(_st(self._browserModel())._nextNode());
  416. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},smalltalk.HLDebuggerCodeWidget)})},
  417. messageSends: ["highlightNode:", "nextNode", "browserModel"]}),
  418. smalltalk.HLDebuggerCodeWidget);
  419. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts', 'interpreter'], 'Helios-Debugger');
  420. smalltalk.addMethod(
  421. smalltalk.method({
  422. selector: "contexts",
  423. fn: function (){
  424. var self=this;
  425. return smalltalk.withContext(function($ctx1) {
  426. var $1;
  427. $1=self["@contexts"];
  428. return $1;
  429. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  430. messageSends: []}),
  431. smalltalk.HLDebuggerModel);
  432. smalltalk.addMethod(
  433. smalltalk.method({
  434. selector: "currentContext",
  435. fn: function (){
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) {
  438. var $1,$2;
  439. $1=self["@currentContext"];
  440. if(($receiver = $1) == nil || $receiver == undefined){
  441. self._currentContext_(self._rootContext());
  442. } else {
  443. $1;
  444. };
  445. $2=self["@currentContext"];
  446. return $2;
  447. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  448. messageSends: ["ifNil:", "currentContext:", "rootContext"]}),
  449. smalltalk.HLDebuggerModel);
  450. smalltalk.addMethod(
  451. smalltalk.method({
  452. selector: "currentContext:",
  453. fn: function (aContext){
  454. var self=this;
  455. function $ASTDebugger(){return smalltalk.ASTDebugger||(typeof ASTDebugger=="undefined"?nil:ASTDebugger)}
  456. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  457. return smalltalk.withContext(function($ctx1) {
  458. var $1,$2;
  459. self._withChangesDo_((function(){
  460. return smalltalk.withContext(function($ctx2) {
  461. self._selectedMethod_(_st(aContext)._method());
  462. self["@currentContext"]=aContext;
  463. self["@currentContext"];
  464. self["@interpreter"]=_st($ASTDebugger())._context_(aContext);
  465. self["@interpreter"];
  466. $1=_st($HLDebuggerContextSelected())._new();
  467. _st($1)._context_(aContext);
  468. $2=_st($1)._yourself();
  469. return _st(self._announcer())._announce_($2);
  470. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  471. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  472. messageSends: ["withChangesDo:", "selectedMethod:", "method", "context:", "announce:", "new", "yourself", "announcer"]}),
  473. smalltalk.HLDebuggerModel);
  474. smalltalk.addMethod(
  475. smalltalk.method({
  476. selector: "initializeContexts",
  477. fn: function (){
  478. var self=this;
  479. var context;
  480. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  481. return smalltalk.withContext(function($ctx1) {
  482. self["@contexts"]=_st($OrderedCollection())._new();
  483. context=self._rootContext();
  484. _st((function(){
  485. return smalltalk.withContext(function($ctx2) {
  486. return _st(context)._notNil();
  487. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  488. return smalltalk.withContext(function($ctx2) {
  489. _st(self["@contexts"])._add_(context);
  490. context=_st(context)._outerContext();
  491. return context;
  492. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  493. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  494. messageSends: ["new", "rootContext", "whileTrue:", "add:", "outerContext", "notNil"]}),
  495. smalltalk.HLDebuggerModel);
  496. smalltalk.addMethod(
  497. smalltalk.method({
  498. selector: "initializeFromContext:",
  499. fn: function (aMethodContext){
  500. var self=this;
  501. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  502. return smalltalk.withContext(function($ctx1) {
  503. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  504. self._initializeContexts();
  505. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  506. messageSends: ["fromMethodContext:", "initializeContexts"]}),
  507. smalltalk.HLDebuggerModel);
  508. smalltalk.addMethod(
  509. smalltalk.method({
  510. selector: "interpreter",
  511. fn: function (){
  512. var self=this;
  513. return smalltalk.withContext(function($ctx1) {
  514. var $1;
  515. $1=self["@interpreter"];
  516. return $1;
  517. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.HLDebuggerModel)})},
  518. messageSends: []}),
  519. smalltalk.HLDebuggerModel);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "nextNode",
  523. fn: function (){
  524. var self=this;
  525. return smalltalk.withContext(function($ctx1) {
  526. var $1;
  527. $1=_st(self._interpreter())._nextNode();
  528. return $1;
  529. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.HLDebuggerModel)})},
  530. messageSends: ["nextNode", "interpreter"]}),
  531. smalltalk.HLDebuggerModel);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "rootContext",
  535. fn: function (){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx1) {
  538. var $1;
  539. $1=self["@rootContext"];
  540. return $1;
  541. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  542. messageSends: []}),
  543. smalltalk.HLDebuggerModel);
  544. smalltalk.addMethod(
  545. smalltalk.method({
  546. selector: "on:",
  547. fn: function (aMethodContext){
  548. var self=this;
  549. return smalltalk.withContext(function($ctx1) {
  550. var $2,$3,$1;
  551. $2=self._new();
  552. _st($2)._initializeFromContext_(aMethodContext);
  553. $3=_st($2)._yourself();
  554. $1=$3;
  555. return $1;
  556. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  557. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  558. smalltalk.HLDebuggerModel.klass);
  559. smalltalk.addClass('HLErrorHandler', smalltalk.ErrorHandler, [], 'Helios-Debugger');
  560. smalltalk.addMethod(
  561. smalltalk.method({
  562. selector: "handleError:",
  563. fn: function (anError){
  564. var self=this;
  565. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  566. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  567. function $HLDebugger(){return smalltalk.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  568. return smalltalk.withContext(function($ctx1) {
  569. self._onErrorHandled();
  570. _st((function(){
  571. return smalltalk.withContext(function($ctx2) {
  572. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  573. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  574. return smalltalk.withContext(function($ctx2) {
  575. return _st(_st($ErrorHandler())._new())._handleError_(error);
  576. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  577. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  578. messageSends: ["onErrorHandled", "on:do:", "handleError:", "new", "openAsTab", "on:", "context"]}),
  579. smalltalk.HLErrorHandler);
  580. smalltalk.addMethod(
  581. smalltalk.method({
  582. selector: "onErrorHandled",
  583. fn: function (){
  584. var self=this;
  585. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  586. return smalltalk.withContext(function($ctx1) {
  587. var $1,$2;
  588. $1=_st($HLProgressWidget())._default();
  589. _st($1)._flush();
  590. $2=_st($1)._remove();
  591. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},smalltalk.HLErrorHandler)})},
  592. messageSends: ["flush", "default", "remove"]}),
  593. smalltalk.HLErrorHandler);
  594. smalltalk.addMethod(
  595. smalltalk.method({
  596. selector: "handleError:",
  597. fn: function (anError){
  598. var self=this;
  599. return smalltalk.withContext(function($ctx1) {
  600. var $1;
  601. $1=_st(self._new())._handleError_(anError);
  602. return $1;
  603. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler.klass)})},
  604. messageSends: ["handleError:", "new"]}),
  605. smalltalk.HLErrorHandler.klass);
  606. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  607. smalltalk.addMethod(
  608. smalltalk.method({
  609. selector: "items",
  610. fn: function (){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) {
  613. var $2,$1;
  614. $2=self["@items"];
  615. if(($receiver = $2) == nil || $receiver == undefined){
  616. self["@items"]=_st(self._model())._contexts();
  617. $1=self["@items"];
  618. } else {
  619. $1=$2;
  620. };
  621. return $1;
  622. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  623. messageSends: ["ifNil:", "contexts", "model"]}),
  624. smalltalk.HLStackListWidget);
  625. smalltalk.addMethod(
  626. smalltalk.method({
  627. selector: "label",
  628. fn: function (){
  629. var self=this;
  630. return smalltalk.withContext(function($ctx1) {
  631. return "Call stack";
  632. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  633. messageSends: []}),
  634. smalltalk.HLStackListWidget);
  635. smalltalk.addMethod(
  636. smalltalk.method({
  637. selector: "selectItem:",
  638. fn: function (aContext){
  639. var self=this;
  640. return smalltalk.withContext(function($ctx1) {
  641. _st(self._model())._currentContext_(aContext);
  642. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  643. messageSends: ["currentContext:", "model"]}),
  644. smalltalk.HLStackListWidget);