Helios-Debugger.deploy.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  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._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. 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. return smalltalk.withContext(function($ctx1) {
  506. self["@rootContext"]=_st(aMethodContext)._aiContext();
  507. self._initializeContexts();
  508. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromContext:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel)})},
  509. messageSends: ["aiContext", "initializeContexts"]}),
  510. smalltalk.HLDebuggerModel);
  511. smalltalk.addMethod(
  512. smalltalk.method({
  513. selector: "interpreter",
  514. fn: function (){
  515. var self=this;
  516. return smalltalk.withContext(function($ctx1) {
  517. var $1;
  518. $1=_st(self._currentContext())._interpreter();
  519. return $1;
  520. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.HLDebuggerModel)})},
  521. messageSends: ["interpreter", "currentContext"]}),
  522. smalltalk.HLDebuggerModel);
  523. smalltalk.addMethod(
  524. smalltalk.method({
  525. selector: "nextNode",
  526. fn: function (){
  527. var self=this;
  528. return smalltalk.withContext(function($ctx1) {
  529. var $1;
  530. $1=_st(self._interpreter())._node();
  531. return $1;
  532. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.HLDebuggerModel)})},
  533. messageSends: ["node", "interpreter"]}),
  534. smalltalk.HLDebuggerModel);
  535. smalltalk.addMethod(
  536. smalltalk.method({
  537. selector: "restart",
  538. fn: function (){
  539. var self=this;
  540. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  541. return smalltalk.withContext(function($ctx1) {
  542. var $1,$2;
  543. _st(self._interpreter())._restart();
  544. $1=_st($HLDebuggerStepped())._new();
  545. _st($1)._context_(self._currentContext());
  546. $2=_st($1)._yourself();
  547. _st(self._announcer())._announce_($2);
  548. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLDebuggerModel)})},
  549. messageSends: ["restart", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"]}),
  550. smalltalk.HLDebuggerModel);
  551. smalltalk.addMethod(
  552. smalltalk.method({
  553. selector: "rootContext",
  554. fn: function (){
  555. var self=this;
  556. return smalltalk.withContext(function($ctx1) {
  557. var $1;
  558. $1=self["@rootContext"];
  559. return $1;
  560. }, function($ctx1) {$ctx1.fill(self,"rootContext",{},smalltalk.HLDebuggerModel)})},
  561. messageSends: []}),
  562. smalltalk.HLDebuggerModel);
  563. smalltalk.addMethod(
  564. smalltalk.method({
  565. selector: "stepOver",
  566. fn: function (){
  567. var self=this;
  568. function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
  569. return smalltalk.withContext(function($ctx1) {
  570. var $1,$2;
  571. _st(self._interpreter())._stepOver();
  572. $1=_st($HLDebuggerStepped())._new();
  573. _st($1)._context_(self._currentContext());
  574. $2=_st($1)._yourself();
  575. _st(self._announcer())._announce_($2);
  576. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLDebuggerModel)})},
  577. messageSends: ["stepOver", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"]}),
  578. smalltalk.HLDebuggerModel);
  579. smalltalk.addMethod(
  580. smalltalk.method({
  581. selector: "on:",
  582. fn: function (aMethodContext){
  583. var self=this;
  584. return smalltalk.withContext(function($ctx1) {
  585. var $2,$3,$1;
  586. $2=self._new();
  587. _st($2)._initializeFromContext_(aMethodContext);
  588. $3=_st($2)._yourself();
  589. $1=$3;
  590. return $1;
  591. }, function($ctx1) {$ctx1.fill(self,"on:",{aMethodContext:aMethodContext},smalltalk.HLDebuggerModel.klass)})},
  592. messageSends: ["initializeFromContext:", "new", "yourself"]}),
  593. smalltalk.HLDebuggerModel.klass);
  594. smalltalk.addClass('HLErrorHandler', smalltalk.ErrorHandler, [], 'Helios-Debugger');
  595. smalltalk.addMethod(
  596. smalltalk.method({
  597. selector: "handleError:",
  598. fn: function (anError){
  599. var self=this;
  600. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  601. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  602. function $HLDebugger(){return smalltalk.HLDebugger||(typeof HLDebugger=="undefined"?nil:HLDebugger)}
  603. return smalltalk.withContext(function($ctx1) {
  604. self._onErrorHandled();
  605. _st((function(){
  606. return smalltalk.withContext(function($ctx2) {
  607. return _st(_st($HLDebugger())._on_(_st(anError)._context()))._openAsTab();
  608. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  609. return smalltalk.withContext(function($ctx2) {
  610. return _st(_st($ErrorHandler())._new())._handleError_(error);
  611. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  612. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler)})},
  613. messageSends: ["onErrorHandled", "on:do:", "handleError:", "new", "openAsTab", "on:", "context"]}),
  614. smalltalk.HLErrorHandler);
  615. smalltalk.addMethod(
  616. smalltalk.method({
  617. selector: "onErrorHandled",
  618. fn: function (){
  619. var self=this;
  620. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  621. return smalltalk.withContext(function($ctx1) {
  622. var $1,$2;
  623. $1=_st($HLProgressWidget())._default();
  624. _st($1)._flush();
  625. $2=_st($1)._remove();
  626. return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},smalltalk.HLErrorHandler)})},
  627. messageSends: ["flush", "default", "remove"]}),
  628. smalltalk.HLErrorHandler);
  629. smalltalk.addMethod(
  630. smalltalk.method({
  631. selector: "handleError:",
  632. fn: function (anError){
  633. var self=this;
  634. return smalltalk.withContext(function($ctx1) {
  635. var $1;
  636. $1=_st(self._new())._handleError_(anError);
  637. return $1;
  638. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.HLErrorHandler.klass)})},
  639. messageSends: ["handleError:", "new"]}),
  640. smalltalk.HLErrorHandler.klass);
  641. smalltalk.addClass('HLStackListWidget', smalltalk.HLToolListWidget, [], 'Helios-Debugger');
  642. smalltalk.addMethod(
  643. smalltalk.method({
  644. selector: "items",
  645. fn: function (){
  646. var self=this;
  647. return smalltalk.withContext(function($ctx1) {
  648. var $2,$1;
  649. $2=self["@items"];
  650. if(($receiver = $2) == nil || $receiver == undefined){
  651. self["@items"]=_st(self._model())._contexts();
  652. $1=self["@items"];
  653. } else {
  654. $1=$2;
  655. };
  656. return $1;
  657. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLStackListWidget)})},
  658. messageSends: ["ifNil:", "contexts", "model"]}),
  659. smalltalk.HLStackListWidget);
  660. smalltalk.addMethod(
  661. smalltalk.method({
  662. selector: "label",
  663. fn: function (){
  664. var self=this;
  665. return smalltalk.withContext(function($ctx1) {
  666. return "Call stack";
  667. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLStackListWidget)})},
  668. messageSends: []}),
  669. smalltalk.HLStackListWidget);
  670. smalltalk.addMethod(
  671. smalltalk.method({
  672. selector: "renderButtonsOn:",
  673. fn: function (html){
  674. var self=this;
  675. return smalltalk.withContext(function($ctx1) {
  676. var $1,$3,$4,$5,$6,$2;
  677. $1=_st(html)._div();
  678. _st($1)._class_("debugger_bar");
  679. $2=_st($1)._with_((function(){
  680. return smalltalk.withContext(function($ctx2) {
  681. $3=_st(html)._button();
  682. _st($3)._class_("btn restart");
  683. _st($3)._with_("Restart");
  684. $4=_st($3)._onClick_((function(){
  685. return smalltalk.withContext(function($ctx3) {
  686. return self._restart();
  687. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  688. $4;
  689. $5=_st(html)._button();
  690. _st($5)._class_("btn stepOver");
  691. _st($5)._with_("Step over");
  692. $6=_st($5)._onClick_((function(){
  693. return smalltalk.withContext(function($ctx3) {
  694. return self._stepOver();
  695. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  696. return $6;
  697. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  698. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLStackListWidget)})},
  699. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "stepOver"]}),
  700. smalltalk.HLStackListWidget);
  701. smalltalk.addMethod(
  702. smalltalk.method({
  703. selector: "restart",
  704. fn: function (){
  705. var self=this;
  706. return smalltalk.withContext(function($ctx1) {
  707. _st(self._model())._restart();
  708. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.HLStackListWidget)})},
  709. messageSends: ["restart", "model"]}),
  710. smalltalk.HLStackListWidget);
  711. smalltalk.addMethod(
  712. smalltalk.method({
  713. selector: "selectItem:",
  714. fn: function (aContext){
  715. var self=this;
  716. return smalltalk.withContext(function($ctx1) {
  717. _st(self._model())._currentContext_(aContext);
  718. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},smalltalk.HLStackListWidget)})},
  719. messageSends: ["currentContext:", "model"]}),
  720. smalltalk.HLStackListWidget);
  721. smalltalk.addMethod(
  722. smalltalk.method({
  723. selector: "stepOver",
  724. fn: function (){
  725. var self=this;
  726. return smalltalk.withContext(function($ctx1) {
  727. _st(self._model())._stepOver();
  728. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.HLStackListWidget)})},
  729. messageSends: ["stepOver", "model"]}),
  730. smalltalk.HLStackListWidget);