Bug 135207

Summary: Web Inspector: InspectorBackend's promise-based agent API does not support multiple return values
Product: WebKit Reporter: Brian Burg <burg>
Component: Web InspectorAssignee: Brian Burg <burg>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

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.