Summary: | Web Inspector: DebuggerManager commands should return promises | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brian Burg <burg> | ||||
Component: | Web Inspector | Assignee: | Brian Burg <burg> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | graouts, joepeck, timothy, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | 135772 | ||||||
Bug Blocks: | 135663 | ||||||
Attachments: |
|
Description
Brian Burg
2014-08-06 23:13:29 PDT
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> |