Helios-Debugger.js 41 KB

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