This could include pause, resume, stepOver, stepInto, stepOut. Note that these should add one-time listeners to the relevant DebuggerManager events, rather than returning the same promise returned by InspectorBackend commands. The latter may fire before the debugger manager has actually received the relevant event from the backend.
<rdar://problem/17942179>
Created attachment 236318 [details] Patch
Comment on attachment 236318 [details] Patch This needs to be tested manually once debugging works again. But, feel free to review before then.
Comment on attachment 236318 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236318&action=review > Source/WebInspectorUI/UserInterface/Base/EventListenerSet.js:27 > +WebInspector.EventListener = function(thisObject, fireOnce) Should be a seperate file. > Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:158 > + throw error; Why throw?
Comment on attachment 236318 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236318&action=review >> Source/WebInspectorUI/UserInterface/Base/EventListenerSet.js:27 >> +WebInspector.EventListener = function(thisObject, fireOnce) > > Should be a seperate file. ok >> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:158 >> + throw error; > > Why throw? From a catch block, you need to re-throw an exception. Otherwise, the overall chain will be resolved instead of rejected. We want the promise returned by this method to cause a larger chain to be rejected if any step fails.
I thought that might be the case. Still a promise noob here.
(In reply to comment #6) > I thought that might be the case. Still a promise noob here. I just wrote up some such Promise gotchas on the Inspector style guide page.
Comment on attachment 236318 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236318&action=review > Source/WebInspectorUI/ChangeLog:26 > + Web Inspector: Add a helper to avoid leaking single-fire event listeners in Promise chains > + https://bugs.webkit.org/show_bug.cgi?id=135772 Should remove this from this patch, which I think you already noticed.
Comment on attachment 236318 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236318&action=review > Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:148 > + listener = new WebInspector.EventListener(this, true); Missing "var" for listener, otherwise this leaks into global scope. [Applies to multiple places in this patch].
Committed r172412: <http://trac.webkit.org/changeset/172412>