1
0

Helios-Debugger.deploy.js 26 KB

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