Helios-Debugger.deploy.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. define("amber/Helios-Debugger", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Helios-Debugger');
  3. smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "context",
  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. messageSends: []}),
  15. smalltalk.HLContextInspectorDecorator);
  16. smalltalk.addMethod(
  17. smalltalk.method({
  18. selector: "initializeFromContext:",
  19. fn: function (aContext){
  20. var self=this;
  21. return smalltalk.withContext(function($ctx1) {
  22. self["@context"]=aContext;
  23. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aContext:aContext},smalltalk.HLContextInspectorDecorator)})},
  24. messageSends: []}),
  25. smalltalk.HLContextInspectorDecorator);
  26. smalltalk.addMethod(
  27. smalltalk.method({
  28. selector: "inspectOn:",
  29. fn: function (anInspector){
  30. var self=this;
  31. var variables,inspectedContext;
  32. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  33. return smalltalk.withContext(function($ctx1) {
  34. var $1,$2,$3;
  35. variables=_st($Dictionary())._new();
  36. inspectedContext=self._context();
  37. _st(variables)._addAll_(_st(inspectedContext)._locals());
  38. _st((function(){
  39. return smalltalk.withContext(function($ctx2) {
  40. return _st(_st(inspectedContext)._notNil())._and_((function(){
  41. return smalltalk.withContext(function($ctx3) {
  42. return _st(inspectedContext)._isBlockContext();
  43. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  44. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  45. return smalltalk.withContext(function($ctx2) {
  46. inspectedContext=_st(inspectedContext)._outerContext();
  47. inspectedContext;
  48. $1=inspectedContext;
  49. if(($receiver = $1) == nil || $receiver == undefined){
  50. return $1;
  51. } else {
  52. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  53. };
  54. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  55. $2=anInspector;
  56. _st($2)._setLabel_("Context");
  57. $3=_st($2)._setVariables_(variables);
  58. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
  59. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "outerContext", "ifNotNil:", "and:", "isBlockContext", "notNil", "setLabel:", "setVariables:"]}),
  60. smalltalk.HLContextInspectorDecorator);
  61. smalltalk.addMethod(
  62. smalltalk.method({
  63. selector: "on:",
  64. fn: function (aContext){
  65. var self=this;
  66. return smalltalk.withContext(function($ctx1) {
  67. var $2,$3,$1;
  68. $2=self._new();
  69. _st($2)._initializeFromContext_(aContext);
  70. $3=_st($2)._yourself();
  71. $1=$3;
  72. return $1;
  73. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},smalltalk.HLContextInspectorDecorator.klass)})},
  74. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  75. smalltalk.HLContextInspectorDecorator.klass);
  76. smalltalk.addClass('HLDebugger', smalltalk.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  77. smalltalk.addMethod(
  78. smalltalk.method({
  79. selector: "codeWidget",
  80. fn: function (){
  81. var self=this;
  82. function $HLDebuggerCodeWidget(){return smalltalk.HLDebuggerCodeWidget||(typeof HLDebuggerCodeWidget=="undefined"?nil:HLDebuggerCodeWidget)}
  83. return smalltalk.withContext(function($ctx1) {
  84. var $2,$3,$4,$1;
  85. $2=self["@codeWidget"];
  86. if(($receiver = $2) == nil || $receiver == undefined){
  87. $3=_st($HLDebuggerCodeWidget())._new();
  88. _st($3)._browserModel_(self._model());
  89. $4=_st($3)._yourself();
  90. self["@codeWidget"]=$4;
  91. $1=self["@codeWidget"];
  92. } else {
  93. $1=$2;
  94. };
  95. return $1;
  96. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLDebugger)})},
  97. messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"]}),
  98. smalltalk.HLDebugger);
  99. smalltalk.addMethod(
  100. smalltalk.method({
  101. selector: "focus",
  102. fn: function (){
  103. var self=this;
  104. return smalltalk.withContext(function($ctx1) {
  105. _st(self._stackListWidget())._focus();
  106. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLDebugger)})},
  107. messageSends: ["focus", "stackListWidget"]}),
  108. smalltalk.HLDebugger);
  109. smalltalk.addMethod(
  110. smalltalk.method({
  111. selector: "initializeFromMethodContext:",
  112. fn: function (aMethodContext){
  113. var self=this;
  114. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  115. return smalltalk.withContext(function($ctx1) {
  116. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  117. self._observeModel();
  118. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.HLDebugger)})},
  119. messageSends: ["on:", "observeModel"]}),
  120. smalltalk.HLDebugger);
  121. smalltalk.addMethod(
  122. smalltalk.method({
  123. selector: "inspectorWidget",
  124. fn: function (){
  125. var self=this;
  126. function $HLInspectorWidget(){return smalltalk.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  127. return smalltalk.withContext(function($ctx1) {
  128. var $2,$1;
  129. $2=self["@inspectorWidget"];
  130. if(($receiver = $2) == nil || $receiver == undefined){
  131. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  132. $1=self["@inspectorWidget"];
  133. } else {
  134. $1=$2;
  135. };
  136. return $1;
  137. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},smalltalk.HLDebugger)})},
  138. messageSends: ["ifNil:", "new"]}),
  139. smalltalk.HLDebugger);
  140. smalltalk.addMethod(
  141. smalltalk.method({
  142. selector: "model",
  143. fn: function (){
  144. var self=this;
  145. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  146. return smalltalk.withContext(function($ctx1) {
  147. var $2,$1;
  148. $2=self["@model"];
  149. if(($receiver = $2) == nil || $receiver == undefined){
  150. self["@model"]=_st($HLDebuggerModel())._new();
  151. $1=self["@model"];
  152. } else {
  153. $1=$2;
  154. };
  155. return $1;
  156. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLDebugger)})},
  157. messageSends: ["ifNil:", "new"]}),
  158. smalltalk.HLDebugger);
  159. smalltalk.addMethod(
  160. smalltalk.method({
  161. selector: "observeModel",
  162. fn: function (){
  163. var self=this;
  164. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  165. return smalltalk.withContext(function($ctx1) {
  166. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  167. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
  168. messageSends: ["on:send:to:", "announcer", "model"]}),
  169. smalltalk.HLDebugger);
  170. smalltalk.addMethod(
  171. smalltalk.method({
  172. selector: "onContextSelected:",
  173. fn: function (anAnnouncement){
  174. var self=this;
  175. function $HLContextInspectorDecorator(){return smalltalk.HLContextInspectorDecorator||(typeof HLContextInspectorDecorator=="undefined"?nil:HLContextInspectorDecorator)}
  176. return smalltalk.withContext(function($ctx1) {
  177. _st(self._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(_st(anAnnouncement)._context()));
  178. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDebugger)})},
  179. messageSends: ["inspect:", "on:", "context", "inspectorWidget"]}),
  180. smalltalk.HLDebugger);
  181. smalltalk.addMethod(
  182. smalltalk.method({
  183. selector: "registerBindingsOn:",
  184. fn: function (aBindingGroup){
  185. var self=this;
  186. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  187. return smalltalk.withContext(function($ctx1) {
  188. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model());
  189. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLDebugger)})},
  190. messageSends: ["registerConcreteClassesOn:for:", "model"]}),
  191. smalltalk.HLDebugger);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "renderContentOn:",
  195. fn: function (html){
  196. var self=this;
  197. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  198. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  199. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  200. return smalltalk.withContext(function($ctx1) {
  201. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._stackListWidget(),_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget()))));
  202. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
  203. messageSends: ["with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget"]}),
  204. smalltalk.HLDebugger);
  205. smalltalk.addMethod(
  206. smalltalk.method({
  207. selector: "stackListWidget",
  208. fn: function (){
  209. var self=this;
  210. function $HLStackListWidget(){return smalltalk.HLStackListWidget||(typeof HLStackListWidget=="undefined"?nil:HLStackListWidget)}
  211. return smalltalk.withContext(function($ctx1) {
  212. var $2,$3,$4,$1;
  213. $2=self["@stackListWidget"];
  214. if(($receiver = $2) == nil || $receiver == undefined){
  215. $3=_st($HLStackListWidget())._on_(self._model());
  216. _st($3)._next_(self._codeWidget());
  217. $4=_st($3)._yourself();
  218. self["@stackListWidget"]=$4;
  219. $1=self["@stackListWidget"];
  220. } else {
  221. $1=$2;
  222. };
  223. return $1;
  224. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},smalltalk.HLDebugger)})},
  225. messageSends: ["ifNil:", "next:", "codeWidget", "on:", "model", "yourself"]}),
  226. smalltalk.HLDebugger);
  227. smalltalk.addMethod(
  228. smalltalk.method({
  229. selector: "unregister",
  230. fn: function (){
  231. var self=this;
  232. return smalltalk.withContext(function($ctx1) {
  233. smalltalk.HLDebugger.superclass.fn.prototype._unregister.apply(_st(self), []);
  234. _st(self._inspectorWidget())._unregister();
  235. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
  236. messageSends: ["unregister", "inspectorWidget"]}),
  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=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("<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=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. self._clearHighlight();
  310. smalltalk.HLDebuggerCodeWidget.superclass.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.HLDebuggerCodeWidget.superclass.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._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)))]);
  337. 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)))]);
  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.HLDebuggerCodeWidget.superclass.fn.prototype._observeBrowserModel.apply(_st(self), []);
  406. _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. self._highlightNode_(_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. self._currentContext_(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. self._withChangesDo_((function(){
  461. return smalltalk.withContext(function($ctx2) {
  462. 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(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=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. 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(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=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. self._onErrorHandled();
  571. _st((function(){
  572. return smalltalk.withContext(function($ctx2) {
  573. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  574. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  575. return smalltalk.withContext(function($ctx2) {
  576. return _st(_st($ErrorHandler())._new())._handleError_(error);
  577. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  578. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  579. messageSends: ["onErrorHandled", "on:do:", "handleError:", "new", "openAsTab", "on:", "context"]}),
  580. smalltalk.HLErrorHandler);
  581. smalltalk.addMethod(
  582. smalltalk.method({
  583. selector: "onErrorHandled",
  584. fn: function (){
  585. var self=this;
  586. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  587. return smalltalk.withContext(function($ctx1) {
  588. var $1,$2;
  589. $1=_st($HLProgressWidget())._default();
  590. _st($1)._flush();
  591. $2=_st($1)._remove();
  592. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},smalltalk.HLErrorHandler)})},
  593. messageSends: ["flush", "default", "remove"]}),
  594. smalltalk.HLErrorHandler);
  595. smalltalk.addMethod(
  596. smalltalk.method({
  597. selector: "handleError:",
  598. fn: function (anError){
  599. var self=this;
  600. return smalltalk.withContext(function($ctx1) {
  601. var $1;
  602. $1=_st(self._new())._handleError_(anError);
  603. return $1;
  604. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler.klass)})},
  605. messageSends: ["handleError:", "new"]}),
  606. smalltalk.HLErrorHandler.klass);
  607. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  608. smalltalk.addMethod(
  609. smalltalk.method({
  610. selector: "items",
  611. fn: function (){
  612. var self=this;
  613. return smalltalk.withContext(function($ctx1) {
  614. var $2,$1;
  615. $2=self["@items"];
  616. if(($receiver = $2) == nil || $receiver == undefined){
  617. self["@items"]=_st(self._model())._contexts();
  618. $1=self["@items"];
  619. } else {
  620. $1=$2;
  621. };
  622. return $1;
  623. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  624. messageSends: ["ifNil:", "contexts", "model"]}),
  625. smalltalk.HLStackListWidget);
  626. smalltalk.addMethod(
  627. smalltalk.method({
  628. selector: "label",
  629. fn: function (){
  630. var self=this;
  631. return smalltalk.withContext(function($ctx1) {
  632. return "Call stack";
  633. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  634. messageSends: []}),
  635. smalltalk.HLStackListWidget);
  636. smalltalk.addMethod(
  637. smalltalk.method({
  638. selector: "selectItem:",
  639. fn: function (aContext){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) {
  642. _st(self._model())._currentContext_(aContext);
  643. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  644. messageSends: ["currentContext:", "model"]}),
  645. smalltalk.HLStackListWidget);
  646. });