Helios-Debugger.deploy.js 25 KB

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