Helios-Debugger.js 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208
  1. define(["amber/boot", "require", "amber/core/Kernel-Objects", "helios/Helios-Core", "helios/Helios-Workspace"], function($boot,requirejs){"use strict";
  2. var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. var $pkg = $core.addPackage("Helios-Debugger");
  4. $pkg.imports = ["amber/core/Compiler-Interpreter"];
  5. //>>excludeStart("imports", pragmas.excludeImports);
  6. $pkg.isReady = new Promise(function (resolve, reject) { requirejs(["amber/core/Compiler-Interpreter"], function () {resolve();}, reject); });
  7. //>>excludeEnd("imports");
  8. $pkg.transport = {"type":"amd","amdNamespace":"helios"};
  9. $core.addClass("HLContextInspectorDecorator", $globals.Object, "Helios-Debugger");
  10. $core.setSlots($globals.HLContextInspectorDecorator, ["context"]);
  11. $core.addMethod(
  12. $core.method({
  13. selector: "context",
  14. protocol: "accessing",
  15. //>>excludeStart("ide", pragmas.excludeIdeData);
  16. args: [],
  17. source: "context\x0a\x09^ context",
  18. referencedClasses: [],
  19. //>>excludeEnd("ide");
  20. pragmas: [],
  21. messageSends: []
  22. }, function ($methodClass){ return function (){
  23. var self=this,$self=this;
  24. return $self.context;
  25. }; }),
  26. $globals.HLContextInspectorDecorator);
  27. $core.addMethod(
  28. $core.method({
  29. selector: "evaluate:on:",
  30. protocol: "evaluating",
  31. //>>excludeStart("ide", pragmas.excludeIdeData);
  32. args: ["aString", "anEvaluator"],
  33. source: "evaluate: aString on: anEvaluator\x0a\x09^ self context evaluate: aString on: anEvaluator",
  34. referencedClasses: [],
  35. //>>excludeEnd("ide");
  36. pragmas: [],
  37. messageSends: ["evaluate:on:", "context"]
  38. }, function ($methodClass){ return function (aString,anEvaluator){
  39. var self=this,$self=this;
  40. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  41. return $core.withContext(function($ctx1) {
  42. //>>excludeEnd("ctx");
  43. return $recv($self._context())._evaluate_on_(aString,anEvaluator);
  44. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  45. }, function($ctx1) {$ctx1.fill(self,"evaluate:on:",{aString:aString,anEvaluator:anEvaluator})});
  46. //>>excludeEnd("ctx");
  47. }; }),
  48. $globals.HLContextInspectorDecorator);
  49. $core.addMethod(
  50. $core.method({
  51. selector: "initializeFromContext:",
  52. protocol: "initialization",
  53. //>>excludeStart("ide", pragmas.excludeIdeData);
  54. args: ["aContext"],
  55. source: "initializeFromContext: aContext\x0a\x09context := aContext",
  56. referencedClasses: [],
  57. //>>excludeEnd("ide");
  58. pragmas: [],
  59. messageSends: []
  60. }, function ($methodClass){ return function (aContext){
  61. var self=this,$self=this;
  62. $self.context=aContext;
  63. return self;
  64. }; }),
  65. $globals.HLContextInspectorDecorator);
  66. $core.addMethod(
  67. $core.method({
  68. selector: "inspectOn:",
  69. protocol: "inspecting",
  70. //>>excludeStart("ide", pragmas.excludeIdeData);
  71. args: ["anInspector"],
  72. source: "inspectOn: anInspector\x0a\x09| variables inspectedContext |\x0a\x0a\x09inspectedContext := self context. console log: 'paso por aqui'.\x0a\x09variables := Array streamContents: [ :stream |\x0a\x09\x09stream nextPutAll: inspectedContext locals associations.\x0a\x09\x09\x0a\x09\x09[ inspectedContext notNil and: [ inspectedContext isBlockContext ] ] whileTrue: [\x0a\x09\x09\x09inspectedContext := inspectedContext outerContext.\x0a\x09\x09\x09inspectedContext ifNotNil: [\x0a\x09\x09\x09\x09stream nextPutAll: inspectedContext locals associations ] ] ].\x0a\x09\x0a\x09anInspector\x0a\x09\x09setLabel: 'Context';\x0a\x09\x09setVariables: variables",
  73. referencedClasses: ["Array"],
  74. //>>excludeEnd("ide");
  75. pragmas: [],
  76. messageSends: ["context", "log:", "streamContents:", "nextPutAll:", "associations", "locals", "whileTrue:", "and:", "notNil", "isBlockContext", "outerContext", "ifNotNil:", "setLabel:", "setVariables:"]
  77. }, function ($methodClass){ return function (anInspector){
  78. var self=this,$self=this;
  79. var variables,inspectedContext;
  80. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  81. return $core.withContext(function($ctx1) {
  82. //>>excludeEnd("ctx");
  83. var $1;
  84. inspectedContext=$self._context();
  85. $recv(console)._log_("paso por aqui");
  86. variables=$recv($globals.Array)._streamContents_((function(stream){
  87. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  88. return $core.withContext(function($ctx2) {
  89. //>>excludeEnd("ctx");
  90. [$recv(stream)._nextPutAll_([$recv([$recv(inspectedContext)._locals()
  91. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  92. ,$ctx2.sendIdx["locals"]=1
  93. //>>excludeEnd("ctx");
  94. ][0])._associations()
  95. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  96. ,$ctx2.sendIdx["associations"]=1
  97. //>>excludeEnd("ctx");
  98. ][0])
  99. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  100. ,$ctx2.sendIdx["nextPutAll:"]=1
  101. //>>excludeEnd("ctx");
  102. ][0];
  103. return $recv((function(){
  104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  105. return $core.withContext(function($ctx3) {
  106. //>>excludeEnd("ctx");
  107. if($core.assert($recv(inspectedContext)._notNil())){
  108. return $recv(inspectedContext)._isBlockContext();
  109. } else {
  110. return false;
  111. }
  112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  113. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  114. //>>excludeEnd("ctx");
  115. }))._whileTrue_((function(){
  116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  117. return $core.withContext(function($ctx3) {
  118. //>>excludeEnd("ctx");
  119. inspectedContext=$recv(inspectedContext)._outerContext();
  120. $1=inspectedContext;
  121. if($1 == null || $1.a$nil){
  122. return $1;
  123. } else {
  124. return $recv(stream)._nextPutAll_($recv($recv(inspectedContext)._locals())._associations());
  125. }
  126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  127. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  128. //>>excludeEnd("ctx");
  129. }));
  130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  131. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)});
  132. //>>excludeEnd("ctx");
  133. }));
  134. $recv(anInspector)._setLabel_("Context");
  135. $recv(anInspector)._setVariables_(variables);
  136. return self;
  137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  138. }, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext})});
  139. //>>excludeEnd("ctx");
  140. }; }),
  141. $globals.HLContextInspectorDecorator);
  142. $core.addMethod(
  143. $core.method({
  144. selector: "on:",
  145. protocol: "instance creation",
  146. //>>excludeStart("ide", pragmas.excludeIdeData);
  147. args: ["aContext"],
  148. source: "on: aContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aContext;\x0a\x09\x09yourself",
  149. referencedClasses: [],
  150. //>>excludeEnd("ide");
  151. pragmas: [],
  152. messageSends: ["initializeFromContext:", "new", "yourself"]
  153. }, function ($methodClass){ return function (aContext){
  154. var self=this,$self=this;
  155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  156. return $core.withContext(function($ctx1) {
  157. //>>excludeEnd("ctx");
  158. var $1;
  159. $1=$self._new();
  160. $recv($1)._initializeFromContext_(aContext);
  161. return $recv($1)._yourself();
  162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  163. }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext})});
  164. //>>excludeEnd("ctx");
  165. }; }),
  166. $globals.HLContextInspectorDecorator.a$cls);
  167. $core.addClass("HLDebugger", $globals.HLFocusableWidget, "Helios-Debugger");
  168. $core.setSlots($globals.HLDebugger, ["model", "stackListWidget", "codeWidget", "inspectorWidget"]);
  169. //>>excludeStart("ide", pragmas.excludeIdeData);
  170. $globals.HLDebugger.comment="I am the main widget for the Helios debugger.";
  171. //>>excludeEnd("ide");
  172. $core.addMethod(
  173. $core.method({
  174. selector: "codeWidget",
  175. protocol: "widgets",
  176. //>>excludeStart("ide", pragmas.excludeIdeData);
  177. args: [],
  178. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLDebuggerCodeWidget new\x0a\x09\x09model: (HLDebuggerCodeModel new\x0a\x09\x09\x09debuggerModel: self model;\x0a\x09\x09\x09yourself);\x0a\x09\x09browserModel: self model;\x0a\x09\x09yourself ]",
  179. referencedClasses: ["HLDebuggerCodeWidget", "HLDebuggerCodeModel"],
  180. //>>excludeEnd("ide");
  181. pragmas: [],
  182. messageSends: ["ifNil:", "model:", "new", "debuggerModel:", "model", "yourself", "browserModel:"]
  183. }, function ($methodClass){ return function (){
  184. var self=this,$self=this;
  185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  186. return $core.withContext(function($ctx1) {
  187. //>>excludeEnd("ctx");
  188. var $1,$2,$3;
  189. $1=$self.codeWidget;
  190. if($1 == null || $1.a$nil){
  191. $2=[$recv($globals.HLDebuggerCodeWidget)._new()
  192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  193. ,$ctx1.sendIdx["new"]=1
  194. //>>excludeEnd("ctx");
  195. ][0];
  196. $3=$recv($globals.HLDebuggerCodeModel)._new();
  197. $recv($3)._debuggerModel_([$self._model()
  198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  199. ,$ctx1.sendIdx["model"]=1
  200. //>>excludeEnd("ctx");
  201. ][0]);
  202. $recv($2)._model_([$recv($3)._yourself()
  203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  204. ,$ctx1.sendIdx["yourself"]=1
  205. //>>excludeEnd("ctx");
  206. ][0]);
  207. $recv($2)._browserModel_($self._model());
  208. $self.codeWidget=$recv($2)._yourself();
  209. return $self.codeWidget;
  210. } else {
  211. return $1;
  212. }
  213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  214. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{})});
  215. //>>excludeEnd("ctx");
  216. }; }),
  217. $globals.HLDebugger);
  218. $core.addMethod(
  219. $core.method({
  220. selector: "cssClass",
  221. protocol: "accessing",
  222. //>>excludeStart("ide", pragmas.excludeIdeData);
  223. args: [],
  224. source: "cssClass\x0a\x09^ super cssClass, ' hl_debugger'",
  225. referencedClasses: [],
  226. //>>excludeEnd("ide");
  227. pragmas: [],
  228. messageSends: [",", "cssClass"]
  229. }, function ($methodClass){ return function (){
  230. var self=this,$self=this;
  231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  232. return $core.withContext(function($ctx1) {
  233. //>>excludeEnd("ctx");
  234. return $recv([(
  235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  236. $ctx1.supercall = true,
  237. //>>excludeEnd("ctx");
  238. ($methodClass.superclass||$boot.nilAsClass).fn.prototype._cssClass.call($self))
  239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  240. ,$ctx1.supercall = false
  241. //>>excludeEnd("ctx");
  242. ][0]).__comma(" hl_debugger");
  243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  244. }, function($ctx1) {$ctx1.fill(self,"cssClass",{})});
  245. //>>excludeEnd("ctx");
  246. }; }),
  247. $globals.HLDebugger);
  248. $core.addMethod(
  249. $core.method({
  250. selector: "focus",
  251. protocol: "actions",
  252. //>>excludeStart("ide", pragmas.excludeIdeData);
  253. args: [],
  254. source: "focus\x0a\x09self stackListWidget focus",
  255. referencedClasses: [],
  256. //>>excludeEnd("ide");
  257. pragmas: [],
  258. messageSends: ["focus", "stackListWidget"]
  259. }, function ($methodClass){ return function (){
  260. var self=this,$self=this;
  261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  262. return $core.withContext(function($ctx1) {
  263. //>>excludeEnd("ctx");
  264. $recv($self._stackListWidget())._focus();
  265. return self;
  266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  267. }, function($ctx1) {$ctx1.fill(self,"focus",{})});
  268. //>>excludeEnd("ctx");
  269. }; }),
  270. $globals.HLDebugger);
  271. $core.addMethod(
  272. $core.method({
  273. selector: "initializeFromError:",
  274. protocol: "initialization",
  275. //>>excludeStart("ide", pragmas.excludeIdeData);
  276. args: ["anError"],
  277. source: "initializeFromError: anError\x0a\x09model := HLDebuggerModel on: anError.\x0a\x09self observeModel",
  278. referencedClasses: ["HLDebuggerModel"],
  279. //>>excludeEnd("ide");
  280. pragmas: [],
  281. messageSends: ["on:", "observeModel"]
  282. }, function ($methodClass){ return function (anError){
  283. var self=this,$self=this;
  284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  285. return $core.withContext(function($ctx1) {
  286. //>>excludeEnd("ctx");
  287. $self.model=$recv($globals.HLDebuggerModel)._on_(anError);
  288. $self._observeModel();
  289. return self;
  290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  291. }, function($ctx1) {$ctx1.fill(self,"initializeFromError:",{anError:anError})});
  292. //>>excludeEnd("ctx");
  293. }; }),
  294. $globals.HLDebugger);
  295. $core.addMethod(
  296. $core.method({
  297. selector: "inspectorWidget",
  298. protocol: "widgets",
  299. //>>excludeStart("ide", pragmas.excludeIdeData);
  300. args: [],
  301. source: "inspectorWidget\x0a\x09^ inspectorWidget ifNil: [ \x0a\x09\x09inspectorWidget := HLInspectorWidget new ]",
  302. referencedClasses: ["HLInspectorWidget"],
  303. //>>excludeEnd("ide");
  304. pragmas: [],
  305. messageSends: ["ifNil:", "new"]
  306. }, function ($methodClass){ return function (){
  307. var self=this,$self=this;
  308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  309. return $core.withContext(function($ctx1) {
  310. //>>excludeEnd("ctx");
  311. var $1;
  312. $1=$self.inspectorWidget;
  313. if($1 == null || $1.a$nil){
  314. $self.inspectorWidget=$recv($globals.HLInspectorWidget)._new();
  315. return $self.inspectorWidget;
  316. } else {
  317. return $1;
  318. }
  319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  320. }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{})});
  321. //>>excludeEnd("ctx");
  322. }; }),
  323. $globals.HLDebugger);
  324. $core.addMethod(
  325. $core.method({
  326. selector: "model",
  327. protocol: "accessing",
  328. //>>excludeStart("ide", pragmas.excludeIdeData);
  329. args: [],
  330. source: "model\x0a\x09^ model ifNil: [ model := HLDebuggerModel new ]",
  331. referencedClasses: ["HLDebuggerModel"],
  332. //>>excludeEnd("ide");
  333. pragmas: [],
  334. messageSends: ["ifNil:", "new"]
  335. }, function ($methodClass){ return function (){
  336. var self=this,$self=this;
  337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  338. return $core.withContext(function($ctx1) {
  339. //>>excludeEnd("ctx");
  340. var $1;
  341. $1=$self.model;
  342. if($1 == null || $1.a$nil){
  343. $self.model=$recv($globals.HLDebuggerModel)._new();
  344. return $self.model;
  345. } else {
  346. return $1;
  347. }
  348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  349. }, function($ctx1) {$ctx1.fill(self,"model",{})});
  350. //>>excludeEnd("ctx");
  351. }; }),
  352. $globals.HLDebugger);
  353. $core.addMethod(
  354. $core.method({
  355. selector: "observeModel",
  356. protocol: "actions",
  357. //>>excludeStart("ide", pragmas.excludeIdeData);
  358. args: [],
  359. source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onDebuggerStepped:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLDebuggerProceeded\x0a\x09\x09send: #onDebuggerProceeded\x0a\x09\x09to: self",
  360. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped", "HLDebuggerProceeded"],
  361. //>>excludeEnd("ide");
  362. pragmas: [],
  363. messageSends: ["on:send:to:", "announcer", "model"]
  364. }, function ($methodClass){ return function (){
  365. var self=this,$self=this;
  366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  367. return $core.withContext(function($ctx1) {
  368. //>>excludeEnd("ctx");
  369. var $1;
  370. $1=$recv($self._model())._announcer();
  371. [$recv($1)._on_send_to_($globals.HLDebuggerContextSelected,"onContextSelected:",self)
  372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  373. ,$ctx1.sendIdx["on:send:to:"]=1
  374. //>>excludeEnd("ctx");
  375. ][0];
  376. [$recv($1)._on_send_to_($globals.HLDebuggerStepped,"onDebuggerStepped:",self)
  377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  378. ,$ctx1.sendIdx["on:send:to:"]=2
  379. //>>excludeEnd("ctx");
  380. ][0];
  381. $recv($1)._on_send_to_($globals.HLDebuggerProceeded,"onDebuggerProceeded",self);
  382. return self;
  383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  384. }, function($ctx1) {$ctx1.fill(self,"observeModel",{})});
  385. //>>excludeEnd("ctx");
  386. }; }),
  387. $globals.HLDebugger);
  388. $core.addMethod(
  389. $core.method({
  390. selector: "onContextSelected:",
  391. protocol: "reactions",
  392. //>>excludeStart("ide", pragmas.excludeIdeData);
  393. args: ["anAnnouncement"],
  394. source: "onContextSelected: anAnnouncement\x0a\x09self inspectorWidget inspect: (HLContextInspectorDecorator on: anAnnouncement context)",
  395. referencedClasses: ["HLContextInspectorDecorator"],
  396. //>>excludeEnd("ide");
  397. pragmas: [],
  398. messageSends: ["inspect:", "inspectorWidget", "on:", "context"]
  399. }, function ($methodClass){ return function (anAnnouncement){
  400. var self=this,$self=this;
  401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  402. return $core.withContext(function($ctx1) {
  403. //>>excludeEnd("ctx");
  404. $recv($self._inspectorWidget())._inspect_($recv($globals.HLContextInspectorDecorator)._on_($recv(anAnnouncement)._context()));
  405. return self;
  406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  407. }, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement})});
  408. //>>excludeEnd("ctx");
  409. }; }),
  410. $globals.HLDebugger);
  411. $core.addMethod(
  412. $core.method({
  413. selector: "onDebuggerProceeded",
  414. protocol: "reactions",
  415. //>>excludeStart("ide", pragmas.excludeIdeData);
  416. args: [],
  417. source: "onDebuggerProceeded\x0a\x09self removeTab",
  418. referencedClasses: [],
  419. //>>excludeEnd("ide");
  420. pragmas: [],
  421. messageSends: ["removeTab"]
  422. }, function ($methodClass){ return function (){
  423. var self=this,$self=this;
  424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  425. return $core.withContext(function($ctx1) {
  426. //>>excludeEnd("ctx");
  427. $self._removeTab();
  428. return self;
  429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  430. }, function($ctx1) {$ctx1.fill(self,"onDebuggerProceeded",{})});
  431. //>>excludeEnd("ctx");
  432. }; }),
  433. $globals.HLDebugger);
  434. $core.addMethod(
  435. $core.method({
  436. selector: "onDebuggerStepped:",
  437. protocol: "reactions",
  438. //>>excludeStart("ide", pragmas.excludeIdeData);
  439. args: ["anAnnouncement"],
  440. source: "onDebuggerStepped: anAnnouncement\x0a\x09self model atEnd ifTrue: [ self removeTab ].\x0a\x09\x0a\x09self inspectorWidget inspect: (HLContextInspectorDecorator on: anAnnouncement context).\x0a\x09self stackListWidget refresh",
  441. referencedClasses: ["HLContextInspectorDecorator"],
  442. //>>excludeEnd("ide");
  443. pragmas: [],
  444. messageSends: ["ifTrue:", "atEnd", "model", "removeTab", "inspect:", "inspectorWidget", "on:", "context", "refresh", "stackListWidget"]
  445. }, function ($methodClass){ return function (anAnnouncement){
  446. var self=this,$self=this;
  447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  448. return $core.withContext(function($ctx1) {
  449. //>>excludeEnd("ctx");
  450. if($core.assert($recv($self._model())._atEnd())){
  451. $self._removeTab();
  452. }
  453. $recv($self._inspectorWidget())._inspect_($recv($globals.HLContextInspectorDecorator)._on_($recv(anAnnouncement)._context()));
  454. $recv($self._stackListWidget())._refresh();
  455. return self;
  456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  457. }, function($ctx1) {$ctx1.fill(self,"onDebuggerStepped:",{anAnnouncement:anAnnouncement})});
  458. //>>excludeEnd("ctx");
  459. }; }),
  460. $globals.HLDebugger);
  461. $core.addMethod(
  462. $core.method({
  463. selector: "registerBindingsOn:",
  464. protocol: "keybindings",
  465. //>>excludeStart("ide", pragmas.excludeIdeData);
  466. args: ["aBindingGroup"],
  467. source: "registerBindingsOn: aBindingGroup\x0a\x09HLToolCommand \x0a\x09\x09registerConcreteClassesOn: aBindingGroup \x0a\x09\x09for: self model",
  468. referencedClasses: ["HLToolCommand"],
  469. //>>excludeEnd("ide");
  470. pragmas: [],
  471. messageSends: ["registerConcreteClassesOn:for:", "model"]
  472. }, function ($methodClass){ return function (aBindingGroup){
  473. var self=this,$self=this;
  474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  475. return $core.withContext(function($ctx1) {
  476. //>>excludeEnd("ctx");
  477. $recv($globals.HLToolCommand)._registerConcreteClassesOn_for_(aBindingGroup,$self._model());
  478. return self;
  479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  480. }, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup})});
  481. //>>excludeEnd("ctx");
  482. }; }),
  483. $globals.HLDebugger);
  484. $core.addMethod(
  485. $core.method({
  486. selector: "renderContentOn:",
  487. protocol: "rendering",
  488. //>>excludeStart("ide", pragmas.excludeIdeData);
  489. args: ["html"],
  490. source: "renderContentOn: html\x0a\x09self renderHeadOn: html.\x0a\x09html with: (HLContainer with: (HLVerticalSplitter\x0a\x09\x09with: self codeWidget\x0a\x09\x09with: (HLHorizontalSplitter\x0a\x09\x09\x09with: self stackListWidget\x0a\x09\x09\x09with: self inspectorWidget)))",
  491. referencedClasses: ["HLContainer", "HLVerticalSplitter", "HLHorizontalSplitter"],
  492. //>>excludeEnd("ide");
  493. pragmas: [],
  494. messageSends: ["renderHeadOn:", "with:", "with:with:", "codeWidget", "stackListWidget", "inspectorWidget"]
  495. }, function ($methodClass){ return function (html){
  496. var self=this,$self=this;
  497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  498. return $core.withContext(function($ctx1) {
  499. //>>excludeEnd("ctx");
  500. $self._renderHeadOn_(html);
  501. [$recv(html)._with_($recv($globals.HLContainer)._with_([$recv($globals.HLVerticalSplitter)._with_with_($self._codeWidget(),$recv($globals.HLHorizontalSplitter)._with_with_($self._stackListWidget(),$self._inspectorWidget()))
  502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  503. ,$ctx1.sendIdx["with:with:"]=1
  504. //>>excludeEnd("ctx");
  505. ][0]))
  506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  507. ,$ctx1.sendIdx["with:"]=1
  508. //>>excludeEnd("ctx");
  509. ][0];
  510. return self;
  511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  512. }, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html})});
  513. //>>excludeEnd("ctx");
  514. }; }),
  515. $globals.HLDebugger);
  516. $core.addMethod(
  517. $core.method({
  518. selector: "renderHeadOn:",
  519. protocol: "rendering",
  520. //>>excludeStart("ide", pragmas.excludeIdeData);
  521. args: ["html"],
  522. source: "renderHeadOn: html\x0a\x09html div \x0a\x09\x09class: 'head'; \x0a\x09\x09with: [ html h2 with: self model error messageText ]",
  523. referencedClasses: [],
  524. //>>excludeEnd("ide");
  525. pragmas: [],
  526. messageSends: ["class:", "div", "with:", "h2", "messageText", "error", "model"]
  527. }, function ($methodClass){ return function (html){
  528. var self=this,$self=this;
  529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  530. return $core.withContext(function($ctx1) {
  531. //>>excludeEnd("ctx");
  532. var $1;
  533. $1=$recv(html)._div();
  534. $recv($1)._class_("head");
  535. [$recv($1)._with_((function(){
  536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  537. return $core.withContext(function($ctx2) {
  538. //>>excludeEnd("ctx");
  539. return $recv($recv(html)._h2())._with_($recv($recv($self._model())._error())._messageText());
  540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  541. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  542. //>>excludeEnd("ctx");
  543. }))
  544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  545. ,$ctx1.sendIdx["with:"]=1
  546. //>>excludeEnd("ctx");
  547. ][0];
  548. return self;
  549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  550. }, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html})});
  551. //>>excludeEnd("ctx");
  552. }; }),
  553. $globals.HLDebugger);
  554. $core.addMethod(
  555. $core.method({
  556. selector: "stackListWidget",
  557. protocol: "widgets",
  558. //>>excludeStart("ide", pragmas.excludeIdeData);
  559. args: [],
  560. source: "stackListWidget\x0a\x09^ stackListWidget ifNil: [ \x0a\x09\x09stackListWidget := (HLStackListWidget on: self model)\x0a\x09\x09\x09next: self codeWidget;\x0a\x09\x09\x09yourself ]",
  561. referencedClasses: ["HLStackListWidget"],
  562. //>>excludeEnd("ide");
  563. pragmas: [],
  564. messageSends: ["ifNil:", "next:", "on:", "model", "codeWidget", "yourself"]
  565. }, function ($methodClass){ return function (){
  566. var self=this,$self=this;
  567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  568. return $core.withContext(function($ctx1) {
  569. //>>excludeEnd("ctx");
  570. var $1,$2;
  571. $1=$self.stackListWidget;
  572. if($1 == null || $1.a$nil){
  573. $2=$recv($globals.HLStackListWidget)._on_($self._model());
  574. $recv($2)._next_($self._codeWidget());
  575. $self.stackListWidget=$recv($2)._yourself();
  576. return $self.stackListWidget;
  577. } else {
  578. return $1;
  579. }
  580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  581. }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{})});
  582. //>>excludeEnd("ctx");
  583. }; }),
  584. $globals.HLDebugger);
  585. $core.addMethod(
  586. $core.method({
  587. selector: "unregister",
  588. protocol: "actions",
  589. //>>excludeStart("ide", pragmas.excludeIdeData);
  590. args: [],
  591. source: "unregister\x0a\x09super unregister.\x0a\x09self inspectorWidget unregister",
  592. referencedClasses: [],
  593. //>>excludeEnd("ide");
  594. pragmas: [],
  595. messageSends: ["unregister", "inspectorWidget"]
  596. }, function ($methodClass){ return function (){
  597. var self=this,$self=this;
  598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  599. return $core.withContext(function($ctx1) {
  600. //>>excludeEnd("ctx");
  601. [(
  602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  603. $ctx1.supercall = true,
  604. //>>excludeEnd("ctx");
  605. ($methodClass.superclass||$boot.nilAsClass).fn.prototype._unregister.call($self))
  606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  607. ,$ctx1.sendIdx["unregister"]=1,$ctx1.supercall = false
  608. //>>excludeEnd("ctx");
  609. ][0];
  610. $recv($self._inspectorWidget())._unregister();
  611. return self;
  612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  613. }, function($ctx1) {$ctx1.fill(self,"unregister",{})});
  614. //>>excludeEnd("ctx");
  615. }; }),
  616. $globals.HLDebugger);
  617. $core.addMethod(
  618. $core.method({
  619. selector: "on:",
  620. protocol: "instance creation",
  621. //>>excludeStart("ide", pragmas.excludeIdeData);
  622. args: ["anError"],
  623. source: "on: anError\x0a\x09^ self new\x0a\x09\x09initializeFromError: anError;\x0a\x09\x09yourself",
  624. referencedClasses: [],
  625. //>>excludeEnd("ide");
  626. pragmas: [],
  627. messageSends: ["initializeFromError:", "new", "yourself"]
  628. }, function ($methodClass){ return function (anError){
  629. var self=this,$self=this;
  630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  631. return $core.withContext(function($ctx1) {
  632. //>>excludeEnd("ctx");
  633. var $1;
  634. $1=$self._new();
  635. $recv($1)._initializeFromError_(anError);
  636. return $recv($1)._yourself();
  637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  638. }, function($ctx1) {$ctx1.fill(self,"on:",{anError:anError})});
  639. //>>excludeEnd("ctx");
  640. }; }),
  641. $globals.HLDebugger.a$cls);
  642. $core.addMethod(
  643. $core.method({
  644. selector: "tabClass",
  645. protocol: "accessing",
  646. //>>excludeStart("ide", pragmas.excludeIdeData);
  647. args: [],
  648. source: "tabClass\x0a\x09^ 'debugger'",
  649. referencedClasses: [],
  650. //>>excludeEnd("ide");
  651. pragmas: [],
  652. messageSends: []
  653. }, function ($methodClass){ return function (){
  654. var self=this,$self=this;
  655. return "debugger";
  656. }; }),
  657. $globals.HLDebugger.a$cls);
  658. $core.addMethod(
  659. $core.method({
  660. selector: "tabLabel",
  661. protocol: "accessing",
  662. //>>excludeStart("ide", pragmas.excludeIdeData);
  663. args: [],
  664. source: "tabLabel\x0a\x09^ 'Debugger'",
  665. referencedClasses: [],
  666. //>>excludeEnd("ide");
  667. pragmas: [],
  668. messageSends: []
  669. }, function ($methodClass){ return function (){
  670. var self=this,$self=this;
  671. return "Debugger";
  672. }; }),
  673. $globals.HLDebugger.a$cls);
  674. $core.addClass("HLDebuggerCodeModel", $globals.HLCodeModel, "Helios-Debugger");
  675. $core.setSlots($globals.HLDebuggerCodeModel, ["debuggerModel"]);
  676. $core.addMethod(
  677. $core.method({
  678. selector: "debuggerModel",
  679. protocol: "accessing",
  680. //>>excludeStart("ide", pragmas.excludeIdeData);
  681. args: [],
  682. source: "debuggerModel\x0a\x09^ debuggerModel",
  683. referencedClasses: [],
  684. //>>excludeEnd("ide");
  685. pragmas: [],
  686. messageSends: []
  687. }, function ($methodClass){ return function (){
  688. var self=this,$self=this;
  689. return $self.debuggerModel;
  690. }; }),
  691. $globals.HLDebuggerCodeModel);
  692. $core.addMethod(
  693. $core.method({
  694. selector: "debuggerModel:",
  695. protocol: "accessing",
  696. //>>excludeStart("ide", pragmas.excludeIdeData);
  697. args: ["anObject"],
  698. source: "debuggerModel: anObject\x0a\x09debuggerModel := anObject",
  699. referencedClasses: [],
  700. //>>excludeEnd("ide");
  701. pragmas: [],
  702. messageSends: []
  703. }, function ($methodClass){ return function (anObject){
  704. var self=this,$self=this;
  705. $self.debuggerModel=anObject;
  706. return self;
  707. }; }),
  708. $globals.HLDebuggerCodeModel);
  709. $core.addMethod(
  710. $core.method({
  711. selector: "doIt:",
  712. protocol: "actions",
  713. //>>excludeStart("ide", pragmas.excludeIdeData);
  714. args: ["aString"],
  715. source: "doIt: aString\x0a\x09^ self debuggerModel evaluate: aString",
  716. referencedClasses: [],
  717. //>>excludeEnd("ide");
  718. pragmas: [],
  719. messageSends: ["evaluate:", "debuggerModel"]
  720. }, function ($methodClass){ return function (aString){
  721. var self=this,$self=this;
  722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  723. return $core.withContext(function($ctx1) {
  724. //>>excludeEnd("ctx");
  725. return $recv($self._debuggerModel())._evaluate_(aString);
  726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  727. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString})});
  728. //>>excludeEnd("ctx");
  729. }; }),
  730. $globals.HLDebuggerCodeModel);
  731. $core.addClass("HLDebuggerCodeWidget", $globals.HLBrowserCodeWidget, "Helios-Debugger");
  732. $core.addMethod(
  733. $core.method({
  734. selector: "addStopAt:",
  735. protocol: "actions",
  736. //>>excludeStart("ide", pragmas.excludeIdeData);
  737. args: ["anInteger"],
  738. source: "addStopAt: anInteger\x0a\x09editor\x0a\x09\x09setGutterMarker: anInteger\x0a\x09\x09gutter: 'stops'\x0a\x09\x09value: '<div class=\x22stop\x22></div>' asJQuery toArray first",
  739. referencedClasses: [],
  740. //>>excludeEnd("ide");
  741. pragmas: [],
  742. messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery"]
  743. }, function ($methodClass){ return function (anInteger){
  744. var self=this,$self=this;
  745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  746. return $core.withContext(function($ctx1) {
  747. //>>excludeEnd("ctx");
  748. $recv($self.editor)._setGutterMarker_gutter_value_(anInteger,"stops",$recv($recv("<div class=\x22stop\x22></div>"._asJQuery())._toArray())._first());
  749. return self;
  750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  751. }, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger})});
  752. //>>excludeEnd("ctx");
  753. }; }),
  754. $globals.HLDebuggerCodeWidget);
  755. $core.addMethod(
  756. $core.method({
  757. selector: "clearHighlight",
  758. protocol: "actions",
  759. //>>excludeStart("ide", pragmas.excludeIdeData);
  760. args: [],
  761. source: "clearHighlight\x0a\x09self editor clearGutter: 'stops'",
  762. referencedClasses: [],
  763. //>>excludeEnd("ide");
  764. pragmas: [],
  765. messageSends: ["clearGutter:", "editor"]
  766. }, function ($methodClass){ return function (){
  767. var self=this,$self=this;
  768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  769. return $core.withContext(function($ctx1) {
  770. //>>excludeEnd("ctx");
  771. $recv($self._editor())._clearGutter_("stops");
  772. return self;
  773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  774. }, function($ctx1) {$ctx1.fill(self,"clearHighlight",{})});
  775. //>>excludeEnd("ctx");
  776. }; }),
  777. $globals.HLDebuggerCodeWidget);
  778. $core.addMethod(
  779. $core.method({
  780. selector: "contents:",
  781. protocol: "accessing",
  782. //>>excludeStart("ide", pragmas.excludeIdeData);
  783. args: ["aString"],
  784. source: "contents: aString\x0a\x09self clearHighlight.\x0a\x09super contents: aString",
  785. referencedClasses: [],
  786. //>>excludeEnd("ide");
  787. pragmas: [],
  788. messageSends: ["clearHighlight", "contents:"]
  789. }, function ($methodClass){ return function (aString){
  790. var self=this,$self=this;
  791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  792. return $core.withContext(function($ctx1) {
  793. //>>excludeEnd("ctx");
  794. $self._clearHighlight();
  795. [(
  796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  797. $ctx1.supercall = true,
  798. //>>excludeEnd("ctx");
  799. ($methodClass.superclass||$boot.nilAsClass).fn.prototype._contents_.call($self,aString))
  800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  801. ,$ctx1.supercall = false
  802. //>>excludeEnd("ctx");
  803. ][0];
  804. return self;
  805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  806. }, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString})});
  807. //>>excludeEnd("ctx");
  808. }; }),
  809. $globals.HLDebuggerCodeWidget);
  810. $core.addMethod(
  811. $core.method({
  812. selector: "editorOptions",
  813. protocol: "accessing",
  814. //>>excludeStart("ide", pragmas.excludeIdeData);
  815. args: [],
  816. source: "editorOptions\x0a\x09^ super editorOptions\x0a\x09\x09at: 'gutters' put: #('CodeMirror-linenumbers' 'stops');\x0a\x09\x09yourself",
  817. referencedClasses: [],
  818. //>>excludeEnd("ide");
  819. pragmas: [],
  820. messageSends: ["at:put:", "editorOptions", "yourself"]
  821. }, function ($methodClass){ return function (){
  822. var self=this,$self=this;
  823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  824. return $core.withContext(function($ctx1) {
  825. //>>excludeEnd("ctx");
  826. var $1;
  827. $1=[(
  828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  829. $ctx1.supercall = true,
  830. //>>excludeEnd("ctx");
  831. ($methodClass.superclass||$boot.nilAsClass).fn.prototype._editorOptions.call($self))
  832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  833. ,$ctx1.supercall = false
  834. //>>excludeEnd("ctx");
  835. ][0];
  836. $recv($1)._at_put_("gutters",["CodeMirror-linenumbers", "stops"]);
  837. return $recv($1)._yourself();
  838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  839. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{})});
  840. //>>excludeEnd("ctx");
  841. }; }),
  842. $globals.HLDebuggerCodeWidget);
  843. $core.addMethod(
  844. $core.method({
  845. selector: "highlight",
  846. protocol: "actions",
  847. //>>excludeStart("ide", pragmas.excludeIdeData);
  848. args: [],
  849. source: "highlight\x0a\x09self browserModel nextNode ifNotNil: [ :node |\x0a\x09\x09self highlightNode: node ]",
  850. referencedClasses: [],
  851. //>>excludeEnd("ide");
  852. pragmas: [],
  853. messageSends: ["ifNotNil:", "nextNode", "browserModel", "highlightNode:"]
  854. }, function ($methodClass){ return function (){
  855. var self=this,$self=this;
  856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  857. return $core.withContext(function($ctx1) {
  858. //>>excludeEnd("ctx");
  859. var $1;
  860. $1=$recv($self._browserModel())._nextNode();
  861. if($1 == null || $1.a$nil){
  862. $1;
  863. } else {
  864. var node;
  865. node=$1;
  866. $self._highlightNode_(node);
  867. }
  868. return self;
  869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  870. }, function($ctx1) {$ctx1.fill(self,"highlight",{})});
  871. //>>excludeEnd("ctx");
  872. }; }),
  873. $globals.HLDebuggerCodeWidget);
  874. $core.addMethod(
  875. $core.method({
  876. selector: "highlightNode:",
  877. protocol: "actions",
  878. //>>excludeStart("ide", pragmas.excludeIdeData);
  879. args: ["aNode"],
  880. 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) } ]",
  881. referencedClasses: [],
  882. //>>excludeEnd("ide");
  883. pragmas: [],
  884. messageSends: ["ifNotNil:", "clearHighlight", "addStopAt:", "-", "x", "positionStart", "setSelection:to:", "editor", "y", "positionEnd"]
  885. }, function ($methodClass){ return function (aNode){
  886. var self=this,$self=this;
  887. var token;
  888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  889. return $core.withContext(function($ctx1) {
  890. //>>excludeEnd("ctx");
  891. if(aNode == null || aNode.a$nil){
  892. aNode;
  893. } else {
  894. $self._clearHighlight();
  895. $self._addStopAt_([$recv([$recv([$recv(aNode)._positionStart()
  896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  897. ,$ctx1.sendIdx["positionStart"]=1
  898. //>>excludeEnd("ctx");
  899. ][0])._x()
  900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  901. ,$ctx1.sendIdx["x"]=1
  902. //>>excludeEnd("ctx");
  903. ][0]).__minus((1))
  904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  905. ,$ctx1.sendIdx["-"]=1
  906. //>>excludeEnd("ctx");
  907. ][0]);
  908. $recv($self._editor())._setSelection_to_($globals.HashedCollection._newFromPairs_(["line",[$recv([$recv([$recv(aNode)._positionStart()
  909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  910. ,$ctx1.sendIdx["positionStart"]=2
  911. //>>excludeEnd("ctx");
  912. ][0])._x()
  913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  914. ,$ctx1.sendIdx["x"]=2
  915. //>>excludeEnd("ctx");
  916. ][0]).__minus((1))
  917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  918. ,$ctx1.sendIdx["-"]=2
  919. //>>excludeEnd("ctx");
  920. ][0],"ch",[$recv([$recv($recv(aNode)._positionStart())._y()
  921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  922. ,$ctx1.sendIdx["y"]=1
  923. //>>excludeEnd("ctx");
  924. ][0]).__minus((1))
  925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  926. ,$ctx1.sendIdx["-"]=3
  927. //>>excludeEnd("ctx");
  928. ][0]]),$globals.HashedCollection._newFromPairs_(["line",$recv($recv([$recv(aNode)._positionEnd()
  929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  930. ,$ctx1.sendIdx["positionEnd"]=1
  931. //>>excludeEnd("ctx");
  932. ][0])._x()).__minus((1)),"ch",$recv($recv(aNode)._positionEnd())._y()]));
  933. }
  934. return self;
  935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  936. }, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,token:token})});
  937. //>>excludeEnd("ctx");
  938. }; }),
  939. $globals.HLDebuggerCodeWidget);
  940. $core.addMethod(
  941. $core.method({
  942. selector: "observeBrowserModel",
  943. protocol: "actions",
  944. //>>excludeStart("ide", pragmas.excludeIdeData);
  945. args: [],
  946. 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",
  947. referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped", "HLDebuggerWhere"],
  948. //>>excludeEnd("ide");
  949. pragmas: [],
  950. messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel"]
  951. }, function ($methodClass){ return function (){
  952. var self=this,$self=this;
  953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  954. return $core.withContext(function($ctx1) {
  955. //>>excludeEnd("ctx");
  956. [(
  957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  958. $ctx1.supercall = true,
  959. //>>excludeEnd("ctx");
  960. ($methodClass.superclass||$boot.nilAsClass).fn.prototype._observeBrowserModel.call($self))
  961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  962. ,$ctx1.supercall = false
  963. //>>excludeEnd("ctx");
  964. ][0];
  965. [$recv([$recv([$self._browserModel()
  966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  967. ,$ctx1.sendIdx["browserModel"]=1
  968. //>>excludeEnd("ctx");
  969. ][0])._announcer()
  970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  971. ,$ctx1.sendIdx["announcer"]=1
  972. //>>excludeEnd("ctx");
  973. ][0])._on_send_to_($globals.HLDebuggerContextSelected,"onContextSelected",self)
  974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  975. ,$ctx1.sendIdx["on:send:to:"]=1
  976. //>>excludeEnd("ctx");
  977. ][0];
  978. [$recv([$recv([$self._browserModel()
  979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  980. ,$ctx1.sendIdx["browserModel"]=2
  981. //>>excludeEnd("ctx");
  982. ][0])._announcer()
  983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  984. ,$ctx1.sendIdx["announcer"]=2
  985. //>>excludeEnd("ctx");
  986. ][0])._on_send_to_($globals.HLDebuggerStepped,"onContextSelected",self)
  987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  988. ,$ctx1.sendIdx["on:send:to:"]=2
  989. //>>excludeEnd("ctx");
  990. ][0];
  991. $recv($recv($self._browserModel())._announcer())._on_send_to_($globals.HLDebuggerWhere,"onContextSelected",self);
  992. return self;
  993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  994. }, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{})});
  995. //>>excludeEnd("ctx");
  996. }; }),
  997. $globals.HLDebuggerCodeWidget);
  998. $core.addMethod(
  999. $core.method({
  1000. selector: "onContextSelected",
  1001. protocol: "reactions",
  1002. //>>excludeStart("ide", pragmas.excludeIdeData);
  1003. args: [],
  1004. source: "onContextSelected\x0a\x09self highlight",
  1005. referencedClasses: [],
  1006. //>>excludeEnd("ide");
  1007. pragmas: [],
  1008. messageSends: ["highlight"]
  1009. }, function ($methodClass){ return function (){
  1010. var self=this,$self=this;
  1011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1012. return $core.withContext(function($ctx1) {
  1013. //>>excludeEnd("ctx");
  1014. $self._highlight();
  1015. return self;
  1016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1017. }, function($ctx1) {$ctx1.fill(self,"onContextSelected",{})});
  1018. //>>excludeEnd("ctx");
  1019. }; }),
  1020. $globals.HLDebuggerCodeWidget);
  1021. $core.addMethod(
  1022. $core.method({
  1023. selector: "renderOn:",
  1024. protocol: "rendering",
  1025. //>>excludeStart("ide", pragmas.excludeIdeData);
  1026. args: ["html"],
  1027. source: "renderOn: html\x0a\x09super renderOn: html.\x0a\x09self contents: self browserModel selectedMethod source",
  1028. referencedClasses: [],
  1029. //>>excludeEnd("ide");
  1030. pragmas: [],
  1031. messageSends: ["renderOn:", "contents:", "source", "selectedMethod", "browserModel"]
  1032. }, function ($methodClass){ return function (html){
  1033. var self=this,$self=this;
  1034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1035. return $core.withContext(function($ctx1) {
  1036. //>>excludeEnd("ctx");
  1037. [(
  1038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1039. $ctx1.supercall = true,
  1040. //>>excludeEnd("ctx");
  1041. ($methodClass.superclass||$boot.nilAsClass).fn.prototype._renderOn_.call($self,html))
  1042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1043. ,$ctx1.supercall = false
  1044. //>>excludeEnd("ctx");
  1045. ][0];
  1046. $self._contents_($recv($recv($self._browserModel())._selectedMethod())._source());
  1047. return self;
  1048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1049. }, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html})});
  1050. //>>excludeEnd("ctx");
  1051. }; }),
  1052. $globals.HLDebuggerCodeWidget);
  1053. $core.addClass("HLDebuggerModel", $globals.HLToolModel, "Helios-Debugger");
  1054. $core.setSlots($globals.HLDebuggerModel, ["rootContext", "debugger", "error"]);
  1055. //>>excludeStart("ide", pragmas.excludeIdeData);
  1056. $globals.HLDebuggerModel.comment="I am a model for debugging Amber code in Helios.\x0a\x0aMy instances hold a reference to an `ASTDebugger` instance, itself referencing the current `context`. The context should be the root of the context stack.";
  1057. //>>excludeEnd("ide");
  1058. $core.addMethod(
  1059. $core.method({
  1060. selector: "atEnd",
  1061. protocol: "testing",
  1062. //>>excludeStart("ide", pragmas.excludeIdeData);
  1063. args: [],
  1064. source: "atEnd\x0a\x09^ self debugger atEnd",
  1065. referencedClasses: [],
  1066. //>>excludeEnd("ide");
  1067. pragmas: [],
  1068. messageSends: ["atEnd", "debugger"]
  1069. }, function ($methodClass){ return function (){
  1070. var self=this,$self=this;
  1071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1072. return $core.withContext(function($ctx1) {
  1073. //>>excludeEnd("ctx");
  1074. return $recv($self._debugger())._atEnd();
  1075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1076. }, function($ctx1) {$ctx1.fill(self,"atEnd",{})});
  1077. //>>excludeEnd("ctx");
  1078. }; }),
  1079. $globals.HLDebuggerModel);
  1080. $core.addMethod(
  1081. $core.method({
  1082. selector: "contexts",
  1083. protocol: "accessing",
  1084. //>>excludeStart("ide", pragmas.excludeIdeData);
  1085. args: [],
  1086. source: "contexts\x0a\x09| contexts 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 ].\x0a\x09\x09\x0a\x09^ contexts",
  1087. referencedClasses: ["OrderedCollection"],
  1088. //>>excludeEnd("ide");
  1089. pragmas: [],
  1090. messageSends: ["new", "rootContext", "whileTrue:", "notNil", "add:", "outerContext"]
  1091. }, function ($methodClass){ return function (){
  1092. var self=this,$self=this;
  1093. var contexts,context;
  1094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1095. return $core.withContext(function($ctx1) {
  1096. //>>excludeEnd("ctx");
  1097. contexts=$recv($globals.OrderedCollection)._new();
  1098. context=$self._rootContext();
  1099. $recv((function(){
  1100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1101. return $core.withContext(function($ctx2) {
  1102. //>>excludeEnd("ctx");
  1103. return $recv(context)._notNil();
  1104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1105. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1106. //>>excludeEnd("ctx");
  1107. }))._whileTrue_((function(){
  1108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1109. return $core.withContext(function($ctx2) {
  1110. //>>excludeEnd("ctx");
  1111. $recv(contexts)._add_(context);
  1112. context=$recv(context)._outerContext();
  1113. return context;
  1114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1115. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1116. //>>excludeEnd("ctx");
  1117. }));
  1118. return contexts;
  1119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1120. }, function($ctx1) {$ctx1.fill(self,"contexts",{contexts:contexts,context:context})});
  1121. //>>excludeEnd("ctx");
  1122. }; }),
  1123. $globals.HLDebuggerModel);
  1124. $core.addMethod(
  1125. $core.method({
  1126. selector: "currentContext",
  1127. protocol: "accessing",
  1128. //>>excludeStart("ide", pragmas.excludeIdeData);
  1129. args: [],
  1130. source: "currentContext\x0a\x09^ self debugger context",
  1131. referencedClasses: [],
  1132. //>>excludeEnd("ide");
  1133. pragmas: [],
  1134. messageSends: ["context", "debugger"]
  1135. }, function ($methodClass){ return function (){
  1136. var self=this,$self=this;
  1137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1138. return $core.withContext(function($ctx1) {
  1139. //>>excludeEnd("ctx");
  1140. return $recv($self._debugger())._context();
  1141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1142. }, function($ctx1) {$ctx1.fill(self,"currentContext",{})});
  1143. //>>excludeEnd("ctx");
  1144. }; }),
  1145. $globals.HLDebuggerModel);
  1146. $core.addMethod(
  1147. $core.method({
  1148. selector: "currentContext:",
  1149. protocol: "accessing",
  1150. //>>excludeStart("ide", pragmas.excludeIdeData);
  1151. args: ["aContext"],
  1152. source: "currentContext: aContext\x0a\x09self withChangesDo: [ \x0a\x09\x09self selectedMethod: aContext method.\x0a\x09\x09self debugger context: aContext.\x0a\x09\x09self announcer announce: (HLDebuggerContextSelected new\x0a\x09\x09\x09context: aContext;\x0a\x09\x09\x09yourself) ]",
  1153. referencedClasses: ["HLDebuggerContextSelected"],
  1154. //>>excludeEnd("ide");
  1155. pragmas: [],
  1156. messageSends: ["withChangesDo:", "selectedMethod:", "method", "context:", "debugger", "announce:", "announcer", "new", "yourself"]
  1157. }, function ($methodClass){ return function (aContext){
  1158. var self=this,$self=this;
  1159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1160. return $core.withContext(function($ctx1) {
  1161. //>>excludeEnd("ctx");
  1162. var $1,$2;
  1163. $self._withChangesDo_((function(){
  1164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1165. return $core.withContext(function($ctx2) {
  1166. //>>excludeEnd("ctx");
  1167. $self._selectedMethod_($recv(aContext)._method());
  1168. [$recv($self._debugger())._context_(aContext)
  1169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1170. ,$ctx2.sendIdx["context:"]=1
  1171. //>>excludeEnd("ctx");
  1172. ][0];
  1173. $1=$self._announcer();
  1174. $2=$recv($globals.HLDebuggerContextSelected)._new();
  1175. $recv($2)._context_(aContext);
  1176. return $recv($1)._announce_($recv($2)._yourself());
  1177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1178. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1179. //>>excludeEnd("ctx");
  1180. }));
  1181. return self;
  1182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1183. }, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext})});
  1184. //>>excludeEnd("ctx");
  1185. }; }),
  1186. $globals.HLDebuggerModel);
  1187. $core.addMethod(
  1188. $core.method({
  1189. selector: "debugger",
  1190. protocol: "accessing",
  1191. //>>excludeStart("ide", pragmas.excludeIdeData);
  1192. args: [],
  1193. source: "debugger\x0a\x09^ debugger ifNil: [ debugger := ASTDebugger new ]",
  1194. referencedClasses: ["ASTDebugger"],
  1195. //>>excludeEnd("ide");
  1196. pragmas: [],
  1197. messageSends: ["ifNil:", "new"]
  1198. }, function ($methodClass){ return function (){
  1199. var self=this,$self=this;
  1200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1201. return $core.withContext(function($ctx1) {
  1202. //>>excludeEnd("ctx");
  1203. var $1;
  1204. $1=$self.debugger;
  1205. if($1 == null || $1.a$nil){
  1206. $self.debugger=$recv($globals.ASTDebugger)._new();
  1207. return $self.debugger;
  1208. } else {
  1209. return $1;
  1210. }
  1211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1212. }, function($ctx1) {$ctx1.fill(self,"debugger",{})});
  1213. //>>excludeEnd("ctx");
  1214. }; }),
  1215. $globals.HLDebuggerModel);
  1216. $core.addMethod(
  1217. $core.method({
  1218. selector: "error",
  1219. protocol: "accessing",
  1220. //>>excludeStart("ide", pragmas.excludeIdeData);
  1221. args: [],
  1222. source: "error\x0a\x09^ error",
  1223. referencedClasses: [],
  1224. //>>excludeEnd("ide");
  1225. pragmas: [],
  1226. messageSends: []
  1227. }, function ($methodClass){ return function (){
  1228. var self=this,$self=this;
  1229. return $self.error;
  1230. }; }),
  1231. $globals.HLDebuggerModel);
  1232. $core.addMethod(
  1233. $core.method({
  1234. selector: "evaluate:",
  1235. protocol: "evaluating",
  1236. //>>excludeStart("ide", pragmas.excludeIdeData);
  1237. args: ["aString"],
  1238. source: "evaluate: aString\x0a\x09^ self environment \x0a\x09\x09evaluate: aString \x0a\x09\x09for: self currentContext",
  1239. referencedClasses: [],
  1240. //>>excludeEnd("ide");
  1241. pragmas: [],
  1242. messageSends: ["evaluate:for:", "environment", "currentContext"]
  1243. }, function ($methodClass){ return function (aString){
  1244. var self=this,$self=this;
  1245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1246. return $core.withContext(function($ctx1) {
  1247. //>>excludeEnd("ctx");
  1248. return $recv($self._environment())._evaluate_for_(aString,$self._currentContext());
  1249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1250. }, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString})});
  1251. //>>excludeEnd("ctx");
  1252. }; }),
  1253. $globals.HLDebuggerModel);
  1254. $core.addMethod(
  1255. $core.method({
  1256. selector: "flushInnerContexts",
  1257. protocol: "private",
  1258. //>>excludeStart("ide", pragmas.excludeIdeData);
  1259. args: [],
  1260. source: "flushInnerContexts\x0a\x09\x22When stepping, the inner contexts are not relevent anymore,\x0a\x09and can be flushed\x22\x0a\x09\x0a\x09self currentContext innerContext: nil.\x0a\x09rootContext := self currentContext.\x0a\x09self initializeContexts",
  1261. referencedClasses: [],
  1262. //>>excludeEnd("ide");
  1263. pragmas: [],
  1264. messageSends: ["innerContext:", "currentContext", "initializeContexts"]
  1265. }, function ($methodClass){ return function (){
  1266. var self=this,$self=this;
  1267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1268. return $core.withContext(function($ctx1) {
  1269. //>>excludeEnd("ctx");
  1270. $recv([$self._currentContext()
  1271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1272. ,$ctx1.sendIdx["currentContext"]=1
  1273. //>>excludeEnd("ctx");
  1274. ][0])._innerContext_(nil);
  1275. $self.rootContext=$self._currentContext();
  1276. $self._initializeContexts();
  1277. return self;
  1278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1279. }, function($ctx1) {$ctx1.fill(self,"flushInnerContexts",{})});
  1280. //>>excludeEnd("ctx");
  1281. }; }),
  1282. $globals.HLDebuggerModel);
  1283. $core.addMethod(
  1284. $core.method({
  1285. selector: "initializeFromError:",
  1286. protocol: "initialization",
  1287. //>>excludeStart("ide", pragmas.excludeIdeData);
  1288. args: ["anError"],
  1289. source: "initializeFromError: anError\x0a\x09| errorContext |\x0a\x09\x0a\x09error := anError.\x0a\x09errorContext := (AIContext fromMethodContext: error context).\x0a\x09rootContext := error signalerContextFrom: errorContext.\x0a\x09self selectedMethod: rootContext method",
  1290. referencedClasses: ["AIContext"],
  1291. //>>excludeEnd("ide");
  1292. pragmas: [],
  1293. messageSends: ["fromMethodContext:", "context", "signalerContextFrom:", "selectedMethod:", "method"]
  1294. }, function ($methodClass){ return function (anError){
  1295. var self=this,$self=this;
  1296. var errorContext;
  1297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1298. return $core.withContext(function($ctx1) {
  1299. //>>excludeEnd("ctx");
  1300. $self.error=anError;
  1301. errorContext=$recv($globals.AIContext)._fromMethodContext_($recv($self.error)._context());
  1302. $self.rootContext=$recv($self.error)._signalerContextFrom_(errorContext);
  1303. $self._selectedMethod_($recv($self.rootContext)._method());
  1304. return self;
  1305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1306. }, function($ctx1) {$ctx1.fill(self,"initializeFromError:",{anError:anError,errorContext:errorContext})});
  1307. //>>excludeEnd("ctx");
  1308. }; }),
  1309. $globals.HLDebuggerModel);
  1310. $core.addMethod(
  1311. $core.method({
  1312. selector: "isReferencesModel",
  1313. protocol: "testing",
  1314. //>>excludeStart("ide", pragmas.excludeIdeData);
  1315. args: [],
  1316. source: "isReferencesModel\x0a\x09^ true",
  1317. referencedClasses: [],
  1318. //>>excludeEnd("ide");
  1319. pragmas: [],
  1320. messageSends: []
  1321. }, function ($methodClass){ return function (){
  1322. var self=this,$self=this;
  1323. return true;
  1324. }; }),
  1325. $globals.HLDebuggerModel);
  1326. $core.addMethod(
  1327. $core.method({
  1328. selector: "nextNode",
  1329. protocol: "accessing",
  1330. //>>excludeStart("ide", pragmas.excludeIdeData);
  1331. args: [],
  1332. source: "nextNode\x0a\x09^ self debugger node",
  1333. referencedClasses: [],
  1334. //>>excludeEnd("ide");
  1335. pragmas: [],
  1336. messageSends: ["node", "debugger"]
  1337. }, function ($methodClass){ return function (){
  1338. var self=this,$self=this;
  1339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1340. return $core.withContext(function($ctx1) {
  1341. //>>excludeEnd("ctx");
  1342. return $recv($self._debugger())._node();
  1343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1344. }, function($ctx1) {$ctx1.fill(self,"nextNode",{})});
  1345. //>>excludeEnd("ctx");
  1346. }; }),
  1347. $globals.HLDebuggerModel);
  1348. $core.addMethod(
  1349. $core.method({
  1350. selector: "onStep",
  1351. protocol: "reactions",
  1352. //>>excludeStart("ide", pragmas.excludeIdeData);
  1353. args: [],
  1354. source: "onStep\x0a\x09rootContext := self currentContext.\x0a\x09\x0a\x09\x22Force a refresh of the context list and code widget\x22\x0a\x09self selectedMethod: self currentContext method.\x0a\x09self announcer announce: (HLDebuggerContextSelected new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  1355. referencedClasses: ["HLDebuggerContextSelected"],
  1356. //>>excludeEnd("ide");
  1357. pragmas: [],
  1358. messageSends: ["currentContext", "selectedMethod:", "method", "announce:", "announcer", "context:", "new", "yourself"]
  1359. }, function ($methodClass){ return function (){
  1360. var self=this,$self=this;
  1361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1362. return $core.withContext(function($ctx1) {
  1363. //>>excludeEnd("ctx");
  1364. var $1,$2;
  1365. $self.rootContext=[$self._currentContext()
  1366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1367. ,$ctx1.sendIdx["currentContext"]=1
  1368. //>>excludeEnd("ctx");
  1369. ][0];
  1370. $self._selectedMethod_($recv([$self._currentContext()
  1371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1372. ,$ctx1.sendIdx["currentContext"]=2
  1373. //>>excludeEnd("ctx");
  1374. ][0])._method());
  1375. $1=$self._announcer();
  1376. $2=$recv($globals.HLDebuggerContextSelected)._new();
  1377. $recv($2)._context_($self._currentContext());
  1378. $recv($1)._announce_($recv($2)._yourself());
  1379. return self;
  1380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1381. }, function($ctx1) {$ctx1.fill(self,"onStep",{})});
  1382. //>>excludeEnd("ctx");
  1383. }; }),
  1384. $globals.HLDebuggerModel);
  1385. $core.addMethod(
  1386. $core.method({
  1387. selector: "openMethod",
  1388. protocol: "testing",
  1389. //>>excludeStart("ide", pragmas.excludeIdeData);
  1390. args: [],
  1391. source: "openMethod\x0a\x09| browser |\x0a\x09\x0a\x09self selectedMethod ifNil: [ ^ self ].\x0a\x09\x0a\x09self withChangesDo: [\x0a\x09\x09browser := HLBrowser openAsTab.\x0a\x09\x09browser openMethod: self selectedMethod ]",
  1392. referencedClasses: ["HLBrowser"],
  1393. //>>excludeEnd("ide");
  1394. pragmas: [],
  1395. messageSends: ["ifNil:", "selectedMethod", "withChangesDo:", "openAsTab", "openMethod:"]
  1396. }, function ($methodClass){ return function (){
  1397. var self=this,$self=this;
  1398. var browser;
  1399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1400. return $core.withContext(function($ctx1) {
  1401. //>>excludeEnd("ctx");
  1402. var $1;
  1403. $1=[$self._selectedMethod()
  1404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1405. ,$ctx1.sendIdx["selectedMethod"]=1
  1406. //>>excludeEnd("ctx");
  1407. ][0];
  1408. if($1 == null || $1.a$nil){
  1409. return self;
  1410. } else {
  1411. $1;
  1412. }
  1413. $self._withChangesDo_((function(){
  1414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1415. return $core.withContext(function($ctx2) {
  1416. //>>excludeEnd("ctx");
  1417. browser=$recv($globals.HLBrowser)._openAsTab();
  1418. return $recv(browser)._openMethod_($self._selectedMethod());
  1419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1420. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1421. //>>excludeEnd("ctx");
  1422. }));
  1423. return self;
  1424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1425. }, function($ctx1) {$ctx1.fill(self,"openMethod",{browser:browser})});
  1426. //>>excludeEnd("ctx");
  1427. }; }),
  1428. $globals.HLDebuggerModel);
  1429. $core.addMethod(
  1430. $core.method({
  1431. selector: "proceed",
  1432. protocol: "actions",
  1433. //>>excludeStart("ide", pragmas.excludeIdeData);
  1434. args: [],
  1435. source: "proceed\x0a\x09self debugger proceed.\x0a\x09\x0a\x09self announcer announce: HLDebuggerProceeded new",
  1436. referencedClasses: ["HLDebuggerProceeded"],
  1437. //>>excludeEnd("ide");
  1438. pragmas: [],
  1439. messageSends: ["proceed", "debugger", "announce:", "announcer", "new"]
  1440. }, function ($methodClass){ return function (){
  1441. var self=this,$self=this;
  1442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1443. return $core.withContext(function($ctx1) {
  1444. //>>excludeEnd("ctx");
  1445. $recv($self._debugger())._proceed();
  1446. $recv($self._announcer())._announce_($recv($globals.HLDebuggerProceeded)._new());
  1447. return self;
  1448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1449. }, function($ctx1) {$ctx1.fill(self,"proceed",{})});
  1450. //>>excludeEnd("ctx");
  1451. }; }),
  1452. $globals.HLDebuggerModel);
  1453. $core.addMethod(
  1454. $core.method({
  1455. selector: "restart",
  1456. protocol: "actions",
  1457. //>>excludeStart("ide", pragmas.excludeIdeData);
  1458. args: [],
  1459. source: "restart\x0a\x09self debugger restart.\x0a\x09self onStep.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  1460. referencedClasses: ["HLDebuggerStepped"],
  1461. //>>excludeEnd("ide");
  1462. pragmas: [],
  1463. messageSends: ["restart", "debugger", "onStep", "announce:", "announcer", "context:", "new", "currentContext", "yourself"]
  1464. }, function ($methodClass){ return function (){
  1465. var self=this,$self=this;
  1466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1467. return $core.withContext(function($ctx1) {
  1468. //>>excludeEnd("ctx");
  1469. var $1,$2;
  1470. $recv($self._debugger())._restart();
  1471. $self._onStep();
  1472. $1=$self._announcer();
  1473. $2=$recv($globals.HLDebuggerStepped)._new();
  1474. $recv($2)._context_($self._currentContext());
  1475. $recv($1)._announce_($recv($2)._yourself());
  1476. return self;
  1477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1478. }, function($ctx1) {$ctx1.fill(self,"restart",{})});
  1479. //>>excludeEnd("ctx");
  1480. }; }),
  1481. $globals.HLDebuggerModel);
  1482. $core.addMethod(
  1483. $core.method({
  1484. selector: "rootContext",
  1485. protocol: "accessing",
  1486. //>>excludeStart("ide", pragmas.excludeIdeData);
  1487. args: [],
  1488. source: "rootContext\x0a\x09^ rootContext",
  1489. referencedClasses: [],
  1490. //>>excludeEnd("ide");
  1491. pragmas: [],
  1492. messageSends: []
  1493. }, function ($methodClass){ return function (){
  1494. var self=this,$self=this;
  1495. return $self.rootContext;
  1496. }; }),
  1497. $globals.HLDebuggerModel);
  1498. $core.addMethod(
  1499. $core.method({
  1500. selector: "stepOver",
  1501. protocol: "actions",
  1502. //>>excludeStart("ide", pragmas.excludeIdeData);
  1503. args: [],
  1504. source: "stepOver\x0a\x09self debugger stepOver.\x0a\x09self onStep.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
  1505. referencedClasses: ["HLDebuggerStepped"],
  1506. //>>excludeEnd("ide");
  1507. pragmas: [],
  1508. messageSends: ["stepOver", "debugger", "onStep", "announce:", "announcer", "context:", "new", "currentContext", "yourself"]
  1509. }, function ($methodClass){ return function (){
  1510. var self=this,$self=this;
  1511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1512. return $core.withContext(function($ctx1) {
  1513. //>>excludeEnd("ctx");
  1514. var $1,$2;
  1515. $recv($self._debugger())._stepOver();
  1516. $self._onStep();
  1517. $1=$self._announcer();
  1518. $2=$recv($globals.HLDebuggerStepped)._new();
  1519. $recv($2)._context_($self._currentContext());
  1520. $recv($1)._announce_($recv($2)._yourself());
  1521. return self;
  1522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1523. }, function($ctx1) {$ctx1.fill(self,"stepOver",{})});
  1524. //>>excludeEnd("ctx");
  1525. }; }),
  1526. $globals.HLDebuggerModel);
  1527. $core.addMethod(
  1528. $core.method({
  1529. selector: "where",
  1530. protocol: "actions",
  1531. //>>excludeStart("ide", pragmas.excludeIdeData);
  1532. args: [],
  1533. source: "where\x0a\x09self announcer announce: HLDebuggerWhere new",
  1534. referencedClasses: ["HLDebuggerWhere"],
  1535. //>>excludeEnd("ide");
  1536. pragmas: [],
  1537. messageSends: ["announce:", "announcer", "new"]
  1538. }, function ($methodClass){ return function (){
  1539. var self=this,$self=this;
  1540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1541. return $core.withContext(function($ctx1) {
  1542. //>>excludeEnd("ctx");
  1543. $recv($self._announcer())._announce_($recv($globals.HLDebuggerWhere)._new());
  1544. return self;
  1545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1546. }, function($ctx1) {$ctx1.fill(self,"where",{})});
  1547. //>>excludeEnd("ctx");
  1548. }; }),
  1549. $globals.HLDebuggerModel);
  1550. $core.addMethod(
  1551. $core.method({
  1552. selector: "on:",
  1553. protocol: "instance creation",
  1554. //>>excludeStart("ide", pragmas.excludeIdeData);
  1555. args: ["anError"],
  1556. source: "on: anError\x0a\x09^ self new\x0a\x09\x09initializeFromError: anError;\x0a\x09\x09yourself",
  1557. referencedClasses: [],
  1558. //>>excludeEnd("ide");
  1559. pragmas: [],
  1560. messageSends: ["initializeFromError:", "new", "yourself"]
  1561. }, function ($methodClass){ return function (anError){
  1562. var self=this,$self=this;
  1563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1564. return $core.withContext(function($ctx1) {
  1565. //>>excludeEnd("ctx");
  1566. var $1;
  1567. $1=$self._new();
  1568. $recv($1)._initializeFromError_(anError);
  1569. return $recv($1)._yourself();
  1570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1571. }, function($ctx1) {$ctx1.fill(self,"on:",{anError:anError})});
  1572. //>>excludeEnd("ctx");
  1573. }; }),
  1574. $globals.HLDebuggerModel.a$cls);
  1575. $core.addClass("HLErrorHandler", $globals.Object, "Helios-Debugger");
  1576. $core.setSlots($globals.HLErrorHandler, ["confirms"]);
  1577. $core.addMethod(
  1578. $core.method({
  1579. selector: "confirmDebugError:",
  1580. protocol: "error handling",
  1581. //>>excludeStart("ide", pragmas.excludeIdeData);
  1582. args: ["anError"],
  1583. source: "confirmDebugError: anError\x0a\x09confirms ifFalse: [\x0a\x09\x09confirms := true.\x0a\x09\x09HLConfirmationWidget new\x0a\x09\x09\x09confirmationString: anError messageText;\x0a\x09\x09\x09cancelBlock: [ confirms := false ];\x0a\x09\x09\x09actionBlock: [ confirms := false. self debugError: anError ];\x0a\x09\x09\x09cancelButtonLabel: 'Abandon';\x0a\x09\x09\x09confirmButtonLabel: 'Debug';\x0a\x09\x09\x09show ]",
  1584. referencedClasses: ["HLConfirmationWidget"],
  1585. //>>excludeEnd("ide");
  1586. pragmas: [],
  1587. messageSends: ["ifFalse:", "confirmationString:", "new", "messageText", "cancelBlock:", "actionBlock:", "debugError:", "cancelButtonLabel:", "confirmButtonLabel:", "show"]
  1588. }, function ($methodClass){ return function (anError){
  1589. var self=this,$self=this;
  1590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1591. return $core.withContext(function($ctx1) {
  1592. //>>excludeEnd("ctx");
  1593. var $1;
  1594. if(!$core.assert($self.confirms)){
  1595. $self.confirms=true;
  1596. $1=$recv($globals.HLConfirmationWidget)._new();
  1597. $recv($1)._confirmationString_($recv(anError)._messageText());
  1598. $recv($1)._cancelBlock_((function(){
  1599. $self.confirms=false;
  1600. return $self.confirms;
  1601. }));
  1602. $recv($1)._actionBlock_((function(){
  1603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1604. return $core.withContext(function($ctx2) {
  1605. //>>excludeEnd("ctx");
  1606. $self.confirms=false;
  1607. return $self._debugError_(anError);
  1608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1609. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1610. //>>excludeEnd("ctx");
  1611. }));
  1612. $recv($1)._cancelButtonLabel_("Abandon");
  1613. $recv($1)._confirmButtonLabel_("Debug");
  1614. $recv($1)._show();
  1615. }
  1616. return self;
  1617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1618. }, function($ctx1) {$ctx1.fill(self,"confirmDebugError:",{anError:anError})});
  1619. //>>excludeEnd("ctx");
  1620. }; }),
  1621. $globals.HLErrorHandler);
  1622. $core.addMethod(
  1623. $core.method({
  1624. selector: "debugError:",
  1625. protocol: "error handling",
  1626. //>>excludeStart("ide", pragmas.excludeIdeData);
  1627. args: ["anError"],
  1628. source: "debugError: anError\x0a\x0a\x09[\x0a\x09\x09anError context ifNil: [ anError context: thisContext ].\x0a\x09\x09(HLDebugger on: anError) openAsTab ]\x0a\x09on: Error do: [ :error | ConsoleErrorHandler new handleError: error ]",
  1629. referencedClasses: ["HLDebugger", "Error", "ConsoleErrorHandler"],
  1630. //>>excludeEnd("ide");
  1631. pragmas: [],
  1632. messageSends: ["on:do:", "ifNil:", "context", "context:", "openAsTab", "on:", "handleError:", "new"]
  1633. }, function ($methodClass){ return function (anError){
  1634. var self=this,$self=this;
  1635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1636. return $core.withContext(function($ctx1) {
  1637. //>>excludeEnd("ctx");
  1638. var $1;
  1639. $recv((function(){
  1640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1641. return $core.withContext(function($ctx2) {
  1642. //>>excludeEnd("ctx");
  1643. $1=$recv(anError)._context();
  1644. if($1 == null || $1.a$nil){
  1645. $recv(anError)._context_($core.getThisContext());
  1646. } else {
  1647. $1;
  1648. }
  1649. return $recv($recv($globals.HLDebugger)._on_(anError))._openAsTab();
  1650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1651. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1652. //>>excludeEnd("ctx");
  1653. }))._on_do_($globals.Error,(function(error){
  1654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1655. return $core.withContext(function($ctx2) {
  1656. //>>excludeEnd("ctx");
  1657. return $recv($recv($globals.ConsoleErrorHandler)._new())._handleError_(error);
  1658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1659. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,3)});
  1660. //>>excludeEnd("ctx");
  1661. }));
  1662. return self;
  1663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1664. }, function($ctx1) {$ctx1.fill(self,"debugError:",{anError:anError})});
  1665. //>>excludeEnd("ctx");
  1666. }; }),
  1667. $globals.HLErrorHandler);
  1668. $core.addMethod(
  1669. $core.method({
  1670. selector: "handleError:",
  1671. protocol: "error handling",
  1672. //>>excludeStart("ide", pragmas.excludeIdeData);
  1673. args: ["anError"],
  1674. source: "handleError: anError\x0a\x09self confirmDebugError: anError",
  1675. referencedClasses: [],
  1676. //>>excludeEnd("ide");
  1677. pragmas: [],
  1678. messageSends: ["confirmDebugError:"]
  1679. }, function ($methodClass){ return function (anError){
  1680. var self=this,$self=this;
  1681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1682. return $core.withContext(function($ctx1) {
  1683. //>>excludeEnd("ctx");
  1684. $self._confirmDebugError_(anError);
  1685. return self;
  1686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1687. }, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError})});
  1688. //>>excludeEnd("ctx");
  1689. }; }),
  1690. $globals.HLErrorHandler);
  1691. $core.addMethod(
  1692. $core.method({
  1693. selector: "initialize",
  1694. protocol: "error handling",
  1695. //>>excludeStart("ide", pragmas.excludeIdeData);
  1696. args: [],
  1697. source: "initialize\x0a\x09confirms := false",
  1698. referencedClasses: [],
  1699. //>>excludeEnd("ide");
  1700. pragmas: [],
  1701. messageSends: []
  1702. }, function ($methodClass){ return function (){
  1703. var self=this,$self=this;
  1704. $self.confirms=false;
  1705. return self;
  1706. }; }),
  1707. $globals.HLErrorHandler);
  1708. $core.addMethod(
  1709. $core.method({
  1710. selector: "onErrorHandled",
  1711. protocol: "error handling",
  1712. //>>excludeStart("ide", pragmas.excludeIdeData);
  1713. args: [],
  1714. 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",
  1715. referencedClasses: ["HLProgressWidget"],
  1716. //>>excludeEnd("ide");
  1717. pragmas: [],
  1718. messageSends: ["flush", "default", "remove"]
  1719. }, function ($methodClass){ return function (){
  1720. var self=this,$self=this;
  1721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1722. return $core.withContext(function($ctx1) {
  1723. //>>excludeEnd("ctx");
  1724. var $1;
  1725. $1=$recv($globals.HLProgressWidget)._default();
  1726. $recv($1)._flush();
  1727. $recv($1)._remove();
  1728. return self;
  1729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1730. }, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{})});
  1731. //>>excludeEnd("ctx");
  1732. }; }),
  1733. $globals.HLErrorHandler);
  1734. $core.addClass("HLStackListWidget", $globals.HLToolListWidget, "Helios-Debugger");
  1735. $core.addMethod(
  1736. $core.method({
  1737. selector: "items",
  1738. protocol: "accessing",
  1739. //>>excludeStart("ide", pragmas.excludeIdeData);
  1740. args: [],
  1741. source: "items\x0a\x09^ self model contexts",
  1742. referencedClasses: [],
  1743. //>>excludeEnd("ide");
  1744. pragmas: [],
  1745. messageSends: ["contexts", "model"]
  1746. }, function ($methodClass){ return function (){
  1747. var self=this,$self=this;
  1748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1749. return $core.withContext(function($ctx1) {
  1750. //>>excludeEnd("ctx");
  1751. return $recv($self._model())._contexts();
  1752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1753. }, function($ctx1) {$ctx1.fill(self,"items",{})});
  1754. //>>excludeEnd("ctx");
  1755. }; }),
  1756. $globals.HLStackListWidget);
  1757. $core.addMethod(
  1758. $core.method({
  1759. selector: "label",
  1760. protocol: "accessing",
  1761. //>>excludeStart("ide", pragmas.excludeIdeData);
  1762. args: [],
  1763. source: "label\x0a\x09^ 'Call stack'",
  1764. referencedClasses: [],
  1765. //>>excludeEnd("ide");
  1766. pragmas: [],
  1767. messageSends: []
  1768. }, function ($methodClass){ return function (){
  1769. var self=this,$self=this;
  1770. return "Call stack";
  1771. }; }),
  1772. $globals.HLStackListWidget);
  1773. $core.addMethod(
  1774. $core.method({
  1775. selector: "observeModel",
  1776. protocol: "actions",
  1777. //>>excludeStart("ide", pragmas.excludeIdeData);
  1778. args: [],
  1779. source: "observeModel\x0a\x09super observeModel.\x0a\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onDebuggerStepped:\x0a\x09\x09to: self",
  1780. referencedClasses: ["HLDebuggerStepped"],
  1781. //>>excludeEnd("ide");
  1782. pragmas: [],
  1783. messageSends: ["observeModel", "on:send:to:", "announcer", "model"]
  1784. }, function ($methodClass){ return function (){
  1785. var self=this,$self=this;
  1786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1787. return $core.withContext(function($ctx1) {
  1788. //>>excludeEnd("ctx");
  1789. [(
  1790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1791. $ctx1.supercall = true,
  1792. //>>excludeEnd("ctx");
  1793. ($methodClass.superclass||$boot.nilAsClass).fn.prototype._observeModel.call($self))
  1794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1795. ,$ctx1.supercall = false
  1796. //>>excludeEnd("ctx");
  1797. ][0];
  1798. $recv($recv($self._model())._announcer())._on_send_to_($globals.HLDebuggerStepped,"onDebuggerStepped:",self);
  1799. return self;
  1800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1801. }, function($ctx1) {$ctx1.fill(self,"observeModel",{})});
  1802. //>>excludeEnd("ctx");
  1803. }; }),
  1804. $globals.HLStackListWidget);
  1805. $core.addMethod(
  1806. $core.method({
  1807. selector: "onDebuggerStepped:",
  1808. protocol: "reactions",
  1809. //>>excludeStart("ide", pragmas.excludeIdeData);
  1810. args: ["anAnnouncement"],
  1811. source: "onDebuggerStepped: anAnnouncement\x0a\x09items := nil.\x0a\x09self refresh",
  1812. referencedClasses: [],
  1813. //>>excludeEnd("ide");
  1814. pragmas: [],
  1815. messageSends: ["refresh"]
  1816. }, function ($methodClass){ return function (anAnnouncement){
  1817. var self=this,$self=this;
  1818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1819. return $core.withContext(function($ctx1) {
  1820. //>>excludeEnd("ctx");
  1821. $self.items=nil;
  1822. $self._refresh();
  1823. return self;
  1824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1825. }, function($ctx1) {$ctx1.fill(self,"onDebuggerStepped:",{anAnnouncement:anAnnouncement})});
  1826. //>>excludeEnd("ctx");
  1827. }; }),
  1828. $globals.HLStackListWidget);
  1829. $core.addMethod(
  1830. $core.method({
  1831. selector: "proceed",
  1832. protocol: "actions",
  1833. //>>excludeStart("ide", pragmas.excludeIdeData);
  1834. args: [],
  1835. source: "proceed\x0a\x09self model proceed",
  1836. referencedClasses: [],
  1837. //>>excludeEnd("ide");
  1838. pragmas: [],
  1839. messageSends: ["proceed", "model"]
  1840. }, function ($methodClass){ return function (){
  1841. var self=this,$self=this;
  1842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1843. return $core.withContext(function($ctx1) {
  1844. //>>excludeEnd("ctx");
  1845. $recv($self._model())._proceed();
  1846. return self;
  1847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1848. }, function($ctx1) {$ctx1.fill(self,"proceed",{})});
  1849. //>>excludeEnd("ctx");
  1850. }; }),
  1851. $globals.HLStackListWidget);
  1852. $core.addMethod(
  1853. $core.method({
  1854. selector: "renderButtonsOn:",
  1855. protocol: "rendering",
  1856. //>>excludeStart("ide", pragmas.excludeIdeData);
  1857. args: ["html"],
  1858. 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 btn-default 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 btn-default 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 btn-default 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 btn-default proceed';\x0a\x09\x09\x09\x09with: 'Proceed';\x0a\x09\x09\x09\x09onClick: [ self proceed ] ]",
  1859. referencedClasses: [],
  1860. //>>excludeEnd("ide");
  1861. pragmas: [],
  1862. messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver", "proceed"]
  1863. }, function ($methodClass){ return function (html){
  1864. var self=this,$self=this;
  1865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1866. return $core.withContext(function($ctx1) {
  1867. //>>excludeEnd("ctx");
  1868. var $1,$2,$3,$4,$5;
  1869. $1=$recv(html)._div();
  1870. [$recv($1)._class_("debugger_bar")
  1871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1872. ,$ctx1.sendIdx["class:"]=1
  1873. //>>excludeEnd("ctx");
  1874. ][0];
  1875. [$recv($1)._with_((function(){
  1876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1877. return $core.withContext(function($ctx2) {
  1878. //>>excludeEnd("ctx");
  1879. $2=[$recv(html)._button()
  1880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1881. ,$ctx2.sendIdx["button"]=1
  1882. //>>excludeEnd("ctx");
  1883. ][0];
  1884. [$recv($2)._class_("btn btn-default restart")
  1885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1886. ,$ctx2.sendIdx["class:"]=2
  1887. //>>excludeEnd("ctx");
  1888. ][0];
  1889. [$recv($2)._with_("Restart")
  1890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1891. ,$ctx2.sendIdx["with:"]=2
  1892. //>>excludeEnd("ctx");
  1893. ][0];
  1894. [$recv($2)._onClick_((function(){
  1895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1896. return $core.withContext(function($ctx3) {
  1897. //>>excludeEnd("ctx");
  1898. return $self._restart();
  1899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1900. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  1901. //>>excludeEnd("ctx");
  1902. }))
  1903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1904. ,$ctx2.sendIdx["onClick:"]=1
  1905. //>>excludeEnd("ctx");
  1906. ][0];
  1907. $3=[$recv(html)._button()
  1908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1909. ,$ctx2.sendIdx["button"]=2
  1910. //>>excludeEnd("ctx");
  1911. ][0];
  1912. [$recv($3)._class_("btn btn-default where")
  1913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1914. ,$ctx2.sendIdx["class:"]=3
  1915. //>>excludeEnd("ctx");
  1916. ][0];
  1917. [$recv($3)._with_("Where")
  1918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1919. ,$ctx2.sendIdx["with:"]=3
  1920. //>>excludeEnd("ctx");
  1921. ][0];
  1922. [$recv($3)._onClick_((function(){
  1923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1924. return $core.withContext(function($ctx3) {
  1925. //>>excludeEnd("ctx");
  1926. return $self._where();
  1927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1928. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  1929. //>>excludeEnd("ctx");
  1930. }))
  1931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1932. ,$ctx2.sendIdx["onClick:"]=2
  1933. //>>excludeEnd("ctx");
  1934. ][0];
  1935. $4=[$recv(html)._button()
  1936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1937. ,$ctx2.sendIdx["button"]=3
  1938. //>>excludeEnd("ctx");
  1939. ][0];
  1940. [$recv($4)._class_("btn btn-default stepOver")
  1941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1942. ,$ctx2.sendIdx["class:"]=4
  1943. //>>excludeEnd("ctx");
  1944. ][0];
  1945. [$recv($4)._with_("Step over")
  1946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1947. ,$ctx2.sendIdx["with:"]=4
  1948. //>>excludeEnd("ctx");
  1949. ][0];
  1950. [$recv($4)._onClick_((function(){
  1951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1952. return $core.withContext(function($ctx3) {
  1953. //>>excludeEnd("ctx");
  1954. return $self._stepOver();
  1955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1956. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  1957. //>>excludeEnd("ctx");
  1958. }))
  1959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1960. ,$ctx2.sendIdx["onClick:"]=3
  1961. //>>excludeEnd("ctx");
  1962. ][0];
  1963. $5=$recv(html)._button();
  1964. $recv($5)._class_("btn btn-default proceed");
  1965. $recv($5)._with_("Proceed");
  1966. return $recv($5)._onClick_((function(){
  1967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1968. return $core.withContext(function($ctx3) {
  1969. //>>excludeEnd("ctx");
  1970. return $self._proceed();
  1971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1972. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)});
  1973. //>>excludeEnd("ctx");
  1974. }));
  1975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1976. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1977. //>>excludeEnd("ctx");
  1978. }))
  1979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1980. ,$ctx1.sendIdx["with:"]=1
  1981. //>>excludeEnd("ctx");
  1982. ][0];
  1983. return self;
  1984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1985. }, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html})});
  1986. //>>excludeEnd("ctx");
  1987. }; }),
  1988. $globals.HLStackListWidget);
  1989. $core.addMethod(
  1990. $core.method({
  1991. selector: "restart",
  1992. protocol: "actions",
  1993. //>>excludeStart("ide", pragmas.excludeIdeData);
  1994. args: [],
  1995. source: "restart\x0a\x09self model restart",
  1996. referencedClasses: [],
  1997. //>>excludeEnd("ide");
  1998. pragmas: [],
  1999. messageSends: ["restart", "model"]
  2000. }, function ($methodClass){ return function (){
  2001. var self=this,$self=this;
  2002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2003. return $core.withContext(function($ctx1) {
  2004. //>>excludeEnd("ctx");
  2005. $recv($self._model())._restart();
  2006. return self;
  2007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2008. }, function($ctx1) {$ctx1.fill(self,"restart",{})});
  2009. //>>excludeEnd("ctx");
  2010. }; }),
  2011. $globals.HLStackListWidget);
  2012. $core.addMethod(
  2013. $core.method({
  2014. selector: "selectItem:",
  2015. protocol: "actions",
  2016. //>>excludeStart("ide", pragmas.excludeIdeData);
  2017. args: ["aContext"],
  2018. source: "selectItem: aContext\x0a \x09self model currentContext: aContext.\x0a\x09super selectItem: aContext",
  2019. referencedClasses: [],
  2020. //>>excludeEnd("ide");
  2021. pragmas: [],
  2022. messageSends: ["currentContext:", "model", "selectItem:"]
  2023. }, function ($methodClass){ return function (aContext){
  2024. var self=this,$self=this;
  2025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2026. return $core.withContext(function($ctx1) {
  2027. //>>excludeEnd("ctx");
  2028. $recv($self._model())._currentContext_(aContext);
  2029. [(
  2030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2031. $ctx1.supercall = true,
  2032. //>>excludeEnd("ctx");
  2033. ($methodClass.superclass||$boot.nilAsClass).fn.prototype._selectItem_.call($self,aContext))
  2034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2035. ,$ctx1.supercall = false
  2036. //>>excludeEnd("ctx");
  2037. ][0];
  2038. return self;
  2039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2040. }, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext})});
  2041. //>>excludeEnd("ctx");
  2042. }; }),
  2043. $globals.HLStackListWidget);
  2044. $core.addMethod(
  2045. $core.method({
  2046. selector: "selectedItem",
  2047. protocol: "actions",
  2048. //>>excludeStart("ide", pragmas.excludeIdeData);
  2049. args: [],
  2050. source: "selectedItem\x0a \x09^ self model currentContext",
  2051. referencedClasses: [],
  2052. //>>excludeEnd("ide");
  2053. pragmas: [],
  2054. messageSends: ["currentContext", "model"]
  2055. }, function ($methodClass){ return function (){
  2056. var self=this,$self=this;
  2057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2058. return $core.withContext(function($ctx1) {
  2059. //>>excludeEnd("ctx");
  2060. return $recv($self._model())._currentContext();
  2061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2062. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{})});
  2063. //>>excludeEnd("ctx");
  2064. }; }),
  2065. $globals.HLStackListWidget);
  2066. $core.addMethod(
  2067. $core.method({
  2068. selector: "stepOver",
  2069. protocol: "actions",
  2070. //>>excludeStart("ide", pragmas.excludeIdeData);
  2071. args: [],
  2072. source: "stepOver\x0a\x09self model stepOver",
  2073. referencedClasses: [],
  2074. //>>excludeEnd("ide");
  2075. pragmas: [],
  2076. messageSends: ["stepOver", "model"]
  2077. }, function ($methodClass){ return function (){
  2078. var self=this,$self=this;
  2079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2080. return $core.withContext(function($ctx1) {
  2081. //>>excludeEnd("ctx");
  2082. $recv($self._model())._stepOver();
  2083. return self;
  2084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2085. }, function($ctx1) {$ctx1.fill(self,"stepOver",{})});
  2086. //>>excludeEnd("ctx");
  2087. }; }),
  2088. $globals.HLStackListWidget);
  2089. $core.addMethod(
  2090. $core.method({
  2091. selector: "where",
  2092. protocol: "actions",
  2093. //>>excludeStart("ide", pragmas.excludeIdeData);
  2094. args: [],
  2095. source: "where\x0a\x09self model where",
  2096. referencedClasses: [],
  2097. //>>excludeEnd("ide");
  2098. pragmas: [],
  2099. messageSends: ["where", "model"]
  2100. }, function ($methodClass){ return function (){
  2101. var self=this,$self=this;
  2102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2103. return $core.withContext(function($ctx1) {
  2104. //>>excludeEnd("ctx");
  2105. $recv($self._model())._where();
  2106. return self;
  2107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2108. }, function($ctx1) {$ctx1.fill(self,"where",{})});
  2109. //>>excludeEnd("ctx");
  2110. }; }),
  2111. $globals.HLStackListWidget);
  2112. });