Bug 135207 - Web Inspector: InspectorBackend's promise-based agent API does not support multiple return values
Summary: Web Inspector: InspectorBackend's promise-based agent API does not support mu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brian Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-23 12:16 PDT by Brian Burg
Modified: 2014-07-23 14:16 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.95 KB, patch)
2014-07-23 12:21 PDT, Brian Burg
no flags Details | Formatted Diff | Diff
Patch (7.12 KB, patch)
2014-07-23 13:33 PDT, Brian Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2014-07-23 12:16:15 PDT
The existing implementation (InspectorBackend.Command.prototype.promise) assumes that there is only one return value (as a payload object, hence variable name 'payload') but InspectorBackend will actually unpack multiple return values as multiple callback arguments.

The wrapper callback here should instead slice the arguments array (excluding the error message) and apply that to the resolve thunk.
Comment 1 Radar WebKit Bug Importer 2014-07-23 12:16:47 PDT
<rdar://problem/17782742>
Comment 2 Brian Burg 2014-07-23 12:21:27 PDT
Created attachment 235367 [details]
Patch
Comment 3 Brian Burg 2014-07-23 13:33:52 PDT
Created attachment 235371 [details]
Patch
Comment 4 Joseph Pecoraro 2014-07-23 13:44:38 PDT
Comment on attachment 235371 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235371&action=review

Clever. Sounds good for now! r=me

> Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:377
> +            // than by setting a magical property on the callback. <webkit.org/b/132386>

Nit: Include "https://" on that URL.
Comment 5 WebKit Commit Bot 2014-07-23 14:16:53 PDT
Comment on attachment 235371 [details]
Patch

Clearing flags on attachment: 235371

Committed r171489: <http://trac.webkit.org/changeset/171489>
Comment 6 WebKit Commit Bot 2014-07-23 14:16:56 PDT
All reviewed patches have been landed.  Closing bug.