Helios-Debugger.js 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  1. smalltalk.addPackage('Helios-Debugger');
  2. smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "context",
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) {
  10. var $1;
  11. $1=self["@context"];
  12. return $1;
  13. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.HLContextInspectorDecorator)})},
  14. args: [],
  15. source: "context\x0a\x09^ context",
  16. messageSends: [],
  17. referencedClasses: []
  18. }),
  19. smalltalk.HLContextInspectorDecorator);
  20. smalltalk.addMethod(
  21. smalltalk.method({
  22. selector: "initializeFromContext:",
  23. category: 'initialization',
  24. fn: function (aContext){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx1) {
  27. self["@context"]=aContext;
  28. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aContext:aContext},smalltalk.HLContextInspectorDecorator)})},
  29. args: ["aContext"],
  30. source: "initializeFromContext: aContext\x0a\x09context := aContext",
  31. messageSends: [],
  32. referencedClasses: []
  33. }),
  34. smalltalk.HLContextInspectorDecorator);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "inspectOn:",
  38. category: 'inspecting',
  39. fn: function (anInspector){
  40. var self=this;
  41. var variables,inspectedContext;
  42. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  43. return smalltalk.withContext(function($ctx1) {
  44. var $1,$2,$3;
  45. variables=_st($Dictionary())._new();
  46. inspectedContext=self._context();
  47. _st(variables)._addAll_(_st(inspectedContext)._locals());
  48. _st((function(){
  49. return smalltalk.withContext(function($ctx2) {
  50. return _st(_st(inspectedContext)._notNil())._and_((function(){
  51. return smalltalk.withContext(function($ctx3) {
  52. return _st(inspectedContext)._isBlockContext();
  53. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  54. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  55. return smalltalk.withContext(function($ctx2) {
  56. inspectedContext=_st(inspectedContext)._outerContext();
  57. inspectedContext;
  58. $1=inspectedContext;
  59. if(($receiver = $1) == nil || $receiver == undefined){
  60. return $1;
  61. } else {
  62. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  63. };
  64. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  65. $2=anInspector;
  66. _st($2)._setLabel_("Context");
  67. $3=_st($2)._setVariables_(variables);
  68. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
  69. args: ["anInspector"],
  70. source: "inspectOn: anInspector\x0a\x09| variables inspectedContext |\x0a\x09\x0a\x09variables := Dictionary new.\x0a\x09inspectedContext := self context.\x0a\x09\x0a\x09variables addAll: inspectedContext locals.\x0a\x09\x0a\x09[ inspectedContext notNil and: [ inspectedContext isBlockContext ] ] whileTrue: [\x0a\x09\x09inspectedContext := inspectedContext outerContext.\x0a\x09\x09inspectedContext ifNotNil: [\x0a\x09\x09\x09variables addAll: inspectedContext locals ] ].\x0a\x09\x0a\x09anInspector\x0a\x09\x09setLabel: 'Context';\x0a\x09\x09setVariables: variables",
  71. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "outerContext", "ifNotNil:", "and:", "isBlockContext", "notNil", "setLabel:", "setVariables:"],
  72. referencedClasses: ["Dictionary"]
  73. }),
  74. smalltalk.HLContextInspectorDecorator);
  75. smalltalk.addMethod(
  76. smalltalk.method({
  77. selector: "on:",
  78. category: 'instance creation',
  79. fn: function (aContext){
  80. var self=this;
  81. return smalltalk.withContext(function($ctx1) {
  82. var $2,$3,$1;
  83. $2=self._new();
  84. _st($2)._initializeFromContext_(aContext);
  85. $3=_st($2)._yourself();
  86. $1=$3;
  87. return $1;
  88. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},smalltalk.HLContextInspectorDecorator.klass)})},
  89. args: ["aContext"],
  90. source: "on: aContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aContext;\x0a\x09\x09yourself",
  91. messageSends: ["initializeFromContext:", "new", "yourself"],
  92. referencedClasses: []
  93. }),
  94. smalltalk.HLContextInspectorDecorator.klass);
  95. smalltalk.addClass('HLDebugger', smalltalk.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  96. smalltalk.HLDebugger.comment="I am the main widget for the Helios debugger.";
  97. smalltalk.addMethod(
  98. smalltalk.method({
  99. selector: "codeWidget",
  100. category: 'accessing',
  101. fn: function (){
  102. var self=this;
  103. function $HLDebuggerCodeWidget(){return smalltalk.HLDebuggerCodeWidget||(typeof HLDebuggerCodeWidget=="undefined"?nil:HLDebuggerCodeWidget)}
  104. return smalltalk.withContext(function($ctx1) {
  105. var $2,$3,$4,$1;
  106. $2=self["@codeWidget"];
  107. if(($receiver = $2) == nil || $receiver == undefined){
  108. $3=_st($HLDebuggerCodeWidget())._new();
  109. _st($3)._browserModel_(self._model());
  110. $4=_st($3)._yourself();
  111. self["@codeWidget"]=$4;
  112. $1=self["@codeWidget"];
  113. } else {
  114. $1=$2;
  115. };
  116. return $1;
  117. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLDebugger)})},
  118. args: [],
  119. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLDebuggerCodeWidget new\x0a\x09\x09browserModel: self model;\x0a\x09\x09yourself ]",
  120. messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"],
  121. referencedClasses: ["HLDebuggerCodeWidget"]
  122. }),
  123. smalltalk.HLDebugger);
  124. smalltalk.addMethod(
  125. smalltalk.method({
  126. selector: "focus",
  127. category: 'actions',
  128. fn: function (){
  129. var self=this;
  130. return smalltalk.withContext(function($ctx1) {
  131. _st(self._stackListWidget())._focus();
  132. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLDebugger)})},
  133. args: [],
  134. source: "focus\x0a\x09self stackListWidget focus",
  135. messageSends: ["focus", "stackListWidget"],
  136. referencedClasses: []
  137. }),
  138. smalltalk.HLDebugger);
  139. smalltalk.addMethod(
  140. smalltalk.method({
  141. selector: "initializeFromMethodContext:",
  142. category: 'accessing',
  143. fn: function (aMethodContext){
  144. var self=this;
  145. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  146. return smalltalk.withContext(function($ctx1) {
  147. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  148. self._observeModel();
  149. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.HLDebugger)})},
  150. args: ["aMethodContext"],
  151. source: "initializeFromMethodContext: aMethodContext\x0a\x09model := HLDebuggerModel on: aMethodContext.\x0a\x09self observeModel",
  152. messageSends: ["on:", "observeModel"],
  153. referencedClasses: ["HLDebuggerModel"]
  154. }),
  155. smalltalk.HLDebugger);
  156. smalltalk.addMethod(
  157. smalltalk.method({
  158. selector: "inspectorWidget",
  159. category: 'accessing',
  160. fn: function (){
  161. var self=this;
  162. function $HLInspectorWidget(){return smalltalk.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  163. return smalltalk.withContext(function($ctx1) {
  164. var $2,$1;
  165. $2=self["@inspectorWidget"];
  166. if(($receiver = $2) == nil || $receiver == undefined){
  167. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  168. $1=self["@inspectorWidget"];
  169. } else {
  170. $1=$2;
  171. };
  172. return $1;
  173. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},smalltalk.HLDebugger)})},
  174. args: [],
  175. source: "inspectorWidget\x0a\x09^ inspectorWidget ifNil: [ \x0a\x09\x09inspectorWidget := HLInspectorWidget new ]",
  176. messageSends: ["ifNil:", "new"],
  177. referencedClasses: ["HLInspectorWidget"]
  178. }),
  179. smalltalk.HLDebugger);
  180. smalltalk.addMethod(
  181. smalltalk.method({
  182. selector: "model",
  183. category: 'accessing',
  184. fn: function (){
  185. var self=this;
  186. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  187. return smalltalk.withContext(function($ctx1) {
  188. var $2,$1;
  189. $2=self["@model"];
  190. if(($receiver = $2) == nil || $receiver == undefined){
  191. self["@model"]=_st($HLDebuggerModel())._new();
  192. $1=self["@model"];
  193. } else {
  194. $1=$2;
  195. };
  196. return $1;
  197. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLDebugger)})},
  198. args: [],
  199. source: "model\x0a\x09^ model ifNil: [ model := HLDebuggerModel new ]",
  200. messageSends: ["ifNil:", "new"],
  201. referencedClasses: ["HLDebuggerModel"]
  202. }),
  203. smalltalk.HLDebugger);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "observeModel",
  207. category: 'actions',
  208. fn: function (){
  209. var self=this;
  210. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  211. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  212. return smalltalk.withContext(function($ctx1) {
  213. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  214. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected:",self);
  215. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
  216. args: [],
  217. source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self",
  218. messageSends: ["on:send:to:", "announcer", "model"],
  219. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped"]
  220. }),
  221. smalltalk.HLDebugger);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "onContextSelected:",
  225. category: 'reactions',
  226. fn: function (anAnnouncement){
  227. var self=this;
  228. function $HLContextInspectorDecorator(){return smalltalk.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  229. return smalltalk.withContext(function($ctx1) {
  230. _st(self._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  231. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDebugger)})},
  232. args: ["anAnnouncement"],
  233. source: "onContextSelected: anAnnouncement\x0a\x09self inspectorWidget inspect: (HLContextInspectorDecorator on: anAnnouncement context)",
  234. messageSends: ["inspect:", "on:", "context", "inspectorWidget"],
  235. referencedClasses: ["HLContextInspectorDecorator"]
  236. }),
  237. smalltalk.HLDebugger);
  238. smalltalk.addMethod(
  239. smalltalk.method({
  240. selector: "registerBindingsOn:",
  241. category: 'keybindings',
  242. fn: function (aBindingGroup){
  243. var self=this;
  244. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  245. return smalltalk.withContext(function($ctx1) {
  246. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model());
  247. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLDebugger)})},
  248. args: ["aBindingGroup"],
  249. source: "registerBindingsOn: aBindingGroup\x0a\x09HLToolCommand \x0a\x09\x09registerConcreteClassesOn: aBindingGroup \x0a\x09\x09for: self model",
  250. messageSends: ["registerConcreteClassesOn:for:", "model"],
  251. referencedClasses: ["HLToolCommand"]
  252. }),
  253. smalltalk.HLDebugger);
  254. smalltalk.addMethod(
  255. smalltalk.method({
  256. selector: "renderContentOn:",
  257. category: 'rendering',
  258. fn: function (html){
  259. var self=this;
  260. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  261. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  262. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  263. return smalltalk.withContext(function($ctx1) {
  264. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._stackListWidget(),_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget()))));
  265. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  266. args: ["html"],
  267. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self stackListWidget\x0a\x09\x09with: (HLVerticalSplitter\x0a\x09\x09\x09with: self codeWidget\x0a\x09\x09\x09with: self inspectorWidget)))",
  268. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"],
  269. referencedClasses: ["HLVerticalSplitter", "HLHorizontalSplitter", "HLContainer"]
  270. }),
  271. smalltalk.HLDebugger);
  272. smalltalk.addMethod(
  273. smalltalk.method({
  274. selector: "stackListWidget",
  275. category: 'accessing',
  276. fn: function (){
  277. var self=this;
  278. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  279. return smalltalk.withContext(function($ctx1) {
  280. var $2,$3,$4,$1;
  281. $2=self["@stackListWidget"];
  282. if(($receiver = $2) == nil || $receiver == undefined){
  283. $3=_st($HLStackListWidget())._on_(self._model());
  284. _st($3)._next_(self._codeWidget());
  285. $4=_st($3)._yourself();
  286. self["@stackListWidget"]=$4;
  287. $1=self["@stackListWidget"];
  288. } else {
  289. $1=$2;
  290. };
  291. return $1;
  292. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  293. args: [],
  294. source: "stackListWidget\x0a\x09^ stackListWidget ifNil: [ \x0a\x09\x09stackListWidget := (HLStackListWidget on: self model)\x0a\x09\x09\x09next: self codeWidget;\x0a\x09\x09\x09yourself ]",
  295. messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"],
  296. referencedClasses: ["HLStackListWidget"]
  297. }),
  298. smalltalk.HLDebugger);
  299. smalltalk.addMethod(
  300. smalltalk.method({
  301. selector: "unregister",
  302. category: 'actions',
  303. fn: function (){
  304. var self=this;
  305. return smalltalk.withContext(function($ctx1) {
  306. smalltalk.HLFocusableWidget.fn.prototype._unregister.apply(_st(self), []);
  307. _st(self._inspectorWidget())._unregister();
  308. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
  309. args: [],
  310. source: "unregister\x0a\x09super unregister.\x0a\x09self inspectorWidget unregister",
  311. messageSends: ["unregister", "inspectorWidget"],
  312. referencedClasses: []
  313. }),
  314. smalltalk.HLDebugger);
  315. smalltalk.addMethod(
  316. smalltalk.method({
  317. selector: "on:",
  318. category: 'instance creation',
  319. fn: function (aMethodContext){
  320. var self=this;
  321. return smalltalk.withContext(function($ctx1) {
  322. var $2,$3,$1;
  323. $2=self._new();
  324. _st($2)._initializeFromMethodContext_(aMethodContext);
  325. $3=_st($2)._yourself();
  326. $1=$3;
  327. return $1;
  328. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebugger.klass)})},
  329. args: ["aMethodContext"],
  330. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  331. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  332. referencedClasses: []
  333. }),
  334. smalltalk.HLDebugger.klass);
  335. smalltalk.addMethod(
  336. smalltalk.method({
  337. selector: "tabClass",
  338. category: 'accessing',
  339. fn: function (){
  340. var self=this;
  341. return smalltalk.withContext(function($ctx1) {
  342. return "debugger";
  343. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLDebugger.klass)})},
  344. args: [],
  345. source: "tabClass\x0a\x09^ 'debugger'",
  346. messageSends: [],
  347. referencedClasses: []
  348. }),
  349. smalltalk.HLDebugger.klass);
  350. smalltalk.addMethod(
  351. smalltalk.method({
  352. selector: "tabLabel",
  353. category: 'accessing',
  354. fn: function (){
  355. var self=this;
  356. return smalltalk.withContext(function($ctx1) {
  357. return "Debugger";
  358. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLDebugger.klass)})},
  359. args: [],
  360. source: "tabLabel\x0a\x09^ 'Debugger'",
  361. messageSends: [],
  362. referencedClasses: []
  363. }),
  364. smalltalk.HLDebugger.klass);
  365. smalltalk.addClass('HLDebuggerCodeWidget', smalltalk.HLBrowserCodeWidget, ['highlightedNode'], 'Helios-Debugger');
  366. smalltalk.addMethod(
  367. smalltalk.method({
  368. selector: "addStopAt:",
  369. category: 'actions',
  370. fn: function (anInteger){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) {
  373. _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st("<div class=\x22stop\x22></stop>"._asJQuery())._toArray())._first());
  374. return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  375. args: ["anInteger"],
  376. source: "addStopAt: anInteger\x0a\x09editor\x0a\x09\x09setGutterMarker: anInteger\x0a\x09\x09gutter: 'stops'\x0a\x09\x09value: '<div class=\x22stop\x22></stop>' asJQuery toArray first",
  377. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"],
  378. referencedClasses: []
  379. }),
  380. smalltalk.HLDebuggerCodeWidget);
  381. smalltalk.addMethod(
  382. smalltalk.method({
  383. selector: "clearHighlight",
  384. category: 'actions',
  385. fn: function (){
  386. var self=this;
  387. return smalltalk.withContext(function($ctx1) {
  388. var $1;
  389. _st(self["@editor"])._clearGutter_("stops");
  390. $1=self._highlightedNode();
  391. if(($receiver = $1) == nil || $receiver == undefined){
  392. $1;
  393. } else {
  394. var node;
  395. node=$receiver;
  396. _st(self["@editor"])._removeLineClass_where_class_(_st(_st(_st(node)._position())._x()).__minus((1)),"background","highlighted");
  397. };
  398. return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},smalltalk.HLDebuggerCodeWidget)})},
  399. args: [],
  400. source: "clearHighlight\x0a\x09editor clearGutter: 'stops'.\x0a\x09self highlightedNode ifNotNil: [ :node |\x0a\x09\x09editor \x0a\x09\x09\x09removeLineClass: node position x - 1\x0a\x09\x09\x09where: 'background'\x0a\x09\x09\x09class: 'highlighted' ]",
  401. messageSends: ["clearGutter:", "ifNotNil:", "removeLineClass:where:class:", "-", "x", "position", "highlightedNode"],
  402. referencedClasses: []
  403. }),
  404. smalltalk.HLDebuggerCodeWidget);
  405. smalltalk.addMethod(
  406. smalltalk.method({
  407. selector: "contents:",
  408. category: 'accessing',
  409. fn: function (aString){
  410. var self=this;
  411. return smalltalk.withContext(function($ctx1) {
  412. self._clearHighlight();
  413. smalltalk.HLBrowserCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  414. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLDebuggerCodeWidget)})},
  415. args: ["aString"],
  416. source: "contents: aString\x0a\x09self clearHighlight.\x0a\x09super contents: aString",
  417. messageSends: ["clearHighlight", "contents:"],
  418. referencedClasses: []
  419. }),
  420. smalltalk.HLDebuggerCodeWidget);
  421. smalltalk.addMethod(
  422. smalltalk.method({
  423. selector: "editorOptions",
  424. category: 'accessing',
  425. fn: function (){
  426. var self=this;
  427. return smalltalk.withContext(function($ctx1) {
  428. var $2,$3,$1;
  429. $2=smalltalk.HLBrowserCodeWidget.fn.prototype._editorOptions.apply(_st(self), []);
  430. _st($2)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  431. $3=_st($2)._yourself();
  432. $1=$3;
  433. return $1;
  434. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},smalltalk.HLDebuggerCodeWidget)})},
  435. args: [],
  436. source: "editorOptions\x0a\x09^ super editorOptions\x0a\x09\x09at: 'gutters' put: #('CodeMirror-linenumbers' 'stops');\x0a\x09\x09yourself",
  437. messageSends: ["at:put:", "editorOptions", "yourself"],
  438. referencedClasses: []
  439. }),
  440. smalltalk.HLDebuggerCodeWidget);
  441. smalltalk.addMethod(
  442. smalltalk.method({
  443. selector: "highlight",
  444. category: 'actions',
  445. fn: function (){
  446. var self=this;
  447. var anchor,head,selection;
  448. return smalltalk.withContext(function($ctx1) {
  449. head=smalltalk.HashedCollection._fromPairs_(["line".__minus_gt(_st(_st(_st(self._highlightedNode())._position())._x()).__minus((1))),"ch".__minus_gt(_st(_st(_st(self._highlightedNode())._position())._y()).__minus((1)))]);
  450. anchor=smalltalk.HashedCollection._fromPairs_(["line".__minus_gt(_st(_st(_st(self._highlightedNode())._extent())._x()).__minus((1))),"ch".__minus_gt(_st(_st(_st(self._highlightedNode())._extent())._y()).__minus((1)))]);
  451. _st(self["@editor"])._setSelection_to_(head,anchor);
  452. return self}, function($ctx1) {$ctx1.fill(self,"highlight",{anchor:anchor,head:head,selection:selection},smalltalk.HLDebuggerCodeWidget)})},
  453. args: [],
  454. source: "highlight\x0a\x09| anchor head selection |\x0a\x09\x0a\x09head := #{\x0a\x09\x09'line' -> (self highlightedNode position x - 1).\x0a\x09\x09'ch' -> (self highlightedNode position y - 1)\x0a\x09}.\x0a\x09\x0a\x09anchor := #{\x0a\x09\x09'line' -> (self highlightedNode extent x - 1).\x0a\x09\x09'ch' -> (self highlightedNode extent y - 1)\x0a\x09}.\x0a\x09\x0a\x09editor setSelection: head to: anchor",
  455. messageSends: ["->", "-", "x", "position", "highlightedNode", "y", "extent", "setSelection:to:"],
  456. referencedClasses: []
  457. }),
  458. smalltalk.HLDebuggerCodeWidget);
  459. smalltalk.addMethod(
  460. smalltalk.method({
  461. selector: "highlightLine:",
  462. category: 'actions',
  463. fn: function (anInteger){
  464. var self=this;
  465. return smalltalk.withContext(function($ctx1) {
  466. _st(self["@editor"])._addLineClass_where_class_(anInteger,"background","highlighted");
  467. return self}, function($ctx1) {$ctx1.fill(self,"highlightLine:",{anInteger:anInteger},smalltalk.HLDebuggerCodeWidget)})},
  468. args: ["anInteger"],
  469. source: "highlightLine: anInteger\x0a\x09editor \x0a\x09\x09addLineClass: anInteger\x0a\x09\x09where: 'background'\x0a\x09\x09class: 'highlighted'",
  470. messageSends: ["addLineClass:where:class:"],
  471. referencedClasses: []
  472. }),
  473. smalltalk.HLDebuggerCodeWidget);
  474. smalltalk.addMethod(
  475. smalltalk.method({
  476. selector: "highlightNode:",
  477. category: 'actions',
  478. fn: function (aNode){
  479. var self=this;
  480. var line;
  481. return smalltalk.withContext(function($ctx1) {
  482. var $1,$2,$3;
  483. $1=aNode;
  484. if(($receiver = $1) == nil || $receiver == undefined){
  485. $1;
  486. } else {
  487. line=_st(_st(_st(aNode)._position())._x()).__minus((1));
  488. line;
  489. $2=self;
  490. _st($2)._clearHighlight();
  491. _st($2)._addStopAt_(line);
  492. _st($2)._highlightLine_(line);
  493. $3=_st($2)._highlightedNode_(aNode);
  494. $3;
  495. };
  496. return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,line:line},smalltalk.HLDebuggerCodeWidget)})},
  497. args: ["aNode"],
  498. source: "highlightNode: aNode\x0a\x09| line |\x0a\x09aNode ifNotNil: [\x0a\x09\x09line := aNode position x - 1.\x0a\x09\x09self \x0a\x09\x09\x09clearHighlight; \x0a\x09\x09\x09addStopAt: line;\x0a\x09\x09\x09highlightLine: line;\x0a\x09\x09\x09highlightedNode: aNode\x0a\x09\x09]",
  499. messageSends: ["ifNotNil:", "-", "x", "position", "clearHighlight", "addStopAt:", "highlightLine:", "highlightedNode:"],
  500. referencedClasses: []
  501. }),
  502. smalltalk.HLDebuggerCodeWidget);
  503. smalltalk.addMethod(
  504. smalltalk.method({
  505. selector: "highlightedNode",
  506. category: 'accessing',
  507. fn: function (){
  508. var self=this;
  509. return smalltalk.withContext(function($ctx1) {
  510. var $1;
  511. $1=self["@highlightedNode"];
  512. return $1;
  513. }, function($ctx1) {$ctx1.fill(self,"highlightedNode",{},smalltalk.HLDebuggerCodeWidget)})},
  514. args: [],
  515. source: "highlightedNode\x0a\x09^ highlightedNode",
  516. messageSends: [],
  517. referencedClasses: []
  518. }),
  519. smalltalk.HLDebuggerCodeWidget);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "highlightedNode:",
  523. category: 'accessing',
  524. fn: function (aNode){
  525. var self=this;
  526. return smalltalk.withContext(function($ctx1) {
  527. self["@highlightedNode"]=aNode;
  528. return self}, function($ctx1) {$ctx1.fill(self,"highlightedNode:",{aNode:aNode},smalltalk.HLDebuggerCodeWidget)})},
  529. args: ["aNode"],
  530. source: "highlightedNode: aNode\x0a\x09highlightedNode := aNode",
  531. messageSends: [],
  532. referencedClasses: []
  533. }),
  534. smalltalk.HLDebuggerCodeWidget);
  535. smalltalk.addMethod(
  536. smalltalk.method({
  537. selector: "observeBrowserModel",
  538. category: 'actions',
  539. fn: function (){
  540. var self=this;
  541. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  542. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  543. return smalltalk.withContext(function($ctx1) {
  544. smalltalk.HLBrowserCodeWidget.fn.prototype._observeBrowserModel.apply(_st(self), []);
  545. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  546. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
  547. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLDebuggerCodeWidget)})},
  548. args: [],
  549. source: "observeBrowserModel\x0a\x09super observeBrowserModel.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self",
  550. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"],
  551. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped"]
  552. }),
  553. smalltalk.HLDebuggerCodeWidget);
  554. smalltalk.addMethod(
  555. smalltalk.method({
  556. selector: "onContextSelected",
  557. category: 'reactions',
  558. fn: function (){
  559. var self=this;
  560. return smalltalk.withContext(function($ctx1) {
  561. self._highlightNode_(_st(self._browserModel())._nextNode());
  562. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},smalltalk.HLDebuggerCodeWidget)})},
  563. args: [],
  564. source: "onContextSelected\x0a\x09self highlightNode: self browserModel nextNode",
  565. messageSends: ["highlightNode:", "nextNode", "browserModel"],
  566. referencedClasses: []
  567. }),
  568. smalltalk.HLDebuggerCodeWidget);
  569. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  570. smalltalk.HLDebuggerModel.comment="I am a model for Helios debugging.\x0a\x0aMy instances hold a reference to an `AIContext` instance, built from a `MethodContext`. The context should be the root of the context stack.";
  571. smalltalk.addMethod(
  572. smalltalk.method({
  573. selector: "contexts",
  574. category: 'accessing',
  575. fn: function (){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) {
  578. var $1;
  579. $1=self["@contexts"];
  580. return $1;
  581. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  582. args: [],
  583. source: "contexts\x0a\x09^ contexts",
  584. messageSends: [],
  585. referencedClasses: []
  586. }),
  587. smalltalk.HLDebuggerModel);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "currentContext",
  591. category: 'accessing',
  592. fn: function (){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx1) {
  595. var $1,$2;
  596. $1=self["@currentContext"];
  597. if(($receiver = $1) == nil || $receiver == undefined){
  598. self._currentContext_(self._rootContext());
  599. } else {
  600. $1;
  601. };
  602. $2=self["@currentContext"];
  603. return $2;
  604. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  605. args: [],
  606. source: "currentContext\x0a\x09currentContext ifNil: [ self currentContext: self rootContext ].\x0a\x09^ currentContext",
  607. messageSends: ["ifNil:", "currentContext:", "rootContext"],
  608. referencedClasses: []
  609. }),
  610. smalltalk.HLDebuggerModel);
  611. smalltalk.addMethod(
  612. smalltalk.method({
  613. selector: "currentContext:",
  614. category: 'accessing',
  615. fn: function (aContext){
  616. var self=this;
  617. function $ASTDebugger(){return smalltalk.ASTDebugger||(typeof ASTDebugger=="undefined"?nil:ASTDebugger)}
  618. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  619. return smalltalk.withContext(function($ctx1) {
  620. var $1,$2;
  621. self._withChangesDo_((function(){
  622. return smalltalk.withContext(function($ctx2) {
  623. self._selectedMethod_(_st(aContext)._method());
  624. self["@currentContext"]=aContext;
  625. self["@currentContext"];
  626. self["@interpreter"]=_st($ASTDebugger())._context_(aContext);
  627. self["@interpreter"];
  628. $1=_st($HLDebuggerContextSelected())._new();
  629. _st($1)._context_(aContext);
  630. $2=_st($1)._yourself();
  631. return _st(self._announcer())._announce_($2);
  632. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  633. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  634. args: ["aContext"],
  635. source: "currentContext: aContext\x0a\x09self withChangesDo: [ \x0a\x09\x09self selectedMethod: aContext method.\x0a\x09\x09currentContext := aContext.\x0a\x09\x09interpreter := ASTDebugger context: aContext.\x0a\x09\x09self announcer announce: (HLDebuggerContextSelected new\x0a\x09\x09\x09context: aContext;\x0a\x09\x09\x09yourself) ]",
  636. messageSends: ["withChangesDo:", "selectedMethod:", "method", "context:", "announce:", "new", "yourself", "announcer"],
  637. referencedClasses: ["ASTDebugger", "HLDebuggerContextSelected"]
  638. }),
  639. smalltalk.HLDebuggerModel);
  640. smalltalk.addMethod(
  641. smalltalk.method({
  642. selector: "initializeContexts",
  643. category: 'initialization',
  644. fn: function (){
  645. var self=this;
  646. var context;
  647. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  648. return smalltalk.withContext(function($ctx1) {
  649. self["@contexts"]=_st($OrderedCollection())._new();
  650. context=self._rootContext();
  651. _st((function(){
  652. return smalltalk.withContext(function($ctx2) {
  653. return _st(context)._notNil();
  654. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  655. return smalltalk.withContext(function($ctx2) {
  656. _st(self["@contexts"])._add_(context);
  657. context=_st(context)._outerContext();
  658. return context;
  659. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  660. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  661. args: [],
  662. source: "initializeContexts\x0a\x09\x22Flatten the context stack into an OrderedCollection\x22\x0a\x09\x0a\x09| context |\x0a\x09\x0a\x09contexts := OrderedCollection new.\x0a\x09context := self rootContext.\x0a\x09\x0a\x09[ context notNil ] whileTrue: [\x0a\x09\x09contexts add: context.\x0a\x09\x09context := context outerContext ]",
  663. messageSends: ["new", "rootContext", "whileTrue:", "add:", "outerContext", "notNil"],
  664. referencedClasses: ["OrderedCollection"]
  665. }),
  666. smalltalk.HLDebuggerModel);
  667. smalltalk.addMethod(
  668. smalltalk.method({
  669. selector: "initializeFromContext:",
  670. category: 'initialization',
  671. fn: function (aMethodContext){
  672. var self=this;
  673. return smalltalk.withContext(function($ctx1) {
  674. self["@rootContext"]=_st(aMethodContext)._aiContext();
  675. self._initializeContexts();
  676. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  677. args: ["aMethodContext"],
  678. source: "initializeFromContext: aMethodContext\x0a\x09rootContext := aMethodContext aiContext.\x0a\x09self initializeContexts",
  679. messageSends: ["aiContext", "initializeContexts"],
  680. referencedClasses: []
  681. }),
  682. smalltalk.HLDebuggerModel);
  683. smalltalk.addMethod(
  684. smalltalk.method({
  685. selector: "interpreter",
  686. category: 'accessing',
  687. fn: function (){
  688. var self=this;
  689. return smalltalk.withContext(function($ctx1) {
  690. var $1;
  691. $1=_st(self._currentContext())._interpreter();
  692. return $1;
  693. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.HLDebuggerModel)})},
  694. args: [],
  695. source: "interpreter\x0a\x09^ self currentContext interpreter",
  696. messageSends: ["interpreter", "currentContext"],
  697. referencedClasses: []
  698. }),
  699. smalltalk.HLDebuggerModel);
  700. smalltalk.addMethod(
  701. smalltalk.method({
  702. selector: "nextNode",
  703. category: 'accessing',
  704. fn: function (){
  705. var self=this;
  706. return smalltalk.withContext(function($ctx1) {
  707. var $1;
  708. $1=_st(self._interpreter())._node();
  709. return $1;
  710. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.HLDebuggerModel)})},
  711. args: [],
  712. source: "nextNode\x0a\x09^ self interpreter node",
  713. messageSends: ["node", "interpreter"],
  714. referencedClasses: []
  715. }),
  716. smalltalk.HLDebuggerModel);
  717. smalltalk.addMethod(
  718. smalltalk.method({
  719. selector: "restart",
  720. category: 'actions',
  721. fn: function (){
  722. var self=this;
  723. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  724. return smalltalk.withContext(function($ctx1) {
  725. var $1,$2;
  726. _st(self._interpreter())._restart();
  727. $1=_st($HLDebuggerStepped())._new();
  728. _st($1)._context_(self._currentContext());
  729. $2=_st($1)._yourself();
  730. _st(self._announcer())._announce_($2);
  731. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLDebuggerModel)})},
  732. args: [],
  733. source: "restart\x0a\x09self interpreter restart.\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  734. messageSends: ["restart", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  735. referencedClasses: ["HLDebuggerStepped"]
  736. }),
  737. smalltalk.HLDebuggerModel);
  738. smalltalk.addMethod(
  739. smalltalk.method({
  740. selector: "rootContext",
  741. category: 'accessing',
  742. fn: function (){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) {
  745. var $1;
  746. $1=self["@rootContext"];
  747. return $1;
  748. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  749. args: [],
  750. source: "rootContext\x0a\x09^ rootContext",
  751. messageSends: [],
  752. referencedClasses: []
  753. }),
  754. smalltalk.HLDebuggerModel);
  755. smalltalk.addMethod(
  756. smalltalk.method({
  757. selector: "stepOver",
  758. category: 'actions',
  759. fn: function (){
  760. var self=this;
  761. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  762. return smalltalk.withContext(function($ctx1) {
  763. var $1,$2;
  764. _st(self._interpreter())._stepOver();
  765. $1=_st($HLDebuggerStepped())._new();
  766. _st($1)._context_(self._currentContext());
  767. $2=_st($1)._yourself();
  768. _st(self._announcer())._announce_($2);
  769. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLDebuggerModel)})},
  770. args: [],
  771. source: "stepOver\x0a\x09self interpreter stepOver.\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  772. messageSends: ["stepOver", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
  773. referencedClasses: ["HLDebuggerStepped"]
  774. }),
  775. smalltalk.HLDebuggerModel);
  776. smalltalk.addMethod(
  777. smalltalk.method({
  778. selector: "on:",
  779. category: 'instance creation',
  780. fn: function (aMethodContext){
  781. var self=this;
  782. return smalltalk.withContext(function($ctx1) {
  783. var $2,$3,$1;
  784. $2=self._new();
  785. _st($2)._initializeFromContext_(aMethodContext);
  786. $3=_st($2)._yourself();
  787. $1=$3;
  788. return $1;
  789. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  790. args: ["aMethodContext"],
  791. source: "on: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aMethodContext;\x0a\x09\x09yourself",
  792. messageSends: ["initializeFromContext:", "new", "yourself"],
  793. referencedClasses: []
  794. }),
  795. smalltalk.HLDebuggerModel.klass);
  796. smalltalk.addClass('HLErrorHandler', smalltalk.ErrorHandler, [], 'Helios-Debugger');
  797. smalltalk.addMethod(
  798. smalltalk.method({
  799. selector: "handleError:",
  800. category: 'error handling',
  801. fn: function (anError){
  802. var self=this;
  803. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  804. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  805. function $HLDebugger(){return smalltalk.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  806. return smalltalk.withContext(function($ctx1) {
  807. self._onErrorHandled();
  808. _st((function(){
  809. return smalltalk.withContext(function($ctx2) {
  810. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  811. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  812. return smalltalk.withContext(function($ctx2) {
  813. return _st(_st($ErrorHandler())._new())._handleError_(error);
  814. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  815. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  816. args: ["anError"],
  817. source: "handleError: anError\x0a\x09self onErrorHandled.\x0a\x0a\x09[ \x0a\x09\x09(HLDebugger on: anError context) openAsTab \x0a\x09] \x0a\x09\x09on: Error \x0a\x09\x09do: [ :error | ErrorHandler new handleError: error ]",
  818. messageSends: ["onErrorHandled", "on:do:", "handleError:", "new", "openAsTab", "on:", "context"],
  819. referencedClasses: ["Error", "ErrorHandler", "HLDebugger"]
  820. }),
  821. smalltalk.HLErrorHandler);
  822. smalltalk.addMethod(
  823. smalltalk.method({
  824. selector: "onErrorHandled",
  825. category: 'error handling',
  826. fn: function (){
  827. var self=this;
  828. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  829. return smalltalk.withContext(function($ctx1) {
  830. var $1,$2;
  831. $1=_st($HLProgressWidget())._default();
  832. _st($1)._flush();
  833. $2=_st($1)._remove();
  834. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},smalltalk.HLErrorHandler)})},
  835. args: [],
  836. source: "onErrorHandled\x0a\x09\x22when an error is handled, we need to make sure that\x0a\x09any progress bar widget gets removed. Because HLProgressBarWidget is asynchronous,\x0a\x09it has to be done here.\x22\x0a\x09\x0a\x09HLProgressWidget default \x0a\x09\x09flush; \x0a\x09\x09remove",
  837. messageSends: ["flush", "default", "remove"],
  838. referencedClasses: ["HLProgressWidget"]
  839. }),
  840. smalltalk.HLErrorHandler);
  841. smalltalk.addMethod(
  842. smalltalk.method({
  843. selector: "handleError:",
  844. category: 'error handling',
  845. fn: function (anError){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx1) {
  848. var $1;
  849. $1=_st(self._new())._handleError_(anError);
  850. return $1;
  851. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler.klass)})},
  852. args: ["anError"],
  853. source: "handleError: anError\x0a\x09^ self new handleError: anError",
  854. messageSends: ["handleError:", "new"],
  855. referencedClasses: []
  856. }),
  857. smalltalk.HLErrorHandler.klass);
  858. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  859. smalltalk.addMethod(
  860. smalltalk.method({
  861. selector: "items",
  862. category: 'accessing',
  863. fn: function (){
  864. var self=this;
  865. return smalltalk.withContext(function($ctx1) {
  866. var $2,$1;
  867. $2=self["@items"];
  868. if(($receiver = $2) == nil || $receiver == undefined){
  869. self["@items"]=_st(self._model())._contexts();
  870. $1=self["@items"];
  871. } else {
  872. $1=$2;
  873. };
  874. return $1;
  875. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  876. args: [],
  877. source: "items\x0a\x09^ items ifNil: [ items := self model contexts ]",
  878. messageSends: ["ifNil:", "contexts", "model"],
  879. referencedClasses: []
  880. }),
  881. smalltalk.HLStackListWidget);
  882. smalltalk.addMethod(
  883. smalltalk.method({
  884. selector: "label",
  885. category: 'accessing',
  886. fn: function (){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) {
  889. return "Call stack";
  890. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  891. args: [],
  892. source: "label\x0a\x09^ 'Call stack'",
  893. messageSends: [],
  894. referencedClasses: []
  895. }),
  896. smalltalk.HLStackListWidget);
  897. smalltalk.addMethod(
  898. smalltalk.method({
  899. selector: "renderButtonsOn:",
  900. category: 'rendering',
  901. fn: function (html){
  902. var self=this;
  903. return smalltalk.withContext(function($ctx1) {
  904. var $1,$3,$4,$5,$6,$2;
  905. $1=_st(html)._div();
  906. _st($1)._class_("debugger_bar");
  907. $2=_st($1)._with_((function(){
  908. return smalltalk.withContext(function($ctx2) {
  909. $3=_st(html)._button();
  910. _st($3)._class_("btn restart");
  911. _st($3)._with_("Restart");
  912. $4=_st($3)._onClick_((function(){
  913. return smalltalk.withContext(function($ctx3) {
  914. return self._restart();
  915. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  916. $4;
  917. $5=_st(html)._button();
  918. _st($5)._class_("btn stepOver");
  919. _st($5)._with_("Step over");
  920. $6=_st($5)._onClick_((function(){
  921. return smalltalk.withContext(function($ctx3) {
  922. return self._stepOver();
  923. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  924. return $6;
  925. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  926. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLStackListWidget)})},
  927. args: ["html"],
  928. source: "renderButtonsOn: html\x0a\x09html div \x0a\x09\x09class: 'debugger_bar'; \x0a\x09\x09with: [\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn restart';\x0a\x09\x09\x09\x09with: 'Restart';\x0a\x09\x09\x09\x09onClick: [ self restart ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn stepOver';\x0a\x09\x09\x09\x09with: 'Step over';\x0a\x09\x09\x09\x09onClick: [ self stepOver ] ]",
  929. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "stepOver"],
  930. referencedClasses: []
  931. }),
  932. smalltalk.HLStackListWidget);
  933. smalltalk.addMethod(
  934. smalltalk.method({
  935. selector: "restart",
  936. category: 'actions',
  937. fn: function (){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx1) {
  940. _st(self._model())._restart();
  941. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLStackListWidget)})},
  942. args: [],
  943. source: "restart\x0a\x09self model restart",
  944. messageSends: ["restart", "model"],
  945. referencedClasses: []
  946. }),
  947. smalltalk.HLStackListWidget);
  948. smalltalk.addMethod(
  949. smalltalk.method({
  950. selector: "selectItem:",
  951. category: 'actions',
  952. fn: function (aContext){
  953. var self=this;
  954. return smalltalk.withContext(function($ctx1) {
  955. _st(self._model())._currentContext_(aContext);
  956. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  957. args: ["aContext"],
  958. source: "selectItem: aContext\x0a \x09self model currentContext: aContext",
  959. messageSends: ["currentContext:", "model"],
  960. referencedClasses: []
  961. }),
  962. smalltalk.HLStackListWidget);
  963. smalltalk.addMethod(
  964. smalltalk.method({
  965. selector: "stepOver",
  966. category: 'actions',
  967. fn: function (){
  968. var self=this;
  969. return smalltalk.withContext(function($ctx1) {
  970. _st(self._model())._stepOver();
  971. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLStackListWidget)})},
  972. args: [],
  973. source: "stepOver\x0a\x09self model stepOver",
  974. messageSends: ["stepOver", "model"],
  975. referencedClasses: []
  976. }),
  977. smalltalk.HLStackListWidget);