Helios-Debugger.deploy.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. smalltalk.addPackage('Helios-Debugger');
  2. smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "context",
  6. fn: function (){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. var $1;
  10. $1=self["@context"];
  11. return $1;
  12. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.HLContextInspectorDecorator)})},
  13. messageSends: []}),
  14. smalltalk.HLContextInspectorDecorator);
  15. smalltalk.addMethod(
  16. smalltalk.method({
  17. selector: "initializeFromContext:",
  18. fn: function (aContext){
  19. var self=this;
  20. return smalltalk.withContext(function($ctx1) {
  21. self["@context"]=aContext;
  22. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aContext:aContext},smalltalk.HLContextInspectorDecorator)})},
  23. messageSends: []}),
  24. smalltalk.HLContextInspectorDecorator);
  25. smalltalk.addMethod(
  26. smalltalk.method({
  27. selector: "inspectOn:",
  28. fn: function (anInspector){
  29. var self=this;
  30. var variables,inspectedContext;
  31. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  32. return smalltalk.withContext(function($ctx1) {
  33. var $1,$2,$3;
  34. variables=_st($Dictionary())._new();
  35. inspectedContext=self._context();
  36. _st(variables)._addAll_(_st(inspectedContext)._locals());
  37. _st((function(){
  38. return smalltalk.withContext(function($ctx2) {
  39. return _st(_st(inspectedContext)._notNil())._and_((function(){
  40. return smalltalk.withContext(function($ctx3) {
  41. return _st(inspectedContext)._isBlockContext();
  42. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  43. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  44. return smalltalk.withContext(function($ctx2) {
  45. inspectedContext=_st(inspectedContext)._outerContext();
  46. inspectedContext;
  47. $1=inspectedContext;
  48. if(($receiver = $1) == nil || $receiver == undefined){
  49. return $1;
  50. } else {
  51. return _st(variables)._addAll_(_st(inspectedContext)._locals());
  52. };
  53. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  54. $2=anInspector;
  55. _st($2)._setLabel_("Context");
  56. $3=_st($2)._setVariables_(variables);
  57. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
  58. messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "outerContext", "ifNotNil:", "and:", "isBlockContext", "notNil", "setLabel:", "setVariables:"]}),
  59. smalltalk.HLContextInspectorDecorator);
  60. smalltalk.addMethod(
  61. smalltalk.method({
  62. selector: "on:",
  63. fn: function (aContext){
  64. var self=this;
  65. return smalltalk.withContext(function($ctx1) {
  66. var $2,$3,$1;
  67. $2=self._new();
  68. _st($2)._initializeFromContext_(aContext);
  69. $3=_st($2)._yourself();
  70. $1=$3;
  71. return $1;
  72. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},smalltalk.HLContextInspectorDecorator.klass)})},
  73. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  74. smalltalk.HLContextInspectorDecorator.klass);
  75. smalltalk.addClass('HLDebugger', smalltalk.HLFocusableWidget, ['model', 'stackListWidget', 'codeWidget', 'inspectorWidget'], 'Helios-Debugger');
  76. smalltalk.addMethod(
  77. smalltalk.method({
  78. selector: "codeWidget",
  79. fn: function (){
  80. var self=this;
  81. function $HLDebuggerCodeWidget(){return smalltalk.HLDebuggerCodeWidget||(typeof HLDebuggerCodeWidget=="undefined"?nil:HLDebuggerCodeWidget)}
  82. return smalltalk.withContext(function($ctx1) {
  83. var $2,$3,$4,$1;
  84. $2=self["@codeWidget"];
  85. if(($receiver = $2) == nil || $receiver == undefined){
  86. $3=_st($HLDebuggerCodeWidget())._new();
  87. _st($3)._browserModel_(self._model());
  88. $4=_st($3)._yourself();
  89. self["@codeWidget"]=$4;
  90. $1=self["@codeWidget"];
  91. } else {
  92. $1=$2;
  93. };
  94. return $1;
  95. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLDebugger)})},
  96. messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"]}),
  97. smalltalk.HLDebugger);
  98. smalltalk.addMethod(
  99. smalltalk.method({
  100. selector: "focus",
  101. fn: function (){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. _st(self._stackListWidget())._focus();
  105. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLDebugger)})},
  106. messageSends: ["focus", "stackListWidget"]}),
  107. smalltalk.HLDebugger);
  108. smalltalk.addMethod(
  109. smalltalk.method({
  110. selector: "initializeFromMethodContext:",
  111. fn: function (aMethodContext){
  112. var self=this;
  113. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  114. return smalltalk.withContext(function($ctx1) {
  115. self["@model"]=_st($HLDebuggerModel())._on_(aMethodContext);
  116. self._observeModel();
  117. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.HLDebugger)})},
  118. messageSends: ["on:", "observeModel"]}),
  119. smalltalk.HLDebugger);
  120. smalltalk.addMethod(
  121. smalltalk.method({
  122. selector: "inspectorWidget",
  123. fn: function (){
  124. var self=this;
  125. function $HLInspectorWidget(){return smalltalk.HLInspectorWidget||(typeof HLInspectorWidget=="undefined"?nil:HLInspectorWidget)}
  126. return smalltalk.withContext(function($ctx1) {
  127. var $2,$1;
  128. $2=self["@inspectorWidget"];
  129. if(($receiver = $2) == nil || $receiver == undefined){
  130. self["@inspectorWidget"]=_st($HLInspectorWidget())._new();
  131. $1=self["@inspectorWidget"];
  132. } else {
  133. $1=$2;
  134. };
  135. return $1;
  136. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},smalltalk.HLDebugger)})},
  137. messageSends: ["ifNil:", "new"]}),
  138. smalltalk.HLDebugger);
  139. smalltalk.addMethod(
  140. smalltalk.method({
  141. selector: "model",
  142. fn: function (){
  143. var self=this;
  144. function $HLDebuggerModel(){return smalltalk.HLDebuggerModel||(typeof HLDebuggerModel=="undefined"?nil:HLDebuggerModel)}
  145. return smalltalk.withContext(function($ctx1) {
  146. var $2,$1;
  147. $2=self["@model"];
  148. if(($receiver = $2) == nil || $receiver == undefined){
  149. self["@model"]=_st($HLDebuggerModel())._new();
  150. $1=self["@model"];
  151. } else {
  152. $1=$2;
  153. };
  154. return $1;
  155. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLDebugger)})},
  156. messageSends: ["ifNil:", "new"]}),
  157. smalltalk.HLDebugger);
  158. smalltalk.addMethod(
  159. smalltalk.method({
  160. selector: "observeModel",
  161. fn: function (){
  162. var self=this;
  163. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  164. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  165. return smalltalk.withContext(function($ctx1) {
  166. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
  167. _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"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.HLFocusableWidget.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.HLBrowserCodeWidget.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.HLBrowserCodeWidget.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._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)))]);
  338. 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)))]);
  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. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  406. return smalltalk.withContext(function($ctx1) {
  407. smalltalk.HLBrowserCodeWidget.fn.prototype._observeBrowserModel.apply(_st(self), []);
  408. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
  409. _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
  410. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLDebuggerCodeWidget)})},
  411. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"]}),
  412. smalltalk.HLDebuggerCodeWidget);
  413. smalltalk.addMethod(
  414. smalltalk.method({
  415. selector: "onContextSelected",
  416. fn: function (){
  417. var self=this;
  418. return smalltalk.withContext(function($ctx1) {
  419. self._highlightNode_(_st(self._browserModel())._nextNode());
  420. return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},smalltalk.HLDebuggerCodeWidget)})},
  421. messageSends: ["highlightNode:", "nextNode", "browserModel"]}),
  422. smalltalk.HLDebuggerCodeWidget);
  423. smalltalk.addClass('HLDebuggerModel', smalltalk.HLToolModel, ['rootContext', 'currentContext', 'contexts'], 'Helios-Debugger');
  424. smalltalk.addMethod(
  425. smalltalk.method({
  426. selector: "contexts",
  427. fn: function (){
  428. var self=this;
  429. return smalltalk.withContext(function($ctx1) {
  430. var $1;
  431. $1=self["@contexts"];
  432. return $1;
  433. }, function($ctx1) {$ctx1.fill(self,"contexts",{},smalltalk.HLDebuggerModel)})},
  434. messageSends: []}),
  435. smalltalk.HLDebuggerModel);
  436. smalltalk.addMethod(
  437. smalltalk.method({
  438. selector: "currentContext",
  439. fn: function (){
  440. var self=this;
  441. return smalltalk.withContext(function($ctx1) {
  442. var $1,$2;
  443. $1=self["@currentContext"];
  444. if(($receiver = $1) == nil || $receiver == undefined){
  445. self._currentContext_(self._rootContext());
  446. } else {
  447. $1;
  448. };
  449. $2=self["@currentContext"];
  450. return $2;
  451. }, function($ctx1) {$ctx1.fill(self,"currentContext",{},smalltalk.HLDebuggerModel)})},
  452. messageSends: ["ifNil:", "currentContext:", "rootContext"]}),
  453. smalltalk.HLDebuggerModel);
  454. smalltalk.addMethod(
  455. smalltalk.method({
  456. selector: "currentContext:",
  457. fn: function (aContext){
  458. var self=this;
  459. function $ASTDebugger(){return smalltalk.ASTDebugger||(typeof ASTDebugger=="undefined"?nil:ASTDebugger)}
  460. function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
  461. return smalltalk.withContext(function($ctx1) {
  462. var $1,$2;
  463. self._withChangesDo_((function(){
  464. return smalltalk.withContext(function($ctx2) {
  465. self._selectedMethod_(_st(aContext)._method());
  466. self["@currentContext"]=aContext;
  467. self["@currentContext"];
  468. self["@interpreter"]=_st($ASTDebugger())._context_(aContext);
  469. self["@interpreter"];
  470. $1=_st($HLDebuggerContextSelected())._new();
  471. _st($1)._context_(aContext);
  472. $2=_st($1)._yourself();
  473. return _st(self._announcer())._announce_($2);
  474. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  475. return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},smalltalk.HLDebuggerModel)})},
  476. messageSends: ["withChangesDo:", "selectedMethod:", "method", "context:", "announce:", "new", "yourself", "announcer"]}),
  477. smalltalk.HLDebuggerModel);
  478. smalltalk.addMethod(
  479. smalltalk.method({
  480. selector: "initializeContexts",
  481. fn: function (){
  482. var self=this;
  483. var context;
  484. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  485. return smalltalk.withContext(function($ctx1) {
  486. self["@contexts"]=_st($OrderedCollection())._new();
  487. context=self._rootContext();
  488. _st((function(){
  489. return smalltalk.withContext(function($ctx2) {
  490. return _st(context)._notNil();
  491. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  492. return smalltalk.withContext(function($ctx2) {
  493. _st(self["@contexts"])._add_(context);
  494. context=_st(context)._outerContext();
  495. return context;
  496. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  497. return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},smalltalk.HLDebuggerModel)})},
  498. messageSends: ["new", "rootContext", "whileTrue:", "add:", "outerContext", "notNil"]}),
  499. smalltalk.HLDebuggerModel);
  500. smalltalk.addMethod(
  501. smalltalk.method({
  502. selector: "initializeFromContext:",
  503. fn: function (aMethodContext){
  504. var self=this;
  505. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  506. return smalltalk.withContext(function($ctx1) {
  507. self["@rootContext"]=_st($AIContext())._fromMethodContext_(aMethodContext);
  508. self._initializeContexts();
  509. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  510. messageSends: ["fromMethodContext:", "initializeContexts"]}),
  511. smalltalk.HLDebuggerModel);
  512. smalltalk.addMethod(
  513. smalltalk.method({
  514. selector: "interpreter",
  515. fn: function (){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) {
  518. var $1;
  519. $1=_st(self._currentContext())._interpreter();
  520. return $1;
  521. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.HLDebuggerModel)})},
  522. messageSends: ["interpreter", "currentContext"]}),
  523. smalltalk.HLDebuggerModel);
  524. smalltalk.addMethod(
  525. smalltalk.method({
  526. selector: "nextNode",
  527. fn: function (){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) {
  530. var $1;
  531. $1=_st(self._interpreter())._node();
  532. return $1;
  533. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.HLDebuggerModel)})},
  534. messageSends: ["node", "interpreter"]}),
  535. smalltalk.HLDebuggerModel);
  536. smalltalk.addMethod(
  537. smalltalk.method({
  538. selector: "restart",
  539. fn: function (){
  540. var self=this;
  541. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  542. return smalltalk.withContext(function($ctx1) {
  543. var $1,$2;
  544. _st(self._interpreter())._restart();
  545. $1=_st($HLDebuggerStepped())._new();
  546. _st($1)._context_(self._currentContext());
  547. $2=_st($1)._yourself();
  548. _st(self._announcer())._announce_($2);
  549. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLDebuggerModel)})},
  550. messageSends: ["restart", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"]}),
  551. smalltalk.HLDebuggerModel);
  552. smalltalk.addMethod(
  553. smalltalk.method({
  554. selector: "rootContext",
  555. fn: function (){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx1) {
  558. var $1;
  559. $1=self["@rootContext"];
  560. return $1;
  561. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  562. messageSends: []}),
  563. smalltalk.HLDebuggerModel);
  564. smalltalk.addMethod(
  565. smalltalk.method({
  566. selector: "stepOver",
  567. fn: function (){
  568. var self=this;
  569. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  570. return smalltalk.withContext(function($ctx1) {
  571. var $1,$2;
  572. _st(self._interpreter())._stepOver();
  573. $1=_st($HLDebuggerStepped())._new();
  574. _st($1)._context_(self._currentContext());
  575. $2=_st($1)._yourself();
  576. _st(self._announcer())._announce_($2);
  577. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLDebuggerModel)})},
  578. messageSends: ["stepOver", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"]}),
  579. smalltalk.HLDebuggerModel);
  580. smalltalk.addMethod(
  581. smalltalk.method({
  582. selector: "on:",
  583. fn: function (aMethodContext){
  584. var self=this;
  585. return smalltalk.withContext(function($ctx1) {
  586. var $2,$3,$1;
  587. $2=self._new();
  588. _st($2)._initializeFromContext_(aMethodContext);
  589. $3=_st($2)._yourself();
  590. $1=$3;
  591. return $1;
  592. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  593. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  594. smalltalk.HLDebuggerModel.klass);
  595. smalltalk.addClass('HLErrorHandler', smalltalk.ErrorHandler, [], 'Helios-Debugger');
  596. smalltalk.addMethod(
  597. smalltalk.method({
  598. selector: "handleError:",
  599. fn: function (anError){
  600. var self=this;
  601. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  602. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  603. function $HLDebugger(){return smalltalk.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  604. return smalltalk.withContext(function($ctx1) {
  605. self._onErrorHandled();
  606. _st((function(){
  607. return smalltalk.withContext(function($ctx2) {
  608. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  609. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  610. return smalltalk.withContext(function($ctx2) {
  611. return _st(_st($ErrorHandler())._new())._handleError_(error);
  612. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  613. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  614. messageSends: ["onErrorHandled", "on:do:", "handleError:", "new", "openAsTab", "on:", "context"]}),
  615. smalltalk.HLErrorHandler);
  616. smalltalk.addMethod(
  617. smalltalk.method({
  618. selector: "onErrorHandled",
  619. fn: function (){
  620. var self=this;
  621. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  622. return smalltalk.withContext(function($ctx1) {
  623. var $1,$2;
  624. $1=_st($HLProgressWidget())._default();
  625. _st($1)._flush();
  626. $2=_st($1)._remove();
  627. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},smalltalk.HLErrorHandler)})},
  628. messageSends: ["flush", "default", "remove"]}),
  629. smalltalk.HLErrorHandler);
  630. smalltalk.addMethod(
  631. smalltalk.method({
  632. selector: "handleError:",
  633. fn: function (anError){
  634. var self=this;
  635. return smalltalk.withContext(function($ctx1) {
  636. var $1;
  637. $1=_st(self._new())._handleError_(anError);
  638. return $1;
  639. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler.klass)})},
  640. messageSends: ["handleError:", "new"]}),
  641. smalltalk.HLErrorHandler.klass);
  642. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  643. smalltalk.addMethod(
  644. smalltalk.method({
  645. selector: "items",
  646. fn: function (){
  647. var self=this;
  648. return smalltalk.withContext(function($ctx1) {
  649. var $2,$1;
  650. $2=self["@items"];
  651. if(($receiver = $2) == nil || $receiver == undefined){
  652. self["@items"]=_st(self._model())._contexts();
  653. $1=self["@items"];
  654. } else {
  655. $1=$2;
  656. };
  657. return $1;
  658. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  659. messageSends: ["ifNil:", "contexts", "model"]}),
  660. smalltalk.HLStackListWidget);
  661. smalltalk.addMethod(
  662. smalltalk.method({
  663. selector: "label",
  664. fn: function (){
  665. var self=this;
  666. return smalltalk.withContext(function($ctx1) {
  667. return "Call stack";
  668. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  669. messageSends: []}),
  670. smalltalk.HLStackListWidget);
  671. smalltalk.addMethod(
  672. smalltalk.method({
  673. selector: "renderButtonsOn:",
  674. fn: function (html){
  675. var self=this;
  676. return smalltalk.withContext(function($ctx1) {
  677. var $1,$3,$4,$5,$6,$2;
  678. $1=_st(html)._div();
  679. _st($1)._class_("debugger_bar");
  680. $2=_st($1)._with_((function(){
  681. return smalltalk.withContext(function($ctx2) {
  682. $3=_st(html)._button();
  683. _st($3)._class_("btn restart");
  684. _st($3)._with_("Restart");
  685. $4=_st($3)._onClick_((function(){
  686. return smalltalk.withContext(function($ctx3) {
  687. return self._restart();
  688. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  689. $4;
  690. $5=_st(html)._button();
  691. _st($5)._class_("btn stepOver");
  692. _st($5)._with_("Step over");
  693. $6=_st($5)._onClick_((function(){
  694. return smalltalk.withContext(function($ctx3) {
  695. return self._stepOver();
  696. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  697. return $6;
  698. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  699. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLStackListWidget)})},
  700. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "stepOver"]}),
  701. smalltalk.HLStackListWidget);
  702. smalltalk.addMethod(
  703. smalltalk.method({
  704. selector: "restart",
  705. fn: function (){
  706. var self=this;
  707. return smalltalk.withContext(function($ctx1) {
  708. _st(self._model())._restart();
  709. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLStackListWidget)})},
  710. messageSends: ["restart", "model"]}),
  711. smalltalk.HLStackListWidget);
  712. smalltalk.addMethod(
  713. smalltalk.method({
  714. selector: "selectItem:",
  715. fn: function (aContext){
  716. var self=this;
  717. return smalltalk.withContext(function($ctx1) {
  718. _st(self._model())._currentContext_(aContext);
  719. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  720. messageSends: ["currentContext:", "model"]}),
  721. smalltalk.HLStackListWidget);
  722. smalltalk.addMethod(
  723. smalltalk.method({
  724. selector: "stepOver",
  725. fn: function (){
  726. var self=this;
  727. return smalltalk.withContext(function($ctx1) {
  728. _st(self._model())._stepOver();
  729. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLStackListWidget)})},
  730. messageSends: ["stepOver", "model"]}),
  731. smalltalk.HLStackListWidget);